./PaxHeaders.27456/intercal-0.300000644000000000000000000000013212507267255013074 xustar0030 mtime=1427992237.754939663 30 atime=1427992237.758939658 30 ctime=1427992237.754939663 intercal-0.30/0000775000175000017500000000000012507267255012716 5ustar00esresr00000000000000intercal-0.30/PaxHeaders.27456/HISTORY0000644000000000000000000000013212507155722014073 xustar0030 mtime=1427954642.770849026 30 atime=1427954642.862848705 30 ctime=1427992235.646945528 intercal-0.30/HISTORY0000664000175000017500000015017312507155722014004 0ustar00esresr00000000000000This is the long-form history of the project. For the short form used to generate release announcements, see NEWS. == Repository head == === Changes by Eric S. Raymond === 1. Typo and formatting fixes to THEORY.txt. === Changes by Mark J. Reed, Alex Smith === 2. Build system fixes required by recent versions of autoconf, which is in randomness and ugliness and propensity to mutate a perfect match for INTERCAL. === Changes by Alex Smith === 3. Some potential undefined behaviour (which happens to do the right thing on every compiler tested) related to the -g option has been fixed. (Thanks to Michael Tautschnig for reporting the bug.) 4. Document how the build system works. (That is, how everything fits together, as opposed to the individual files.) 5. Fixes for two nasty dependency issues to do with testing. One issue was that the tests could potentially be run against an old version of the compiler (they now ensure the compiler is up-to-date); the other was that tests on a non-installed compiler could potentially use library files from an installed version, which might not necessarily be the same version of the compiler and might not contain the same bugfixes. 6. C-INTERCAL now understands C11 in the external calls system, the same way that it understands C89 and C99. This gives us a gap of (2011-1972 = 39) years between languages standards simultaneously supported by the same compiler. Anyone know if this is a record? 7. Most of the tests in the pit are run by a common framework. However, one of the tests is different; yapp's test involves another call to ick to make sure that the output is correct INTERCAL that produces the correct output. Guess what happened. This change fixes it. (Hint if you're still guessing: what needs to be done to make an INTERCAL program with no double-oh-sevens run in a reproducible way, as might be required by an automated testsuite?) 8. Fixed a typo in the definition of the "smudgeleft" and "smudgeright" helper functions. This might theoretically have lead to code being misoptimized, although I don't know of any specific situation in which that would occur. == Release 0.29 (by Alex Smith, Eric S. Raymond) 29 Nov 2010 == === Changes by Eric S. Raymond === 1. There is now a compiler regression-test suite, invoked through the test production in the pit makefile. 2. There are two new compiler error messages, E990 and E994. 3. A new program for the pit: Brendan Gregg's guess game. 4. The floating-point library is now automatically included if a program NEXTs to labels in the range 5000-5999. Internally, line-range to system library mappings are no longer hardcoded but rather declared as an array of associations that can be easily modified. 5. The source now uses explicit bool, rather than using int everywhere. 6. README, HISTORY, and BUGS are now mastered in asciidoc for easier web-page generation. 7. The history of the hitherto-mysterious "Atari implementation" is now documented. === Bugs reported and changes patched by Arvid Norlander === 8. Fixed a typo in the perpet.c version of the help information. 9. Fixed the CREATE statement to work on 64-bit architectures. 10. The availability of variable argument list mechanisms is now determined automatically by the configure script, rather than relying on the old method of checking which usually gets the wrong answer with modern compilers, leading to build failures on many modern systems (previously this was patched just for DJGPP, the patch now applies to all operating systems and platforms). This bug is known to have affected the build on DOS, FreeBSD and Mac OS X, and possibly affects other platforms. (also reported independently by Elliott Hird) 11. Fixed some nonsense in the -@ help screen that was generated by an errant search-and-replace. 12. Made several changes to bring the new Befunge-98 interface code (see below) in line with changes in the Befunge-98 interpreter in use. 13. Added consts and statics in the code, hopefully to make bugs easier to notice. 14. Refactored main(). It needed it, badly. === Bugs reported by Elliott Hird === 15. Fixed the configure script to work with the default Debian shell dash. (also reported independently by Debian) 16. Actually fixed unlambda.i; the fix was meant to be in 0.28, and is described in its changelog, but for some reason never made it to the distributed tarball. 17. The -F option again works. (AIS: I accidentally broke it in the preceding version, making it basically a no-op by mistake.) 18. The build now succeeds (with warnings) when lex or yacc are missing, rather than failing with mysterious error messages that seem to have nothing to do with the problems. (The success is made possible by using the prebuilt versions; see change 11 of version 0.26, this is finishing what that started.) === Bugs reported, changes requested, and patches by Joris Huizer === 19. The [xoritself] optimiser idiom has been generalised to handle some situations where the redundant XOR operands are on different grouping levels; this helps to optimise some heavily inlined greater-than tests. 20. Fixed unary operators applied to constants (AIS: it seems that my patch to solve this issue earlier was itself buggy). 21. The -g option now causes optimisation of the output compiled C to be turned off, and adds comments to the output file the same way -c does. 22. Added more optimiser idioms: [cxorand16], [cxorand32], [cfoldintoorinand], [or16and], [xor16and], [lshift32half], [rshiftoutofneg], [andoutofneg]; also generalised the idiom-matching code to compare 16-bit and 32-bit constants as equal if they have the same value, and fixed some typos in the current 16-bit complement idioms. 23. ABSTAINING or REINSTATING are now a lot more efficient, taking an amount of time proportional to the number of commands effected, rather than the number of commands in the program. (AIS: I implemented this with the algorithm in the patch Joris provided, but with different code, to make it easier to maintain.) === Changes by Stefan O'Rear === 24. Added INTERCAL syntax highlighting information for vim. Why should Emacs have all the fun? === Changes reported by Phantom Hoover === 25. Fixed a nasty documentation typo. === Changes reported by the Debian autobuilders and Joey Hess === 26. The build of the optimiser idioms is now split over many files, to reduce the memory usage of gcc when it tries to compile the giant output C file. This was a problem on ia64. (The ulimit method of preventing thrashing has been removed, as this method works better; likewise, the optimiser optimisation now works again.) === Changes by Alex Smith === 27. The build system has been completely redone, again; it now uses automake as well as a much newer version of autoconf. This means that there is now one build system that works the same way on all systems, and that all sorts of clever tricks like out-of-tree builds, a self-rebuilding build system, and building the distribution directly from the Makefile, are possible. As a side effect, the directory structure looks somewhat different to how it looked in previous versions; src, doc, etc and pit are still there, but now there's prebuilt instead of temp, an extra directory buildaux, and bin, lib and include have disappeared. 28. The distribution now comes in compressed pax format. (Before anyone complains that they have no idea what that is, or that I'm using something strange and nonstandard, I'd like to point out that tar is no longer part of POSIX, but that pax is. (See man 5 tar on a recent Linux system for details of the whole mess.) Luckily, pax is forward-compatible with tar so tar readers should be able to read it just fine, if you can't get your hands on a pax reader.) 29. convickt can now produce its output as INTERCAL initialisation of a tail array. (This doesn't auto-offset between the different characters; it is therefore mostly useful for producing Baudot arrays for CLC-INTERCAL-style IO.) 30. The function clock_gettime is now supported by the yuk profiler as an alternative method of getting a high-resolution clock for profiling (it is available on at least Linux). 31. The profiler now autodetects the same profiling mechanism at compile time and at run time. (It was getting confused as to what mechanism it was using, causing some really weird bugs.) 32. Added support for computed CREATE (the computation is done at create-time, rather than when the unknown statement is encountered); partly because this was rather easy, but mostly because it can be used to simulate a computed NEXT, thus making the example expansion library compunex (which I forgot to mention in the 0.28 release notes) redundant. Because it was deprecated when I added it, compunex is now doubly deprecated, and anyone tempted to use it should use computed CREATE instead. (I have always maintained that if computed NEXT were ever added to C-INTERCAL, it would be deprecated on arrival; the computed CREATE method implements all features of NEXT, anyway, rather than the small subset COMPUNEX could manage.) 33. Plugged a couple of small memory leaks; however, there are still several much bigger memory leaks that could do with being fixed. 34. Added support for CREATING operators, with similar syntax to the CREATION of commands. This requires the -ea options to be set to work properly. 35. More file extensions are now supported by the external calls system. The .c99 extension indicates a C99 (rather than C89) file; all .c99 files are preprocessed as C99, and if any C99 files are used the final compilation which compiles and links everything will be done as C99 rather than C89 (this causes no problems for C-INTERCAL's output which is both legal C89 and legal C99). Also, libraries can be linked in; to link in the maths library for instance (i.e. pass -lm to gcc), write libm.a as a filename at the end of the command line. (The file's real name is libm.a; if a filename is in lib*.a format, then ick will look in the normal library locations instead of the current directory.) Other .a files can be linked in from the current directory. 36. Fixed the handling of division by zero in the syslibc expansion library. (The Revamped Manual states 'In all cases, division by 0 returns 0'.) 37. Made several changes to the documentation, including fixes for some rather nasty typos (two of the worst were specifying variables as IGNORED by default, and stating that select acts like OR in TriIntercal!). 38. Fixed a bug in the external calls system that made it impossible to write a COME FROM in more than one file at a time whilst still having the resulting program work reliably. 39. Added support for external calls to Befunge-98 programs; however, this distribution does not ship with a Funge-98 interpreter, so in order to use this feature you will first have to compile a Funge-98 interpreter into a library for use with C-INTERCAL (see README.txt or the Revamped Manual for information on this). Also added a test program for this to the pit. 40. Fixed some bugs in the go-away command in interfunge.i. 41. Fixed many bugs in the optimiser, and added a fuzz-tester ("make fuzz") for the optimiser which has a chance at finding any new optimiser bugs that may be introduced, or any that the maintainers don't know about. == Release 0.28 (by Alex Smith) 1 Apr 2008 == === Patches, suggestions and bugs found by Joris Huizer === 1. Fixed a typo in the [noopxor] optimiser idiom. 2. Added a [redundantdoublenot] optimiser idiom (a generalisation of Joris' suggestion of and code for [triplenot]). 3. Fixed a typo that caused the flow optimiser to optimise some errors into non-erroring code. 4. Fixed the [lshift16] optimiser idiom; previously it was giving incorrect values in some cases where the bits being selected from the original number weren't contiguous. 5. There is now no longer a segfault when the unusual option combination -f (without specifying -O) is used. 6. It is again possible to recompile more than one source file at a time. 7. The flow optimiser now recognises that comments can be reinstated in programs where they can be reinstated. === Changes by Alex Smith === 8. Fixed some typos in the documentation. 9. Applying an infix unary operator to a constant (as in ) now returns the correct value; previously it returned the unary operator applied to a sequence number that was 0 for the first unique constant that was the argument of a unary operator, 1 for the second unique constant, and so on. (This was a bug in the parser.) 10. Added doc/THEORY.txt back in. (It seems that it went missing some time between 1.26 and 0.27.) Updated it to describe the current compiler. 11. Turned off optimisation of the optimiser, and also placed a 128MB limit on the data segment and virtual memory it was allowed to use. This is to prevent Linux thrashing and/or invoking the dreaded oom-killer when recompiling idiotism.c. (This happened only rarely, but it happened to me twice, each time making my computer unusable for about half an hour. Therefore, a fix to prevent the situation happening again was added, assuming your computer has at least 128MB free memory and disk space.) As a bonus, the build process is now considerably faster, because the optimisation of the optimiser was the slowest step of the process. 12. Internally, all symbols that are visible globally are now name-mangled (by using the prefix ick_). This allows other files to be linked with files compiled from INTERCAL without namespace collisions. This does not include symbols that are only useful in multithreading (as INTERCAL's multithreading model is incompatible with other programs), only for the debugger (because linking yuk into a program causes all sorts of chaos if non-INTERCAL programs are involved), or only used by the compiler (which hopefully should never be linked to another program that isn't specifically designed to be linked to it). 13. Thoroughly delinted the code, using Splint; the code is now annotated to show Splint what is being done where (and all the non-obvious annotations are explained so that humans can figure out what is going on as well); over 800 warnings have been fixed, including some which identified bugs in the original program (many of which were to do with edge cases involving unusually long strings, and some of which were buffer overflows). All comments from /*@ to @*/ are mine, and are annotations for Splint. 14. Implemented external calls, which allow multiple INTERCAL programs to be linked to each other, and/or to C programs, via the -e option and NEXT / COME FROM / NEXT FROM / FORGET / RESUME statements. See the manual for more details. (Note that external calls require you to use gcc, GNU cpp, and GNU ld, because they rely on features of those programs to work.) 15. Two other new compiler options have been added: -E (don't link system library), and -w (enable +printflow debugging even for non-multithread programs). +printflow has been enhanced to show what's going on in externally-called programs to some extent, too. 16. Added a version of the INTERCAL system library written in C, as pit/lib/syslibc.c. A new compiler feature allows the inclusion of such expansion libraries via the command line; to include this library, you would write the command line as ick -eE yourprogram.i syslibc (possibly adding other options than -eE). The main advantage of the C-based system library is speed; also, note that an implemented-in-a-faster-language- than-INTERCAL system library existed in the Princeton compiler (which is possibly how the INTERCAL version managed to stay buggy for decades without anyone noticing), so this is another case of catching up with historically available features. (The feature is also somewhat reminicent of CLC-INTERCAL's 'preloads', but is implemented differently, and is useful for different things, as it doesn't affect the compiler.) Expansion libraries are included via -e, like non-INTERCAL programs are, but are distinguished by not having an extension. 17. The handling of syntax errors has been improved; many lines that previously caused E017 at compile time are now correctly interpreted as run-time errors. The only way to cause E017 nowadays is to write a constant out of the onespot range, and the manual description of the error has been changed accordingly. (Note that I caused several regressions while implementing this; I hope they're all fixed now, but there may be some left. Please report any remaining parsing problems caused by this; they mostly manifest as either the line after a comment being corrupted or ignored, or as the line before a comment being taken to be part of the comment.) 18. A new 'just-in-case' compilation method is used for syntax errors. If a syntax error is encountered at compile-time, and contains just capital letters with no other meaning (i.e. they don't form keywords and none of them is the letter V), variables, and expressions, and there are no two consecutive expressions or variables involved (i.e. they are separated by keywords), the compiler will compile it anyway, just in case it happens to gain a meaning later (see the next changelog entry). This is sort of the converse of the way CLC-INTERCAL goes about compiling things that don't have a meaning yet (it uses a 'just-too-late' compiler which waits for the offending statement to error out, then recompiles it to see if it's gained a meaning in the meantime), and this difference in handling typifies the difference between the compilers quite well. 19. Implemented the CREATE statement, because I could (see point 18). This allows new syntax to be created at runtime. CLC-INTERCAL also has a CREATE statement, but its syntax is totally different (it specifies the bytecode for the command, whereas C-INTERCAL's CREATE statement allows you to specify what the new command does in INTERCAL itself.) A function call ick_create is also available; it's usable from externally-called programs and from expansion libraries, and means that INTERCAL commands can now be defined to do things which were previously well out of INTERCAL's reach. This makes expansion libraries act even more like CLC-INTERCAL preloads. 20. Fixed a strange bug in yuk when the basename of the INTERCAL program was the same as that of a shell builtin or command on the user's path. 21. Programs accept a new option +instapipe that causes output to be output immediately, even if not followed by a newline, by flushing the output after every character. This is most useful with binary output into pipes, and occasionally useful for getting the output to very slow programs faster. 22. Fixed an error in an optimiser idiom that could optimise erroring code involving mingles into non-erroring code (which is of course incorrect); also edited unlambda.i in the pit, which was taking advantage of this error (and erroring out if optimisation was turned off). 23. Fixed a bug with the ON THE WAY TO line number displayed when COME FROMs are involved that I accidentally introduced in 0.25. === Changes from elsewhere === 24. Added yet another nontrivial INTERCAL program to the pit; interfunge.i (written by Jeffrey Lee) is a Befunge-93 interpreter written in INTERCAL. (It appears to conform to the standard (I actually ran it against a testsuite, and it passed); its only pecularities, apart from the language in which it's written, appear to be the need for a blank line at the end of the program, but no blank lines earlier (because INTERCAL can't sense EOF, although there are plans to change that), the restriction to 80x25 is enforced (this seems to be an implied requirement in the standard, but most Befunge-93 interpreters don't enforce it), and numeric output is in Roman numerals (what did you expect?).) == Release 0.27 (by Alex Smith) 22 Dec 2007 == 1. Joris Huizer pointed out that the manual nowhere says that a GIVE UP line can't be abstained from by line number. This was probably a mistake in the INTERCAL-72 manual, but the behaviour specified by the original manual is now implemented; after all, it wouldn't do to violate the original de facto standard. (Note that if a GIVE UP line is abstained by line number, there is then no way to reinstate it; also, if the -X switch for CLC-INTERCAL compatibility is used, ABSTAINING FROM a GIVE UP line by line number is also silently ignored.) 2. Rewrote the optimizer in a language (OIL) invented specifically for the purpose; the set of optimizer idioms is now in idiotism.oil, and translated into C and linked with the rest of the compiler at metacompile time (that is, when the compiler itself is being compiled). It contains many of the same idioms, but some have been generalised or reduced into smaller parts and some new ones were added. Documentation for OIL has been added as part of the documentation for the distribution as a whole. 3. Joris Huizer submitted a patch to fix a memory allocation bug which occasionally caused memory corruption when a program had a number of commands that was 1 less than a multiple of 256. 4. Completely redid the autoconfiguration. The install should now progress with less user interaction than before. As a bonus, if you have a range of GNU utilities including make, sed, tr, and bash (and possibly others), it's now possible to compile using 'sh configdj.sh' followed by 'make' under DJGPP. (To be specific, some settings that previously sometimes had to be set by the user, such as whether lex provided yylineno and yyrestart, are now either detected by config.sh or no longer relevant. Other settings that were not previously detected, such as what extension executables have, are now detected so that the config script works on DJGPP as well, now; compiling the config script on a non-DJGPP system seems to result in a script that fails on DJGPP, and likewise compiling the script on DJGPP seems to result on a script that fails on other systems, so both scripts are provided. The autoconfigurer now also adapts coopt.sh so that -F works on DJGPP too, sort of (or else detects that it won't work and disables it). 5. Improved the action of 'make install', so that it actually installs everything in the right place. It works under DJGPP, now, too, as long as you have the programs installed that allow configdj.sh and make to work. 6. Fixed a bug involving COME FROM in multithreaded programs; now, if a line COMEs FROM itself (either because this is written explicitly or because it is a computed COME FROM computing to its own line number), the loop this creates doesn't block all the other threads in the program. 7. Added support for statement WHILE statement, with similar semantics to CLC- INTERCAL. (The second statement is repeated for as long as the first statement is executing; NEXTing to the statement nexts to the first statement and doesn't set off the loop, and COMING or NEXTING FROM the first statement leaves the loop running until the NEXT FROM returns.) With the current implementation, strange things happen if the same WHILE is simultaneously run by multiple threads, although I decided to work out exactly what the rules were anyway and document them, so those strange things are now official. 8. Fixed some weird bugs in the multithreader that could cause segfaults in several situations involving backtracking; it's kind of surprising that they didn't turn up sooner. 9. Prevented a segfault in some situations where a syntax error was the target of a noncomputed COME FROM or NEXT FROM. 10. CALCULATING now includes array dimensioning. (There previously was no gerund for this situation; the original manual doesn't say what to do but implies that this is a special case of calculate.) 11. Made operand overloading interact more sensibly with multithreading. Previously, overloading information was shared between all threads, but the stashes for operand overloading were separate in each thread. Now, the overloading is not shared between threads, except when they are woven by a WHILE statement. 12. There's no longer a need to set or modify copyloc in the makefile by hand; COPYING.txt is now found the same way as syslib and the skeleton. It's also now copied out of the distribution to the same place as the other data files when installing, preventing the need to keep the original installation directory around. 13. The compiler now actually looks for a temporary directory to place a file in when creating a temporary file; this was meant to be fixed in 1.26, but the fix didn't actually work. 14. Added a new program to the pit: an Unlambda interpreter written by Oerjan Johansen in 2001, and also a commented version as documentation. 15. Section 23 of the release notes for version 0.26 is wrong; I was obviously confused when I wrote them because they were speaking nonsense. For the record: no, there is nothing special about NEXT in connection with backtracking. It should have said "NEXT", not "choicepoint". Instead of rewriting history, this changelog entry is added as a fix. 16. Added an entirely new set of documentation, the Revamped Manual, which is available in a wide range of formats and documents recent language changes, as well as many other things INTERCAL. The Revised Manual has been preserved, but it seems unlikely to be updated in the near future (it is still well worth a read anyway). 17. For compatibility, the COMMENT gerund can now be spelt COMMENTS or COMMENTING. 18. Corrected the Emacs INTERCAL mode to work with more recent versions of Emacs than it previously worked with, hopefully without sacrificing too much backward compatibility. 19. Added a conversion program 'convickt'; it can convert between the Latin-1, Baudot and EBCDIC character sets used by CLC-INTERCAL (Latin-1 is also accepted by C-INTERCAL, so this gives a practical way to run CLC-INTERCAL programs in unusual character sets on C-INTERCAL), and can also attempt to convert into the 'Atari character set' (which uses $ instead of the cent sign, ? instead of yen, and so on for the other characters that differ between C-INTERCAL and CLC-INTERCAL). 20. Reorganised the Makefile and environment variable system for finding locations to make more logical sense; various definitions and environment variables now do what their name suggests rather than something completely different, a situation which confused the programmers previously. The new version should be better at finding files that it needs, and also cuts down on the amount of useless copying that the Makefile did (such copying is now only done if the destination file doesn't already exist or is out of date). 21. Fixed some problems in the PIC-INTERCAL code: one problem with finding the correct location for the skeleton, and some code duplication between the two header files. Also clarified one of the comments. 22. Added support for CLC-INTERCAL-style Baudot I/O (generalised array I/O is currently unimplemented, though). This has a two minor differences to the CLC-INTERCAL version: unrecognised characters, instead of causing an error, become 0 when WRITING IN (except that tabs are translated to single spaces) and ASCII code 26 when READING OUT. (Baudot characters not in ASCII will be translated to Latin-1; there are more of these than might be expected, because the CLC-INTERCAL extended Baudot is being used). 23. The man pages and some fixes for the documentation Makefile from the Debian package were copied into the main distribution. The man page was written originally by Mark W. Eichin and later modified by Joey Hess (and was further modified by me prior to placing it in the distribution); the Makefile fixes are due to Joey Hess. Strangely, many of the changes I made to the Makefile for this version have much the same effect as fixes that the Debian package maintainers had come up with earlier; a new Makefile variable ick_specific_subdir has been added to hopefully make the Debian maintainer's job easier (it allows elimination of versioned subdirectories, replacing them with versionless subdirectories). 24. Added a new test program to the pit, tests/ignorret.i, that demonstrates how the interaction between IGNORE and RETRIEVE is different between C-INTERCAL, CLC-INTERCAL, and J-INTERCAL, and documentation showing the results on each version. Release 1.26 (by Alex Smith) [a bugfix of 0.26] 3 Sep 2007 1. Fixed an optimizer bug (thanks to Joris Huizer for pointing it out), relating to active-bits deduction in some expressions involving select. 2. Fixed a bug in the flow optimizer that caused it to occasionally confuse ABSTAIN with REINSTATE when gerunds were used. 3. Simplified the compilation of INTERCAL files to .exe under DJGPP, to avoid some temporary files (hopefully solving some problems users may be having with finding which directory the temporary files are in under DJGPP); when under DJGPP a temporary file other than .c or .exe is needed, the compiler now looks for a directory reserved for temporary files to place it in rather than just using the current directory. 4. The original INTERCAL manual specifies that GIVE UP cannot be REINSTATED or ABSTAINED FROM; this is now implemented, by taking only the original DO/DO NOT status into account when executing a GIVE UP statement. 5. Dealt with problems with what happens with the 'original' stdin (this information was previously lost, making it hard for the debugger to accept input because it had no obvious place to accept it from), and removed the previous hacky workarounds for this problem (which were my fault). 6. Made several improvements to the documentation, especially with respect to installing and running under DJGPP. 7. Modified the version number scheme, so that minor revisions and bugfixes now increment the major version number rather than the minor version number (it was getting a little bored stuck at 0). The next major release will be version 0.27. == Release 0.26 (by Alex Smith) 1 Apr 2007 == 1. Fixed a few bugs in the previous release (some bugfixed by Joris Huizer). 2. Ported to DJGPP. The compiler now works on both POSIX and DJGPP systems. 3. Reorganized the directory structure. 4. Added support for cross-compiling to the PIC microcontroller. 5. Added a simple test program for PIC cross-compilation. 6. Improved further searching for skeletons and executables. 7. Delinted some of the code, and turned up the default gcc warning level. 8. Reformatted some of the documentation. 9. Renamed and split files; all files used in the build now have 8.3 filenames, to prevent any problems using DJGPP on 8.3 systems. The optimizer was split from the code degeneration into dekludge.c (optimizer) and feh2.c (degeneration), because feh.c was getting too large. 10. The text documentation (README, COPYING, NEWS, and BUGS) was renamed to end .txt (again for DJGPP compatibility); formatting changes were made to README in addition to the addition of extra readme information. 11. Included precompiled-to-C versions of the parser and the lexer so that DJGPP (or I suppose, POSIX if you hacked the makefile) implementations without bison or flex could still compile the rest of C-INTERCAL and give a running program. 12. Fixed a bug involving optimization of Tri-INTERCAL programs. 13. Added to the lexer, so that it supports CLC-INTERCAL syntax for operators that were already present in C-INTERCAL, as long as they don't conflict with C-INTERCAL syntax. (Using the -X switch will support CLC-INTERCAL syntax for operators that were already present in C-INTERCAL even if they conflict with C-INTERCAL syntax.) For the symbols present in the CLC-INTERCAL character set but not in ASCII, ISO-8859-1 is supported as an encoding as well as UTF-8 (to increase the chance that CLC-INTERCAL programs will run without modification); it was meant to be supported to some extent before, but seemed not to be working. 14. Added the COMMENT gerund, with the same semantics as in CLC-INTERCAL. 15. Added COME FROM gerund. This suffers from the same restrictions as computed COME FROM, in that it can't be used in PIC programs and causes the program to end up substantially less efficient. 16. Added support for prefix as well as infix unary operators. The rule is that any number of prefix unary operators, but only one infix unary operator, is allowed on each group, variable, and/or mesh. (Previously, only infix operators were supported, and then only one per mesh.) 17. Added positional precedences to the parser. INTERCAL still doesn't have operator precedences (that would be completely contrary to the spirit of INTERCAL) but it now has rules for deciding on the meaning of previously ambiguous expressions. Chains of select and mingle operations right- associate, and when a unary operator could legitimately be in either a prefix or infix position, the infix position is assumed (although remember that only one infix operator is allowed for each group, variable, and/or mesh). 18. Added the not character as a synonym for NOT. 19. Added operand overloading, for onespot and twospot variables. This uses the slat operator in almost, but not quite, the same way as CLC-INTERCAL. Note that the width of unary operations will mostly depend on the type a variable appears to have in an expression, rather than on its actual bitwidth (if a onespot is overloaded to a twospot or vice versa). Note that meshes won't change as the result of operand overloading unless the -v option is used (an error will be generated instead). 20. Added an option for generalised assignments. With the -v option, expressions (rather than just variables) can appear on the left of an assignment. Any meshes on the left of an assignment (even if in apparently inoccuous positions) may change value as a result. (Note that such assignments aren't always possible.) If the left-hand-side of an expression is anything other than simply a variable or a constant, the compiler will try to change the values of meshes and non-ignored variables in the expression to make it fit. (In bases other than 2, it will nearly always fail.) Unlike CLC-INTERCAL, assigning to a mesh only changes that mesh, not line labels or other uses of the number. 21. Restricted the compiler to just one input file at a time (it used to break if this wasn't done anyway). 22. Fixed a nonportability involving stdin and stdout in cesspool.c. 23. Added support for the NEXT FROM command, with the same semantics as COME FROM (including computed NEXT FROM and NEXT FROM gerund), except that it saves the line that was NEXTed FROM on the choicepoint stack. 24. Fixed a bug where the yuk debugger accessed unallocated memory. == Release 0.25 (by Alex Smith) 21 Jun 2006 == 1. Added support for computed ABSTAIN and TRY AGAIN. 2. Added support for computed COME FROM. 3. Added support for multithread programs. This includes ONCE and AGAIN, which also work in singlethread programs. 4. Expanded intercal.el to support Font Lock and some utilities for generating INTERCAL-style constants. It also works with the compilation routines of Emacs to compile INTERCAL programs without the need for make. Degenerated C code now has a mode line to help with Emacs compatibility. 5. Added a rudimentary debugger and profiler for singlethread programs. The debugger's features include useful things like 'write out INTERCAL expression in simpler terms' (which is only possible if -O is on). The profiler works much like gcov, counting the length of time spent in and number of executions of each command in the code. 6. Changed searching for includes, libraries, syslib, skeleton. This is so that non-root users, or people who want to evaluate ick, can do so more simply. The compiler will search for the above files in the directory they should have been installed in, the current directory, and the directory in which ick's executable resides (in that order). Skeleton problems, in particular, seem to have been a major problem for unfamiliar users trying out ick. 7. Added several new test programs to the Pit. 8. Greatly expanded the original optimizer (which optimizes expressions). It can now recognize most of the idioms in syslib, and many idioms in other Pit programs. Also added a new optimizer, to try to optimize program flow, which is important because otherwise INTERCAL wouldn't have any rudimentary optimizers. There is also the -F optimizer, which I hope will become infamous. It creates object code which is close to maximally fast in some specialized situations, at the expense of compile time (compilation can take a very long time when -F is active) and object file size. I suggest checking its effect on primes.i. 9. Fixed the grammar (again) in a spark/ears situation involving array subscripts, after proving that the previous fixes weren't adequate. 10. Added support for backtracking (MAYBE, GO AHEAD, GO BACK). Note that it is possible for multithreading, backtracking, computed ABSTAIN, and computed COME FROM to all be used simultaneously in the same program, to help maximize obfuscation. 11. Added an option (-l) for generating warnings. To prevent this actually being useful, it is designed to generate far too many warnings, which all have to be trawled through to find the important ones, and has no way to turn the unimportant ones off. 12. Added the +printflow and +mystery options for executing INTERCAL programs. Note that it is not entirely obvious what either of them do (+printflow is a debugging aid, but the output is somewhat obfuscated, and I am not going to explain what +mystery does in this document). == Release 0.24 (by Eric S. Raymond) 31 Dec 2003 == 1. RPMs can now be built by non-root users. == Release 0.23 (by Eric S. Raymond) 9 Mar 2003 == 1. More fixes by Don Knuth. He found a bug in the type-propagation logic. == Release 0.22 (by Eric S. Raymond) 4 Mar 2003 == 1. Incorporated a minor fix patch from Donald Knuth. Yes, *the* Donald Knuth. Seems he found a weakness in the code for handling comments, and fixed it to do multiline comments properly. He also made some improvements to intercal.el, and contributed a test program. 2. Updated build machinery. This package now uses GNU autoconf. == Release 0.21 (by Eric S. Raymond) 30 July 2002 == 1. Jonathan Nieder sent a grammar fix for BLR's old bug #5 (a bad spark-ears interaction.) 2. Latin-1 support and makefile fixes from Magnus Bodin. == Release 0.20 (by Eric S. Raymond) 16 September 1999 == (The following changes are due to John Cowan ) 1. In addition to Latin-1, UTF-8 is now acceptable in source code as well. All the numerous currency symbols of Unicode (ISO 10646) can be used as big-money alternatives in their UTF-8 format. Indeed, a random mixture of Latin-1 and UTF-8 also works fine; this seems very much in the spirit of Intercal. 2. Intercal has now been localized for the Ancient Roman as well as the Posix/C locale. You may input numbers in Latin and write Intercal programs using Latin keywords. See lexer.l for a list of equivalences. 3. The Makefile in the pit directory now works like a real Makefile, and won't compile anything that's already been compiled. == Release 0.19 (by Eric S. Raymond) 16 August 1998 == 1. Fixed a code-generation error in assignments from tail and hybrid variables. (Error pointed out by Malcom Ryan.) == Release 0.18 (by Eric S. Raymond) 29 April 1998 == (The following changes are due to John Cowan ) 1. The source code is now POSIXly correct. By making the POSIX variable in the Makefile undefined, you can restore the use of , but otherwise is now used. 2. Latin-1 (ISO 8859-1) is now the standard input charset of C-INTERCAL. This means that the change operator (0xA2) has returned as an alternative to big money ($). Furthermore, the quid (0xA3) and zlotnik (0xA4) are also acceptable. For those using Latin-9 (ISO 8859-15), the euro (0xA4) will also work. ("Euro", like "ampersand", cannot be sillified further.) New names have been added to intercal.mm. 3. A fortiori, input of Volap\"uk digits may now be in Latin-1 or TeX format. 4. Yacc is now deprecated in favor of bison; some old yaccs don't do proper error recovery, and lines like "DO ~ ERROR" failed at compile time. 5. Some minor portability bugs on systems where ptr_diff is not the same as int were removed by casting expressions of the form (ptr - ptr) to int. == Release 0.17 (by Eric S. Raymond) 27 Feb 1998 == Incorporates a minor bug fix by Jeff Uphoff . == Release 0.16 (by Brian Raiter and Eric S. Raymond) 26 May 1997 == This is the 25th-anniversary release of INTERCAL. This language, conceived in irony a quarter century ago today, has outlasted many more serious and high-minded essays in computer language design. This fact should give us pause to reflect, or possibly frighten the crap out of us. Or both. 1. Corrected manual bugs. 2. Fixed over-enthusiastic install production in the Makefile. 3. DO PLEASE is no longer accepted (Brian Raiter pointed out that the manual does not sanction it). 4. Fixed various bugs in the optimizer. 5. Incorporated fixes made by William Walter Patterson for bugs that appeared when multiple files are given on the command line. (The following changes are due to Brian Raiter) 6. The system library is now available for TriINTERCAL (all bases, 3 to 7). The compiler has been updated to use the right library automagically. 7. The error 774 feature has been brought into conformance with the Princeton compiler. The odds are now a flat 10% (but still 0% with -b). 8. The compiler has been modified to allocate memory dynamically, and the hard-coded limits on program size and number of variables has been removed. Programs are now only limited by the amount of available memory. 9. Array output now fflushes after outputting newlines. 10. Two minor bug fixes: one in wimpmode input, which was clamping input to the signed integer range, and one in politesse checking. The latter was causing programs to be recognized as impolite only if their ratio was less that one-sixth, not one-fifth. (Fixing this also necessitated adding a few PLEASEs to pit/rot13.i.) 11. Several new programs have been tossed into the pit. == Release 0.15 (by Eric S. Raymond) 20 Jun 1996 == 1. Switched the INTERCAL manual master to mgm in order to be able to handle section crossreferences properly. The manual has now been carefully proofread against the paper version by ESR and seems to match. It's also been independently proofread for typos by Brian Raiter. 2. The optimizer now does complete analysis and evaluation of constant expressions at compile time. 3. Added optimization templates for ~, |, &, ^ expressions. Also added |, &, ^ idioms to the system library, and documented them. (The following changes are due to Brian Raiter) 4. Every one of the INTERCAL-72 messages is now emitted when appropriate. including the previously un-emitted E000, E197, and E200 (and see below). 5. A close reading (while proofing) of the sections of the manual on error messages seems to indicate that splatted lines were only splatted in the default listing printed after a successful compile. (This seems to be a standard feature of IBM compilers; I remember that RPG did this as well.) My understanding of the manual is when the syntactically offensive line is encountered at runtime, it is printed as error E000. I have modified the code to do this. 6. I have fixed INTERCAL in order to add another bug. Namely, I have implemented the BUG/NOBUG option in the Princeton compiler. By default, there is a chance that INTERCAL will randomly insert error E774 into your executable. (The odds are 1/128 per statement, not counting COME FROMs. Is there any way to find out what the Princeton compiler's odds were?) The new option -b turns this feature off. 7. The new file pit/lib/numio.i contains routines for wimpmode I/O. These routines are documented in the file pit/lib/numio.doc. It is my earnest hope that C-INTERCAL programmers everywhere will flock to these handy routines, and C-INTERCAL users will thus no longer need to fear that they might succumb to the foul and awful temptation to use the dastardly +wimpmode option. == Release 0.14 (by Eric S. Raymond) 9 Jun 1996 == 1. The documentation has been reorganized and cleaned up (you can now format either a C-INTERCAL or INTERCAL-72 manual from the same master). The diagrams in the paper original have been transcribed as pic figures. See doc/READ.ME for details. 2. Yet more code. The pit now includes a second random-number generator, a ROT13 filter, and even two programs in TriINTERCAL! 3. Louis Howell's corrected system library is now included. 4. The distribution is now formally GPLed. == Release 0.13 (by Eric S. Raymond) 5 Jun 1996 == 1. I folded in patches by Brian Raiter that port this code to Linux, ANSIfies it, and enables it to use flex. Note: This version has been tested on Linux and SunOS but not yet elsewhere. 2. Another piece of nontrivial INTERCAL code has been found! (Doubtless hell is freezing over even as I write.) We've added to the pit the `beer' program by Matt DiMeo , courtesy of the infamous Beer List (URL:http://www.ionet.net/~timtroyr/funhouse/beer.html). == Release 0.12 (by Eric S. Raymond) 22 Mar 1995 == 1. The code now compiles and runs under Linux, using bison and lex. It does *not* yet work with flex; C.P. Osborne's patches for 0.11 turned out not to be sufficient (at least for flex 2.4.6 under Linux using the -l option). See the BUGS list. 2. Note 3 under 0.11 was incorrect. We're in conformance after all. 3. The politesse check is a little smarter about programs too small to conform to the 1/5-to-1/3 criterion. All the pit programs have been checked for conformance. Also, the politesse error message now tells you the offending program's line count. == Release 0.11 (by Eric S. Raymond) 24 Sep 1994 == 1. Incorporated changes by Jan-Pieter Cornet for magical inclusion of the system library. These address an outstanding bug 2. (SS) The `system library' should be precompiled and `linked' to user written code, at least optionally. Doing this with the current compiler presents a few problems. which has accordingly been removed from the BUGS file. They also fix a previously unknown bug; due to a minor oversight in the lexer, it was not possible to ABSTAIN FROM WRITING IN or READING OUT. Jan also contributed a test program that demonstrates gerund abstention. 2. Despite the obvious appeal of the idea, and much discussion on alt.lang.intercal, I decided *not* to add Klingon; maintaining two parallel grammars just so the compiler could support SVO and OSV languages would be too painful. There was also a minor mess near case-sensitivity in the digits. The workaround kluges I was offered instead failed to satisfy. 3. We fess up to a violation of the INTERCAL-72 standard. That implementation, instead of accepting an entire multiple-digit number per line of input, expected one digit per *card image* (input line). It is unclear how INTERCAL-72 programs ever managed to input more than one number. 4. Added patches by C.P.Osborne to make the lexer work using flex, for Linux and BSD/386 support. I didn't use his error-reporting patch, though; instead, I changed the parser to catch errors at logical-line level. I also kept the N in `RESUBNIT'; this is a carefully preserved feature of INTERCAL-72. 5. Volapuk digits are now recognized on input. TO DO: Recognize Volapuk keywords, including gerunds. == Release 0.10 (by Eric S. Raymond) 9 Sep 1994 == 1. It is now possible to undo a line-number abstention with a gerund reinstatement, or undo a gerund abstention with a line-number reinstatement. In previous versions, gerund abstention/reinstatements and line-number abstention/reinstatements were independent of each other. 2. After release 0.5, I wrote in the TO DO list as follows: 2. (ESR) Input format internationalization -- allow WRITE IN input digits in major languages such as Nahuatl, Tagalog, Sanskrit, and Basque. The twisted loons in the alt.folklore.computers crowd loved this idea, and I actually got sent digit lists for Nahuatl, Tagalog, Sanskrit, and Basque -- also, Kwakiutl, Georgian, Ojibwe, and Albanian. I've left out Albanian (didn't want to keep track of the dipthong diacritical) and Ojibwe (no zero digit). So: Nahuatl, Tagalog, Sanskrit, Basque, Georgian, and Kwakiutl are now supported in addition to English. 3. The THEORY document has been significantly revised. == Release 0.9 (by Eric S. Raymond) 5 Mar 1993 == 1. An embarrassing port bug in the INTERCAL skeleton has been fixed 2. Jamie Zawinski's suggestion for an improved E333 error message has been accepted. 3. Added and improved documentation for pit programs. 4. The install production in the Makefile now puts lose.h in place as well as cesspool.h. 5. You can now set the C compiler to be used as a back end by INTERCAL by setting the environment variable CC. The default is cc. == Release 0.8 (many hacks on 0.7 by Eric Raymond) 21 Jan 1992 == 1. A previously undocumented `feature' of the Princeton compiler, revealed by Don Woods, is now emulated. If fewer than 1/5 or more than 1/3 of a program's statements contain the qualifier `PLEASE', the program is rejected with an entertaining error message. Programs in pit have been hacked to pass the politesse test. 2. The `sample' program now works correctly, thanks to Louis Howell. Also, he has contributed new programs to calculate pi and to search for prime numbers. 3. An intercal mode for GNU Emacs is included. It helps programmers deal with the new politesse check by randomly expanding the abbrev "do" to DO PLEASE or PLEASE DO about 1/4 of the time. 4. Improvements in code generation for NEXT/RESUME. 5. Fixes to the optimizer; it handles the results of optimized MINGLEs correctly now. Also, added a rewrite rule that checks for the equality-test idiom using XOR. 6. The original error messages from the Princeton compiler have been restored. The documentation has been updated to reflect these changes. == Release 0.7 (by Louis Howell) 21 Dec 1991 == In addition to bug fixes, new features in this version include arrays, character I/O, modified (hopefully improved!) semantics for the COME FROM statement, extensions to bases other than 2, new INTERCAL programs, and new documentation. == Release 0.6 (by Steve Swales) 5 Jan 1991 == 1. Restored Princeton documentation (courtesy of Michael Ernst). 2. Added -@ usage option to ick. 3. Added [+/-]help, [+/-]traditional, and [+/-]wimpmode options for generated programs; [+/-]traditional is a no-op at this point. 4. Various bug fixes, esp. in lexical analysis. == Release 0.5 (ESR's second pre-release) 5 Jun 1990 == 1. As a convenience to all you junior birdmen out there, `NINER' is accepted as a synonym for `NINE' in INTERCAL input. 2. The COME FROM statement is now compiled. == Release 0.3 (ESR's original pre-release) == The resurrection of INTERCAL from its grave took place on 12 May 1990 when ESR released 0.3 on an unsuspecting USENET. intercal-0.30/PaxHeaders.27456/control0000644000000000000000000000013212507241321014401 xustar0030 mtime=1427981009.981258368 30 atime=1427981009.993258337 30 ctime=1427992235.642945545 intercal-0.30/control0000664000175000017500000000153012507241321014302 0ustar00esresr00000000000000# Not a real Debian control file, though the syntax is upward-compatible. # It's project metadata for the shipper tool Package: intercal Description: a compiler for the INTERCAL language INTERCAL is the original esoteric language, a farrago of features that will test the mettle of any programmer and bend the minds of most. The INTERCAL suite includes not just a compiler and debugger for the language but most of the code ever written for it as well. Homepage: http://www.catb.org/~esr/intercal XBS-Repository-URL: http://thyrsus.com/gitweb/?p=intercal.git XBS-Clone-From: git@thyrsus.com:intercal XBS-Freecode-Tags: language, retrocomputing, parody, hacker culture Destinations: freecode,mailto:mam@theory.stanford.edu, mailto:ais523@bham.ac.uk, mailto:design@adastragames.com, mailto:albaugh@employees.org XBS-VC-Tag-Template: %(version)s intercal-0.30/PaxHeaders.27456/COPYING0000644000000000000000000000007411437550756014056 xustar0030 atime=1427954558.343140896 30 ctime=1427992235.498945939 intercal-0.30/COPYING0000644000175000017500000003536711437550756013767 0ustar00esresr00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. intercal-0.30/PaxHeaders.27456/aclocal.m40000644000000000000000000000013212507267225014651 xustar0030 mtime=1427992213.055008369 30 atime=1427992213.235007868 30 ctime=1427992235.486945978 intercal-0.30/aclocal.m40000664000175000017500000011244112507267225014556 0ustar00esresr00000000000000# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Copyright (C) 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper # if it is needed. If the detection of archiver interface fails, run # ACT-IF-FAIL (default is to abort configure with a proper error message). AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a ]) ]) case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) m4_default([$1], [AC_MSG_ERROR([could not determine $AR interface])]) ;; esac AC_SUBST([AR])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ(2.50)dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR intercal-0.30/PaxHeaders.27456/etc0000644000000000000000000000007411442404607013506 xustar0030 atime=1427992237.754939663 30 ctime=1427992235.602945656 intercal-0.30/etc/0000755000175000017500000000000011442404607013456 5ustar00esresr00000000000000intercal-0.30/etc/PaxHeaders.27456/interfuzz.pl0000644000000000000000000000007411440130756016157 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.602945656 intercal-0.30/etc/interfuzz.pl0000755000175000017500000003234511440130756016064 0ustar00esresr00000000000000#!/usr/bin/perl # # NAME # interfuzz.pl -- C-INTERCAL optimiser fuzz-tester # # LICENSE TERMS # Copyright (C) 2010 Alex Smith # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # use strict; use warnings; use File::Temp qw/tempdir/; use File::Spec; use constant fuzzamount => 1000; use constant ickpath => $ENV{ICK} || '../build/ick'; use constant idiompath => $ENV{IDIOTISM} || '../src/idiotism.oil'; # Before getting to the main program, we need to read in idiom LHSes. print STDERR "Loading idioms...\n"; my $idioms = ''; my %idiomlist = (); my %idiomnames = (); open my $idiomfh, '<', idiompath; while(defined ($_=<$idiomfh>)) { # OIL is whitespace-insensitive, except that comments go from # semicolons to newlines. s/;.*$//; # Square brackets indicate idiom names. s/\[(\w+)\]/($idiomnames{$1}=1),''/eg; $idioms .= $_; } close $idiomfh; # Remove whitespace. $idioms =~ s/\s//g; # Eliminate C from the testbench, leaving only OIL. # Constants with a condition are changed to ,n rather than #n, to tell # them apart from constants with a stated value. $idioms =~ s/#\{[^{}]*\}/,/g; $idioms =~ s/([.:_])\{[^{}]*\}/$1/g; # Remove bitwidths. $idioms =~ s/([^#\d])(?:16|32)/$1/g; # Remove reference numbers. For idioms that need numbers to be equal, we # have to rely on the random chance of getting a duplication due to a # random duplication of operand or of variable. $idioms =~ s/([.:_,])\d+/$1/g; # Replace overlarge constants with mingles. $idioms =~ s/#(\d+)/$1 > 65535 ? mingle_constant($1) : "#$1"/eg; # Change _ ("allow any value") to . ("force 16-bit"); because the # optimiser is free to optimise errors into errors, but we want to # generate known non-erroring code. $idioms =~ s/_/./g; # To find idiom LHSes, we look for balanced paren groups on the LHS of a # ->. (This will miss idioms that use sparkears for the outermost group, # but nobody does that anyway, and it doesn't change the correctness of # this testbench, just makes it randomize in a slightly worse way.) # We ignore idioms containing the following characters: +-*/%<> because # they can't easily be translated into INTERCAL, and so there's no # direct way to cause the idiom to happen. $idioms =~ s/(\((?:[^-()+*\/\%<>]|(?1))+\))->/($idiomlist{$1}=1),"$1->"/eg; # We generate random INTERCAL expressions as follows: start with a # placeholder _1, then repeatedly replace the placeholder with a more # complicated expression, which is either a primitive equation (_1~_2, # _V1, etc) or the LHS of an idiom (in order to increase the chance of # finding idiom bugs). An OIL-style syntax is used internally in order # to make things easier, it's translated into INTERCAL at the end # (with any C operators replaced by INTERCAL definitions of them). The # placeholders are eventually changed to random constants (50% chance) # or to random variables in the set .123, except that every # expression contains at least one non-constant variable. Random # constants have a 50% chance of being completely random, and a 50% # chance of being a number somehow significant to INTERCAL idioms. # Instead of the OIL-like _1, we use _[1] in case we end up with more # than 9 placeholders. sub random_constant { my $bitshift = int(rand(30)); $bitshift == 23 and $bitshift = 1; # 2 and 3 are significant $bitshift > 23 and $bitshift = 0; # but not as significant as 0 and 1 $bitshift > 16 and $bitshift = 16; # or as 65535 my $constant = 1 << $bitshift; $constant > 65535 || (rand) > 0.5 and $constant--; return '#'.$constant; } sub random_operand { my $bitwidth = shift; my $whichoperand = rand; $whichoperand < 0.5 and return '.'.(int(rand(3))+1); if ($bitwidth == 16) { $whichoperand < 0.75 and return '#'.int(rand(65536)); return random_constant; } else { $whichoperand < 0.75 and return '(#'.int(rand(65536)).'$#'.int(rand(65536)).')'; return '('.random_constant.'$'.random_constant.')'; } } sub oil_expression { my $expr = ':[1]'; local $_; my $idiomsused = 0; while ((rand) < 0.9 || $expr eq ':[1]') { my @placeholders = ($expr =~ /[.:]\[\d+\]/g); last unless @placeholders; my $unused_placeholder = 1; /[.:]\[(\d+)\]/ and $1 >= $unused_placeholder and $unused_placeholder = $1 + 1 for @placeholders; my $replaced_placeholder = $placeholders[int(rand(@placeholders))]; my $whichexpr = (rand); my $newexpr = "*"; if ($replaced_placeholder =~ /:/) {{ $idiomsused > 0 and $whichexpr *= 0.4; $whichexpr < 0.1 and $newexpr = '(:~:)', last; $whichexpr < 0.2 and $newexpr = '(.$.)', last; $whichexpr < 0.25 and $newexpr = '?:', last; $whichexpr < 0.3 and $newexpr = 'V:', last; $whichexpr < 0.35 and $newexpr = '&:', last; if ($whichexpr < 0.4) { $newexpr = $placeholders[int(rand(@placeholders))] while $newexpr !~ /^\:/; last; } # Grab an idiom from the list. $newexpr = (keys %idiomlist)[int(rand(keys %idiomlist))]; $idiomsused++; }} else {{ $whichexpr < 0.2 and $newexpr = '(.~.)', last; $whichexpr < 0.6 and $newexpr = '(:~.)', last; $whichexpr < 0.7 and $newexpr = '?.', last; $whichexpr < 0.8 and $newexpr = 'V.', last; $whichexpr < 0.9 and $newexpr = '&.', last; $newexpr = $placeholders[int(rand(@placeholders))] while $newexpr !~ /^\./; }} $newexpr =~ /[.,:]\[\d+\]/ or $newexpr =~ s/([.,:])/$1."[".($unused_placeholder++)."]"/eg; # Use {} as maybe-brackets; we don't know if $newexpr needs parens yet. $expr =~ s/\Q$replaced_placeholder\E/{$newexpr}/g; $expr =~ s/([?&V])\{([?&V][^{}]+)\}/$1($2)/g; $expr =~ s/[{}]//g; } my $newop; # Replace random operands $newop = random_operand(16), $expr =~ s/\Q$_\E/$newop/g for ($expr =~ /.\[\d+\]/g); $newop = random_operand(32), $expr =~ s/\Q$_\E/$newop/g for ($expr =~ /:\[\d+\]/g); # and random constants $newop = random_constant, $expr =~ s/\Q$_\E/$newop/g for ($expr =~ /,\[\d+\]/g); $expr =~ /[.:]/ or goto &oil_expression; return $expr; } # A utility function for creating 32-bit C logical operations, to help # create code needed to trigger various idioms. sub clogop { my $op = shift; my $a = shift; my $b = shift; return "($op(($a~(#65535\$#0))\$($b~(#65535\$#0)))~(#0\$#65535))\$". "($op(($a~(#0\$#65535))\$($b~(#0\$#65535)))~(#0\$#65535))"; } sub intercal_expression { my $expr = oil_expression; # C that came from idioms must be translated into INTERCAL. my $intercal_operand = qr/[?\&V]?[#.:]\d+|[?\&V]?(\((?:[^()]|(?-1))+\))/; { $expr =~ s/(?'a'$intercal_operand)==(?'b'$intercal_operand)/!($+{a}^$+{b})/g and redo; $expr =~ s/(?'a'$intercal_operand)!=(?'b'$intercal_operand)/(($+{a}^$+{b})~($+{a}^$+{b}))~#1/g and redo; $expr =~ s/!(?'a'$intercal_operand)/?((($+{a}~$+{a})~#1)\$#1)~#1/g and redo; $expr =~ s/(?'a'$intercal_operand)\^(?'b'$intercal_operand)/clogop('?',$+{a},$+{b})/ge and redo; $expr =~ s/(?'a'$intercal_operand)\|(?'b'$intercal_operand)/clogop('V',$+{a},$+{b})/ge and redo; $expr =~ s/(?'a'$intercal_operand)\&(?'b'$intercal_operand)/clogop('&',$+{a},$+{b})/ge and redo; # C bitwise complement is tricky as there's a clash with INTERCAL # binary select. So we check specifically for the ( before the ~. # The other problem is guessing the bitwidth - 4294967295^x may # overflow if x is actually 16-bit - so we instead just take a # 16-bit complement. $expr =~ s/\(~(?'a'$intercal_operand)/'('.clogop('?','#65535',$+{a})/ge and redo; } # Two changes are needed to allow for INTERCAL's insane syntax: # move all unaries forwards one character, and change parens into # spark/ears. In theory we could safely change everything to # sparks as the location of operands disambiguates, but we'll be # good and alternate in order to make life easier on a reader. my $spark = 1; $expr =~ s/([()])/($spark=!$spark),$spark ^ ($1 eq '(')?"'":'"'/ge; $expr =~ s/([?&V]+)([#.'"])/$2$1/g; return $expr; } # A utility function for creating 32-bit constants. sub mingle_constant { my $c = shift; my $a = 0; my $b = 0; for (0..15) { $c & 1 and $b |= 65536; $c & 2 and $a |= 65536; $a >>= 1; $b >>= 1; $c >>= 2; } return "(#$a\$#$b)"; } # The main program: create a temporary directory, and an INTERCAL # program in it. We run fuzzamount expressions, each on fuzzamount # sets of variable values. print STDERR "Generating test data...\n"; my $dir = tempdir( CLEANUP => 1 ); my $fn = File::Spec->catfile($dir,"fuzz"); open my $fh, '>', "$fn.i"; my (@dot1, @dot2, @dot3); # Store the data in a massive stash. for (0..(fuzzamount-1)) { print $fh "PLEASE .1 <- ", ($dot1[$_]=random_constant); print $fh " DO .2 <- #", ($dot2[$_]=int(rand(65536))); print $fh " DO .3 <- ", ($dot3[$_]=random_constant); print $fh " DO STASH .1 + .2 + .3\n"; } # The computed ABSTAIN is used as a loop counter. print $fh "PLEASE ABSTAIN #".fuzzamount." FROM (3) (1) DO COME FROM (2)\n"; print $fh "DO RETRIEVE .1 + .2 + .3\n"; print STDERR "Generating test program...\n"; my $pleaseflop = 0; my @expressions = (); $|=1; for (0..(fuzzamount-1)) { print STDERR "$_/",fuzzamount,"\r"; $expressions[$_] = intercal_expression; $pleaseflop && print $fh "PLEASE "; $pleaseflop = !$pleaseflop; print $fh "DO :1 <- ", $expressions[$_], " DO READ OUT :1\n"; } print $fh "(2) DO REINSTATE (3) (3) DO COME FROM (1) PLEASE GIVE UP\n"; close $fh; print STDERR "Running optimiser and compiling to C...\n"; my $ickpath = ickpath; my $optimiser_output = `$ickpath -bOch $fn.i 2>&1`; my %usedopts = (); $usedopts{$_}++ for $optimiser_output =~ m/\[(\w+)\]/g; # These prints are sent to stdout. print "Optimisations seen:\n"; (printf '%8d %s'."\n", $usedopts{$_}, $_), delete $idiomnames{scalar (/^([^_]+)/,$1)} for sort {$usedopts{$b} <=> $usedopts{$a}} keys %usedopts; print " 0 $_\n" for sort keys %idiomnames; print STDERR "Compiling optimised program to executable...\n"; open my $prog, '<', "$fn.c"; my $line1 = <$prog>; close $prog; # We grab the compile-command that ick places into the generated # executable, and run it minus any -On option (because gcc is bad at # optimising large programs, and because we're not fuzzing /it/). my ($compilecommand) = $line1 =~ /compile-command:"([^"]+)"/; $compilecommand =~ s/-O\d//; system $compilecommand; print STDERR "Running optimised program...\n"; my $optimised_output = `$fn`; # -g suppresses optimisation print STDERR "Compiling program unoptimised...\n"; system "$ickpath -bg $fn.i"; print STDERR "Running unoptimised program...\n"; my $unoptimised_output = `$fn`; if ($optimised_output eq $unoptimised_output) { print STDERR "No errors found!\n"; exit(0); } print STDERR "Errors were found...\n"; # The remaining output is the error report, sent to stdout. print "Errors found:\n"; my @o1 = split $/, $unoptimised_output; my @o2 = split $/, $optimised_output; my %problemindices = (); my %problemlines = (); for my $index (0..$#o1) { $o1[$index] eq $o2[$index] and next; $problemindices{int($index/2)} = 1; $problemlines{(int($index/2) % fuzzamount) + 1}++; } for my $index (sort {$a%fuzzamount <=> $b%fuzzamount} keys %problemindices) { my $dataline = fuzzamount - 1 - int($index/fuzzamount); my $ickline = ($index % fuzzamount) + 1; $problemlines{$ickline} == -1 and next; my $line2 = "Line $ickline (.1 = ". $dot1[$dataline]; if ($problemlines{$ickline} > 500) { $problemlines{$ickline} = -1; $line2 = "Line $ickline fails on most input, e.g. (.1 = ". $dot1[$dataline]; } if ($problemlines{$ickline} > 100) { $problemlines{$ickline} = -1; $line2 = "Line $ickline fails on many inputs, e.g. (.1 = ". $dot1[$dataline]; } $line2 .= ", .2 = #". $dot2[$dataline]; $line2 .= ", .3 = ". $dot3[$dataline] . "): u = "; my $line1 = ' ' x length $line2; $line1 .= $o1[$index*2]; $line2 .= $o1[$index*2+1] . ", o = "; $line1 .= ' ' x ((length $line2) - (length $line1)); $line1 .= $o2[$index*2]; $line2 .= $o2[$index*2+1]; print "$line1\n$line2\n"; } for my $index (sort {$a <=> $b} keys %problemlines) { print "Line $index is ".$expressions[$index-1]."\n"; } exit(1); intercal-0.30/etc/PaxHeaders.27456/IFFI0000644000000000000000000000007411437550756014236 xustar0030 atime=1427992237.754939663 30 ctime=1427992235.598945662 intercal-0.30/etc/IFFI/0000755000175000017500000000000011437550756014206 5ustar00esresr00000000000000intercal-0.30/etc/IFFI/PaxHeaders.27456/IFFI.c0000644000000000000000000000007411437550756015174 xustar0030 atime=1427954558.347140885 30 ctime=1427992235.598945662 intercal-0.30/etc/IFFI/IFFI.c0000644000175000017500000002152111437550756015070 0ustar00esresr00000000000000/* -*- mode: C; coding: utf-8; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- cfunge - a conformant Befunge93/98/08 interpreter in C. Copyright (C) 2008 Arvid Norlander Copyright (C) 2008 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Note that this code is designed to be linked against a GPLv3 library (producing a GPLv3 output), and therefore it is recommended that modifications to this code are compatible with GPLv3, although this is not a legal requirement. */ #include "IFFI.h" #include "../../stack.h" #include "../../settings.h" #include "../../interpreter.h" #ifdef HAVE_clock_gettime # include #else # include #endif static instructionPointer *iffiIP = NULL; static bool firstload = true; // Communication functions with the ecto_b98 expansion library void ick_save_ip_pos_delta(struct ick_ipposdeltatype* ippd) { ippd->ix = iffiIP->position.x; ippd->iy = iffiIP->position.y; ippd->dx = iffiIP->delta.x; ippd->dy = iffiIP->delta.y; } void ick_restore_ip_pos_delta(const struct ick_ipposdeltatype* ippd) { iffiIP->position.x = ippd->ix; iffiIP->position.y = ippd->iy; iffiIP->delta.x = ippd->dx; iffiIP->delta.y = ippd->dy; } void ick_interpreter_run(void) { if (!fungespace_create()) { perror("Couldn't create funge space!?"); exit(EXIT_FAILURE); } #if (CFUNGE_API_VERSION < 2) fungespace_load_string(ick_iffi_befungeString); #else fungespace_load_string(ick_iffi_befungeString, strlen((const char*)ick_iffi_befungeString)); #endif iffiIP = ip_create(); if (iffiIP == NULL) { perror("Couldn't create instruction pointer!?"); exit(EXIT_FAILURE); } { #ifdef HAVE_clock_gettime struct timespec tv; if (clock_gettime(CLOCK_REALTIME, &tv)) { perror("Couldn't get time of day?!"); exit(EXIT_FAILURE); } // Set up randomness srandom(tv.tv_nsec); #else struct timeval tv; if (gettimeofday(&tv, NULL)) { perror("Couldn't get time of day?!"); exit(EXIT_FAILURE); } // Set up randomness srandom(tv.tv_usec); #endif } if(ick_printflow) setting_trace_level=9; ick_interpreter_main_loop(); } void ick_iffi_interpreter_one_iteration(void) { funge_cell opcode; opcode = fungespace_get(&iffiIP->position); if (setting_trace_level > 8) { fprintf(stderr, "x=%" FUNGECELLPRI " y=%" FUNGECELLPRI ": %c (%" FUNGECELLPRI ")\n", iffiIP->position.x, iffiIP->position.y, (char)opcode, opcode); stack_print_top(iffiIP->stack); } else if (setting_trace_level > 3) { fprintf(stderr, "x=%" FUNGECELLPRI " y=%" FUNGECELLPRI ": %c (%" FUNGECELLPRI ")\n", iffiIP->position.x, iffiIP->position.y, (char)opcode, opcode); } else if (setting_trace_level > 2) fprintf(stderr, "%c", (char)opcode); execute_instruction(opcode, iffiIP); if (iffiIP->needMove) ip_forward(iffiIP); else iffiIP->needMove = true; } // A - CREATE a new INTERCAL instruction static void finger_IFFI_create(instructionPointer * ip) { // arguments: line number on TOS, signature as 0gnirts beneath it funge_cell l = stack_pop(ip->stack); unsigned char * restrict str = stack_pop_string(ip->stack, NULL); ick_create((const char*)str, l); } // C - In markmode COME FROM the top of stack static void finger_IFFI_come_from(instructionPointer * ip) { funge_cell l; l = stack_pop(ip->stack); if (ick_iffi_inmarkmode) { ick_iffi_breakloop = 1; ick_iffi_linelabel = l; ick_iffi_comingfrom = 1; } } // D - Push information about a CREATED instruction argument static void finger_IFFI_create_data(instructionPointer * ip) { // Arguments: argument's index (0-based) on TOS // Return: the following values (from bottom to top): // The argument's data type, in bits // Whether the argument is an array variable // 0 if the argument is not a variable, or its number if it is // The argument's value at the time the CREATED instruction was called // The argument's value now (same as previous if -a was not used) funge_cell i; if (firstload) { ip_reverse(ip); return; } i = stack_pop(ip->stack); stack_push(ip->stack, ick_c_i_width(i)); stack_push(ip->stack, ick_c_i_isarray(i)); stack_push(ip->stack, ick_c_i_varnumber(i)); stack_push(ip->stack, ick_c_i_value(i)); stack_push(ip->stack, ick_c_i_getvalue(i)); } // F - FORGET NEXT stack entries equal to top of stack static void finger_IFFI_forget(instructionPointer * ip) { funge_cell f; if (firstload) { ip_reverse(ip); return; } if (ick_iffi_inmarkmode) { /* this is an error in the user's code */ ip_reverse(ip); return; } f = stack_pop(ip->stack); if (f > 81 || f < 0) f = 81; ick_iffi_forgetcount = f; } // G - Get the value of an INTERCAL scalar variable static void finger_IFFI_var_get(instructionPointer * ip) { // arguments: var number on TOS // var numbers are positive for onespot, negative for twospot // return: the value of the variable funge_cell v; if (firstload) { ip_reverse(ip); return; } v = stack_pop(ip->stack); if (v == 0) { ip_reverse(ip); } else if (v > 0) { stack_push(ip->stack, ick_getonespot(v)); } else { stack_push(ip->stack, ick_gettwospot(-v)); } } // L - Use top of stack as a line label for this point static void finger_IFFI_label(instructionPointer * ip) { funge_cell l; if (firstload) { ip_reverse(ip); return; } l = stack_pop(ip->stack); ick_iffi_breakloop = 1; ick_iffi_linelabel = l; ick_iffi_sucking = 1; } // M - Marks points where the code can be entered from outside static void finger_IFFI_marker(instructionPointer * ip) { (void) ip; ick_iffi_breakloop = ick_iffi_inmarkmode; } // N - Try to NEXT to the line labelled with the top of stack static void finger_IFFI_next(instructionPointer * ip) { funge_cell l; if (firstload) { ip_reverse(ip); return; } if (ick_iffi_inmarkmode) { /* this is an error in the user's code */ ip_reverse(ip); return; } l = stack_pop(ip->stack); ick_iffi_breakloop = 1; ick_iffi_linelabel = l; ick_iffi_nexting = 1; } // R - RESUME to the top-of-stackth NEXT stack entry static void finger_IFFI_resume(instructionPointer * ip) { funge_cell f; if (firstload) { ip_reverse(ip); return; } if (ick_iffi_inmarkmode) { /* this is an error in the user's code */ ip_reverse(ip); return; } f = stack_pop(ip->stack); if (f > 81 || f < 0) f = 81; ick_iffi_forgetcount = f; ick_iffi_resuming = 1; ick_iffi_breakloop = 1; } // S - Set the value of an INTERCAL scalar variable static void finger_IFFI_var_set(instructionPointer * ip) { // arguments: var number on TOS, new value beneath it // var numbers are positive for onespot, negative for twospot // return: the value of the variable funge_cell v, d; if (firstload) { ip_reverse(ip); return; } v = stack_pop(ip->stack); d = stack_pop(ip->stack); if (v == 0) { ip_reverse(ip); } else if (v > 0) { ick_setonespot(v, d); } else { ick_settwospot(-v, d); } } // V - Assign to a CREATEd instruction argument static void finger_IFFI_arg_set(instructionPointer * ip) { // arguments: 0-based argument index on TOS, new value beneath it // note that this is a NOP unless -a was used when compiling funge_cell i, d; if (firstload) { ip_reverse(ip); return; } i = stack_pop(ip->stack); d = stack_pop(ip->stack); ick_c_i_setvalue(i, d); } // X - In markmode NEXT FROM the top of stack static void finger_IFFI_next_from(instructionPointer * ip) { funge_cell l; l = stack_pop(ip->stack); if (ick_iffi_inmarkmode) { ick_iffi_breakloop = 1; ick_iffi_linelabel = l; ick_iffi_nextingfrom = 1; } } // Y - Marks the end of initialisation static void finger_IFFI_yield(instructionPointer * ip) { ick_iffi_breakloop = firstload; if (! firstload) ip_reverse(ip); firstload = false; } bool finger_IFFI_load(instructionPointer * ip) { manager_add_opcode(IFFI, 'A', create) manager_add_opcode(IFFI, 'C', come_from) manager_add_opcode(IFFI, 'D', create_data) manager_add_opcode(IFFI, 'F', forget) manager_add_opcode(IFFI, 'G', var_get) manager_add_opcode(IFFI, 'L', label) manager_add_opcode(IFFI, 'M', marker) manager_add_opcode(IFFI, 'N', next) manager_add_opcode(IFFI, 'R', resume) manager_add_opcode(IFFI, 'S', var_set) manager_add_opcode(IFFI, 'V', arg_set) manager_add_opcode(IFFI, 'X', next_from) manager_add_opcode(IFFI, 'Y', yield) return true; } intercal-0.30/etc/IFFI/PaxHeaders.27456/IFFI.h0000644000000000000000000000007411437550756015201 xustar0030 atime=1427954558.347140885 30 ctime=1427992235.598945662 intercal-0.30/etc/IFFI/IFFI.h0000644000175000017500000000703611437550756015102 0ustar00esresr00000000000000/* -*- mode: C; coding: utf-8; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- cfunge - a conformant Befunge93/98/08 interpreter in C. Copyright (C) 2008 Arvid Norlander Copyright (C) 2008 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Note that this code is designed to be linked against a GPLv3 library (producing a GPLv3 output), and therefore it is recommended that modifications to this code are compatible with GPLv3, although this is not a legal requirement. */ #ifndef FUNGE_HAD_SRC_FINGERPRINTS_IFFI_H #define FUNGE_HAD_SRC_FINGERPRINTS_IFFI_H #include "../../global.h" #include "../manager.h" #if !defined(CFUNGE_API_VERSION) || (CFUNGE_API_VERSION > 3) # error "This version of IFFI isn't compatible with this cfunge version." #endif #ifdef CONCURRENT_FUNGE # error "The C-INTERCAL/cfunge external calls interface cannot be used concurrently." #endif // We need at least GCC 4.1 for this trick. #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) # if (__GNUC_MINOR__ >= 1) || (__GNUC__ > 4) # define PUBLIC __attribute__((visibility("protected"),externally_visible)) extern # else # define PUBLIC extern # endif #else # define PUBLIC extern #endif struct ick_ipposdeltatype { long long ix, iy, dx, dy; }; // Externally-visible functions from IFFI.c // This is for manager.c bool finger_IFFI_load(instructionPointer * ip); // We export these for use by ecto_b98 // Please remember to update the matching extern(s) over there // if you change here. PUBLIC void ick_save_ip_pos_delta(struct ick_ipposdeltatype* ippd); PUBLIC void ick_restore_ip_pos_delta(const struct ick_ipposdeltatype* ippd); PUBLIC void ick_interpreter_run(void); PUBLIC void ick_iffi_interpreter_one_iteration(void); // Implemented in ecto_b98 extern void ick_interpreter_main_loop(void); // Communication variables with ecto_b98 extern unsigned short ick_iffi_forgetcount; extern int ick_iffi_nexting; extern int ick_iffi_comingfrom; extern int ick_iffi_nextingfrom; extern int ick_iffi_sucking; extern int ick_iffi_resuming; extern uint32_t ick_iffi_linelabel; extern int ick_iffi_breakloop; extern int ick_iffi_inmarkmode; // Communication variables with the compiled .cio file extern const unsigned char * ick_iffi_befungeString; // Communication variables with the runtime library extern int ick_printflow; // Accessors and mutators for INTERCAL storage extern void ick_create(const char*, unsigned long); extern uint16_t ick_getonespot(unsigned short); extern void ick_setonespot(unsigned short, uint16_t); extern uint32_t ick_gettwospot(unsigned short); extern void ick_settwospot(unsigned short, uint32_t); extern int ick_c_i_width(int); extern int ick_c_i_isarray(int); extern unsigned short ick_c_i_varnumber(int); extern uint32_t ick_c_i_value(int); extern uint32_t ick_c_i_getvalue(int); extern void ick_c_i_setvalue(int, uint32_t); #endif intercal-0.30/etc/PaxHeaders.27456/IFFI.spec0000644000000000000000000000007411437550756015167 xustar0030 atime=1427954558.347140885 30 ctime=1427992235.598945662 intercal-0.30/etc/IFFI.spec0000644000175000017500000000153311437550756015064 0ustar00esresr00000000000000%fingerprint-spec 1.4 %fprint:IFFI %url:http://example.com %desc:INTERCAL-like Foreign Function Interface %safe:false %begin-instrs #I name desc A create CREATE a new INTERCAL instruction C come_from In markmode COME FROM the top of stack D create_data Push information about a CREATEd instruction argument F forget FORGET NEXT stack entries equal to top of stack G var_get Get the value of an INTERCAL scalar variable L label Use top of stack as a line label for this point M marker Marks points where the code can be entered from outside N next Try to NEXT to the line labelled with the top of stack R resume RESUME to the top-of-stackth NEXT stack entry S var_set Set the value of an INTERCAL scalar variable V arg_set Assign to a CREATEd instruction argument X next_from In markmode NEXT FROM the top of stack Y yield Marks the end of initialisation %end intercal-0.30/etc/PaxHeaders.27456/cftoec.sh0000644000000000000000000000007411442404607015362 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.602945656 intercal-0.30/etc/cftoec.sh0000755000175000017500000001223411442404607015262 0ustar00esresr00000000000000#! /bin/sh # This shell-script takes one argument, the path to a source # distribution of cfunge, and compiles that source distribution into a # library (libick_ecto_b98.a) suitable for linking to C-INTERCAL # programs. The cfunge distribution itself is not modified; all changes # are made on a copy. die() { echo "Error: $1"; exit 1; } if [ -z "$1" ] || [ -z "$2" ]; then echo "Usage: $0 ick-source-path cfunge-path" exit 1 fi # test x$1 != x || ( # echo Please give the path to the root of a cfunge source # echo distribution as an argument to this script. # exit 1 # ) || exit 1 ICKSRC_PATH="$1" CFUNGE_PATH="$2" BUILD_PATH="$(pwd)" ICKSRC_PATH=`(cd $ICKSRC_PATH; pwd)` || ( echo Please give the path to the root of C-INTERCAL source echo distribution as the first argument to this script\; the directory echo or file you gave does not exist. exit 1 ) || exit 1 CFUNGE_PATH=`(cd $CFUNGE_PATH; pwd)` || ( echo Please give the path to the root of a cfunge source echo distribution as the second argument to this script\; the directory echo or file you gave does not exist. exit 1 ) || exit 1 test -f "$CFUNGE_PATH/src/interpreter.c" || ( echo Please give the path to the root of a cfunge source echo distribution as the second argument to this script. echo You gave $CFUNGE_PATH, but it does not appear to be a cfunge echo source distribution. exit 1 ) || exit 1 test -f "$ICKSRC_PATH/etc/IFFI.spec" || ( echo Please give the path to the root of the C-INTERCAL source echo distribution as the first argument of this script. echo You gave $ICKSRC_PATH, but it does not appear to be a C-INTERCAL echo source distribution. exit 1 ) || exit 1 echo Compiling cfunge into a library suitable for use with C-INTERCAL: rm -rf cftoec_temp || die "Failed to remove any old temp directory" mkdir -p cftoec_temp || die "Failed to create temp directory" cd cftoec_temp || die "Failed to change directory to temp directory" # Select compiler if [ -z "$CC" ]; then CC=cc fi CFLAGS="-std=c99 -DUSE32 -DDISABLE_GC -DFUNGE_EXTERNAL_LIBRARY -DCFUN_IS_IFFI -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -DFUNGE_OLD_HANDPRINT=0x43464649 '-DFUNGE_NEW_HANDPRINT=\"http://example.com/\"'" # If GCC 4.1 or later is used add: # -O1 -combine -fwhole-program -fvisibility=hidden. # At least -O1 needed or -fwhole-program have no effect. Which is needed for # this trick. if "$CC" --version 2>&1 | grep -q GCC; then GCC_VERSION="$("$CC" --version 2>&1 | awk '/[^ ]+ \(GCC\)/ {print $3}')" GCC_MAJOR="$(echo "$GCC_VERSION" | cut -d. -f 1)" GCC_MINOR="$(echo "$GCC_VERSION" | cut -d. -f 2)" # We need GCC 4.1 or later. if [ "$GCC_MAJOR" -eq 4 ]; then if [ "$GCC_MINOR" -ge 1 ]; then IS_GCC=yes fi elif [ "$GCC_MAJOR" -gt 4 ]; then IS_GCC=yes fi fi if [ "$IS_GCC" ]; then CFLAGS="$CFLAGS -O1 -combine -fwhole-program -fvisibility=hidden" fi # Allow optional -O2 or such: if [ "$CFUNGE_CFLAGS" ]; then CFLAGS="$CFLAGS $CFUNGE_CFLAGS" fi # Please enable this when making changes. Requested by the cfunge author. #CFLAGS="$CFLAGS -Wall -Wextra -pedantic -Wpointer-arith -Wimplicit -Wnested-externs -Wcast-align -Wcast-qual -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wparentheses -Wshadow -Wundef -Wpacked -Wfloat-equal -Wstrict-aliasing=2 -Wformat=2 -Wmissing-noreturn -Wmissing-format-attribute -Wdeclaration-after-statement -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wwrite-strings" echo " " Duplicating cfunge source tree so that it can be modified... cp -r $CFUNGE_PATH/src $CFUNGE_PATH/lib $CFUNGE_PATH/tools . # Comment these lines back in if patching is needed # echo " " Patching cfunge source tree for use with C-INTERCAL... # patch -p0 < ../cfunge.patch echo " " Adding the IFFI fingerprint... cp -r "$ICKSRC_PATH/etc/IFFI" "$ICKSRC_PATH/etc/IFFI.spec" src/fingerprints echo " " Regenerating fingerprint lists... tools/gen_fprint_list.sh > /dev/null || die "Failed to regen list." # Trust the filenames that are in the cfunge directory tree; if the user's # trying to trick themselves into running this on something that looks like # the cfunge directory tree but which has spaces or quotes in the filenames, # I really can't be bothered to save them from themself. Dump all the resulting # object files in this temp directory. echo " " Compiling source... if [ "$IS_GCC" ]; then FILES="$(find . -name '*.c' -printf "%p ")" # Pipe needed due to messy double quoting. # It is impossible to use -o -c and multiple files all at once. GCC errors # if you try. However the *.o will be equal to one of the source filenames # but placed in the current directory and with .c replaced with .o echo "$CC $CFLAGS -c $FILES" | sh else find . -name '*.c' -printf "$CC $CFLAGS -c %p -o %f.o\n" | sh fi # Remove any existing library or ar would just add to the existing one. rm -f ../libick_ecto_b98.a echo " " Creating library... ar cr ../libick_ecto_b98.a *.o ranlib ../libick_ecto_b98.a echo " " Cleaning up... rm -rf * cd .. rm -rf cftoec_temp echo Finished, unless there were errors. intercal-0.30/etc/PaxHeaders.27456/intercal.el0000644000000000000000000000007411437550756015721 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.602945656 intercal-0.30/etc/intercal.el0000644000175000017500000006554411437550756015632 0ustar00esresr00000000000000;;; intercal.el -- mode for editing INTERCAL code ;; This mode was written by Eric S. Raymond ;; for the C-INTERCAL distribution, and is copyrighted by him 1992. Free ;; redistribution encouraged. Someday, maybe, this will be made part of GNU. ;; But probably not unless they take many mind-eroding drugs first. ;; This mode provides abbrevs for C-INTERCAL's statements, including COME FROM. ;; These abbrevs are context-sensitive and will generate either verb or gerund ;; form as appropriate. The keys RET, ( and * are also bound in useful ways. ;; The intercal-politesse-level adjustment purports to assist the hapless ;; INTERCAL programmer in meeting INTERCAL's Miss Manners requirement. In ;; INTERCAL-72 and C-INTERCAL releases after 0.7, no fewer than 1/5 and no ;; more than 1/3 of the program statements must contain a PLEASE to gratify ;; the iron whim of the INTERCAL compiler; this mode assists by randomly ;; expanding some fraction of the "do" abbrevs typed to PLEASE DO. ;; The intercal-politesse-level constant is the denominator of this fraction. ;; AIS: I corrected the READ/WRITE, IN/OUT reversal independent of the correction ;; that happened from 0.22 to 0.24 (this code was originally based on the 0.22 ;; distribution and updated for 0.24 compatibility); this version is distributed ;; with C-INTERCAL 0.27. ;; ;; I also altered the code for ( so the user didn't have to go to the beginning ;; of the line, added C-c C-[a,c,r,s] for convenience when working with ;; constants, and added support for TRY AGAIN, ONCE, AGAIN, and Font Lock. ;; I added support for M-x compile so it could compile INTERCAL programs ;; correctly (assuming that ick has been installed). ;; $Id: intercal.el,v 1.5 1996/11/14 04:02:00 esr Exp $ (defconst intercal-politesse-level 4 "Fraction of DOs that are automagically expanded to PLEASE DO.") (defvar intercal-mode-map nil "Keymap for INTERCAL mode.") (if intercal-mode-map nil (setq intercal-mode-map (make-sparse-keymap)) (define-key intercal-mode-map "\t" 'tab-to-tab-stop) (define-key intercal-mode-map "\r" 'intercal-return) (define-key intercal-mode-map "\C-J" 'intercal-return) (define-key intercal-mode-map "\C-C\C-C" 'intercal-constant-convert) ;AIS (define-key intercal-mode-map "\C-C\C-R" 'intercal-constant-radix-convert) ;AIS (define-key intercal-mode-map "\C-C\C-S" 'intercal-char-constant-convert) ;AIS (define-key intercal-mode-map "\C-C\C-A" 'intercal-string-array-convert) ;AIS (define-key intercal-mode-map "\C-C\C-U" 'intercal-lnu) ;AIS (define-key intercal-mode-map "(" 'intercal-paren) (define-key intercal-mode-map "*" 'intercal-splat) (define-key intercal-mode-map "\177" 'backward-delete-char-untabify) ) (defvar intercal-mode-syntax-table nil "Syntax table in use in Intercal-mode buffers.") (if intercal-mode-syntax-table nil (let ((table (make-syntax-table))) (modify-syntax-entry ?\\ "\\" table) (modify-syntax-entry ?+ "." table) (modify-syntax-entry ?- "." table) (modify-syntax-entry ?= "." table) (modify-syntax-entry ?% "." table) (modify-syntax-entry ?< "." table) (modify-syntax-entry ?> "." table) (modify-syntax-entry ?& "." table) (modify-syntax-entry ?| "." table) (modify-syntax-entry ?\' "\"" table) (setq intercal-mode-syntax-table table))) (defvar intercal-mode-abbrev-table nil "*Abbrev table in use in Intercal-mode buffers.") (if intercal-mode-abbrev-table nil (define-abbrev-table 'intercal-mode-abbrev-table ()) (define-abbrev intercal-mode-abbrev-table "pl" "PLEASE" nil) (define-abbrev intercal-mode-abbrev-table "on" "ONCE" nil) ;AIS (define-abbrev intercal-mode-abbrev-table "ag" "AGAIN" nil) ;AIS (define-abbrev intercal-mode-abbrev-table "ne" "" 'intercal-ne-abbrev) (define-abbrev intercal-mode-abbrev-table "fo" "" 'intercal-fo-abbrev) (define-abbrev intercal-mode-abbrev-table "res" "" 'intercal-res-abbrev) (define-abbrev intercal-mode-abbrev-table "st" "" 'intercal-st-abbrev) (define-abbrev intercal-mode-abbrev-table "ret" "" 'intercal-ret-abbrev) (define-abbrev intercal-mode-abbrev-table "ig" "" 'intercal-ig-abbrev) (define-abbrev intercal-mode-abbrev-table "rem" "" 'intercal-rem-abbrev) (define-abbrev intercal-mode-abbrev-table "ab" "" 'intercal-ab-abbrev) (define-abbrev intercal-mode-abbrev-table "rei" "" 'intercal-rei-abbrev) (define-abbrev intercal-mode-abbrev-table "gi" "" 'intercal-gi-abbrev) (define-abbrev intercal-mode-abbrev-table "rea" "" 'intercal-rea-abbrev) (define-abbrev intercal-mode-abbrev-table "wr" "" 'intercal-wr-abbrev) (define-abbrev intercal-mode-abbrev-table "co" "" 'intercal-co-abbrev) (define-abbrev intercal-mode-abbrev-table "do" "" 'intercal-do-abbrev) (define-abbrev intercal-mode-abbrev-table "wh" "" 'intercal-wh-abbrev) ;AIS (define-abbrev intercal-mode-abbrev-table "goa" "" 'intercal-goa-abbrev) ;AIS (define-abbrev intercal-mode-abbrev-table "gob" "" 'intercal-gob-abbrev) ;AIS (define-abbrev intercal-mode-abbrev-table "cr" "" 'intercal-cr-abbrev) ;AIS (define-abbrev intercal-mode-abbrev-table "ma" "MAYBE" nil) ;AIS (define-abbrev intercal-mode-abbrev-table "tr" "" 'intercal-tr-abbrev) ;AIS (define-abbrev intercal-mode-abbrev-table "cal" "" 'intercal-cal-abbrev) ;AIS ) (defun use-gerund () (save-excursion (beginning-of-line) (or (looking-at ".*ABSTAIN") (looking-at ".*REINSTATE")))) (defmacro make-intercal-abbrev (sym gerund verb) (list 'defun sym '() (list 'insert (list 'if '(use-gerund) gerund verb)))) (make-intercal-abbrev intercal-ne-abbrev "NEXTING" "NEXT") (make-intercal-abbrev intercal-fo-abbrev "FORGETTING" "FORGET") (make-intercal-abbrev intercal-res-abbrev "RESUMING" "RESUME") (make-intercal-abbrev intercal-st-abbrev "STASHING" "STASH") (make-intercal-abbrev intercal-ret-abbrev "RETRIEVING" "RETRIEVE") (make-intercal-abbrev intercal-ig-abbrev "IGNORING" "IGNORE") (make-intercal-abbrev intercal-rem-abbrev "REMEMBERING" "REMEMBER") (make-intercal-abbrev intercal-ab-abbrev "ABSTAINING" "ABSTAIN FROM") (make-intercal-abbrev intercal-rei-abbrev "REINSTATING" "REINSTATE") (make-intercal-abbrev intercal-gi-abbrev "GIVING UP" "GIVE UP") (make-intercal-abbrev intercal-rea-abbrev "READING OUT" "READ OUT") (make-intercal-abbrev intercal-wr-abbrev "WRITING IN" "WRITE IN") (make-intercal-abbrev intercal-co-abbrev "COMING FROM" "COME FROM") (make-intercal-abbrev intercal-tr-abbrev "TRYING AGAIN" "TRY AGAIN") ;AIS (make-intercal-abbrev intercal-cal-abbrev "CALCULATING" "cal") ;AIS (make-intercal-abbrev intercal-wh-abbrev "WHILING" "WHILE") ;AIS (make-intercal-abbrev intercal-goa-abbrev "GOING AHEAD" "GO AHEAD") ;AIS (make-intercal-abbrev intercal-gob-abbrev "GOING BACK" "GO BACK") ;AIS (make-intercal-abbrev intercal-cr-abbrev "CREATION" "CREATE") ;AIS (defun intercal-do-abbrev () "Emit a DO (usually). Occasionally, emit PLEASE DO." (insert (if (zerop (% (random) intercal-politesse-level)) "PLEASE DO" "DO") )) (defun intercal-return () "Insert LFD + tab, to bring us back to code-indent level." (interactive) (if (eolp) (delete-horizontal-space)) (insert "\n") (delete-horizontal-space) ;AIS (tab-to-tab-stop) (if intercal-lnu-mode (intercal-lnu)) ;AIS ) ;; AIS: This is the old intercal-paren function, modified slightly. (defun intercal-paren-2 () "Generate an INTERCAL label if at start of line. Otherwise type '('." (interactive) (if (and (bolp) (looking-at "[ \t]\\|$")) (insert (format "(%d)" (save-restriction (widen) (save-excursion (beginning-of-line) (1+ (count-lines 1 (point)))))) "\t") (insert "("))) ;; AIS: I wrote this as a better intercal-paren-2. (defun intercal-paren () "Generate an INTERCAL label or (." (interactive) (save-excursion (beginning-of-line) (if (looking-at "^[ \t]*$") (delete-horizontal-space))) (intercal-paren-2) ) (defun intercal-splat () "Begin an INTERCAL comment." (interactive) (insert "*") (forward-char -1) (delete-horizontal-space) (forward-char 1) (insert " ") ) ;; AIS: Added new abbreviations (marked ;AIS above), expanded the documentation. (defun intercal-mode () "A major editing mode for the language Intercal. It activates the following abbrevs (each one appropriately modified to a gerund if it occurs on a line with ABSTAIN or REINSTATE). ab ABSTAIN co COME FROM fo FORGET gi GIVE UP ig IGNORE ne NEXT rea READ OUT rei REINSTATE rem REMEMBER res RESUME ret RETRIEVE st STASH wr WRITE IN pl PLEASE tr TRY AGAIN on ONCE ag AGAIN ma MAYBE goa GO AHEAD gob GO BACK do DO, or sometimes PLEASE DO cal CALCULATE cr CREATE wh WHILE Carriage return takes you to the first tab stop (code indent level). Certain other single keys are bound to things which may or may not be useful. You may consider discovering these one of the pleasures awaiting you in your discovery of INTERCAL's unique ambience. Typing C-c C-c converts a constant in the form # to a legal INTERCAL constant (such as #45 or #65280$#65280). If the answer is a mingled one, it is only valid in binary. For programmers who prefer TRI-INTERCAL, another constant conversion function is given. Typing a number in the format (say) #3r2210210011 and pressing C-c C-r will result in a (possibly mingled) decimal constant that works in base 3. This works likewise for other bases, say #6r520314 would generate a base-6 constant. For binary I/O, C-c C-s is provided. This takes a constant of the form #? and converts it into a constant of the form #. With a prefix argument (as in C-u C-c C-s), the output has its bottom 8 bits reversed, and so is suitable for use with semi-standard output routines. For longer strings, C-c C-a can produce sections of programs that store strings in arrays. The command can give help on itself. For information about C-c C-u and LNU, see `intercal-lnu-mode'. Turning on Intercal mode calls the value of the variable intercal-mode-hook with no args, if that value is non-nil." (interactive) (kill-all-local-variables) (use-local-map intercal-mode-map) (setq major-mode 'intercal-mode) (setq mode-name "Intercal") (setq local-abbrev-table intercal-mode-abbrev-table) (set-syntax-table intercal-mode-syntax-table) (make-local-variable 'comment-start) (setq comment-start "* ") (make-local-variable 'comment-end) (setq comment-end "") (make-local-variable 'comment-column) (setq comment-column 32) (make-local-variable 'require-final-newline) (setq require-final-newline t) (setq abbrev-mode t) (setq abbrev-all-caps t) (run-hooks 'intercal-mode-hook)) (provide 'intercal-mode) ;; AIS: I wrote everything from here down. ;; Line Number Update minor mode. (defvar intercal-lnu-mode nil "Whether intercal-lnu-mode is on or not.") (make-variable-buffer-local 'intercal-lnu-mode) (defvar intercal-lnu-mode-initialized nil "Whether intercal-lnu-mode is initialized.") (defun intercal-lnu-mode (arg) "Minor mode used primarily when editing INTERCAL. (LNU stands for Line Number Update). The mode tries to ensure that all line labels below 1000 are equal to the line numbers of the lines they refer to. Renumbering is done when RET is pressed, the mode is turned on, or C-c C-u is pressed. This mode has no effect unless intercal-mode is also active, or its functions are called. It is inadvisable to turn LNU mode on in long files, because line number updates take a long time to run in long files. Instead, leave LNU mode off and use `intercal-lnu' (C-c C-u). Labels greater than or equal to 1000 are ignored because they probably indicate library functions." (interactive "P") (setq intercal-lnu-mode (if (null arg) (not intercal-lnu-mode) (> (prefix-numeric-value arg) 0))) (force-mode-line-update) (if intercal-lnu-mode (intercal-lnu)) (if (not intercal-lnu-mode-initialized) (intercal-lnu-initialize)) ) (defun intercal-lnu-initialize () "Initializes INTERCAL LNU mode. See `intercal-lnu-mode'." (if (not intercal-lnu-mode-initialized) (setq minor-mode-alist (cons '(intercal-lnu-mode " LNU") minor-mode-alist) intercal-lnu-mode-initialized t)) ) (defsubst cadar (x) "Return the car of the cdr of the car of X." (car (cdr (car x)))) (defun intercal-lnu () "Updates line numbers in an INTERCAL program. See `intercal-lnu-mode'. This function will run even if intercal-lnu-mode is off, but intercal-mode must be on. Running this function manually (with C-c C-u) rather than automatically is a good idea in long files, which take a long time to update." (interactive) (if (equal major-mode 'intercal-mode) (save-excursion (let ((line-number-update-list nil)) (goto-char (point-min)) (while (re-search-forward "^(\\([0-9]+\\))" nil t) (if (< (string-to-number (match-string-no-properties 1)) 1000) (setq line-number-update-list (cons (list (string-to-number (match-string-no-properties 1)) (count-lines 1 (point))) line-number-update-list)))) (while line-number-update-list (intercal-lnu-individual (caar line-number-update-list) (cadar line-number-update-list)) (setq line-number-update-list (cdr line-number-update-list)))) (goto-char (point-min)) (while (search-forward "LNUChange:" nil t) (replace-match ""))) (error "The buffer is not in intercal-mode")) ) (defun intercal-lnu-individual (oldlabel newlabel) "Updates all occurrences of one label in an INTERCAL program for another." (save-excursion (goto-char (point-min)) (while (search-forward (concat "(" (number-to-string oldlabel) ")") nil t) (replace-match (concat "(LNUChange:" (number-to-string newlabel) ")")))) ) ;; Font Lock settings. ;; We use keyword-face for commands, builtin-face for gerunds, constant-face ;; for meshes and mingle-mesh constants, and comment-face for initially ;; abstained lines (because these are usually comments, and anyway it's good ;; for them to stand out). Only the first line of multiline comments is marked. ;; MAYBE lines aren't marked because that's a big giveaway that the line won't ;; be abstained from all program. (defvar intercal-font-lock-keywords '(("^\\(([0-9]+)\\|\\)[ \t]*\\(PLEASE DO\\|DO\\|PLEASE\\)[ \t]*\\(NOT\\|N'T\\).*$" . font-lock-comment-face) ("\\<\\(ABSTAIN\\|GIVE UP\\|READ OUT\\|RESUME\\|WRITE IN\\|PIN\\|COME\\|FROM\\|IGNORE\\|REINSTATE\\|RETRIEVE\\|PLEASE\\|DO\\|MAYBE\\|ONCE\\|AGAIN\\|FORGET\\|NEXT\\|REMEMBER\\|STASH\\|DON'T\\|NOT\\|TRY AGAIN\\|WHILE\\|GO AHEAD\\|GO BACK\\)\\>" . font-lock-keyword-face) ("\\<\\(ABSTAINING\\|GIVING UP\\|READING OUT\\|RESUMING\\|WRITING IN\\|PINNING\\|COMING\\|IGNORING\\|REINSTATING\\|RETRIEVING\\|FORGETTING\\|NEXTING\\|REMEMBERING\\|STASHING\\|TRYING AGAIN\\|CALCULATING\\|WHILING\\|GOING AHEAD\\|GOING BACK\\)\\>" . font-lock-builtin-face) ("[.,:;][0-9]+" . font-lock-variable-name-face) ("#[0-9]+\\(\\$#[0-9]+\\|\\)" . font-lock-constant-face)) "Default expressions to highlight in Intercal mode.") ;; Find an error message produced by ick. If the famous RESUBNIT spelling error ;; is ever corrected, this will need to be corrected too. (defvar intercal-error-regexp '("\\(ICL[0-9][0-9][0-9][IW].*\\)\n[ \t]*ON THE WAY TO \\([0-9]+\\)\n[ \t]*\\(\\(CORRECT\\)\\|\\(RECONSIDER\\)\\) SOURCE AND RESUBNIT$" nil 2 nil (5 . nil) 1) "Regexp that identifies an INTERCAL error message, and the file and line number positions in it.") ;; Detect the line with which ick was invoked, so the filename used can be ;; used by Emacs' compile-mode to find the error. This will need to be changed ;; if command-line arguments to ick other than letters are allowed. (defvar intercal-file-regexp '(".*ick \\(-[a-zA-Z]+ \\)*\\(.*i\\)$" 2 nil nil 0 2) "Regexp that identifies the line with which ick was invoked, and the filename it was used on.") ;; Helper function for the binary I/O routines. (defun intercal-reverse-bits-if-nonnull (flag num) "Returns num if flag is null, or num with bits reversed if flag is nonnull." (if (null flag) num (let ((ans 0) (count 8) (num1 num)) (while (> count 0) (setq ans (* ans 2)) (if (= (% num1 2) 1) (setq ans (1+ ans))) (setq num1 (/ num1 2)) (setq count (1- count))) ans)) ) ;; Internal memory for inter-function communication. Yes, I know it's ;; unLispish to do this sort of thing, and breaks if the user tries to ;; convert two strings simultaneously. (defvar intercal-string-array-convert-options-buffer-used nil "Variable that keeps track of a buffer used to display options for intercal-string-array-convert.") ;; Function that inputs options for intercal-string-array-convert. ;; If the user asks for help, it pops up a help buffer and returns nil. ;; Its documentation string is the information required to appear in ;; the help buffer. (defun intercal-string-array-convert-options (opts) "Options for use with intercal-string-array-convert: ? Display the list of options 1 Pack the string one char/element (default) 2 Pack the string two chars/element (unimplemented) 4 Pack the string four chars/element (unimplemented) $ Pack the string in mingled format (default) so \"abcd\" would become \"a$b\"$\"c$d\" < Pack the string in shifted format (concatentate the codes for each character) R Bit-reverse each character code (default) W Don't bit-reverse each character code , Treat entered number as a tail array (default) ; Treat entered number as a hybrid array 0 Each character code is based at 0 (default) + Each character code is based at the previous code (unimplemented)" (interactive "sOptions: (type ?[RET] for help)") (if (string= opts "?") (progn (setq intercal-string-array-convert-options-buffer-used t) (with-output-to-temp-buffer "*Options*" (princ (documentation 'intercal-string-array-convert-options))) nil) opts) ) ;; The displaying of the help buffer is done by ;; intercal-string-array-convert-options, if required. This function holds ;; tests to put the display back as it was in two possible common situations ;; involving the user asking for help (one window active, two windows active). (defun intercal-string-array-convert (in arr &optional opts) "Generate INTERCAL code to initialize an array with information that makes it suitable for use as a string. For more information, run the command and enter a question mark for the options." (interactive "*MEnter string to convert:\nnEnter number of array required:") (let ((cb (current-buffer)) (w1p (one-window-p)) (ow nil)) (if (null w1p) (setq ow other-window-scroll-buffer)) (while (null opts) (setq opts (call-interactively 'intercal-string-array-convert-options))) (if intercal-string-array-convert-options-buffer-used (progn (select-window (get-buffer-window cb)) (if w1p (delete-other-windows) (switch-to-buffer-other-window ow)))) (setq intercal-string-array-convert-options-buffer-used nil)) (let ((packing 1) (basis nil) (arrtype ",") (revbits t) (mingle t)) (while (> (length opts) 0) (if (string= (substring opts 0 1) "1") (setq packing 1) (if (string= (substring opts 0 1) "2") (error "Unimplemented") ;(setq packing 2) ;unimplemented (if (string= (substring opts 0 1) "4") (error "Unimplemented") ;(setq packing 4) ;unimplemented (if (string= (substring opts 0 1) "$") (setq mingle t) ;unimplemented, but has no effect on option 1 (if (string= (substring opts 0 1) "<") (setq mingle nil);unimplemented, but has no effect on option 1 (if (string= (substring opts 0 1) "R") (setq revbits t) (if (string= (substring opts 0 1) "W") (setq revbits nil) (if (string= (substring opts 0 1) ",") (setq arrtype ",") (if (string= (substring opts 0 1) ";") (setq arrtype ";") (if (string= (substring opts 0 1) "0") (setq basis nil) (if (string= (substring opts 0 1) "+") (error "Unimplemented") ;(setq basis t) ;unimplemented (error "Invalid option")))))))))))) (setq opts (substring opts 1))) (intercal-return) (intercal-do-abbrev) (let ((al (/ (+ (length in) packing -1) packing))) (insert " " arrtype (int-to-string arr) " <- #" (int-to-string al))) (let ((lastchar 0) (arrind 1)) (while (> (length in) 0) (intercal-return) (intercal-do-abbrev) (insert " " arrtype (int-to-string arr) " SUB #" (int-to-string arrind)) (insert " <- #?" (substring in 0 1)) (setq in (substring in 1)) (intercal-char-constant-convert revbits)))) ) ;; Converts char to int by subtracting ! and adding 33. (defun intercal-char-constant-convert (arg) "Convert a constant of the form #? into a legal INTERCAL constant representing the character's character code. With a prefix argument, gives bit-reversed output. This routine is intended for use with the binary I/O capabilities of INTERCAL." (interactive "*P") ;Check prefix arg, not read-only (save-excursion (if (re-search-backward "#" (line-beginning-position) t) (if (re-search-forward "#\\?\\(.\\)" (line-end-position) t) (replace-match (concat "#" (int-to-string (intercal-reverse-bits-if-nonnull arg (+ 33 (- (string-to-char (match-string-no-properties 1)) ?!))))))))) ) ;; This is simpler than the next function because we're ;; converting from the target base, so it's simply a case ;; of selecting every second character if we need to produce ;; a mingled result (defun intercal-constant-radix-convert () "Convert a constant of the form #r to a legal TRI-INTERCAL constant in that base. If the number is sufficiently small, it is converted to decimal; otherwise, it is converted to two mingled decimal constants." (interactive "*") (save-excursion (if (re-search-backward "#" (line-beginning-position) t) (if (re-search-forward "#\\([2-7]\\)r\\([0-6]+\\)" (line-end-position) t) (replace-match (let ((radix (string-to-number (match-string-no-properties 1) 10)) (str (match-string-no-properties 2)) (slen 0) (mingle1 "") (mingle2 "") (num1 0) (num2 0)) (setq slen (length str)) (if (or (<= (* radix slen) 32) ; Calculate max onespot length (or (and (= radix 6) (= slen 6)) ;on these (and (= radix 7) (= slen 5)))) ;three lines (progn (setq num1 (string-to-number str radix)) (concat "#" (number-to-string num1))) (progn (while (/= 0 (length str)) (setq mingle2 (concat (substring str -1) mingle2)) (setq str (substring str 0 -1)) (if (/= 0 (length str)) (progn (setq mingle1 (concat (substring str -1) mingle1)) (setq str (substring str 0 -1))))) (setq num1 (string-to-number mingle1 radix)) (setq num2 (string-to-number mingle2 radix)) (concat "#" (number-to-string num1) "$#" (number-to-string num2))))))))) ) ;; The following code needs a bit of explanation. INTERCAL ;; can handle constants up to 4294967295 (0xffffffff), but ;; Emacs's constants max out somewhere between 100 million ;; and 1 billion. So, when a high number is entered, the ;; code processes the last 6 digits (in whatever base the ;; number is entered in) separately from the rest of the ;; number. This ensures that the arithmetic routines never ;; overflow if the input is a valid integer in the range ;; 0-4294967295. The calculations used do not work for ;; higher numbers, but that doesn't matter because ;; INTERCAL wouldn't accept them. Constants higher than ;; 65535 are given in mingled form (e.g. #65280$#65280). (defun intercal-constant-convert () "Convert a constant of the form # to a legal INTERCAL constant (#<16-bit decimal integer> or #<16-bit decimal integer>$#<16-bit decimal integer>). Decimal (#4294967295), octal (#037777777777) and hex (#0xffffffff) formats are all supported." (interactive "*") (save-excursion (if (re-search-backward "#" (line-beginning-position) t) (if (re-search-forward "#\\(0?[xX]?\\)\\([0-9a-fA-F]+\\)" (line-end-position) t) (replace-match (let ((str (match-string-no-properties 2)) (strhi "0") (strlow "0") (base (if (string= (match-string-no-properties 1) "") 10 (if (string= (match-string-no-properties 1) "0") 8 16)))) (if (<= (length str) 6) (setq strlow str) (setq strlow (substring str -6) strhi (substring str 0 -6))) (let ((num (string-to-number strlow base)) (numhi (string-to-number strhi base))) (if (and (<= num 65535) (string= strhi "0")) (concat "#" (number-to-string num)) (let ((mingle1 0) (mingle2 0) (count 16) (temp 0)) (while (> count 0) (progn (setq temp (% num 4)) (setq num (/ num 4)) (if (= (% temp 2) 1) (setq mingle2 (+ mingle2 65536))) (if (> temp 1) (setq mingle1 (+ mingle1 65536))) (setq mingle1 (/ mingle1 2)) (setq mingle2 (/ mingle2 2)) (setq count (- count 1)) (if (= count 13) (setq num (+ num (* (/ (expt base 6) 64) numhi)))))) (concat "#" (number-to-string mingle1) "$#" (number-to-string mingle2)) )))) t t)))) ) ;; This wraps around compilation-parse-errors in compile, and makes sure that ;; the first line of the compilation buffer is blank. This is to make the ;; call of ick (which is needed to determine the source file) look like an ;; error message rather than a compiler call. (defun intercal-error-wrap (limit-search find-at-least) "Parse the current buffer as ick error messages. This just wraps around 'compilation-parse-errors'. See variable 'compilation-parse-errors-function' for the interface it uses." (save-excursion (beginning-of-buffer) (if (looking-at "^$") nil (newline))) (compilation-parse-errors limit-search find-at-least) ) (require 'compile) ;Now a prerequisite for intercal.el, so its variables can be ;changed to INTERCAL values upon loading an INTERCAL file ;; This hook changes settings in fontlock and compile, so that they ;; recognize INTERCAL syntax and ick error messages. Default options to ;; ick are to optimize, but I chose not to give -b as a default (because ;; it spoils the fun). I'm slightly tempted to use -m as default, but ;; I'm not sure I'm that evil, and I left -f out for the time being because ;; it's something of a radical change to the output. (add-hook 'intercal-mode-hook (function (lambda () (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(intercal-font-lock-keywords t)) (make-local-variable 'compile-command) (setq compile-command (concat "ick -O " (buffer-name))) (make-local-variable 'compilation-parse-errors-function) (setq compilation-parse-errors-function 'intercal-error-wrap)))) ;; In recent versions of Emacs this must apparently be set globally; ;; also, the -error-regexp and -file-regexp were merged. (setq compilation-error-regexp-alist (cons intercal-error-regexp compilation-error-regexp-alist)) (if (boundp 'compilation-file-regexp-alist) (setq compilation-file-regexp-alist (cons intercal-file-regexp compilation-file-regexp-alist)) (setq compilation-error-regexp-alist (cons intercal-file-regexp compilation-error-regexp-alist)) ) ;; AIS: End of section I wrote. ;;; intercal.el ends here intercal-0.30/etc/PaxHeaders.27456/intercal.vim0000644000000000000000000000007411437550756016114 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.602945656 intercal-0.30/etc/intercal.vim0000644000175000017500000001115611437550756016013 0ustar00esresr00000000000000" Vim syntax file " Language: INTERCAL " Maintainer: Stefan O'Rear " Last Change: 2008 Nov 29 " Remark: Use the Power of Vim to turn your INTERCAL programs into angry " fruit salad. " " How to use this: " * Put levdes.vim (this file) under ~/.vim/syntax (or similar directory for " your system - usually C:\Program Files\Vim\vimfiles\syntax on Windows). " * In your .vimrc, add this line: " au BufRead,BufNewFile *.i set syntax=intercal " Thereafter, any .i files you edit in (g)vim will use syntax highlighting. if version < 600 syntax clear elseif exists("b:current_syntax") finish endif if !exists("main_syntax") let main_syntax = 'ick' endif syn match ickIdentifier /DO\|PLEASE/ syn region ickComment start=/\(PLEASE\s*DO\s*\|PLEASE\s*\|DO\s*\|\)N\s*['O]\s*T/ end=/\(([ 0-9]*[0-9])\s*\)\?\(DO\|PLEASE\)/me=s-1 syn match ickKeyword /F\s*O\s*R\s*G\s*E\s*T/ syn match ickKeyword /G\s*I\s*V\s*E\s*U\s*P/ syn match ickKeyword /I\s*G\s*N\s*O\s*R\s*E/ syn match ickKeyword /N\s*E\s*X\s*T/ syn match ickKeyword /R\s*E\s*I\s*N\s*S\s*T\s*A\s*T\s*E/ syn match ickKeyword /R\s*E\s*M\s*E\s*M\s*B\s*E\s*R/ syn match ickKeyword /R\s*E\s*S\s*U\s*M\s*E/ syn match ickKeyword /R\s*E\s*T\s*R\s*I\s*E\s*V\s*E/ syn match ickKeyword /S\s*T\s*A\s*S\s*H/ syn match ickKeyword /W\s*R\s*I\s*T\s*E\s*I\s*N/ syn match ickKeywordAIS /A\s*G\s*A\s*I\s*N/ syn match ickKeywordAIS /G\s*O\s*A\s*H\s*E\s*A\s*D/ syn match ickKeywordAIS /G\s*O\s*B\s*A\s*C\s*K/ syn match ickKeywordAIS /M\s*A\s*Y\s*B\s*E/ syn match ickKeywordAIS /O\s*N\s*C\s*E/ syn match ickKeywordAIS /P\s*I\s*N/ syn match ickKeywordAIS /T\s*R\s*Y\s*A\s*G\s*A\s*I\s*N/ syn match ickKeywordAISGrn /G\s*O\s*I\s*N\s*G\s*A\s*H\s*E\s*A\s*D/ syn match ickKeywordAISGrn /G\s*O\s*I\s*N\s*G\s*B\s*A\s*C\s*K/ syn match ickKeywordAISGrn /N\s*E\s*X\s*T\s*I\s*N\s*G\s*F\s*R\s*O\s*M/ syn match ickKeywordAISGrn /P\s*I\s*N\s*N\s*I\s*N\s*G/ syn match ickKeywordAISGrn /T\s*R\s*Y\s*I\s*N\s*G\s*A\s*G\s*A\s*I\s*N/ syn match ickKeywordCLC /C\s*R\s*E\s*A\s*T\s*E/ syn match ickKeywordCLC /N\s*E\s*X\s*T\s*F\s*R\s*O\s*M/ syn match ickKeywordCLCExp /W\s*H\s*I\s*L\s*E/ syn match ickKeywordCLCGrn /C\s*O\s*M\s*M\s*E\s*N\s*T/ syn match ickKeywordCLCGrn /C\s*O\s*M\s*M\s*E\s*N\s*T\s*I\s*N\s*G/ syn match ickKeywordCLCGrn /C\s*O\s*M\s*M\s*E\s*N\s*T\s*S/ syn match ickKeywordCLCGrn /C\s*R\s*E\s*A\s*T\s*I\s*N\s*G/ syn match ickKeywordCLCGrn /C\s*R\s*E\s*A\s*T\s*I\s*O\s*N/ syn match ickKeywordCLCGrn /L\s*O\s*O\s*P\s*I\s*N\s*G/ syn match ickKeywordCLCGrn /W\s*H\s*I\s*L\s*I\s*N\s*G/ syn match ickKeywordESR /C\s*O\s*M\s*E\s*F\s*R\s*O\s*M/ syn match ickKeywordESRGrn /C\s*O\s*M\s*I\s*N\s*G\s*F\s*R\s*O\s*M/ syn match ickKeywordExp /B\s*Y/ syn match ickKeywordExp /S\s*U\s*B/ syn match ickKeywordGrn /R\s*E\s*M\s*E\s*M\s*B\s*E\s*R\s*I\s*N\s*G/ syn match ickKeywordGrn /R\s*E\s*I\s*N\s*S\s*T\s*A\s*T\s*I\s*N\s*G/ syn match ickKeyword /A\s*B\s*S\s*T\s*A\s*I\s*N\s*F\s*R\s*O\s*M/ syn match ickKeywordGrn /A\s*B\s*S\s*T\s*A\s*I\s*N\s*I\s*N\s*G/ syn match ickKeywordGrn /C\s*A\s*L\s*C\s*U\s*L\s*A\s*T\s*I\s*N\s*G/ syn match ickKeywordGrn /F\s*O\s*R\s*G\s*E\s*T\s*T\s*I\s*N\s*G/ syn match ickKeywordGrn /I\s*G\s*N\s*O\s*R\s*I\s*N\s*G/ syn match ickKeywordGrn /R\s*E\s*A\s*D\s*I\s*N\s*G\s*O\s*U\s*T/ syn match ickKeyword /R\s*E\s*A\s*D\s\+O\s*U\s*T/ syn match ickKeywordGrn /N\s*E\s*X\s*T\s*I\s*N\s*G/ syn match ickKeywordGrn /R\s*E\s*S\s*U\s*M\s*I\s*N\s*G/ syn match ickKeywordGrn /R\s*E\s*T\s*R\s*I\s*E\s*V\s*I\s*N\s*G/ syn match ickKeywordGrn /S\s*T\s*A\s*S\s*H\s*I\s*N\s*G/ syn match ickKeywordGrn /W\s*R\s*I\s*T\s*I\s*N\s*G\s*I\s*N/ syn match ickKeywordExp /<\s*-/ syn match ickVariable /[!.:]\s*\(\s\|\d\)*\d/ contains=ickUnaryVar syn match ickArrayVar /[,;][0-9 ]*[0-9]/ syn match ickConstant /#[0-9 ]*[0-9]/ syn match ickUnaryVar /[&|?^]\|[2-5]\?@/ contained syn match ickLabel /([0-9 ]*[0-9][9-9 ]*)/ hi link ickLabel Tag hi link ickUnaryVar Normal hi link ickVariable Identifier hi link ickArrayVar Special hi link ickConstant Constant hi link ickIdentifier PreProc hi link ickComment Comment hi link ickKeywordGrn Type hi link ickKeywordExp Operator hi link ickKeyword Keyword hi link ickKeywordAISGrn ickKeywordGrn hi link ickKeywordAISExp ickKeywordExp hi link ickKeywordAIS ickKeyword hi link ickKeywordCLCGrn ickKeywordGrn hi link ickKeywordCLCExp ickKeywordExp hi link ickKeywordCLC ickKeyword hi link ickKeywordESRGrn ickKeywordGrn hi link ickKeywordESRExp ickKeywordExp hi link ickKeywordESR ickKeyword syn sync minlines=45 let b:current_syntax="intercal" intercal-0.30/PaxHeaders.27456/MANIFEST0000644000000000000000000000013212507267255014145 xustar0030 mtime=1427992237.758939658 30 atime=1427992237.754939663 30 ctime=1427992237.758939658 intercal-0.30/MANIFEST0000664000175000017500000001111712507267255014050 0ustar00esresr00000000000000. ./aclocal.m4 ./BUGS ./buildaux ./buildaux/bconfigh.in ./buildaux/buildconfig ./buildaux/buildconfig.ac ./buildaux/configh.in ./buildaux/depcomp ./buildaux/hostmak.in ./buildaux/install-sh ./buildaux/Makefile.am ./buildaux/Makefile.in ./buildaux/missing ./buildaux/ylwrap ./configure ./configure.ac ./control ./COPYING ./doc ./doc/chipspec.txt ./doc/convickt.1 ./doc/fdl-1-2.txi ./doc/fix83.pl ./doc/fixtoc.pl ./doc/ick.1 ./doc/ick.info ./doc/ick.info-1 ./doc/ick.info-2 ./doc/ickstyle.css ./doc/ick.txi ./doc/ick.txt ./doc/intercal.mm ./doc/Makefile ./doc/READ.ME ./doc/THEORY.txt ./doc/tidy.cfg ./etc ./etc/cftoec.sh ./etc/IFFI ./etc/IFFI/IFFI.c ./etc/IFFI/IFFI.h ./etc/IFFI.spec ./etc/intercal.el ./etc/intercal.vim ./etc/interfuzz.pl ./HISTORY ./MANIFEST ./NEWS ./pit ./pit/beer.chk ./pit/beer.doc ./pit/beer.i ./pit/blinkers ./pit/bubble.chk ./pit/bubble.doc ./pit/bubble.i ./pit/bubble.tst ./pit/CATALOG ./pit/change.doc ./pit/change.i ./pit/continuation.doc ./pit/continuation.i ./pit/explib ./pit/explib/compunex.c ./pit/explib/ecto_b98.c ./pit/explib/ecto_b98.doc ./pit/explib/syslibc.c ./pit/explib/syslibc.doc ./pit/fft-delta.chk ./pit/fft-delta.tst ./pit/fft.doc ./pit/fft.i ./pit/fft-tophat.chk ./pit/fft-tophat.tst ./pit/flonck.chk ./pit/flonck.doc ./pit/flonck.i ./pit/flonck.tst ./pit/.gitignore ./pit/glider ./pit/guess.i ./pit/gun ./pit/hail_mary.3i ./pit/hail_mary.doc ./pit/icat.chk ./pit/icat.i ./pit/iching1.i ./pit/iching2.i ./pit/iching.doc ./pit/ins.doc ./pit/ins.i ./pit/interfunge.chk ./pit/interfunge.doc ./pit/interfunge.i ./pit/interfunge.tst ./pit/lib ./pit/lib/1910.doc ./pit/lib/floatlib.doc ./pit/lib/floatlib.i ./pit/lib/lib2.doc ./pit/lib/lib2.i ./pit/lib/numio.doc ./pit/lib/numio.i ./pit/lib/plus.i ./pit/lib/syslib3.3i ./pit/lib/syslib3-7.doc ./pit/lib/syslib4.4i ./pit/lib/syslib5.5i ./pit/lib/syslib6.6i ./pit/lib/syslib7.7i ./pit/lib/syslib.doc ./pit/lib/syslib.i ./pit/lib/syslib-orig.i ./pit/life2.doc ./pit/life2.i ./pit/life.doc ./pit/life.i ./pit/Makefile ./pit/pass.chk ./pit/pass.i ./pit/pass.tst ./pit/pi.chk ./pit/pi.doc ./pit/pi.i ./pit/pow.chk ./pit/pow.i ./pit/pow.tst ./pit/primes.doc ./pit/primes.i ./pit/quine.i ./pit/random2.i ./pit/random.doc ./pit/random.i ./pit/regresscheck ./pit/rot13b.chk ./pit/rot13b.doc ./pit/rot13b.i ./pit/rot13.chk ./pit/rot13.doc ./pit/rot13.i ./pit/sample.i ./pit/sort.chk ./pit/sort.i ./pit/sort.tst ./pit/tests ./pit/tests/ais1.chk ./pit/tests/ais1.i ./pit/tests/ais1.tst ./pit/tests/ais2.chk ./pit/tests/ais2.i ./pit/tests/ais2.tst ./pit/tests/arrtest.doc ./pit/tests/arrtest.i ./pit/tests/compucome.i ./pit/tests/count.3i ./pit/tests/count.chk ./pit/tests/count.doc ./pit/tests/hello.chk ./pit/tests/hello.i ./pit/tests/iffit1.i ./pit/tests/iffit2.b98 ./pit/tests/iffit.doc ./pit/tests/ignorearray.chk ./pit/tests/ignorearray.i ./pit/tests/ignorret.chk ./pit/tests/ignorret.doc ./pit/tests/ignorret.i ./pit/tests/iogerunds.doc ./pit/tests/iogerunds.i ./pit/tests/knuth.i ./pit/tests/limits3.3i ./pit/tests/limits.i ./pit/tests/normaldist.i ./pit/tests/onceagain.chk ./pit/tests/onceagain.i ./pit/tests/permute.chk ./pit/tests/permute.doc ./pit/tests/permute.i ./pit/tests/pictest.i ./pit/tests/sink.chk ./pit/tests/sink.doc ./pit/tests/sink.i ./pit/tests/test16bit.i ./pit/tests/test1.chk ./pit/tests/test1.i ./pit/tests/test2.chk ./pit/tests/test2.doc ./pit/tests/test2.i ./pit/tests/test2.tst ./pit/tests/testarray.i ./pit/tests/testcf.i ./pit/tests/testcreate.chk ./pit/tests/testcreate.i ./pit/tests/testi18n.i ./pit/tests/testlib2.i ./pit/tests/testonce.chk ./pit/tests/testonce.i ./pit/tests/testops3.3i ./pit/tests/testops5.5i ./pit/tests/testsplat.chk ./pit/tests/testsplat.i ./pit/tests/version.4i ./pit/tests/version.doc ./pit/tests/whileadd.chk ./pit/tests/whileadd.i ./pit/tests/whileadd.tst ./pit/tpk.chk ./pit/tpk.doc ./pit/tpk.i ./pit/tpk.tst ./pit/t_tet ./pit/unlambda.chk ./pit/unlambda.doc ./pit/unlambda.i ./pit/unlambda.tst ./pit/yapp.doc ./pit/yapp.i ./pit/yapp.tst ./prebuilt ./prebuilt/lexer.c ./prebuilt/oil-oil.c ./prebuilt/parser.c ./prebuilt/parser.h ./README ./src ./src/abcessh.in ./src/arrgghh.c ./src/atari.bin ./src/baudot.bin ./src/bin2c.c ./src/cesspool.c ./src/clc-cset.c ./src/convickt.c ./src/cooptsh.in ./src/dekludge.c ./src/ebcdic.bin ./src/feh2.c ./src/feh.h ./src/fiddle.c ./src/fiddle.h ./src/ick_bool.h ./src/ick_ec.c ./src/ick_ec.h ./src/ick.h ./src/ick_lose.c ./src/ick_lose.h ./src/ick-wrap.c ./src/idiotism.oil ./src/latin1.bin ./src/lexer.l ./src/numerals.c ./src/oil.h ./src/oil.y ./src/parser.y ./src/perpet.c ./src/pick1.h ./src/pick2.h ./src/pickwrap.c ./src/sizes.h ./src/uncommon.c ./src/uncommon.h ./src/unravel.c ./src/yuk.c ./src/yuk.h intercal-0.30/PaxHeaders.27456/doc0000644000000000000000000000013212507267255013504 xustar0030 mtime=1427992237.734939724 30 atime=1427992237.754939663 30 ctime=1427992237.734939724 intercal-0.30/doc/0000775000175000017500000000000012507267255013463 5ustar00esresr00000000000000intercal-0.30/doc/PaxHeaders.27456/convickt.10000644000000000000000000000007411437550756015472 xustar0030 atime=1427954558.343140896 30 ctime=1427992235.502945933 intercal-0.30/doc/convickt.10000644000175000017500000000543611437550756015375 0ustar00esresr00000000000000.TH CONVICKT 1 .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection .\" other parms are allowed: see man(7), man(1) .\" .\" Created by Alex Smith; licensed under GNU GPL v2 or later. .SH NAME convickt \- convert INTERCAL files between formats .SH SYNOPSIS .B convickt .I "incharset outcharset [paddingrule [arrayname]]" .SH "DESCRIPTION" This manual page describes the .BR convickt command. Fuller documentation is available via the command .B info convickt . .PP .B convickt converts INTERCAL programs from one character set to another; it takes input from standard input and sends its output to standard output. .SH OPTIONS For .I incharset and .I outcharset .TP .B atari Interpret the input as being ASCII-7 Atari syntax INTERCAL, as is used by the Atari INTERCAL-72 compiler, J-INTERCAL, and C-INTERCAL default syntax, or output in that syntax. .TP .B baudot Interpret the input as being in CLC-INTERCAL's extended Baudot syntax, or output in that syntax. .TP .B ebcdic Interpret the input as being in the CLC-INTERCAL dialect of EBCDIC, or output in that syntax. .TP .B latin1 Interpret the input as being Latin-1 Princeton syntax INTERCAL, as is used by default by CLC-INTERCAL and also readable by C-INTERCAL with the .B \-X switch, or output in that syntax. .PP For .I paddingrule .TP .B zero Pad the irrelevant bits in ASCII-7 and Baudot output with zeros. .TP .B printable Set the values of the irrelevant bits in ASCII-7 and Baudot output to try to cause the output to stay within character range 32-126. This option is the default. (Note that .I paddingrule is irrelevant for 8-bit character sets like Latin-1 and EBCDIC). .TP .B random Pad the irrelevant bits in ASCII-7 and Baudot output with random data, except that outputing an all-bits-zero octet is avoided. .SH CAVEATS Not all conversions are possible, due to the character sets having different characters available. In most cases, an unconvertible or invalid character will be converted to a 0 (padded appropriately); the exception is that if a tab cannot be converted, it will instead be converted to a single space (so that INTERCAL programs still run if converted to Baudot). Using .B atari as an input or output character set will literally convert characters which differ between Atari and Princeton syntax without checking to see whether they are being used as operators or not. .PP If .I arrayname is given, then instead of outputting the converted text literally, it will be output as portable (that is, legal in INTERCAL-72, C-INTERCAL, J-INTERCAL and CLC-INTERCAL) INTERCAL that dimensions the tail array given as .I arrayname and assigns each byte of the output to an element of that array; this is mostly useful for producing Baudot text for CLC-INTERCAL-style array IO. .SH AUTHOR .B convickt and this manual page were written by Alex Smith. intercal-0.30/doc/PaxHeaders.27456/fdl-1-2.txi0000644000000000000000000000007411437550756015360 xustar0030 atime=1427954558.347140885 30 ctime=1427992235.622945595 intercal-0.30/doc/fdl-1-2.txi0000644000175000017500000005103211437550756015254 0ustar00esresr00000000000000@c The GNU Free Documentation License. @center Version 1.2, November 2002 @c This file is intended to be included within another document, @c hence no sectioning command or @node. @display Copyright @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. @end display @enumerate 0 @item PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document @dfn{free} in the sense of freedom: to assure 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 way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of ``copyleft'', which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. @item APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The ``Document'', below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as ``you''. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A ``Modified Version'' of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A ``Secondary Section'' is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The ``Invariant Sections'' are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections 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 that the Document is released under this License. A Front-Cover Text may be 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 the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not ``Transparent'' is called ``Opaque''. Examples of suitable formats for Transparent copies include plain @sc{ascii} without markup, Texinfo input format, La@TeX{} input format, @acronym{SGML} or @acronym{XML} using a publicly available @acronym{DTD}, and standard-conforming simple @acronym{HTML}, PostScript or @acronym{PDF} designed for human modification. Examples of transparent image formats include @acronym{PNG}, @acronym{XCF} and @acronym{JPG}. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, @acronym{SGML} or @acronym{XML} for which the @acronym{DTD} and/or processing tools are not generally available, and the machine-generated @acronym{HTML}, PostScript or @acronym{PDF} produced by some word processors for output 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 material this License requires to appear in the title page. For works in formats which do not have any title page as such, ``Title Page'' means the 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 whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific 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 a section ``Entitled XYZ'' according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. @item VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. @item COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a 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 ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. @item MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: @enumerate A @item Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. @item List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. @item State on the Title page the name of the publisher of the Modified Version, as the publisher. @item Preserve all the copyright notices of the Document. @item Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. @item Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. @item Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. @item Include an unaltered copy of this License. @item Preserve the section Entitled ``History'', Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled ``History'' in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. @item Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the ``History'' section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. @item For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. @item Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. @item Delete any section Entitled ``Endorsements''. Such a section may not be included in the Modified Version. @item Do not retitle any existing section to be Entitled ``Endorsements'' or to conflict in title with any Invariant Section. @item Preserve any Warranty Disclaimers. @end enumerate If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list 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 contains nothing but endorsements of your Modified Version by various parties---for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by 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 explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. @item COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant 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 all sections Entitled ``Endorsements.'' @item COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. @item AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. @item TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled ``Acknowledgements'', ``Dedications'', or ``History'', the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. @item TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. @item FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See @uref{http://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 this License ``or any later version'' applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. @end enumerate @page @heading ADDENDUM: How to use this License for your documents 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: @smallexample @group Copyright (C) @var{year} @var{your name}. 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''. @end group @end smallexample If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the ``with@dots{}Texts.'' line with this: @smallexample @group with the Invariant Sections being @var{list their titles}, with the Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}. @end group @end smallexample If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. 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. @c Local Variables: @c ispell-local-pdict: "ispell-dict" @c End: intercal-0.30/doc/PaxHeaders.27456/Makefile0000644000000000000000000000007411442661572015223 xustar0030 atime=1427954558.343140896 30 ctime=1427992235.618945611 intercal-0.30/doc/Makefile0000644000175000017500000000665011442661572015125 0ustar00esresr00000000000000# # Makefile for the Intercal documentation # # Making the original manual: # To see the Revised Manual, generate intercal.txt or intercal.ps # To see the original INTERCAL-72 manual, generate original.txt or original.ps. # Making the Revamped Manual: # generate ick.inf, ickhtml (will be placed into a directory), # ick.htm (all in one file), ick.pdf, or ick.txt. # We make two passes in order to resolve SETR/GETNH references. # The sed hackery strips the trailing dots from level 1 section references. all: allorig allnew allorig: intercal.ps intercal.txt original.ps original.txt allnew: ick.inf ickhtml ick.htm ick.txt ick.pdf intercal.ps: intercal.mm groff -U -dc=y -Tps -p -t -mm intercal.mm >intercal.refs.tmp sed tmp.refs; mv tmp.refs intercal.refs.tmp groff -U -dc=y -Tps -p -t -mm intercal.mm >intercal.ps -rm -f intercal.refs.qrf intercal.refs.tmp original.ps: intercal.mm groff -U -dc=n -Tps -p -t -mm intercal.mm >intercal.refs.tmp sed tmp.refs; mv tmp.refs intercal.refs.tmp groff -U -dc=n -Tps -p -t -mm intercal.mm >original.ps -rm -f intercal.refs.qrf intercal.refs.tmp intercal.txt: intercal.mm groff -U -dc=y -Tascii -p -t -mm intercal.mm >/dev/null sed tmp.refs; mv tmp.refs intercal.refs.tmp GROFF_NO_SGR=1 groff -U -dc=y -Tascii -p -t -mm intercal.mm >intercal.txt -rm -f intercal.refs.qrf intercal.refs.tmp original.txt: intercal.mm groff -U -dc=n -Tascii -p -t -mm intercal.mm >/dev/null sed tmp.refs; mv tmp.refs intercal.refs.tmp GROFF_NO_SGR=1 groff -U -dc=n -Tascii -p -t -mm intercal.mm >original.txt -rm -f intercal.refs.qrf intercal.refs.tmp # Don't delete *.txt here - not while we have asciidoc text masters, anyway clean: rm -f *.ps *.refs* ick.in* ick.txt RFC-DRAFT.txt ick.htm ick.pdf *.tmp rm -rf html ick.inf: ick.txi fdl-1-2.txi makeinfo -o ick.info ick.txi -mv ick.info ick.inf RFC-DRAFT.txt: RFC-DRAFT.roff groff -Tascii RFC-DRAFT.roff | col -x -b >RFC-DRAFT.txt # The --css-include is skipped here because it seems to cause makeinfo # to leak open file space, and it fails with an EMFILE error. Instead, # fix83.pl (which changes filenames to 8.3 format, among other things) # is used to add the styling. Tidy is run to clean up the output if # available, but if it isn't, that isn't a problem; there will just be # a harmless warning. ickhtml:html/index.htm html/index.htm: ick.txi ickstyle.css fdl-1-2.txi tidy.cfg rm -rf html makeinfo --html -o html ick.txi ls -1 html | perl -w fix83.pl | sh perl -i.tmp -w fix83.pl html/*.htm chmod u+w html/*.htm -tidy -config tidy.cfg -m html/*.htm || : rm html/*.tmp # fixtoc.pl is used here to reformat the TOC to look good under the # multiple-part system (which makeinfo doesn't really know about). ick.htm: ick.txi ickstyle.css fdl-1-2.txi tidy.cfg makeinfo --html --no-split --no-header --css-include=ickstyle.css -D notsplit -o ick.htm ick.txi -perl -i.tmp -w fixtoc.pl ick.htm rm ick*.tmp chmod u+w ick.htm -tidy -config tidy.cfg -m ick.htm || : # For some reason, ick.htm comes out of this readonly sometimes, which # is why the chmod seems to be needed. No idea why, though. ick.txt: ick.txi fdl-1-2.txi makeinfo --plaintext -D notsplit -o ick.txt ick.txi ick.pdf: ick.txi fdl-1-2.txi -texi2dvi -b -c -e -p -q ick.txi intercal-0.30/doc/PaxHeaders.27456/ick.txi0000644000000000000000000000013212507155722015050 xustar0030 mtime=1427954642.778848997 30 atime=1427954642.862848705 30 ctime=1427992235.550945797 intercal-0.30/doc/ick.txi0000664000175000017500000115473312507155722014770 0ustar00esresr00000000000000\input texinfo @c -*- texinfo -*- @c %**start of header @setfilename ick.info @set VERSION 0.29 @set VERSIONDASH 0-29 @settitle C-INTERCAL @value{VERSION} Revamped Instruction Manual @paragraphindent 0 @documentlanguage en @documentencoding ISO-8859-1 @c Command line option index. @defcodeindex op @c Error index @defindex er @c Commands and language features are in the predefined fnindex. @c Things generally are in the predefined cpindex. @c Combining indices. @syncodeindex fn cp @syncodeindex op cp @synindex er cp @c Adding to the main documentation tree. @dircategory INTERCAL @direntry * C-INTERCAL: (ick). The C-INTERCAL language and compiler. * ick: (ick) Invoking ick. Invoking the C-INTERCAL compiler. * convickt: (ick) convickt. The command-line character set converter. @end direntry @c Some macros to ease writing and updating. (The VERSION is set above because @c it's needed to set the title.) @macro cic{} @abbr{C-INTERCAL} @end macro @macro clcic{} @abbr{CLC-INTERCAL} @end macro @macro icst{} @abbr{INTERCAL-72} @end macro @macro jic{} @abbr{J-INTERCAL} @end macro @macro ical{} @acronym{INTERCAL} @end macro @c Part headings for unsplit output @macro partheading{arg} @html

\arg\

@end html @c @end macro @iftex @set notsplit @end iftex @c 'Portability' boxes @macro portability{st,c,clc,j} @multitable @columnfractions .23 .23 .23 .23 @headitem @icst{} @tab @cic{} @tab @clcic{} @tab @jic{} @item \st\ @tab \c\ @tab \clc\ @tab \j\ @end multitable @c @end macro @c Generating items and anchors together is also helpful. @macro ianchor{arg} @item \arg\ @anchor{\arg\} @c @end macro @macro ianchorc{arg} @item \arg\ @anchor{\arg\+} @c @end macro @macro ieanchor{arg} @item \arg\ @anchor{\arg\} @erindex \arg\ @c @end macro @macro ianchorpm{arg} @item +\arg\ @itemx -\arg\ @anchor{+\arg\} @anchor{-\arg\} @c @end macro @c Some fixes for HTML. @ifhtml @c Examples are styled in CSS; don't do it with hardcoded whitespace! @exampleindent 0 @end ifhtml @c %**end of header @copying This manual is for @cic{} version @value{VERSION}. 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 @cic{} (unlike the other manual, it is not derived from the original @icst{} manual). Copyright @copyright{} 2007 Alex Smith. @quotation 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.'' @end quotation @end copying @titlepage @ifset notsplit @title C-INTERCAL Revamped Instruction Manual @subtitle (this version distributed with version @value{VERSION} of C-INTERCAL) @page @vskip 0pt plus 1filll @insertcopying @end ifset @end titlepage @ifset notsplit @contents @end ifset @ifnottex @node Top @top C-INTERCAL @value{VERSION} @insertcopying @menu * About this manual:: What is covered in this manual The @cic{} compiler * Installation:: How to install @cic{} * Invoking ick:: Options to give to the compiler ick * Errors and Warnings:: Error messages, and what to do about them * The yuk debugger:: How to use the runtime debugger Basic @ical{} features * Syntax:: Holding statements together * Expressions:: Operators, operands, and grouping * Statements:: What an @ical{} statement can do * System Libraries:: Pre-existing @ical{} routines @ical{} dialects and extensions * TriINTERCAL:: @ical{} in non-binary bases * Multithreading and Backtracking:: Running @ical{} programs in parallel * Operand Overloading:: Where one expression stands for another * PIC-INTERCAL:: @ical{} on embedded systems * CREATE:: Creating new syntax at runtime * External Calls:: Linking @ical{} with other languages * Differences to Other Compilers:: @cic{} vs. @clcic{} Appendices and indices * Character Sets:: A list of character sets used by @ical{} * convickt:: The command-line character set converter * Optimizer Idiom Language:: The syntax to specify optimizer idioms * Copying:: License information for the code and manual * Main Index:: An index of all the pages in this manual @end menu @end ifnottex @node About this manual @unnumbered About this manual @cindex About this manual This is the Revamped Instruction Manual for @cic{} (this version is distributed with @cic{} version @value{VERSION}). It is divided into four parts. The first part is about the @cic{} compiler @command{ick}, 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. The second part is about the core @ical{} 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 (@pxref{Copying}), so if you disagree you can move the commands from section to section yourself.) Mostly only commands that are implemented in @cic{} are covered here (if you're interested in the other commands implemented in other compilers, read @clcic{}'s documentation). However, a comprehensive guide to portability of these commands between @cic{} and other @ical{} compilers is given. The third part covers the @ical{} extensions and dialects that are implemented by @cic{}, such as TriINTERCAL and Threaded @ical{}. Again, extensions and dialects not implemented have been mostly left out. The final part contains appendices (which were known as `tonsils' in the original @ical{} manual), such as character sets used by @ical{}, programs other than @command{ick} in the @cic{} distribution, information on how to read and update the list of optimizer idioms used by the compiler, and the copyright. @ifset notsplit @partheading{PART I: THE @cic{} COMPILER} @end ifset @node Installation @chapter Installation @cindex installation @cindex @command{ick}, installing The @cic{} 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. @menu * Obtaining:: How to get a @cic{} distribution to install * Unpacking:: What to do with the distribution file * Simple Installation:: How to install things the easy way * Installation on DOS:: For users of DOS with DJGPP * Uninstalling:: If you don't want to use the software * Reporting Bugs:: If it doesn't work or you know how to fix it * Distributing:: How to make your own @cic{} distribution @end menu @node Obtaining @section Obtaining @cindex obtaining C-INTERCAL @cindex C-INTERCAL, obtaining a copy @cic{} 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 @uref{news:alt.lang.intercal,,alt.lang.intercal newsgroup}; all releases of the @cic{} compiler ought to be announced there. (If you are interested in what other @ical{} 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 @uref{http://groups.google.com,Google Groups}, and a search for @samp{alt.lang.intercal} there should tell you where to find a copy. 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.) @node Unpacking @section Unpacking @cindex C-INTERCAL, unzipping @cindex C-INTERCAL, unpacking @cindex unzipping C-INTERCAL @cindex unpacking C-INTERCAL @cindex ick-@value{VERSIONDASH}.pax.* @cic{} is distributed in compressed pax format; for instance, you may find it as a @samp{.pax.lzma} file if you have the @command{unlzma} decompression program (this is advised, as it's the smallest); @samp{.pax.bz2} is larger and @samp{.pax.gz} is larger still. Most computers can decompress files in this format, even if they don't realise it, because pax is forwards-compatible with tar; try renaming the extension from @samp{.pax} to @samp{.tar} after decompressing to see if you have a progam that can decompress it. (If you're wondering why such an apparently non-standard format is being used, this is is actually a case where @cic{} is being perfectly nonstandard by conforming to the standards; tar is no longer specified by POSIX, and pax is its replacement. It's just that pax never really caught on.) 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 @emph{are} an administrator, or at least have the same privileges, and can extract it anywhere). Some commands that you might use to extract it: @table @asis @item Generic UNIX/Linux @example unlzma ick-@value{VERSIONDASH}.pax.lzma tar xvf ick-@value{VERSIONDASH}.pax @end example @i{or} @example bunzip2 ick-@value{VERSIONDASH}.pax.bz2 tar xvf ick-@value{VERSIONDASH}.pax @end example @i{or} @example gunzip ick-@value{VERSIONDASH}.pax.gz tar xvf ick-@value{VERSIONDASH}.pax @end example On most UNIX-based and Linux-based systems, @command{tar} will be available to unpack the installation files once they've been uncompressed with @command{gunzip}. (I've heard that some BSD systems have @command{pax} itself to decompress the files, although have not been able to verify this; some Linux distributions also have @command{pax} in their package managers. Both tar and pax should work fine, though.) @command{gunzip} is also likely to be available (and @command{bunzip2} and @command{unlzma} are less likely, but use those versions if you have them to save on your bandwidth); if it isn't, you will need to download a copy from the Internet. @item Using GNU tar @example tar xzvf ick-@value{VERSIONDASH}.pax.gz @end example @i{or} @example tar xqvf ick-@value{VERSIONDASH}.pax.bz2 @end example If you are using the GNU version of @command{tar} (which is very likely on Linux), you can combine the two steps into one as shown here, except when using the lzma-compressed version. @item Using DJGPP @example djtar -x ick-@value{VERSIONDASH}.pax.gz @end example On a DOS system, you will have to install DJGPP anyway to be able to compile the distribution, and once you've done that you will be able to use DJGPP's decompressing and unpacking utility to extract the files needed to install the distribution. (You will need to type this at the command line; on Windows 95 and later, try choosing Run...@: from the start menu then typing @command{cmd} (or @command{command} if that fails) in the dialog box that opens to get a command prompt, which you can exit by typing @command{exit}. After typing any command at a command line, press @key{RET} to tell the shell to execute that command.) @item On Windows If you're running a Windows system, you could always try double-clicking on the ick-@value{VERSIONDASH}.pax.gz file; probably renaming it to have the extension @samp{.tgz} is likely to give the best results. It's quite possible that you'll have a program installed that's capable of decompressing and unpacking it. Unfortunately, I can't guess what program that might be, so I can't give you any instructions for using it. @end table Whatever method you use, you should end up with a directory created called @file{ick-@value{VERSION}}; 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-@value{VERSION}}). @node Simple Installation @section Simple Installation @cindex installation, simple @cindex simple installation @findex config.sh @findex make @findex make install @cindex compiling, @command{ick} itself @cindex installation, via autoconf and make @cindex configuring There are scripts included in the distribution to automate the process of installing, in various ways. The simplest method of installing on most operating systems (on DOS, @pxref{Installation on DOS}) is to use the following routine: @enumerate @item Configure @cic{}, by running @command{configure}. Although building in the distribution directory works, it is recommended that you build elsewhere; create a directory to build in (using @command{mkdir} on most operating systems), then run @command{configure} from inside that directory (for instance, you could do this from inside the main installation directory: @example mkdir build cd build ../configure @end example to build in a subdirectory of the distribution called ``build''). You also specify where you want the files to be installed at this stage; the default of @samp{/usr/local} is good for many people, but you may want to install elsewhere (in particular, if you want to test out @cic{} without installing it, create a new directory somewhere you own and specify that as the place to install it, so the install will actually just copy the files into the right structure for use instead of installing them). To specify a location, give the option @option{--prefix=@var{location}} to configure; for instance, @command{configure --prefix=/usr} would install in /usr. @item Compile the source code, with the command @command{make}. The Makefile will be set up for your version of @command{make}, and to automatically recompile only what needs compiling (it will even recompile the build system if you change that). @item Optionally, create libraries from third-party interpreters to add support for more languages to the @cic{} external calls system; see @ref{Creating the Funge-98 Library}. (This step can be skipped; you can also do it later, but if you do so you need to run the next step again.) @item Install the executables, help files, include files, and libraries, using @command{make install}. (This is the only step that needs root/administrator permissions; so on a system that uses sudo to elevate permissions, for instance, write it as @command{sudo make install} if you're installing into a directory that you can't write to as a non-administrative user.) This step is optional; if you do not install @cic{}, you can still run it by directly referencing the exact location of the @command{ick} command. @end enumerate 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 (configure); its autoconf source code is available in the file @file{configure.ac}.) 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 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}. 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}, and don't have the shell @command{bash} which can emulate it, and so can't run @command{configure} 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 (@cic{} was designed to work with @command{gcc} and is tested mostly with that compiler, but in theory it should work with other C compilers too, and this is tested on occasion) and the associated software needed to compile C files to object files and executables, combine object files into libraries, etc.@:; but this requires trying to do the build by hand, so it's generally easier just to install a UNIX-like shell and associated tools. Another possibility 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} 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. @cindex installation, Debian @cindex installation, Ubuntu @cindex Debian @cindex Ubuntu 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 @samp{binutils}, @samp{cpp}, @samp{gcc}, @samp{libc6-dev}, @samp{make} to compile @cic{}, and if you want to modify it, you may also need @samp{autoconf}, @samp{automake}, @samp{bison}, and @samp{flex}. For debugging help, you may also want @samp{gdb}, and to recompile the documentation, you may need @samp{groff}, @samp{texlive}, @samp{texinfo}, and @samp{tidy}. 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{configure --help} to view the options that you can set on @command{configure}; there's a wide range of settings that you can set available there, and one of them may be what you want. @node Installation on DOS @section Installation on DOS @cindex installing, DOS @cindex DOS @cindex DJGPP On DOS-based systems, it's possible to install @cic{} via compiling it using DJGPP, a free DOS development system. (You can obtain DJGPP via its homepage, at @uref{http://www.delorie.com/djgpp/}.) The process for installing it works like this: @enumerate @item To start with, you will need to install DJGPP and various utilities (especially many of the GNU utilities) that come with it. To do this, see the instructions on DJGPP's website, and download and unpack any additional packages on this list that you did not install as part of those instructions (a filename by which the package can be found on DJGPP mirrors is given, and a version number with which @cic{} was tested is given as part of the filename, but other versions are likely to work as well): @itemize @item Unzip32 (@samp{unzip32.exe}) --- to unpack the other packages @item DJGPP development kit (@samp{v2/djdev203.zip}) --- needed for all DJGPP compiles @item CS's DPMI Provider (@samp{v2misc/csdpmi7b.zip}) --- you need some DPMI provider to run @cic{} on a plain DOS system, although this is not needed on systems such as Microsoft Windows' emulation of DOS which already include a DPMI provider @item GNU Binutils (@samp{v2gnu/bnu219b.zip}) --- needed to produce executables @item gcc (@samp{v2gnu/gcc444b.zip}) --- used to compile C code @item GNU make (@samp{v2gnu/mak3791b.zip}) --- used to resolve dependencies within the build system @item GNU bash (@samp{v2gnu/bsh204b.zip}) --- used to interpret build scripts @item GNU Diffutils (@samp{v2gnu/dif20b.zip}) --- used by the build scripts @item GNU Fileutils (@samp{v2gnu/fil41b.zip}) --- used by the build scripts @item GNU Findutils (@samp{v2gnu/find41b.zip}) --- used by the build scripts @item GNU awk (@samp{v2gnu/gwk318b.zip}) --- used by the build scripts @item GNU sed (@samp{v2gnu/sed421b.zip}) --- used by the build scripts @item GNU Shellutils (@samp{v2gnu/shl2011b.zip}) --- used by the build scripts @item GNU Textutils (@samp{v2gnu/txt20b.zip}) --- used by the build scripts, and sometimes by @cic{} itself too @end itemize You might want to install other packages, particularly GNU Bison and GNU Flex, in order to be able to rebuild certain parts of the compiler if you change them. This is not necessary to simply be able to run @cic{} without changing it, though. @item Test your DJGPP install to ensure it works, and make sure you have environment variables set up correctly. In addition to the @samp{DJGPP} variable that points to your @samp{DJGPP.ENV} file, and the @samp{PATH} variable that needs to contain DJGPP's binaries directory, you also need to set the @samp{DJDIR} environment variable to point to the main DJGPP installation directory. @item Unpack a copy of @cic{} in its own directory, if you haven't already (@pxref{Unpacking}). @item Load up a @command{bash} session, change to the @samp{buildaux} subdirectory of your main @cic{} directory, and run the command @command{build-dj.sh}. This will run the entire @cic{} build system, and hopefully end up with executables you can run in the @samp{build} subdirectory that will be created in your main @cic{} directory. @item If you wish, you can install @cic{} by using the command @command{make install} from the new @samp{build} subdirectory. It will run just fine in-place without a need to install, though, if you prefer. @end enumerate @node Uninstalling @section Uninstalling @cindex uninstalling @cindex @command{ick}, uninstalling It may happen that you decide to uninstall @cic{} 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 @cic{} because this will save some disk space; you cannot install two versions of @cic{} at once (at least, not in the same directory; but you can change the @option{--prefix} of one of the installations to get two versions at once). If you installed @cic{} using @command{make install}, you can uninstall it by using @command{make uninstall} 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 @file{ick} and @file{convickt} where your computer installs binaries (with an extension like @samp{.exe} added if that's usual for binaries on your operating system), @file{libick.a}, @file{libickmt.a}, @file{libickec.a}, and @file{libyuk.a} where your computer installs libraries, and the subdirectories @file{ick-@value{VERSION}} in the places where your computer installs data files and include files, and their contents. You can go further than uninstalling. Running @command{make clean} will delete any files created by compilation; @command{make distclean} will delete those files, and also any files created by configuring. It's probably a wise idea to uninstall before doing a distclean, though, as otherwise information needed to uninstall will be deleted, as that information is generated by @command{configure}. You can go even further and use @command{make veryclean} which will delete not only files created by configuring, but the entire build system; doing so is not recommended unless you have some method of rebuilding the build system from its original sources (a script to do this is provided in repository versions of @cic{}, because the generated part of the build system is not stored in the repository). @node Reporting Bugs @section Reporting Bugs @cindex bugs, reporting @cindex reporting bugs @cindex patches, submitting @cindex submitting patches If you can't get @cic{} 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 @uref{news:alt.lang.intercal,,alt.lang.intercal} news group; to report a bug or submit a patch, email the person who released the most recent @cic{} version (which you can determine by looking at that newsgroup). 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 (@pxref{E778}) 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 (@pxref{Debug Options}) 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. 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} (@pxref{-H+,,-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} (@pxref{-U+,,-U}), it helps if you can load a debugger (such as @command{gdb}) on the core dump, use the debugger to produce a backtrace, and send that backtrace. 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 @cic{}), 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}; 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 @cic{}. If you have a suggestion for a new feature, it makes sense to first discuss it on the @uref{news:alt.lang.intercal,,alt.lang.intercal} news group; other @ical{} compiler maintainers may also want to implement that feature. If you have developed code to implement that feature in @cic{}, you can submit it the same way that you would submit a patch for a bug. @node Distributing @section Distributing @cindex C-INTERCAL, distributing @cindex distributing C-INTERCAL @cindex releasing C-INTERCAL Due to the licensing conditions of @cic{}, 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: @enumerate @item Make sure the new version is based on the most recent existing version. Looking at the @uref{news:alt.lang.intercal,,alt.lang.intercal} newsgroup will normally let you know what version is most recent. @item Increment the version number; if you add any new features, increment the major version number (after the decimal point) and drop the minor version number (before the decimal point) to 0, and otherwise increment the minor version number. You have to update the version number in the following files: @file{configure.ac}, @file{configure}, and @file{doc/ick.txi}. You also have to rename the installation directory to reflect the new version number. @item Add an entry to the @file{NEWS} file explaining what's new in the version that you're releasing, following the same format as the other entries. @item Update the @file{README} with a description of any new files you may have added. @item Remove any autosave or backup files that may be littering the installation directory or its subdirectories. @item Run @command{make distcheck}, which will make the distribution paxballs, and rename them to have the correct extensions (Automake thinks they're tarballs, so will use @samp{.tar} rather than @samp{.pax}, and you have to fix this by hand). @command{make distcheck} will also perform some sanity checks on the build system of the resulting paxball, which will help to ensure that nothing important is missing from it; and some regression tests on a version of C-INTERCAL built from the distribution tarball itself, to prove that it runs correctly and produces plausible output. (A failure of the regression checks will not stop the build, but should stop you distributing the resulting compiler.) @item Place the new version somewhere on the Internet, and announce the location and the fact that a new version has been released on @uref{news:alt.lang.intercal,,alt.lang.intercal}. @end enumerate @node Invoking ick @chapter Invoking ick @cindex command line options @cindex options, to @command{ick} @cindex @command{ick}, command line options @cindex @command{ick}, invoking @cindex @command{ick}, options @cindex compiling, @ical{} source code All operations on @ical{} source code available in @cic{}, other than the conversion from one character set to another, are currently carried out by the compiler @command{ick}. The syntax is @example ick -options @var{inputfile} @end example @noindent (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 @ical{} 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. @menu * Language-affecting Options:: Options that specify language dialect * Debug Options:: Debug your code or ick itself * Output Options:: Specifying output format and location * Optimizer Options:: Yes, you can optimize @ical{}! * Other Options:: Options not covered in other sections * Options to Generated Programs:: Generated executables allow options too * Environment Variables:: What environment variables affect ick @end menu @node Language-affecting Options @section Language-affecting Options @cindex options, language-affecting @cindex language-affecting options @cindex options, dialect @cindex dialect options The following command-line options to @command{ick} affect what dialect of the @ical{} language is compiled by the compiler; you may need to set one or more of these options if your input is not the default @cic{} but instead some other language like @icst{} or @clcic{}, 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 @abbr{TriINTERCAL} (or the base 4-7 versions); instead, the numeric base to use is determined by looking at the filename extension (@samp{.i} for base 2, the default, or @samp{.3i} to @samp{.7i} for the base 3-7 versions.) @table @option @ianchor -b @opindex -b @cindex random bug @cindex E774, disabling If this option is @emph{not} given, there is a small chance that a random bug appears in the compiler, which causes the programs it creates to manifest a bug that causes error E774 (@pxref{E774}). Giving the option means that this bug will not happen. (You may wonder why this bug was preserved; it is in fact a bug that was carefully preserved since the days of @icst{}, in this case, but the option to turn it off is available as a workaround. (There are no plans to fix this or any of the other carefully preserved bugs any time soon, because that would kind of defeat the point of having preserved them.) Interestingly, the @icst{} compiler documentation mentions a similar command-line option that is a workaround for the same bug.) @ianchor -m @opindex -m @cindex multithreading, enabling @cindex backtracking, enabling This option needs to be given to allow any multithreading or backtracking commands or identifiers to be used. (Unlike with other language features, this is not autodetected because it's legal to have a program with multiple COME FROM (@pxref{COME FROM}) commands aiming at the same line even when it isn't multithreaded, in which case the commands cause error E555 (@pxref{E555}) when that line is encountered (with the usual caveats about both commands having to be active at the time).) Attempts to use non-COME FROM multithreading or backtracking commands without this option produce error E405 (@pxref{E405}). @ianchor -e @opindex -e @cindex external calls, enabling This option makes it possible to link non-@ical{} programs with @ical{} programs; instead of giving @ical{} programs only on the command line, give one @ical{} program, followed by any number of programs in other languages that have been written to be able to link to @ical{} programs. It also allows expansion libraries to be specified on the command line, after the @ical{} program (expansion libraries are given with no extension). For more information, see @ref{External Calls}. Also, both the @option{-a} and @option{-e} options must be set to use CREATEd operators (regardless of whether external calls are used or not). @ianchorc -E @opindex -E @cindex system library, disabling This option causes the system library to never be linked; this option is only useful if your program references a line number in the range 1000 to 1999, contains no line numbers in that range, and yet still doesn't want the system library to be linked in; therefore, it is mostly useful with @option{-e} when adding in a custom replacement system library written in a non-@ical{} language, especially the expansion library @option{syslibc} (a system library replacement written in C). @ianchor -t @opindex -t @cindex INTERCAL-72 compatibility mode @cindex compatibility, INTERCAL-72 This option tells the compiler to treat the source code as @icst{}; as a result, any language constructs that are used but weren't available in 1972 will trigger error E111 (@pxref{E111}). @ianchor -a @opindex -a @cindex CREATE, enabling This option allows the CREATE statement (@pxref{CREATE}) to be used. Note that enabling it carries a run-time penalty, as it means that operand overloading code has to be generated for every variable in the program. (This option is not necessarily needed for the external call version of CREATE to work, but the external call version has fewer features without it.) Note that @option{-e} (@pxref{-e}) also needs to be set to be able to CREATE operators. @ianchor -v @opindex -v @cindex constants, assigning to @cindex assigning to constants It is possible to write @ical{} code sufficiently tortuous that it ends up assigning to a constant. Generally speaking, this isn't what you wanted to do, so the compiler will kindly cause an error (E277; @pxref{E277}) that stops the insanity at that point, but at the cost of a significant amount of performance you can give this option to tell the compiler to simply change the constant and keep on going anyway. (Note that unlike @clcic{}, this only changes uses of the constant preceded by @code{#} in your program, not things like line numbers; you want @uref{http://esolangs.org/wiki/Forte,Forte} for that.) This option also allows you to write arbitary expressions on the left of an assignment statement if you wish. @ianchorc -C @opindex -C @cindex clockface mode When this option is given, the generated programs will write the number 4 as @samp{IIII} rather than @samp{IV}, in case you're writing a clock program. @ianchorc -P @opindex -P @cindex PIC-INTERCAL, command line option @cindex E256, avoiding @cindex E652, avoiding This tells the compiler to treat the input as @abbr{PIC-INTERCAL} (@pxref{PIC-INTERCAL}) rather than ordinary @cic{} input, and generate PIC output code accordingly. There are a lot of options that are incompatible with this, as well as many language features, due to the limited memory available on a PIC. If you get error E256 (@pxref{E256}), you have this option given when it shouldn't be; likewise, if you get error E652 (@pxref{E652}), you should be using this option but aren't. (A few simple programs are @cic{}/@abbr{PIC-INTERCAL} polyglots, but such programs are incapable of doing input or output, meaning that they aren't particularly useful.) @ianchorc -X @opindex -X @cindex Princeton syntax, option @cindex syntax, Princeton The @cic{} and @clcic{} compilers use different notation for various things, sometimes to the extent where the same notation is legal in both cases but has a different meaning. As this is the @cic{} compiler, it rather guessably uses its own notation by default; however, the @clcic{} notation can be used as the default instead using this option. (In most situations where there isn't an ambiguity about what something means, you can use the `wrong' syntax freely.) The option causes ambiguous characters like @code{?} to be interpreted with Princeton rather than Atari meanings. @ianchor -x @opindex -x @cindex CLC-INTERCAL compatibility mode @cindex compatibility, CLC-INTERCAL This option causes some constructs with different meanings in @cic{} and @clcic{} to use the @clcic{} meaning rather than the @cic{} meaning. At present, it affects the abstention of a GIVE UP (@pxref{GIVE UP}) command by line number, which is possible as long as this switch isn't given; reading through the @icst{} manual, there are a lot of things that imply that this probably wasn't intended to be possible, but as far as I can tell that manual doesn't actually @emph{say} anywhere that this particular case is disallowed, even though it rules out all other similar cases. It also causes I/O on array variables to be done in @clcic{}'s extended Baudot syntax, rather than using the Turing Tape method. @end table @node Debug Options @section Debug Options @cindex options, debug @cindex debug options Sometimes things will go wrong with your program, or with the way @command{ick} was installed. There may even be unknown bugs in @command{ick} itself (if you find one of these, please report it). The following options are used to debug the whole system on various levels. @table @option @ianchor -d @opindex -d @cindex debugging, parser @cindex parser, debugging @cindex debugging, lexical analyser @cindex lexical analyser, debugging If you think that something has gone wrong with the parser, or you want to see how your program is being parsed, you can give this option on the command line. All the debug output produced by the parser and lexical analyser will be output. @ianchor -g @opindex -g @cindex debugging, C code @cindex C code, debugging @cindex C code, leaving in place This option allows debugging of the final executable at the C code level. Any C code generated will be left in place, and the @option{-g} 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 the executable will be present there. @item -h @itemx -H @itemx -hH @anchor{-h} @anchor{-H+} @anchor{-hH} @opindex -h @opindex -H @opindex -hH @cindex optimizer, debugging @cindex debugging, optimizer @cindex OIL, debugging @cindex debugging, OIL These options allow debugging of the optimiser, or produce output helpful for understanding how your program has been summarised. @option{-h} produces a summary of what optimiser rules were used, the initial expression and what it was optimised to; @option{-H} produces a more expanded view that shows each intermediate step of optimisation, and @option{-hH} shows the same output as @option{-H}, but written completely using C syntax (the other options output in a strange mix of @ical{} and C). @ianchor -l @opindex -l @cindex warnings, enabling This option turns on generation of warnings (@pxref{Warnings}). To make sure that they aren't actually useful, or are only marginally useful, the warning generator is far too sensitive, and there is no way to decide which warnings are given and which ones aren't; you either get all of them or none. @ianchor -p @opindex -p @cindex profiling @cindex yuk, profiling 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 on the computer and operating system; DOS, in particular, is really bad with timer resolution. The output will be saved in a file called @file{yuk.out} when the program finishes running. It's legal to turn on both the profiler and the interactive debugger at the same time, but if you do this the profiler will also identify bottlenecks in the person typing in commands to step through the program! The profiler will, in fact, identify all the timings that particular commands in the program take; so @code{WRITE IN} instructions will often show up as taking a long time due to their need to wait for input. @ianchor -w @opindex -w @cindex +printflow, enabling @cindex printflow, enabling This option causes the produced program to support the @option{printflow} option fully; when this option is not given, @option{printflow} will in most cases have partial or no support (except in multithreaded programs, where this option is redundant), because not all the code needed for it will be included in the program to save space. @ianchor -u @opindex -u @cindex skeleton file, directory problems @cindex system library, directory problems @cindex syslib, directory problems @cindex directory problems @cindex E999, debugging @cindex E127, debugging When you are getting problems with finding files -- for instance, the compiler can't find the skeleton file (@pxref{E999}) or the system library (@pxref{E127}) -- this option will let you know, on standard error, where the compiler is looking for files. This may hopefully help you pin down where the file-finding problems are coming from, and also offers the option of simply placing copies of the files where the compiler is looking as a last resort. @ianchor -y @opindex -y @cindex yuk, command line option This is the main debugging option: it loads yuk, an interactive @ical{} debugger with ability to step through the program, set breakpoints, view and modify variables, etc. @xref{yuk}. @ianchorc -Y @opindex -Y @cindex external calls, debugging @cindex command line, showing intermediates This options causes the command line to be displayed for all calls to other programs that @command{ick} makes (mostly to @command{gcc}); it is therefore useful for debugging problems with the command lines used when using the external calls system (@pxref{External Calls}). @ianchorc -U @opindex -U @cindex internal errors, debugging @cindex debugging, internal errors @cindex internal errors, dumping core @cindex dumping core on error @cindex E778, debugging The internal error E778 (@pxref{E778}) should never happen. However, there are all sorts of potential problems that may come up, and if part of the code detects something impossible, or more usually when the operating system detects things have got too insane and segfaults, normally this error will just be generated and that's that. (I most often get this when I've been writing a new section of code and have made a mistake; hopefully, all or at least most of these errors are fixed before release, though.) If you want more information as to what's going on, you can give the @option{-U} option, which will cause the compiler to raise an abort signal when an internal error happens. This can generally be caught by a debugger that's being run on @command{ick} itself at the time; on many systems, it will also cause a core dump. @end table @node Output Options @section Output Options @cindex output options @cindex options, output 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. @table @option @ianchor -c @opindex -c @cindex code generation, stopping at C code @cindex C, stopping after C is generated @cindex output, C only By default, the original @ical{} code will be compiled all the way to an executable, and the intermediate C and object files produced will be deleted. Giving this option causes the compiler to stop when it has finished producing the C file, leaving the C file there as the final output of the compiler. (Its filename is the same as the source file, but with @samp{.c} as its extension/suffix rather than the source file's extension.) Without this option, an executable will be produced with the extension 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. @ianchor -o @opindex -o @cindex output, to standard output @cindex standard output This option causes the compiler to progress no further than producing the C output file, but instead of writing it to a file writes it directly to standard output. This might occasionally be useful when using @command{ick} as part of a pipe; it can also be useful to see how far the compiler gets with compiling code before an error happens, when you're trying to track down an error. @end table @node Optimizer Options @section Optimizer Options @cindex optimizer options @cindex options, optimizer @cindex optimization There are various command line options that can be used to tell @command{ick} whether and in what ways to optimize code. @table @option @ianchor -f @opindex -f @cindex flow optimization @cindex optimization, flow @cindex optimization, control flow This option requests the compiler to attempt to analyse the flow of the program and optimize accordingly; for instance, it will detect which commands can't possibly be @code{ABSTAINED} from and refrain from generating code to check the abstention status of those commands. @ianchorc -F @opindex -F @cindex optimization, extreme @cindex extreme optimization This option tells the compiler to optimize the output for speed. This is done to crazy extremes; the compiler may take several hours/days analysing the program in some cases and still not come up with an improvement. It turns on all the other optimizer options. Note that not all systems accept this option, because it sometimes outputs a shell script disguised as an executable rather than an actual executable. @ianchorc -O @opindex -O @cindex optimization, idioms @cindex idiom optimization @cindex optimization, OIL @cindex OIL, optimizing code This option tells the compiler to apply optimizer idioms to the expressions in the code given, when appropriate. The list of idioms is stored in the file @file{src/idiotism.oil}; note that it is compiled into the compiler, though, so you will have to rebuild and reinstall the compiler if you change it. For more information about changing the list of idioms, see @ref{Optimizer Idiom Language}. @end table @node Other Options @section Other Options @cindex other options @cindex options, other Some options just can't be classified. @table @option @item -@@ @anchor{-at} @opindex -@@ @cindex options, help @cindex help with options @cindex usage instructions, printing If this option is given, the compiler doesn't run at all, but instead prints a set of instructions for using it, explaining which options are available on the system you're on and which options conflict with which other options. @end table @node Options to Generated Programs @section Options to Generated Programs @cindex generated programs, options @cindex options, to generated programs 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. @table @option @ianchorpm help @opindex +help @opindex -help Whether @samp{+} or @samp{-} is given at the start of this option, it will cause the program to print out what options are available and what state they are in. It will then cause the program to exit via an internal error. @ianchorpm wimpmode @opindex +wimpmode @opindex -wimpmode @cindex wimpmode @cindex Roman numerals, disabling @cindex Arabic numberals, enabling @cindex input, in Arabic numerals @cindex output, in Arabic numerals If the @samp{+} version of this is given (rather than the default @samp{-}), then the program will print a message explaining that you are a wimp (the mode itself is known as wimpmode), and for the rest of execution will input in Arabic numerals (@samp{123} rather than @samp{ONE TWO THREE}) and likewise will output in Arabic numerals rather than Roman numerals (such as @samp{CXXIII}). True @ical{} programmers should rarely have to use this mode. @ianchorpm traditional @opindex +traditional @opindex -traditional This option does not actually appear to do anything. @ianchorpm instapipe @opindex +instapipe @opindex -instapipe @cindex output, flushing @cindex flushing This option causes standard output to be flushed whenever any characters are output when the @samp{+} version is used, rather than on each newline (the default @samp{-} version). It is most useful for more responsive pipes when outputting binary data, and also useful for debugging very slow programs. @ianchorpm printflow @opindex +printflow @opindex -printflow @cindex flow, printing @cindex debugging, flow @cindex debugging, multithreaded programs @cindex multithreading, debugging @cindex backtracking, debugging The usual debugging methods don't work with multithreaded or backtracking programs. This option exists to give at least a slim chance of working out what is going on with them. It causes the program to print the line number of the command it thinks it may be executing next (i.e.@: the line number that would be printed if that line had an error) immediately after executing each command, and also an internal identifier for the thread that that command was in. It also prints a trace of what parts of the multithreader are being activated; so for instance, it will tell you when a thread is being forked into multiple threads or when a choicepoint has been deleted. Note that the @option{-w} option (@pxref{-w}) must be given to gain full support for flow printing in non-multithreaded non-backtracking programs, because otherwise the required code to print this information will not be generated. @ianchorpm mystery @opindex +mystery @opindex -mystery This option is occasionally capable of doing something, but is deliberately undocumented. Normally changing it will have no effect, but changing it is not recommended. @end table @node Environment Variables @section Environment Variables @cindex environment variables Various environment variables can be set to affect the operation of @command{ick}. @multitable @columnfractions .3 .7 @headitem Variable @tab Meaning @item ICKINCLUDEDIR@*ICKLIBDIR@*ICKSYSDIR@*ICKCSKELDIR @tab These four environment variables suggest locations in which @command{ick} 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). @c Note: ICKSYDIR and ICKCSKELDIR used to be one variable, ICKDATADIR. @item CC @tab The name of a C compiler to use (defaults to @command{gcc}; @cic{} has recently been tested only with @command{gcc} and @command{clang}). This option has no effect on DJGPP, where @command{gcc} is always used. @item ICKTEMP@*TMPDIR@*TEMP@*TMP @tab On DJGPP, @command{ick} 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. @end multitable @node Errors and Warnings @chapter Errors and Warnings @cindex @command{ick}, errors and warnings @cindex errors and warnings 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 @ical{}. Errors and warnings appear as an error code starting with @samp{ICL}, followed by a three digit number, followed by @samp{I} for an error or @samp{W} for a warning. However, they will be notated here as @samp{E000}, etc.@:, to save space and because consistency was never a strong point of @ical{}. 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 @code{COME FROM}s or computed @code{COME FROM}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 (@pxref{E633}). 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.) @menu * Errors:: Error messages that might be produced * Warnings:: Warnings produced by the @option{-l} option @end menu @node Errors @section Errors @cindex errors @cindex @command{ick}, errors This is a list of the error messages that might be produced during the compilation or execution of an @ical{} program. @table @asis @ieanchor E000 @cindex syntax error This is an unusual error; it's what's printed when a syntax error is encounted at runtime, in a situation in which it would be executed. (An @code{ABSTAIN}ed syntax error, for instance, would not be executed; this is one of the mechanisms available for writing comments.) The text of the error message is simply the statement that couldn't be decoded. @ieanchor E017 @cindex constant, twospot @cindex overflow, in constant @quotation DO YOU EXPECT ME TO FIGURE THIS OUT? @end quotation This error occurs when there is an attempt to use a constant with a value outside the onespot range; it's a compile-time error. @ieanchor E079 @cindex politesse @cindex @code{PLEASE}, proportion required @quotation PROGRAMMER IS INSUFFICIENTLY POLITE @end quotation The balance between various statement identifiers is important. If less than approximately one fifth of the statement identifiers used are the polite versions containing @code{PLEASE}, that causes this error at compile time. @ieanchor E099 @quotation PROGRAMMER IS OVERLY POLITE @end quotation Of course, the same problem can happen in the other direction; this error is caused at compile time if more than about one third of the statement identifiers are the polite form. @ieanchor E111 @quotation COMMUNIST PLOT DETECTED, COMPILER IS SUICIDING @end quotation This error happens when you give the @option{-t} option (@pxref{-t}) but you use a language construct that wasn't available in @icst{}. If this happens, then either there's a mistake in the program that prevents it being @icst{} or you shouldn't be compiling it as @icst{} in the first place. @ieanchor E123 @cindex black lagoon @cindex @code{NEXT}, stack overflow @cindex stack overflow @quotation PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON @end quotation There is a hard limit of 80 @command{NEXT}s at a time; this is to discourage excessive use of @command{NEXTING} for things like recursion. (Recursive programs are entirely legal; you simply have to figure out how to do it with computed @command{COME FROM} instead. (For the record, it is possible. (Using lots of nested brackets when talking about recursion is great (yay!@:).))) Another problem with writing the source code that can cause this error is a failure to properly @command{FORGET} the entry on the @command{NEXT} stack created when trying to simulate a goto. @ieanchor E127 @cindex system library, errors @cindex syslib, errors @quotation SAYING 'ABRACADABRA' WITHOUT A MAGIC WAND WON'T DO YOU ANY GOOD @end quotation Your program asked to include a system library (by specifying a line number in a magic range without including a line with that number), but due to installation problems the compiler couldn't find the system library to include. You could try using the @option{-u} (@pxref{-u}) option to see where the compiler's looking; that may give you an idea of where you need to copy the system library so that the compilation will work. This error happens at compile time and doesn't give a next command line number. @ieanchor E129 @cindex @code{NEXT}, nonexistent target @quotation PROGRAM HAS GOTTEN LOST @end quotation This error happens at compile time when the compiler can't figure out where a @code{NEXT} command is actually aiming (normally due to a typo in either the line label given or the line label on the line aimed for). The logic behind this error means that the next line to be executed is unknown (after all, that's the whole point of the error) and is therefore not given. The @option{-e} command-line option (@pxref{-e}) makes this error into a run-time error, because it allows @code{NEXT} commands to dynamically change targets at runtime, as well as line labels to dynamically change values, and thus the error is impossible to detect at compile time. @ieanchor E139 @cindex @code{ABSTAIN}, nonexistent target @cindex @code{REINTSTATE}, nonexistent target @quotation I WASN'T PLANNING TO GO THERE ANYWAY @end quotation This error happens at compile time when an @code{ABSTAIN} or @code{REINSTATE} references a non-existent target line. This generally happens for much the same reasons as E129 (@pxref{E129}). @ieanchor E182 @cindex line label, duplicate @cindex duplicate line label @quotation YOU MUST LIKE THIS LABEL A LOT! @end quotation At present, it's impossible to have more than one line with the same line number. That would make @code{NEXT} act too much like @code{COME FROM} in reverse to be interesting. This error happens at compile time. (For inconsistency, it @i{is} possible to have multiple lines with the same number as long as at most one of them is in an @ical{} program (the others have to be in programs in other languages included via the external calls system). The resulting behaviour is entirely inconsistent with the rest of the language, though, for what I hope are obvious reasons.) @ieanchor E197 @cindex line label, illegal value @cindex illegal line label value @cindex invalid line label value @quotation SO@! 65535 LABELS AREN'T ENOUGH FOR YOU? @end quotation Legal values for line labels are 1 to 65535 (certain subranges are reserved for system and expansion libraries). This error comes up if you use nonpositive or twospot values for a line label. @ieanchor E200 @cindex variable, illegal number @cindex illegal variable number @cindex invalid variable number @quotation NOTHING VENTURED, NOTHING GAINED @end quotation You used a variable that isn't actually in your program. Failing that (which, contrary to previous versions of this manual, is indeed possible in the present version of @cic{}, although I'm not telling how; a hint:@: what mechanism in @cic{} allows for a computed variable number?), you specified an illegal number for a variable (legal numbers are positive and onespot). This error happens at compile time, at least for illegal variable numbers. @ieanchor E222 @cindex out of memory, during @code{STASH} @quotation BUMMER, DUDE! @end quotation In @ical{}, you're allowed to @code{STASH} as much as you like; this makes the language Turing-complete and allows for unlimited recursion when combined with computed @code{COME FROM} in the right way. Unfortunately, real computers aren't so idealised; if you manage to write a program so memory-intensive that the computer runs out of memory to store stashes, it causes this error at runtime. To fix this error, you either have to simplify the program or upgrade your computer's memory, and even then that will only help to some extent. @ieanchor E240 @cindex array, invalid dimension @cindex invalid array dimension @cindex illegal array dimension @quotation ERROR HANDLER PRINTED SNIDE REMARK @end quotation Arrays have to be large enough to hold at least one element; you tried to dimension an array which isn't large enough to hold any data. This error happens at run time. @ieanchor E241 @cindex array, wrong dimension @cindex wrong array dimension @cindex array, out of bounds @cindex out of bounds @quotation VARIABLES MAY NOT BE STORED IN WEST HYPERSPACE @end quotation This error happens at run time when the subscripts given to an array are inconsistent with the way the array was dimensioned, either because there were the wrong number of subscripts or because a subscript was too large to fit in the array. It can also happen when a multidimensional array is given to a command, such as @code{WRITE IN}, that expects it to be monodimensional. @ieanchor E252 @cindex I/O, out of memory @cindex out of memory, I/O @quotation I'VE FORGOTTEN WHAT I WAS ABOUT TO SAY @end quotation This run-time error message is caused by the compiler running out of memory whilst trying to do I/O; at present, it can only happen during @clcic{}-style I/O. @ieanchor E256 @cindex PIC-INTERCAL, unsupported command @quotation THAT'S TOO HARD FOR MY TINY BRAIN @end quotation Some commands simply aren't available in @abbr{PIC-INTERCAL}. I mean, @acronym{PIC}s generally have less than a kilobyte of memory; you're not going to be able to use some of the more confusing language features with that sort of resource limitation. The solution is to replace the affected command, or to not give the @option{-P} option (@pxref{-P+,,-P}) if you didn't mean to compile as @abbr{PIC-INTERCAL} in the first place. @ieanchor E275 @cindex overflow, over onespot @cindex overflow, over 16 bits @cindex onespot overflow @cindex 16 bit overflow @quotation DON'T BYTE OFF MORE THAN YOU CAN CHEW @end quotation This error happens when there is an attempt to store a twospot value in a onespot variable. The actual size of the value is what matters when counting its spots; so you can store the output of a mingle in a onespot variable if it happens to be less than or equal to 65535, for instance. (This is not necessarily the case in versions of @ical{} other than @cic{}, though, so you have to be careful with portability when doing this.) @ieanchor E277 @cindex reverse assignment, impossible @cindex reverse assignment, error @cindex operand overloading, impossible @cindex impossible reverse assignment @quotation YOU CAN ONLY DISTORT THE LAWS OF MATHEMATICS SO FAR @end quotation Reverse assignments are not always mathematically possible. Also, sometimes they require changing the value of a constant; this is only legal if you specifically specified that it was legal by using the @option{-v} option. In the case of an impossible reverse assignment (including a situation in which operand overloading causes a reverse assignment to happen), this error happens at runtime. This error can also come up when a scalar variable is overloaded to an array (which doesn't make sense, but could happen if someone exploited bugs in the CREATE statement (@pxref{CREATE})), and an attempt is made to read or assign to that variable. (Subscripting a scalar variable is a syntax error, so there is no use for doing such an overload anyway.) @ieanchor E281 @cindex spark, nesting limit @cindex ears, nesting limit @cindex rabbit-ears, nesting limit @cindex nesting limit @findex SENESTMAX @quotation THAT MUCH QUOTATION AMOUNTS TO PLAGIARISM @end quotation There is a limit of 3200 on the number of nested spark/ears groups allowed. If you somehow manage to exceed that limit, that will cause this error. Try breaking the expression up into smaller expressions. (The limit is trivial to increase by changing @code{SENESTMAX} in @file{ick.h}; if you ever actually come across a program that hits the limit but wasn't designed to, just email the maintainer to request a higher limit.) @ieanchor E333 @cindex variables, limit @quotation YOU CAN'T HAVE EVERYTHING, WHERE WOULD YOU PUT IT? @end quotation Your program references so many variables that the compiler couldn't cope. This error is unlikely to ever happen; if it does, try reducing the number of variables you use by combining some into arrays. This is a compile-time error. @ieanchor E345 @cindex out of memory @quotation THAT'S TOO COMPLEX FOR ME TO GRASP @end quotation This is another compile-time error that's unlikely to ever happen; this one signifies the compiler itself running out of memory trying to compile your program. The only solutions to this are to simplify your program, or to make more memory available to the compiler. @ieanchor E404 @cindex @code{GO BACK}, no choicepoint @cindex @code{GO AHEAD}, no choicepoint @quotation I'M ALL OUT OF CHOICES! @end quotation Your program asked that a choicepoint be backtracked to or removed, but there aren't any choicepoints at the moment. This runtime error usually indicates a logic mistake in your program. In backtracking programs translated from other backtracking languages, this indicates that the program has failed. @ieanchor E405 @cindex multithreading, not enabled @cindex backtracking, not enabled @cindex @code{WHILE}, not enabled @cindex @code{MAYBE}, not enabled @cindex @code{GO AHEAD}, not enabled @cindex @code{GO BACK}, not enabled @quotation PROGRAM REJECTED FOR MENTAL HEALTH REASONS @end quotation Your program used a construct that only makes sense when multithreading or backtracking (@code{WHILE}, @code{MAYBE}, @code{GO BACK}, or @code{GO AHEAD}), but you didn't specify the @option{-m} option (@pxref{-m}). If you meant to write a multithreaded or backtracking program, just give that option; if you didn't, be careful what words you use in comments! This error happens at compile-time. @ieanchor E436 @cindex @code{RETRIEVE}, without stashing @cindex stash failure @quotation THROW STICK BEFORE RETRIEVING! @end quotation In order to @code{RETRIEVE} a variable, it has to be @code{STASH}ed first; if it isn't, then this error happens at runtime. @ieanchor E444 @cindex @code{COME FROM}, no target @cindex @code{NEXT FROM}, no target @quotation IT CAME FROM BEYOND SPACE @end quotation A @code{COME FROM} aiming at a line label --- as opposed to a computed @code{COME FROM}, which is allowed to be pointing at a nonexistent line --- must point to a valid line label. The same applies to @code{NEXT FROM}. This error happens at compile time if a nonexistent line label is found in one of these contexts. @ieanchor E533 @cindex overflow, over twospot @cindex overflow, over 32 bits @cindex twospot overflow @cindex 32 bit overflow @quotation YOU WANT MAYBE WE SHOULD IMPLEMENT 64-BIT VARIABLES? @end quotation This error is like E275 (@pxref{E275}), but applies when an attempt is made at runtime to store a threespot value (or even a fourspot or morespot value) in a twospot variable, or a threespot or greater value is produced as an intermediate during a calculation (for instance by a mingle operation). No values above twospot are allowed at any point during an @ical{} program; if you want to process higher numbers, you have to figure out a different way of storing them. @ieanchor E553 @cindex buffer overflow @quotation BETTER LATE THAN NEVER @end quotation Oops! The compiler just noticed that it had a buffer overflow. (Normally programs catch buffer overflows before they happen; @cic{} catches them just afterwards instead.) This only happens on systems which don't have a modern C standard library. Try using shorter or fewer filenames on the command line, to reduce the risk of such an overflow. @ieanchor E555 @cindex @code{COME FROM}, ambiguity @quotation FLOW DIAGRAM IS EXCESSIVELY CONNECTED @end quotation Aiming two @code{COME FROM}s at the same line only makes sense in a multithreaded program. In a non-multithread program, doing that will cause this error at compile time (if neither @code{COME FROM} is computed) or at run time (if the command that has just finished running is simultaneously the target of two or more @code{COME FROM}s). This either indicates an error in your program or that you've forgotten to use the @option{-m} option (@pxref{-m}) if you are actually trying to split the program into two threads. @ieanchor E562 @cindex input, EOF @cindex EOF @cindex end of file @quotation I DO NOT COMPUTE @end quotation The program asked for input, but for some reason it wasn't available. (This is a runtime error, obviously.) The error may happen because the input is being piped in from a command or file which has reached end-of-file, or because the user typed @kbd{@key{CTRL}-@key{D}} (UNIX/Linux) or @kbd{@key{CTRL}-@key{Z}} (DOS/Windows) while the program was trying to @code{WRITE IN} some data. @ieanchor E579 @cindex input, invalid @quotation WHAT BASE AND/OR LANGUAGE INCLUDES @var{string}? @end quotation When reading spelt-out-digit input, the input didn't seem to be a valid digit in English, Sanskrit, Basque, Tagalog, Classical Nahuatl, Georgian, Kwakiutl, Volap@"uk, or Latin. This seems to have languages covered pretty well; what on earth were you using, or did you just make a spelling mistake? @ieanchor E621 @cindex @code{RESUME}, by 0 @quotation ERROR TYPE 621 ENCOUNTERED @end quotation The compiler encountered error E621 (@pxref{E621}). This happens at runtime when the program requests that no entries are removed from the @code{NEXT} stack (which is possible), but that the last entry removed should be jumped to (which given the circumstances isn't, because no entries were removed). @ieanchor E632 @quotation THE NEXT STACK RUPTURES. ALL DIE. OH, THE EMBARRASSMENT! @end quotation When an attempt is made to @code{RESUME} past the end of the @code{NEXT} stack, the program ends; however, this cause the program to end in a manner other than via @code{GIVE UP} or @code{DON'T TRY AGAIN}, so an error message must be printed, and this is that error message. @ieanchor E633 @quotation PROGRAM FELL OFF THE EDGE @end quotation You can't just let execution run off the end of the program. At least, that is, if it doesn't end with @code{TRY AGAIN}. An attempt to do that causes this error at runtime. Note that if your program references the system library, then it counts as being appended to your program and so the program will run into the first line of the system library rather than cause this error. As it happens, the first line of the system library is a syntax error, so doing this will cause E000 (@pxref{E000}) with the error text @samp{PLEASE KNOCK BEFORE ENTERING}. There isn't a next statement to be executed with E633, so the next statement won't be given in the error message. @ieanchor E652 @cindex @code{PIN}, in a non-PIC program @quotation HOW DARE YOU INSULT ME! @end quotation The @code{PIN} command doesn't make much sense for anything bigger than a @acronym{PIC}; using it in a non-@acronym{PIC} program causes this error at compile-time. Try using the normal input and output mechanisms instead. This error may also be a clue that you are trying to compile a @abbr{PIC-INTERCAL} program without giving the @option{-P} option (@pxref{-P+,,-P}). @ieanchor E666 @cindex out of memory, during compile @cindex too many input files @cindex line too long @quotation COMPILER HAS INDIGESTION @end quotation There isn't a limit on the length of an input program other than your computer's memory; if your computer does run out of memory during compilation, it causes this error. This error can also be caused if too many input files are specified on the command line; if you suspect this is the problem, split the compilation into separate compilations if you can, or otherwise you may be able to concatenate together your input files into larger but fewer files. Yet another potential cause of this error is if a line in an input program is too long; sensible line-wrapping techniques are encouraged. @ieanchor E774 @cindex random bug, error message @quotation RANDOM COMPILER BUG @end quotation No compiler is perfect; sometimes errors just happen at random. In this case, the random error is E774. If you don't like the idea that your program may be shot down by a random compiler bug, or you are doing something important, you can use the @option{-b} option (@pxref{-b}) to prevent this bug happening. (You may wonder why this bug is in there at all if it's so easily prevented. The answer is that such a bug was present in the original @icst{} compiler, which also had an option to turn the bug off. It's also a reward for people who actually read the manual.) @ieanchor E777 @cindex directory problems, source file @cindex no source file @quotation A SOURCE IS A SOURCE, OF COURSE, OF COURSE @end quotation You specified a file to compile on the command line, but the compiler couldn't find or couldn't open it. This is almost certainly because you made a typo specifying the file. @ieanchor E778 @cindex internal errors @quotation UNEXPLAINED COMPILER BUG @end quotation This should never come up, either at compile time or at run time. It could come up at either when an internal check by the compiler or the runtime libraries realises that something has gone badly wrong; mistakes happen, and in such cases the mistake will have been detected. (If this happens at compile time you can use the @option{-U} option (@pxref{-U+,,-U}) to cause the compiler to send an abort signal -- which normally causes a core dump -- when the error happens, to help debug what's causing it.) More often, this error comes up when the operating system has noticed something impossible, like an attempt to free allocated memory twice or to write to a null pointer, and tells the compiler an error has occured, in which case the same response of putting up this error happens. The point is that in all cases this error 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 it and send a bug report (@pxref{Reporting Bugs}). @ieanchor E810 @cindex yuk, input overflow @quotation ARE ONE-CHARACTER COMMANDS TOO SHORT FOR YOU? @end quotation This is a debug-time error caused when you give too much input to the debugger when all it wanted was to know what you wanted to do next. @ieanchor E811 @cindex yuk, breakpoint overflow @cindex yuk, too many breakpoints @cindex breakpoints, too many @quotation PROGRAM IS TOO BADLY BROKEN TO RUN @end quotation 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 a debug-time error. @ieanchor E888 @quotation I HAVE NO FILE AND I MUST SCREAM @end quotation @cindex output file, failure to write The output file couldn't be written, maybe because the disk is full or because there's already a read-only file with the same name. This is a compile-time error. @ieanchor E899 @quotation HELLO? CAN ANYONE GIVE ME A HAND HERE? @end quotation @cindex Funge, no external library @cindex Befunge, no external library @cindex external libraries, unavailable @cindex .b98, no external library This error occurs at compile-time if a file type was requested for which the required libraries are unavailable. (Support for Funge does not ship with the compiler; instead, you need to generate the library yourself from the cfunge sources. For more information, see @ref{Creating the Funge-98 Library}.) @ieanchor E990 @cindex unsupported file type @cindex invocation flag, unnown @quotation FLAG ETIQUETTE FAILURE BAD SCOUT NO BISCUIT @end quotation This error occurs at runtime if an INTERCAL program was passed an unknown option flag. @ieanchor E991 @cindex out of memory, multithreading @cindex out of memory, backtracking @cindex multithreading, out of memory @cindex backtracking, out of memory @quotation YOU HAVE TOO MUCH ROPE TO HANG YOURSELF @end quotation There is no limit on the number of threads or choicepoints that you can have in a multithreaded or backtracking program (in a program that isn't multithreaded or backtracking, these are obviously limited to 1 and 0 respectively). However, your computer may not be able to cope; if it runs out of memory in the multithreader, it will cause this error at runtime. @ieanchor E993 @cindex @code{TRY AGAIN}, not last @quotation I GAVE UP LONG AGO @end quotation @code{TRY AGAIN} has to be the last command in a program, if it's there at all; you can't even follow it by comments, not even if you know in advance that they won't be @code{REINSTATE}d. This error happens at compile time if a command is found after a @code{TRY AGAIN}. @ieanchor E994 @cindex illegal opcode @quotation NOCTURNAL EMISSION, PLEASE LAUNDER SHEETS IMMEDIATELY @end quotation This error should never happen, and if it does indicates a compiler bug. It means the emitter function in the code degenerator has encountered an unknown opcode. Please send a copy of the program that triggered it to the INTERCAL maintainers. @ieanchor E995 @quotation DO YOU REALLY EXPECT ME TO HAVE IMPLEMENTED THAT? @end quotation Some parts of the code haven't been written yet. There ought to be no way to cause those to actually run; however, if you do somehow find a way to cause them to run, they will cause this error at compile time. @ieanchor E997 @cindex whirlpool, in base 2 @cindex sharkfin, in base 2 @cindex TriINTERCAL, operators in base 2 @quotation ILLEGAL POSSESSION OF A CONTROLLED UNARY OPERATOR @end quotation Some operators (such as whirlpool (@code{@@}) and sharkfin (@code{^})) only make sense in @abbr{TriINTERCAL} programs, and some have a minimum base in which they make sense. This error happens at compile-time if you try to use an operator that conflicts with the base you're in (such as using @abbr{TriINTERCAL} operators in an @ical{} program in the default base 2). @ieanchor E998 @cindex unsupported file type @cindex file type, unsupported @quotation EXCUSE ME, YOU MUST HAVE ME CONFUSED WITH SOME OTHER COMPILER @end quotation This error occurs just before compile-time if a file is encountered on the command line that @cic{} doesn't recognise. (If this error occurs due to a @samp{.a}, @samp{.b98}, @samp{.c}, @samp{.c99}, or @samp{.c11} file, then you forgot to enable the external calls system using @option{-e} (@pxref{-e}).) @ieanchor E999 @cindex skeleton file, errors @quotation NO SKELETON IN MY CLOSET, WOE IS ME! @end quotation The skeleton file @file{ick-wrap.c} or @file{pickwrap.c} is needed to be able to compile @ical{} to C. If the compiler can't find it, it will give this error message. This indicates a problem with the way the compiler has been installed; try using the @option{-u} option (@pxref{-u}) to find out where it's looking (you may be able to place a copy of the skeleton file in one of those places). @end table @node Warnings @section Warnings @cindex warnings @cindex @command{ick}, warnings This is a list of the warnings stored in the warning database. Warnings only come up when the @option{-l} option (@pxref{-l}) is given; even then, some of the warnings are not currently implemented and therefore will never come up. @table @asis @ieanchor W016 @quotation DON'T TYPE THAT SO HASTILY @end quotation The positional precedence rules for unary operators are somewhat complicated, and it's easy to make a mistake. This warning is meant to detect such mistakes, but is not currently implemented. @ieanchor W018 @quotation THAT WAS MEANT TO BE A JOKE @end quotation If an @ical{} expression has been translated from another language such as C, the optimiser is generally capable of translating it back into something similar to the original, at least in base 2. When after optimisation there are still @ical{} operators left in an expression, then this warning is produced. (Therefore, it's likely to come up quite a lot if optimisation isn't used@!) The system library produces some of these warnings (you can tell if a warning has come up in the system library because you'll get a line number after the end of your program). @ieanchor W112 @cindex warnings, non-INTERCAL-72 @cindex non-INTERCAL-72 warning @quotation THAT RELIES ON THE NEW WORLD ORDER @end quotation This warning comes up whenever the compiler recognises that you've added some code that didn't exist in @icst{}. This allows you to check whether your code is valid @icst{} (although @option{-t} (@pxref{-t}) is more useful for that); it also warns you that code might not be portable (because @icst{} is implemented by most @ical{} compilers, but more recent language features may not be). @ieanchor W128 @quotation SYSLIB IS OPTIMIZED FOR OBUSCATION @end quotation There is an idiom used in the system library that does a right-shift by selecting alternate bits from a twospot number and then mingling them the other way round. A rightshift can much more easily be done with a single rightshift, so this is a silly way to do it, and this warning warns that this idiom was used. However, the present optimizer is incapable of recognising whether this problem exists or not, so the warning is not currently implemented. @ieanchor W276 @cindex onespot, overflow warning @cindex overflow, warning @quotation YOU CAN'T EXPECT ME TO CHECK BACK THAT FAR @end quotation It's an error to assign a twospot value (a value over 65535) to a onespot variable, or to use it as an argument to a mingle. If the optimizer can't guarantee at compile time that there won't be an overflow, it issues this warning. (Note that this doesn't necessarily mean there's a problem --- for instance, the system library generates some of these warnings --- only that the optimiser couldn't work out for sure that there wasn't a problem.) @ieanchor W239 @quotation WARNING HANDLER PRINTED SNIDE REMARK @end quotation Your code looks like it's trying to assign 0 to an array, giving it no dimension; this is an error. This warning is produced at compile time if it looks like a line in your code will cause this error, but it isn't necessarily an error because that line of code might never be executed. @ieanchor W278 @quotation FROM A CONTRADICTION, ANYTHING FOLLOWS @end quotation It's sometimes impossible to reverse an assignment (a reverse assignment can happen if the @option{-v} option (@pxref{-v}) is used and an expression is placed on the left of an assignment, or in operand overloading); if the compiler detects that a reversal failure is inevitable, it will cause this warning. Note that this doesn't always cause an error, because the relevant code might never be executed. @ieanchor W450 @quotation THE DOCUMENTOR IS NOT ALWAYS RIGHT @end quotation There is no way to get this warning to come up; it isn't even written anywhere in @cic{}'s source code, is not implemented by anything, and there are no circumstances in which it is even meant to come up. It is therefore not at all obvious why it is documented. @ieanchor W534 @cindex unary operators, portability @cindex portability, unary operators @quotation KEEP LOOKING AT THE TOP BIT @end quotation @cic{} uses a slightly different typing mechanism to some other @ical{} 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 a case has come up or not, but if the compiler or optimizer thinks that such a case might have come up, it will issue this warning. @ieanchor W622 @quotation WARNING TYPE 622 ENCOUNTERED @end quotation Your code looks like it's trying to resume by 0; this is an error. This warning is produced at compile time if it looks like a line in your code will cause this error, but it isn't necessarily an error because that line of code might never be executed. @end table @node The yuk debugger @chapter The yuk debugger @cindex yuk @cindex debugging, yuk @cindex debugging, runtime @cindex runtime debugger @anchor{yuk} The @cic{} 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} (@pxref{-y}) to the command line of @command{ick} 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.) yuk can also be used as a profiler using the @option{-p} option (@pxref{-p}); this produces a file @file{yuk.out} containing information on how much time was spent running each command in your program, and does not prompt for debugger commands. Note that some command line arguments are incompatible with the debugger, such as @option{-m} and @option{-f}. In particular, this means that multithreaded programs and programs that use backtracking cannot be debugged using this method; the @option{+printflow} option (@pxref{+printflow}) to a compiled program may or may not be useful for debugging multithreaded programs. 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, @samp{yuk007 }, to let you know you can input a command. @cindex yuk, commands 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 @code{.}, @code{,}, @code{:} or @code{;} followed by a number in decimal; note that some commands only allow onespot and twospot variables as arguments). @multitable @columnfractions .15 .85 @headitem Command @tab Description @item a@var{LINE} @tab All non-abstained commands on line @var{LINE} become abstained from once. @item b@var{LINE} @tab A breakpoint is set on line @var{LINE}. The breakpoint causes execution with @samp{c} to stop when it is reached. @item c @tab The program is run until it ends (which also ends the debugger) or a breakpoint is reached. @item d@var{LINE} @tab Any breakpoint that may be on line @var{LINE} is removed. @item e@var{LINE} @tab An explanation of the main expression in each command on line @var{LINE} is printed to the screen. The explanation is in the same format as the format produced by @option{-h} (@pxref{-h}) and shows what the optimiser optimised the expression to (or the original expression if the optimiser wasn't used). @item f@var{LINE} @tab Removes the effect of the @samp{m} command on line @var{LINE}. @item g@var{LINE} @tab Causes the current command to be the first command on @var{LINE} (if not on that line already) or the next command on @var{LINE}, as if that line was @code{NEXT}ed to and then that @code{NEXT} stack item was forgotten. @item h @tab 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. @item i@var{VAR} @tab Causes variable @var{VAR} to become @code{IGNORE}d, making it read-only. @item j@var{VAR} @tab Causes variable @var{VAR} to become @code{REMEMBER}ed, making it no longer read-only. @item k @tab Continues executing commands until the @command{NEXT} stack is the same size or smaller than it was before. In other words, if the current command is not a @command{NEXT} and doesn't have a @command{NEXT FROM} aiming at it, one command is executed; but if a @command{NEXT} does happen, execution will continue until that @command{NEXT} returns or is forgotten. A breakpoint or the end of the program also end this. @item l@var{LINE} @tab Lists 10 lines of source code either side of line @var{LINE}, the same way as with @samp{h}, but using a line stated in the command rather than the current line. @item m@var{LINE} @tab Produces a message onscreen every time a command on line @var{LINE} is executed, but without interrupting the program. @item n @tab Show the @command{NEXT} stack on the screen. @item o @tab Continue executing commands until the @command{NEXT} stack is smaller than it was before. If you are using @command{NEXT}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. @item p @tab Displays the value of all onespot and twospot variables. @item q @tab Aborts the current program and exits the debugger. @item r@var{LINE} @tab Reinstates once all abstained commands on line @var{LINE}. @item s @tab Executes one command. @item t @tab Continues execution until the end of the program or a breakpoint: each command that executes is displayed while this command is running. @item u@var{LINE} @tab Continues execution of the program until just before a command on line @var{LINE} is run (or a breakpoint or the end of the program). @item v@var{VAR} @tab Adds a `view' on variable @var{VAR} (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 @samp{m} or @samp{t} commands). @item w @tab Displays the current line and current command onscreen. @item x@var{VAR} @tab Removes any view and any action that may be associated with it on variable @var{VAR} (which must be onespot or twospot). @item y@var{VAR} @tab Adds a view on variable @var{VAR}; also causes a break, as if a breakpoint was reached, whenever the value of that variable changes. @item z@var{VAR} @tab Adds a view on variable @var{VAR}; also causes a break, as if a breakpoint was reached, whenever that variable's value becomes 0. @item @var{VAR} @tab A onespot or twospot variable written by itself prints out the value of that variable. @item <@var{VAR} @tab @command{WRITEs IN} a new value for variable @var{VAR}. Note that input must be in the normal @samp{ONE TWO THREE} format; input in any other format will cause error E579 (@pxref{E579}) and as that is a fatal error, the debugger and program it's debugging will end. @item * @tab Displays the license conditions under which @command{ick} is distributed. @item ? @tab Displays a summary of what each command does. (@samp{@@} does the same thing.) @end multitable While the code is executing (for instance, during a @samp{c}, @samp{k}, @samp{o}, @samp{t} or @samp{u} command), it's possible to interrupt it with @kbd{@key{CTRL}-@key{C}} (on UNIX/Linux) or @kbd{@key{CTRL}-@key{BREAK}} (on Windows/DOS); this will cause the current command to finish running and the debugger prompt to come back up. @ifset notsplit @partheading{PART II: THE @ical{} LANGUAGE} @end ifset @node Syntax @chapter Syntax @cindex syntax, INTERCAL @cindex INTERCAL, syntax @ical{} 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. Whitespace is generally insignificant in @ical{} 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. An @ical{} statement consists of an optional line label, a statement identifier, an optional execution chance, the statement itself (@pxref{Statements}), and optionally @code{ONCE} or @code{AGAIN}. @menu * Princeton and Atari Syntax:: There are two syntaxes for @ical{} * Line Labels:: Allowing lines to be referred to * Statement Identifiers:: Marking the start of a statement * Execution Chance:: Statements that might not execute * ONCE and AGAIN:: Self-abstaining and self-reinstating statements @end menu @node Princeton and Atari Syntax @section Princeton and Atari Syntax @cindex syntax, dialects @cindex dialects of syntax @cindex character sets The history of @ical{} 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). @cindex syntax, Princeton @cindex Princeton syntax @subheading Princeton syntax @portability{some versions, version 0.18+, all versions, no} The original @icst{} compiler was the Princeton compiler, which introduced what has become known as the Princeton syntax for @ical{}; this is the syntax used in the original manual, for instance, and can be considered to be the `original' or `official' @ical{} 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 @samp{V}, backspace, @samp{-}, 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 @clcic{} compiler, which is the @i{de facto} standard for expanding the Princeton syntax to modern @ical{} features that are not found in @icst{}; 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, @clcic{} uses the Latin-1 yen symbol for this, which just to make things confusing, refers to a mingle in modern Atari syntax). @cindex syntax, Atari @cindex Atari syntax @subheading Atari syntax @portability{some versions, yes, version 0.05+, yes} The other main syntax is the Atari syntax, so called because it was originally described in notes about an ``Atari implementation'' added to the paper @icst{} manual when it was softcopied in 1982. These notes describe a never-completed compiler implementation for 6502 by Mike Albaugh and Karlina Ott; it was meant to use the Atari 800 cartrtidge and screen editor, but that portion was never written. The syntax was designed to work better on ASCII-based systems, by avoiding the change character (although it can still be written as @samp{c}, backspace, @samp{/}, which the Atari compiler documentation claims that the Princeton compiler supported) in favour of a `big money' character (@samp{$}), and using the `what' (@samp{?}) as an alternative character for exclusive-or. This is the syntax that @cic{} and @jic{} have always used, and is the one most commonly used for communicating @ical{} 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 @icst{} is normally taken to be that used by the @cic{} compiler, because it is the only Atari-syntax-based compiler that contains non-@icst{} constructs that actually need their own notation. @node Line Labels @section Line Labels @cindex line label @cindex line number @portability{yes, all versions, all versions, all versions} The first part of an @ical{} statement is a line label that specifies what its line number is. This is optional; it's legal 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. A line label is a integer expressed in decimal within a wax/wane pair (@code{(} and @code{)}). For instance, this is a valid line label: @example (1000) @end example 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. It has become reasonably customary for people writing @ical{} 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 @ical{} library, it may be a good idea to look at the existing libraries (in the @file{pit/lib} directory in the @cic{} 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. @node Statement Identifiers @section Statement Identifiers @cindex statement identifier @findex DO @findex PLEASE @findex NOT @findex N'T @cindex abstain, at program start @cindex reinstate, at program start @cindex initial abstention @cindex abstained state @cindex reinstated state @portability{yes, all versions, all versions, all versions} 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. @anchor{DO}@anchor{PLEASE} The main statement identifier is @code{DO}. It also has two synonyms, @code{PLEASE} and @code{PLEASE DO}; 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. @anchor{NOT}@anchor{N'T} Adding @code{NOT} or @code{N'T} to the end of any of these identifiers, to create a statement identifier such as @code{DO NOT} or @code{PLEASE DON'T}, 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: @example PLEASE NOTE: This is a comment. @end example The statement identifier (@code{PLEASE NOT}) is the only part of this statement that is valid @ical{}; however, because the statement identifier is in the negated form that contains @code{NOT}, the syntax error won't be executed, and therefore this is a valid statement. (In @ical{}, syntax errors happen at runtime, so a program containing a statement like @code{DOUBT THIS WILL WORK} will still compile, and will not end due to the syntax error unless that statement is actually executed. @xref{E000}.) The @code{ABSTAIN} and @code{REINSTATE} statements can override the @code{NOT} or otherwise on a statement identifier; see @ref{ABSTAIN}. In backtracking programs, @code{MAYBE} is also a valid statement identifier; see @ref{MAYBE}. It comes before the other keywords in the statement identifier, and an implicit @code{DO} is added if there wasn't one already in the statement identifier (so @code{MAYBE}, @code{MAYBE DO}, @code{MAYBE DON'T}, @code{MAYBE PLEASE}, and so on are all valid statement identifiers). @node Execution Chance @section Execution Chance @cindex execution chance @cindex double-oh-seven @findex % @portability{yes, all versions, version 0.02+, all versions} 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 @ical{}, although it is the only way to introduce randomness into a program. (The @cic{} 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 (@code{%}) 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 @code{DO %40 WRITE OUT #1} has a 40% chance of writing out @samp{I}, but the statement @code{DON'T %40 WRITE OUT #1} has no chance of writing out @code{I} or anything else, because the @code{N'T} prevents it running and the double-oh-seven cannot override that. @node ONCE and AGAIN @section ONCE and AGAIN @cindex ABSTAIN, self-abstaining @cindex REINSTATE, self-reinstating @cindex self-abstaining @cindex self-reinstating @findex ONCE @findex AGAIN @anchor{ONCE}@anchor{AGAIN} @portability{no, version 0.25+, no, no} The last part of a statement is an optional @code{ONCE} or @code{AGAIN}. @code{ONCE} specifies that the statement is self-abstaining or self-reinstating (this will be explained below); @code{AGAIN} 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 @code{ONCE} on an initially reinstated statement or @code{AGAIN} on an initially abstained statement indicates a self-abstention, and a @code{ONCE} on an initially abstained statement or @code{AGAIN} on an initially reinstated statement indicates a self-reinstatement. 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 a 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 @code{ONCE} effectively changes to an @code{AGAIN}; the @code{ONCE} only happens once, as might be expected. @code{REINSTATING} a currently abstained self-abstaining statement or @code{ABSTAINING} (that is, with the @code{ABSTAIN} or @code{REINSTATE} commands) a currently reinstated self-reinstating statement causes the @code{AGAIN} on the statement to change back into a @code{ONCE}, so the statement will again self-abstain or self-reinstate. Likewise, @code{REINSTATING} a currently abstained self-reinstating statement or @code{ABSTAINING} a currently reinstated self-abstaining statement causes its @code{ONCE} to turn into an @code{AGAIN}. Historical note: @code{ONCE} was devised by Malcom Ryan as a method of allowing synchronisation between threads in a multithreaded program (@code{ONCE} is atomic with the statement it modifies, that is, there is no chance that threads will change between the statement and the @code{ONCE}). @code{AGAIN} 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 @code{ONCE}s to happen multiple times, which is needed to implement some multithreaded algorithms). @node Expressions @chapter Expressions @cindex expressions Many @ical{} statements take expressions as arguments. Expressions are made up out of operands and operators between them. Note that there is no operator precedence in @ical{}; different compilers resolve ambiguities different ways, and some versions of some compilers (including the original @icst{} compiler) will cause error messages on compiling or executing an ambiguous expression, so it's safest to fully group each expression. @menu * Constants and Variables:: The basic operands that make up expressions * Grouping Rules:: How to specify grouping in expressions * Operators:: Joining operands into more complex expressions @end menu @node Constants and Variables @section Constants and Variables @cindex constant @cindex variable @cindex mesh @cindex onespot @cindex twospot @cindex tail @cindex hybrid @findex # @findex . @findex : @findex , @findex ; @portability{yes, all versions, all versions, all versions} The basic operands in @ical{} 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 @ical{}, but by default @cic{} turns this off because it carries an efficiency penalty and can be confusing; this can be turned on with the @option{-v} option (@pxref{-v}).) 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 @ref{Mingle}.) A constant is written as a mesh (@code{#}) 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, @code{#100} has 100 as its value, and it's strongly advised not to change the value of a constant during the execution of a program. 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 (@code{.}, @code{:}, @code{,}, and @code{;}) 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 @cic{} before version 0.7.) 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, @code{.1} and @code{.001} are the same variable, onespot number 1. Array variables need to be dimensioned before they are used, by assigning dimensions to them; see @ref{Calculate}. @node Grouping Rules @section Grouping Rules @cindex grouping rules @cindex positional precedence @cindex spark @cindex rabbit-ears @cindex ears @findex ' @findex " Because there are no operator precedences in @ical{}, there are various solutions to specifying what precedences actually are. @table @asis @item The portable solution All known versions of @ical{} accept the @icst{} grouping rules. These state that it's possible to specify that an operator takes precedence by grouping it inside sparks (@code{'}) or rabbit-ears (@code{"}), the same way as wax/wane pairs (parentheses) are used in other programming languages. @icst{} and earlier @cic{} versions demanded that expressions were grouped fully like this, and this practice is still recommended because it leads to portable programs and is easier to understand. Whether sparks or rabbit-ears (often called just `ears' for short) are used normally doesn't matter, and programmers can use one or the other for clarity or for aesthetic appeal. (One common technique is to use just sparks at the outermost level of grouping, just ears at the next level, just sparks at the next level, and so on; but expressions like @code{''#1~#2'~"#3~#4"'~#5} are completely unambiguous, at least to the compiler.) There are, however, some complicated situations involving array subscripting where it is necessary to use sparks and ears at alternate levels, if you want to write a portable program. This limitation is in @cic{} to simplify the parsing process; @icst{} has the same limitation, probably for the same reason. Compare these two statements: @example DO .1 <- ,3SUB",2SUB.1".2 DO .1 <- ,3SUB",2SUB.1".2~.3"".4 @end example The problem is that in the first statement, the ears close a group, and in the second statement, the ears open a group, and it's impossible to tell the difference without unlimited lookahead in the expression. Therefore, in similar situations (to be precise, in situations where a group is opened inside an array subscript), it's necessary to use the other grouping character to the one that opened the current group if you want a portable program. One final comment about sparks and rabbit-ears; if the next character in the program is a spot, as often happens because onespot variables are common choices for operands, a spark and the following spot can be combined into a wow (@code{!}). Unfortunately, the rabbit-ear/spot combination has no one-character equivalent in any of the character sets that @cic{} accepts as input (UTF-8, Latin-1, and ASCII-7) as none of these contain the rabbit character, although the Hollerith input format that @clcic{} can use does. @item Positional precedences: @clcic{} rules The precedence rules used by @clcic{} for grouping when full grouping isn't used are simple to explain: the largest part of the input that looks like an expression is taken to be that expression. The main practical upshot of this is that binary operators right-associate; that is, @code{.1~.2~.3} is equivalent to @code{.1~'.2~.3'}. @cic{} versions 0.26 and later also right-associate binary operators so as to produce the same results as @clcic{} rules in this situation, but as nobody has yet tried to work out what the other implications of @clcic{} rules are they are not emulated in @cic{}, except possibly by chance. @ianchor Prefix and infix unary operators @cindex unary operator, prefix @cindex unary operator, infix In @icst{} and versions of @cic{} before 0.26, unary operators were always in the `infix' position. (If you're confused about how you can have an infix unary operator: they go one character inside a group that they apply to, or one character after the start of a constant or variable representation; so for instance, to portably apply the unary operator @code{&} to the variable @code{:1}, write @code{:&1}, and to portably apply it to the expression @code{'.1~.2'}, write @code{'&.1~.2'}.) @clcic{}, and versions of @cic{} from 0.26 onwards, allow the `prefix' position of a unary operator, which is just before whatever it applies to (as in @code{&:1}). This leads to ambiguities as to whether an operator is prefix or infix. The portable solution is, of course, to use only infix operators and fully group everything, but when writing for recent versions of @cic{}, it's possible to rely on its grouping rule, which is: unary operators are interpreted as infix where possible, but at most one infix operator is allowed to apply to each variable, constant, or group, and infix operators can't apply to anything else. So for instance, the @cic{} @code{'&&&.1~.2'} is equivalent to the portable @code{'&"&.&1"~.2'} (or the more readable version of this, @code{"&'"&.&1"~.2'"}, which is also portable). If these rules are counter-intuitive to you, remember that this is @ical{} we're talking about; note also that this rule is unique to @cic{}, at least at the time of writing, and in particular @clcic{} is likely to interpret this expression differently. @end table @node Operators @section Operators @cindex operator 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 @ref{Prefix and infix unary operators} 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 @icst{} operators; many @ical{} extensions add their own operators. @menu * Mingle:: Interleaving bits in two operands * Select:: Selecting from one operand according to another * Unary Binary Logic:: Binary logic on adjacent bits of an operand * Array Subscript:: Selecting elements of arrays @end menu @node Mingle @subsection Mingle @cindex mingle @cindex interleave @findex $ @portability {yes, all versions, all versions, all versions} Mingle, or interleave, is one of the two binary operators in @icst{}. However, different @ical{} 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. The original @icst{} compiler (the Princeton compiler) used the 'change' (cent) character for a mingle, represented as @code{c}, backspace, @code{/}. (By the way, this is still the most portable way to write a mingle; both @cic{} and @clcic{} accept it, at least if a lowercase @code{c} is used, the Atari compiler was to accept it, and its documentation claimed that the Princeton compiler also accepted it; @clcic{} also accepts a capital @code{C} before the backspace and @code{/}, and allows @code{|} rather than @code{/}.) The uncompleted Atari compiler intended to use a 'big money' character (@code{$}) as the mingle character; this character is also the only one accepted for mingle by the @jic{} compiler. @cic{} originally also used the @code{$} character for mingle, and this character is the one most commonly seen in existing @cic{} programs, and most often used when giving examples of @ical{} on Usenet, because it exists in the ASCII-7 character set, and because it doesn't contain control characters. From version 0.18 of @cic{} 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. @clcic{} has always used the change character (either the Latin-1 version or the version that contains a backspace) for mingle. In this manual, mingle will be represented as @code{$}, but it's important to bear in mind that this character is not the most portable choice. 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; @cic{} 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; @cic{} 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 a mingle.) 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. One of the most common uses of interleaving is to create a constant with a value greater than 65535; for instance, 65536 is @code{#0$#256}. 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. @node Select @subsection Select @portability{yes, all versions, all versions, all versions} The select operator is one of the two binary operators in @icst{}; unlike mingle, every known implementation of @ical{} ever has used the sqiggle character (@code{~}) as the representation of the select operator, meaning that writing it portably is easy. The select operator takes two arguments, which can be of either datatype (that is, 16- or 32-bit). It returns a value made by selecting certain bits of its first operand indicated by the second operand, and right-justifying them. What it does is that it ignores all the bits of the first operand where the second operand has a 0 as the corresponding bit, that is, deletes them from a copy of the operand's value; the bits that are left are squashed together towards the least-significant end of the number, and the result is filled with 0s to make it up to 16 or 32 bits. (In @icst{} the minimum multiple of 16 bits possible that the result fits into is chosen, although if :1 has the value 131061 (in hex, 1FFFF) the expression @code{#21~:1} produces a 32-bit result because 17 bits were selected, even though many of the leading bits were zeros; in @cic{} the data type of the result is the same as of the right operand of the select, so that it can be determined at compile time, and so using a unary binary logic operator on the result of select when the right operand has a 32-bit type is nonportable and not recommended.) As an example, @code{#21~:1} produces 21 as its result if :1 has the value 131061, 10 as its result if :1 has the value 30 (1E in hex; the least significant bit of 21 is removed because it corresponds to a 0 in :1), and 7 as its result if :1 has the value 21 (because three bits in 21 are set, and those three bits from 21 are therefore selected by 21). Select is used for right-shifts, to select every second bit from a number (either to produce what will eventually become an argument to 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. @node Unary Binary Logic @subsection Unary Binary Logic @cindex unary binary logic @cindex and @cindex or @cindex xor @cindex exor @cindex exclusive or @findex ? @findex & @findex V @cindex what @cindex ampersand @cindex book @portability{yes, all versions, all versions, all versions} There are three unary operators in @icst{}, 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 (@code{&}) and book (@code{V}) 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 @code{V}, backspace, @code{-}, in the Princeton @icst{} implementation, and this is still the most portable way to write it (@cic{} and @clcic{} accept it). The Atari implementation of @icst{} wrote it with a what (@code{?}), and this is the representation originally used by @cic{} (and still accepted), the only representation accepted by @jic{}, 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). @clcic{} approximates a bookworm with the yen character, which being a currency character is one of the possible representations for mingle in @cic{}; @cic{} 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 @clcic{} doesn't support UTF-8.) In the same way, @clcic{} has a @cic{} compatibility option to allow the use of @code{?} for exclusive-or. 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, @code{#&26} is 16 (26 is 1A in hexadecimal or 11010 in binary); @code{#V26} is 31 (11111 in binary), and @code{#?26} is 23 (10111 in binary). 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 @ical{}, 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 @icst{} system library: @example 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 @end example 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): @example ((_1~:2)~((?32(:2~:2))^#2147483648))->(_1>(:2^_1)) @end example (Here, the ^ refers to a bitwise exclusive or, an operation found in OIL but not in @ical{}, which is why the @ical{} version is so much longer.) The @ical{} version also has some extra code to check for equality and to produce 1 or 2 as the output rather than 0 or 1. @node Array Subscript @subsection Array Subscript @cindex arrays, subscripting @cindex subscripts @findex SUB @portability{yes, version 0.7+, all versions, all versions} 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 @code{SUB}. Note that an array element is not a variable, so it is not accepted as an acceptable argument to statements like @code{IGNORE}; however, it can be assigned to. The syntax for an array element is the array, followed by the keyword @code{SUB}, 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 @code{SUB} 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. For instance, this is a legal (but not particularly useful) @ical{} program with no syntax errors that shows some of the syntaxes possible with array subscripting: @example 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 @end example 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 @ref{Grouping Rules}. @node Statements @chapter Statements @cindex statements @cindex statements, INTERCAL There is a wide range of statements available to @ical{} programs; some identifiably belong to a particular variant or dialect (such as Backtracking @ical{}), but others can be considered to be part of the 'core language'. The statements listed here are those that the @cic{} 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 @ical{}; known incompatibilities are listed here, but it's important to check your program on multiple compilers when attempting to write a portable program. @menu * Syntax Error:: Why use a deliberate syntax error? * Calculate:: Assigning to variables and arrays * NEXT FORGET and RESUME:: @icst{}-style flow control * STASH and RETRIEVE:: Value stacks and scoping * IGNORE and REMEMBER:: Creating read-only variables * ABSTAIN and REINSTATE:: Dynamic DOs and DON'Ts * READ OUT and WRITE IN:: @ical{} input and output * GIVE UP:: How to end a program * TRY AGAIN:: Control flow without loops * COME FROM and NEXT FROM:: Time-reversed GOTO @end menu @node Syntax Error @section Syntax Error @cindex syntax error @cindex comment @findex COMMENT @findex COMMENTS @findex COMMENTING @portability{yes,version 0.15+,all versions,all versions} One of the more commonly-used commands in @ical{} is the syntax error. A properly-written syntax error looks nothing like any known @ical{} command; a syntax error that looks vaguely like a command but isn't may confuse @cic{} before version 0.28, 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. 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: @example DOUBLE OR SINGLE PRECISION ARITHMETIC OVERFLOW @end example This is a valid @ical{} command, that produces an error when run (note the @code{DO} at the start). An even more common use is to produce an initially abstained syntax error by using an appropriate statement identifier, for instance @example PLEASE NOTE THAT THIS IS A COMMENT @end example 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 @code{PLEASE NOT}; the extra @code{E} causes the command to be a syntax error, and this particular construction is idiomatic.) 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 @clcic{} (version 1.-94.-3 and later, with @code{COMMENT}, @code{COMMENTS}, or @code{COMMENTING}), and @cic{} (@code{COMMENT} in version 0.26 and later, and also @code{COMMENTS} and @code{COMMENTING} 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. @node Calculate @section Calculate @findex CALCULATING @cindex calculate @cindex assignment @cindex arrays, dimensioning @cindex dimensioning arrays @cindex variables, assignment @portability{yes, all versions, all versions, all versions} At present, the only @ical{} command that contains no keywords (apart from the statement identifier and possibly @code{ONCE} or @code{AGAIN}) 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: @example DO .1 <- ':2~:3'~#55 @end example That is, the command is written as a variable or array element, then the @code{<-} 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 @code{BY} to cause the array to become multidimensional; so for a 3 by 4 by 5 array, it would be possible to write @example DO ,1 <- #3 BY #4 BY #5 @end example 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. The gerund to refer to calculations is @code{CALCULATING}; however, if you are planning to use this, note that a bug in older versions of @cic{} means that assignments to arrays are not affected by this gerund before version 0.27. @clcic{} from 1.-94.-4 onwards, and @cic{} from 0.26 onwards, allow arbitrary expressions on the left hand side of an assignment (@cic{} only if the @code{-v} option is used); for more information on how such `reverse assignments' work, see @ref{Operand Overloading}. @node NEXT FORGET and RESUME @section NEXT, FORGET and RESUME @findex NEXT @findex FORGET @findex RESUME @findex NEXTING @findex FORGETTING @findex RESUMING @cindex NEXT stack @cindex flow control, INTERCAL-72 @cindex stack, NEXT @cindex stack, instruction pointer @anchor{NEXT} @anchor{FORGET} @anchor{RESUME} @portability{yes, all versions, see text, all versions} The only flow-control commands in @icst{} were @code{NEXT}, @code{RESUME}, and @code{FORGET}; together these manipulate a stack of locations in the program known as the `NEXT stack'. Although all @ical{} compilers have implemented these, from @clcic{} version 0.05 onwards @clcic{} 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 @icst{} implements nothing else.) Note that there is a strict limit of 80 locations on the NEXT stack, enforced by all known @ical{} compilers; this helps to enforce good programming style, by discouraging NEXT-stack leaks (which are otherwise quite easy to write). Here are examples to show the syntax of these three statements: @example DO (1000) NEXT DO FORGET '.1~.1'~#1 DO RESUME .5 @end example The @code{NEXT} command takes a line label as its argument (unlike most other @ical{} commands, it comes after its argument rather than before); both @code{FORGET} and @code{RESUME} take expressions. (@clcic{} from version 0.05 onwards also allows an expression in @code{NEXT}, rather than a label, to give a computed @code{NEXT}, but this behaviour was not implemented in other compilers, and is deprecated in @clcic{} along with noncomputed @code{NEXT}; if computed @code{NEXT} is ever implemented in @cic{}, it will likely likewise be deprecated upon introduction). (Update: it was implemented in @cic{} version 0.28, but only as part of the external calls system, so it cannot be used in ordinary programs; a sample expansion library gives in-program access to a limited form of computed @code{NEXT}, but should probably not be used.) Running a @code{NEXT} 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 @code{NEXT} command on the top of the NEXT stack. In order to remove items from the @code{NEXT} stack, to prevent it filling up (which is what happens with a naive attempt to use the @code{NEXT} command as an equivalent to what some other languages call GOTO), it is possible to use the @code{FORGET} or @code{RESUME} commands. They each remove a number of items from the NEXT stack equal to their argument; @code{RESUME} also transfers control flow to the last location removed from the @code{NEXT} stack this way. Trying to remove no items, or more items than there are in the stack, does not cause an error when @code{FORGET} is used (no items or all the items are removed respectively); however, both of these cases are errors in a @code{RESUME} statement. Traditionally, boolean values in @ical{} 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 @icst{} is by @code{NEXTING}, then @code{NEXTING} again, then @code{RESUMING} either by 1 or 2 according to an expression, and then if the expression evaluated to 1 @code{FORGETTING} the remaining NEXT stack entry. By the way, the previous sentence also explained what the appropriate gerunds are for @code{NEXT}, @code{RESUME}, and @code{FORGET}. @node STASH and RETRIEVE @section STASH and RETRIEVE @anchor{STASH} @anchor{RETRIEVE} @findex STASH @findex RETRIEVE @findex STASHING @findex RETRIEVING @cindex stack, variable @cindex stashes @cindex variables, stashes @portability{yes, all versions, all versions, all versions} The NEXT stack is not the only stack available in an @ical{} program; each variable used in the program also has its own stack, which holds values of the same type as the variable. The @code{STASH} command pushes a variable's value onto that variable's stack; @code{RETRIEVE} 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 @ical{} commands, with the word @code{STASH} or @code{RETRIEVE} followed by the variable or variables to stash or retrieve: @example DO STASH .1 + ;2 DO RETRIEVE ,3 @end example Note that it is possible to stash or retrieve multiple variables at once, by listing their names separated by intersections (@code{+}); it's even possible to stash or retrieve a variable twice in the same statement. It is not entirely clear how @code{RETRIEVE} interacts with @code{IGNORE} in historical @icst{} compilers; the three modern @ical{} compilers all use different rules for the interaction (and the @cic{} maintainers recommend that if anyone decides to write their own compiler, they choose yet another different rule so that looking at the interaction (the so-called `ignorret test') can be used as a method of determining which compiler is running): @cindex @code{IGNORE}/@code{RETRIEVE} interaction @cindex @code{RETRIEVE}/@code{IGNORE} interaction @cindex ignorret test @itemize @item @cic{} treats a retrieval just like an assignment. That is, a read-only variable will not be changed by a retrieval, and will remain read-only, but the side-effect of popping that variable's stash will still happen. @item @jic{} ignores the read-only status of a variable when retrieving it from a stash; the value of the variable changes despite being read-only. The variable remains read-only; the @code{RETRIEVE} simply allows a change to its value despite the read-only status. @item @clcic{} is the most complicated; it stores read-only status or otherwise in the stash, along with the variable's value. This means that if a variable was stashed when read-only, retrieving it will retrieve its value and set it to read-only regardless of its previous read-only status; likewise, if a variable was stashed when read-write, retrieving it will retrieve its value and set it to read-write even if it was previously read-only. @end itemize The appropriate gerunds for @code{STASH} and @code{RETRIEVE} are @code{STASHING} and @code{RETRIEVING} respectively. @node IGNORE and REMEMBER @section IGNORE and REMEMBER @anchor{IGNORE} @anchor{REMEMBER} @findex IGNORE @findex IGNORING @findex REMEMBER @findex REMEMBERING @cindex variables, read-only @cindex variables, read-write @cindex read-only variables @cindex read-write variables @cindex variables, ignoring @cindex variables, remembering @portability{yes, all versions, all versions, all versions} Variables in @ical{} can be either read-write or read-only. At the start of a program, all variables are read-write, but this status can be changed dynamically during execution of a program using the @code{IGNORE} and @code{REMEMBER} statements (whose gerunds are @code{IGNORING} and @code{REMEMBERING} respectively). The syntax is the same as for @code{STASH} and @code{RETRIEVE}: the command's name followed by an intersection-separated list of variables. For instance: @example DO IGNORE .4 DO REMEMBER ,4 + ;5 @end example Using the @code{IGNORE} statement sets a variable to be read-only (or does nothing if it's read-only already); @code{REMEMBER} 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. The interaction between @code{IGNORE} and @code{RETRIEVE} was never defined very clearly, and is in fact different in @cic{}, @clcic{} and @jic{}; for more details, see @ref{RETRIEVE}. @node ABSTAIN and REINSTATE @section ABSTAIN and REINSTATE @anchor{ABSTAIN} @anchor{REINSTATE} @findex ABSTAIN @findex ABSTAINING @findex REINSTATE @findex REINSTATING @cindex abstain, during execution @cindex reinstate, during execution @portability{yes, all versions, all versions, all versions} 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 @code{ABSTAIN} and @code{REINSTATE}. 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 @clcic{} versions), and one which takes an intersection-delimited list of gerunds. They look like this: @example DO ABSTAIN FROM ABSTAINING + REINSTATING DO ABSTAIN FROM (10) DO REINSTATE CALCULATING DO REINSTATE (22) @end example (This also illustrates the gerunds used for these commands; note that @code{ABSTAINING} from @code{REINSTATING} 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 @code{ABSTAIN} and/or @code{REINSTATE} won't abstain from a command that's already abstained, or reinstate a command that's already reinstated. There is a strange set of restrictions on @code{ABSTAIN} and @code{REINSTATE} that has existed since @icst{}; historically such restrictions have not always been implemented, or have not been implemented properly. They together define an unusual interaction of @code{ABSTAIN} and @code{GIVE UP} (note, for instance, that there isn't a gerund for @code{GIVE UP}). The wording used in the @icst{} manual is: @quotation [...] 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. @end quotation This restriction was not implemented at all in the only @clcic{} version before 0.02 (i.e.@: version 0.01), or in @cic{} versions before 1.26. The restriction was implemented in @cic{} version 1.26 and @clcic{} versions 0.02 and later as ``@code{GIVE UP} cannot be @code{REINSTATED} or @code{ABSTAINED FROM}''; however, this is not strictly the same as the definition used by @icst{} (@cic{} still uses this definition in @clcic{} compatibility mode). The @jic{} implementation of this restriction is to make @code{REINSTATING} or @code{ABSTAINING} from a line label that refers to a @code{GIVE UP} statement a compile-time error, but this does not fit the @icst{} definition either. The definition adopted with version 0.27 and later of @cic{}, which is hopefully correct, is to allow abstaining from a @code{GIVE UP} 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). As well as @clcic{}'s extension to abstain/reinstate by computed line number, there is also (since version 0.25) a @cic{}-specific extension to @code{ABSTAIN}, also known as `computed abstain', but with a different syntax and different semantics. It's written like an ordinary @code{ABSTAIN}, but with an expression between the words @code{ABSTAIN} and @code{FROM}, for instance: @example DO ABSTAIN #1 FROM (1000) DO ABSTAIN .2 FROM WRITING IN @end example Unlike non-computed @code{ABSTAIN}, this form 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. There are many uses for @code{ABSTAIN} (both the computed and non-computed versions) and @code{REINSTATE}, especially when interacting with @code{ONCE} and @code{AGAIN} (@pxref{ONCE and AGAIN}); 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. @node READ OUT and WRITE IN @section READ OUT and WRITE IN @anchor{READ OUT} @anchor{WRITE IN} @findex READ OUT @findex READING OUT @findex WRITE IN @findex WRITING IN @cindex I/O @cindex input @cindex output The @code{READ OUT} and @code{WRITE IN} commands are the output and input commands in @ical{}; they allow communication between the program and its user. There was a numeric I/O mechanism implemented in @icst{}, 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 @cic{} and @clcic{}. The syntax of @code{READ OUT} and @code{WRITE IN} 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 be different for different elements in the list. @menu * INTERCAL-72 I/O:: Spelt-out numbers and Roman numerals * C-INTERCAL I/O:: The Turing Tape I/O system * CLC-INTERCAL I/O:: Baudot and mingled binary @end menu @node INTERCAL-72 I/O @subsection INTERCAL-72 I/O @cindex I/O, INTERCAL-72 @cindex input, INTERCAL-72 @cindex output, INTERCAL-72 @cindex INTERCAL-72, I/O @cindex Roman numerals @portability{yes, all versions, see text, all versions} @icst{} had its own versions of I/O commands; these commands are available in all modern @ical{} compilers as well (but @clcic{} implements output slightly differently). To distinguish @icst{} input and output from the other more modern types of I/O, the @code{READ OUT} and @code{WRITE IN} 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 @code{READ OUT}) a constant, meaning that these are some examples of the possible forms: @example READ OUT .1 READ OUT ;2 SUB .3:4 READ OUT #3 WRITE IN :4 WRITE IN ,5 SUB #6 @end example The statements do what you would expect; @code{READ OUT} outputs its argument to the user, and @code{WRITE IN} 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 @code{WRITE IN} 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. 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 @code{ONE TWO THREE FOUR FIVE} as input (if they were using English, the most portable choice of language). In @icst{} only English is accepted as a language, but other compilers accept other languages in addition. @cic{} from version 0.10 onwards accepts English, Sanskrit, Basque, Tagalog, Classical Nahuatl, Georgian, and Kwakiutl; also Volap@"uk from version 0.11 onwards, and Latin from version 0.20 onwards. @jic{} accepts the same languages, except with Esperanto instead of Latin; from version 0.05 of @clcic{} onwards, the same list of languages as @cic{} is supported (apart from Latin, which was added in version 1.-94.-8), plus Scottish Gaelic. The format that output can be read in is a modified form of Roman numerals, known as `butchered' Roman numerals. @icst{}, @cic{} and @jic{} do this the same way; @clcic{} is somewhat different. The characters @samp{I}, @samp{V}, @samp{X}, @samp{L}, @samp{C}, @samp{D}, and @samp{M} 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 @samp{XI} is 11 and @samp{IX} is 9, for instance. In @icst{}, @cic{}, and @jic{}, a bar over a numeral multiplies its value by 1000, and writing a letter in lowercase multiplies its value by 1000000; however, @clcic{} uses lowercase to represent multiplication by 1000 and for multiplication by 1000000 writes a backslash before the relevant numeral. @node C-INTERCAL I/O @subsection C-INTERCAL I/O @cindex I/O, C-INTERCAL @cindex input, C-INTERCAL @cindex output, C-INTERCAL @cindex C-INTERCAL, I/O @cindex Turing Tape @portability{no, version 0.07+, version 0.05+, no} @cic{}'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 @cic{}-style I/O is being used, an array must be used as the argument to @code{READ OUT} or @code{WRITE IN}; as the syntax is the same as for @clcic{}'s I/O, command-line arguments and the capabilities of the version of the compiler being used serve to distinguish the two mechanisms. 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 @code{WRITE IN} to the next. 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 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 @file{src/cesspool.c}) or at some example @cic{} programs that do text-based I/O.) @node CLC-INTERCAL I/O @subsection CLC-INTERCAL I/O @cindex Baudot @cindex I/O, Baudot @cindex I/O, CLC-INTERCAL @cindex CLC-INTERCAL I/O @cindex input, CLC-INTERCAL @cindex output, CLC-INTERCAL @portability{no, see text, all versions, no} There are also two @clcic{}-specific I/O mechanisms. These are Baudot-based text I/O (which is also implemented from @cic{} version 0.27 onwards), and @clcic{} generalised binary I/O (not implemented in @cic{}). Baudot text-based I/O is specified by using a tail array as an argument to @code{WRITE IN} or @code{READ OUT}. (A tail array can also be used to specify @cic{}-style Turing Tape I/O. In order to determine which is used: both @cic{} and @clcic{} use their own sort of I/O unless a command-line argument instructs them to use the other.) In the case of @code{WRITE IN}, one line of input is requested from the user (@cic{} requires this to be input in Latin-1, and will then automatically convert it; @clcic{} 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; @clcic{} pads with zeros, @cic{} pads with random bits. Trying to input at end-of-file will act as if the input were a blank line. @code{READ OUT} is the reverse; it interprets the array as extended Baudot and converts it to an appropriate character set (Latin-1 for @cic{}, or whatever was specified on the command line for @clcic{}), 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, @ref{Character Sets}. Generalised binary I/O is specified using a hybrid array as an argument to @code{WRITE IN} or @code{READ OUT}. 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. @node GIVE UP @section GIVE UP @findex GIVE UP @cindex quitting @cindex exiting @portability{yes, all versions, all versions, all versions} The @code{GIVE UP} command causes the program to end (or, in a multithreaded program, causes the current thread to end). It is written simply as @code{GIVE UP}. 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 @code{TRY AGAIN}, and that it has an unusual interaction with @code{ABSTAIN}; for details of this, see @ref{ABSTAIN}. (Going past the last command in the program is an error.) There is no gerund for @code{GIVE UP}; in particular, @code{GIVING UP} is a syntax error. @node TRY AGAIN @section TRY AGAIN @findex TRY AGAIN @cindex loops, entire program @portability{no, version 0.25+, no, no} The @code{TRY AGAIN} 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 @code{TRY AGAIN} 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. The gerund for @code{TRY AGAIN} is @code{TRYING AGAIN}. @node COME FROM and NEXT FROM @section COME FROM and NEXT FROM @anchor{COME FROM} @anchor{NEXT FROM} @findex COME FROM @findex NEXT FROM @cindex reverse goto @cindex goto, time-reversed @cindex time-reversed goto @portability{no, see text, see text, see text} The @code{COME FROM} statement (incidentally also invented in 1972, but not in connection with @ical{}) is the main control-flow command in @clcic{} (which deprecates @code{NEXT}), and one of two main control flow structures in other modern @ical{} compilers. It takes either a label or an expression as its argument; these forms are noncomputed @code{COME FROM} and computed @code{COME FROM}. Noncomputed @code{COME FROM} was implemented in version 0.5 of @cic{}, but did not conform to modern-day semantics until version 0.7; it is available in every version of @clcic{} and @jic{}. Computed @code{COME FROM} support is available in every version of @clcic{} and in @cic{} from version 0.25 onwards, but not in @jic{}; the variant @code{NEXT FROM} of @code{COME FROM} is available from @clcic{} version 1.-94.-8 and @cic{} version 0.26 (both computed and noncomputed). @cic{} and @clcic{} also have a from-gerund form of @code{COME FROM} and @code{NEXT FROM}, which was also implemented from @clcic{} version 1.-94.-8 and @cic{} version 0.26. The basic rule of @code{COME FROM} is that if a @code{COME FROM} statement references another statement, whenever that statement is reached, control flow will be transferred to the @code{COME FROM} after that statement finishes executing. (@code{NEXT FROM} is identical except that in addition to the @code{COME FROM} 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 itself a @code{NEXT}.) Here are examples of noncomputed, computed, and from-gerund @code{COME FROM}: @example DO COME FROM (10) DO COME FROM #2$'.1~#1' DO COME FROM COMING FROM @end example (The last example is an infinite loop. If it said @code{DO NEXT FROM NEXTING FROM}, it would not be an infinite loop because the NEXT stack would overflow and cause an error. This also establishes the gerunds used for @code{COME FROM} and @code{NEXT FROM}.) There are some things to be careful with involving @code{COME FROM} and @code{NEXT FROM}. First, if the statement come from or nexted from happens to be a @code{NEXT}, the @code{NEXT} doesn't count as 'finishing executing' until the NEXT stack entry created by the @code{NEXT} is @code{RESUME}d to. In particular, this means that if @code{FORGET} is used to remove the entry, or a @code{RESUME} with a large argument resumes a lower entry, the @code{COME FROM} doesn't steal execution at all. Second, you may be wondering what happens if two @code{COME FROM}s or @code{NEXT FROM}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 @code{COME FROM}s or @code{NEXT FROM}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 @code{COME FROM}s or @code{NEXT FROM}s are noncomputed, however, a compiler can (but does not have to) give a compile time error if two @code{COME FROM}s or @code{NEXT FROM}s share a label, and so that situation should be avoided in portable code. (If it is wanted, one solution that works for @cic{} and @clcic{} is to use computed @code{COME FROM}s or @code{NEXT FROM}s with a constant expression.) @node System Libraries @chapter System Libraries @cindex system libraries Some programming support libraries may be included automatically at the end of your program by the @cic{} compiler. While such a convenience feature might be judged not in the spirit of @ical{}, the required level of perversity is arguably restored by the way inclusion is triggered: whenever your program refers to a line from specified magic ranges without defining any line in those ranges in the program. (@clcic{} does not have this feature, but it is trivial to concatenate a copy of any desire library onto the end of the program.) The following table maps magic line ranges to systen libraries. Descriptions of the libraries follow it. @menu * syslib:: Base system library * floatlib:: Floating-point library @end menu @multitable @columnfractions .1 .1 .15 .55 @headitem From @tab To @tab Versions @tab Description @item (1000) @tab (1999) @tab All @tab Basic System Library @item (5000) @tab (5999) @tab >=0.29 @tab Floatring Point Library @end multitable @node syslib @section syslib @cindex syslib @portability{yes, all versions, no, all versions} @ical{} has a system library, called @samp{syslib} (versions for bases other than 2 will have a numeric suffix on the name). The intention of the system library is to provide a range of useful capabilities, like multiplication, that can otherwise be hard to write in @ical{}. System library routines are used by @code{NEXTING} to their line number (@pxref{NEXT}), where they will make changes to certain variables depending on certain other variables (depending on which routine is called), and @code{RESUME} back to the original program. As the system library is itself written in @ical{}, there are some restrictions that need to be obeyed for calls to it to be guaranteed to work; none of the variables it uses (@code{.1} to @code{.6} and @code{:1} to @code{:5}) 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 @code{DO ABSTAIN FROM (1500)} or more subtle problems like gerund-abstention) or have @code{COME FROM}s or @code{NEXT FROM}s aiming at them. The system library is currently available in all bases from 2 to 7 (@pxref{TriINTERCAL}), but not every command is available in every base, and @cic{} is the only one of the three compilers listed above that has the system library to ship with a version in bases other than 2. (This table was originally based on the @icst{} 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. @multitable @columnfractions .1 .7 .15 @headitem Line @tab Description @tab Bases @item (1000) @tab .3 <- .1 plus .2, error exit on overflow @tab 2, 3, 4, 5, 6, 7 @item (1009) @tab .3 <- .1 plus .2, overflow checked @tab 2, 3, 4, 5, 6, 7 @item (1010) @tab .3 <- .1 minus .2, no action on overflow @tab 2, 3, 4, 5, 6, 7 @item (1020) @tab .1 <- .1 plus #1, no action on overflow @tab 2, 3, 4, 5, 6, 7 @item (1030) @tab .3 <- .1 times .2, error exit on overflow @tab 2, 3, 4, 5, 6, 7 @item (1039) @tab .3 <- .1 times .2, overflow checked @tab 2, 3, 4, 5, 6, 7 @item (1040) @tab .3 <- .1 divided by .2 @tab 2, 3, 4, 5, 6, 7 @item (1050) @tab .2 <- :1 divided by .1, error exit on overflow @tab 2, 3, 4, 5, 6, 7 @item (1200) @tab .2 <- .1 times #2, overflow captured in .3 @tab 4, 6 @item (1210) @tab .2 <- .1 divided by #2, one digit after the quartic or sextic point stored in .3 @tab 4, 6 @item (1500) @tab :3 <- :1 plus :2, error exit on overflow @tab 2, 3, 4, 5, 6, 7 @item (1509) @tab :3 <- :1 plus :2, overflow checked @tab 2, 3, 4, 5, 6, 7 @item (1510) @tab :3 <- :1 minus :2, no action on overflow @tab 2, 3, 4, 5, 6, 7 @item (1520) @tab :1 <- .1 concatenated with .2 @tab 2, 3, 4, 5, 6, 7 @item (1530) @tab :1 <- .1 times .2 @tab 2, 3, 4, 5, 6, 7 @item (1540) @tab :3 <- :1 times :2, error exit on overflow @tab 2, 3, 4, 5, 6, 7 @item (1549) @tab :3 <- :1 times :2, overflow checked @tab 2, 3, 4, 5, 6, 7 @item (1550) @tab :3 <- :1 divided by :2 @tab 2, 3, 4, 5, 6, 7 @item (1700) @tab :2 <- :1 times #2, overflow captured in .1 @tab 4, 6 @item (1710) @tab :2 <- :1 divided by #2, one digit after the quartic or sextic point stored in .1 @tab 4, 6 @item (1720) @tab :2 <- :1 times the least significant digit of .1, overflow captured in .2 @tab 5, 7 @item (1900) @tab .1 <- uniform random number from #0 to #65535 @tab 2, 3, 4, 5, 6, 7 @item (1910) @tab .2 <- normal random number from #0 to .1, with standard deviation .1 divided by #12 @tab 2, 3, 4, 5, 6, 7 @end multitable If you happen to be using base 2, and are either using the external call system (@pxref{External Calls}) or are willing to use it, it is possible to use a version of the system library written in C for speed, rather than the default version (which is written in @ical{}). To do this, use the command line options @option{-eE} (before the @ical{} file), and @option{syslibc} (at the end of the command line). @node floatlib @section floatlib @cindex floatlib @portability{yes, all versions, no, all versions} @ical{} also has a floating-point library, called @samp{floatlib}, presently available only in base 2. It is used by several of the demonstration programs shipped with the distribution. In versions after 0.28 it is included automatically at the end of your program by the compiler whenever your program refers to a line from (5000) to (5999) without defining any line in that range in the program. Here is a summary of routines in floatlib.i: @multitable @columnfractions .1 .8 @headitem Line @tab Description @item (5000) @tab :3 <- :1 plus :2 @item (5010) @tab :3 <- :1 minus :2 @item (5020) @tab :2 <- the integer part of :1, :3 <- the fractional part of :1 @item (5030) @tab :3 <- :1 times :2 @item (5040) @tab :3 <- :1 divided by :2 @item (5050) @tab :3 <- :1 modulo :2 @item (5060) @tab :2 <- :1 cast from a two's-complement integer into a floating-point number @item (5070) @tab :2 <- :1 cast from a floating-point number into the nearest two's-complement ineger @item (5080) @tab :2 <- :1 cast from a floating-point number into a decimal representation in scientific notation @item (5090) @tab :2 <- :1 cast from a decimal representation in scientific notation into a floating-point number @item (5100) @tab :2 <- the square root of :1 @item (5110) @tab :2 <- the natural logarithm of :1 @item (5120) @tab :2 <- e to the power of :1 (the exponential function) @item (5130) @tab :3 <- :1 to the power of :2 @item (5200) @tab :2 <- sin :1 @item (5210) @tab :2 <- cos :1 @item (5220) @tab :2 <- tan :1 @item (5400) @tab :1 <- uniform random number between zero and one exclusive @item (5410) @tab :2 <- :1 times phi @item (5419) @tab :2 <- :1 divided by phi @end multitable Note: All of the above routines except (5020), (5060), (5080), (5200), (5210), and (5400) also modify .5 as follows: .5 will contain #3 if the result overflowed or if the arguments were out of domain, #2 if the result underflowed, #1 otherwise. (See below.) The INTERCAL floating-point library uses the IEEE format for 32-bit floating-point numbers, which uses bit 31 as a sign bit (1 being negative), bits 30 through 23 hold the exponent with a bias of 127, and bits 22 through 0 contain the fractional part of the mantissa with an implied leading 1. In mathematical notation: @samp{N = (1.0 + fraction) * 2^(exponent - 127) * -1^sign} Thus the range of floating-point magnitudes is, roughly, from 5.877472*10^-39 up to 6.805647*10^38, positive and negative. Zero is specially defined as all bits 0. (Actually, to be precise, zero is defined as bits 30 through 0 as being 0. Bit 31 can be 1 to represent negative zero, which the library generally treats as equivalent to zero, though don't hold me to that.) Note that, contrary to the IEEE standard, exponents 0 and 255 are not given special treatment (besides the representation for zero). Thus there is no representation for infinity or not-a-numbers, and there is no gradual underflow capability. Conformance with widely-accepted standards was not considered to be a priority for an INTERCAL library. (The fact that the general format conforms to IEEE at all is due to sheer pragmatism.) @ifset notsplit @partheading{PART III: @ical{} DIALECTS AND EXTENSIONS} @end ifset @node TriINTERCAL @chapter TriINTERCAL @cindex TriINTERCAL @cindex ternary @cindex whirlpool @cindex sharkfin @cindex BUT @cindex add-without-carry @cindex subtract-without-borrow @cindex controlled unary operator @findex ^ @findex @@ @portability{no, version 0.7+, version 1.-94.-8+, no} One extension to @ical{} that is implemented by both @cic{} and @clcic{} is known as TriINTERCAL, and extends @ical{} to bases other than binary. Unlike ordinary @ical{} programs, which have the extension @samp{.i}, TriINTERCAL programs in bases from 3 to 7 (the only allowed bases) have extensions from @samp{.3i} to @samp{.7i} respectively. 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: @itemize @item Exclusive-or becomes two operators, known either as subtract-without-borrow and add-without-carry due to their mathematical interpretations, or what and sharkfin after their Atari syntax representations (@code{?} and @code{^}). (In Princeton syntax, these are the bookworm or yen sign, and a spike (@code{|}).) The two operators do the same thing in binary, but differ in higher bases. (Nevertheless, it is an error to use a sharkfin in binary, because it is a so-called `controlled unary operator', as are the rest of the new operators defined in this section, which has a lower limit on which base it is allowed in.) Instead of doing the exclusive-or operation, the bits being combined are either subtracted or added; if the result is out of range for the base being used, the base is added or subtracted from the result until it is in range. (For the subtraction, the bit that was less significant is subtracted from the bit that was more significant in any given pair of bits, except for the subtraction between the most and least significant bits, where the most significant bit is subtracted from the least.) @item The AND and OR operators are generalised into an entire sequence of operators; the number of operators available is the same as the base that is being used. In base 3, the third operator is known as BUT; in other bases, there are no commonly accepted names for the extra operators, 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 0 if either argument is a 0, and otherwise a 1, and likewise, an OR gives the result 1 if either argument is a 1, and otherwise a 0; they could be said to favour 0 over 1 and 1 over 0 respectively. In base 3, AND favours 0 over 2 over 1, OR favours 2 over 1 over 0, and BUT favours 1 over 0 over 2. (The symbol for BUT is @code{@@} (a `whirlpool', which is another name for the BUT operation) in Atari syntax, and @code{?} in Princeton syntax.) The pattern continues: in base 4, AND favours 0 over 3 over 2 over 1, BUT favours 1 over 0 over 3 over 2, 2BUT (written @code{2@@} or @code{2?}) favours 2 over 1 over 0 over 3, and OR favours 3 over 2 over 1 over 0. (This can be extended to higher bases following the same pattern, introducing operators @code{3@@} or @code{3?}, etc., to favour 3, etc., when neither AND (which always favours 0) nor OR (which favours the highest digit in the base) are available.) All the whirlpool operators are controlled unary operators, which are only legal when both the base contains the favoured digit, and they aren't redundant to AND nor OR. @item Select has its semantics modified to deal with more than one nonzero digit in the base. It starts off by doing an AND (in whatever base is being used) between the two numbers being selected; then the bits of the result are sorted by the bits of the right-hand argument to the select, with bits corresponding to 0s in the right-hand argument ending up more significant than bits corresponding to high digits in the right-hand argument. In base 2, this has the same effect as a traditional-style select. @end itemize 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.) @node Multithreading and Backtracking @chapter Multithreading and Backtracking @cindex multithreading @cindex threading @cindex Threaded INTERCAL @cindex Backtracking INTERCAL The multithreading and backtracking extensions to @ical{} were originally invented by Malcom Ryan, who implemented @code{COME FROM}-based multithreading as a modified version of @cic{}, known as Threaded @ical{}, but did not implement backtracking. (The same functionality is implemented in @cic{} today, but with different code. Most likely, this means that the original code was better.) He also invented the original version of Backtracking @ical{}, but did not implement it; the only known implementation is the @cic{} one. A different version of multithreading, using @code{WHILE}, was implemented as part of @clcic{} (like all extensions first available in @clcic{}, it is most likely due to Claudio Calvelli) and then added to @cic{}, although its implications were not noticed for some time afterwards. So nowadays, three freely-mixable threading-like extensions to @ical{} exist, all of which are implemented in @cic{}. (A fourth, Quantum @ical{}, is implemented in @clcic{} but not @cic{}, 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 @cic{}, because the @ical{} 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 @ical{} as a whole, for that matter.) @menu * Multithreading using COME FROM:: Creating separate threads. * Multithreading using WHILE:: Creating connected threads. * Backtracking:: Multithreading in series, not parallel. @end menu @node Multithreading using COME FROM @section Multithreading using COME FROM @cindex @code{COME FROM}, multithreading @cindex @code{NEXT FROM}, multithreading @cindex multithreading, separate threads @cindex threading, separate @cindex threading, unwoven @cindex separate threads @cindex unwoven threads @portability{no, version 0.25+, version 0.05+, no} 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 @code{COME FROM}s or @code{NEXT FROM}s (or a mixture of these) 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. 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 @code{COME FROM} and a @code{NEXT FROM} aim at the same line, for instance, the @code{NEXT FROM} thread will end up with a NEXT stack entry that isn't in the @code{COME FROM} thread, created by the @code{NEXT FROM} 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 @ical{}.) In @cic{}, 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, @code{COME FROM}s and @code{NEXT FROM}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 @code{COME FROM} or @code{NEXT FROM} 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 @cic{} from 0.27 onwards, there is a third guarantee; that if a @code{COME FROM} 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 @code{COME FROM} could block all threads if it aimed for itself due to the speed restrictions and the fact that @code{COME FROM}s need not count towards the total command count.) Also, all commands, including any @code{ONCE} or @code{AGAIN} 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 @ical{} status quo, these guarantees are somewhat @emph{better} than in most other languages that implement threading, amusingly continuing to leave @ical{} with the status of being unlike any other mainstream language.) 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 @code{ABSTAIN} and @code{ONCE} is one way to communicate atomically, due to the atomic nature of @code{ONCE}.) If there are at least two threads, the @code{GIVE UP} command ends the current thread, rather than the current program. @node Multithreading using WHILE @section Multithreading using WHILE @findex WHILE @anchor{WHILE} @cindex multithreading, connected threads @cindex threading, connected @cindex threading, woven @cindex connected threads @cindex woven threads @portability{no, version 0.27+, version 0.05+, no} The @code{WHILE} 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 @clcic{}, there are at least two other meanings for @code{WHILE}, but only the one implemented in @cic{} is discussed here.) The syntax is somewhat unusual, and consists of two commands separated by the @code{WHILE} keyword, but sharing the statement identifier, execution chance, and any @code{ONCE}/@code{AGAIN} keyword that may be present. For instance: @example (1) DO COME FROM ".2~.2"~#1 WHILE :1 <- "'?.1$.2'~'"':1/.1$.2'~#0"$#65535'"$ "'"'&.1$.2'~'#0$#65535'"$#0'~#32767$#1" @end example (OK, maybe that's an unnecessarily complicated example, and maybe it shouldn't have included the @code{/} operator which is part of another @ical{} extension (@pxref{Operand Overloading}). Still, I thought that maybe you'd want to see how addition can be implemented in @ical{}.) A @code{WHILE} 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 @code{WHILE} 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. @code{NEXTING FROM}, @code{ABSTAINING FROM} or similar behaviour with respect to the @code{WHILE} 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 @code{WHILE} 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 @code{NEXTING}, 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 @code{NEXT}), that thread loops and reruns that command as long as the left command has not finished; @code{COMING FROM} that command, or a @code{NEXT}/@code{NEXT FROM} from/aiming at that command, doesn't count as finishing that command until it is @code{RESUME}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 @code{GIVE}s @code{UP} or the loop ends due to the command ending later in another thread). A @code{WHILE} 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 of the same @code{WHILE} 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 @code{WHILE} ends, they together only cause one right-hand command to end. (What, did you expect the logical and orthogonal behaviour?) The two threads produced by a @code{WHILE} (the original thread and a new copy of it) have more in common than ordinary @ical{} threads created by @code{COME FROM}; ordinary threads share only @code{ABSTAIN}/@code{REINSTATE} information, whereas the @code{WHILE}-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. Ordinary multithreading cannot create woven threads. When threads are created by multiple @code{COME FROM}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 (@pxref{Backtracking}) 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 @code{MAYBE}, 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 @code{WHILE} inside one of the threads that is already woven, which causes all the new threads to be woven together (the weaving relationship is transitive). @node Backtracking @section Backtracking @cindex backtracking @cindex choicepoints @cindex dormant thread @cindex threading, in series @cindex threading, dormant @portability{no, version 0.25+, no, no} 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 @code{MAYBE} 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 @code{GO AHEAD} and get rid of the dormant thread, or decide that it didn't like the consquences of the command and @code{GO BACK} 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.) @anchor{MAYBE} @findex MAYBE @cindex choicepoints, creating To create a choicepoint, the statement identifier @code{MAYBE} is used, rather than the more usual @code{DO} or @code{PLEASE}. (Combination statement identifiers are still allowed, but must be in the order @code{MAYBE PLEASE DO NOT} with optionally some parts omitted, or different versions of @code{NOT} used, or both.) Here's an example: @example MAYBE DON'T GIVE UP @end example When a command whose statement identifer contains @code{MAYBE} 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 @code{ABSTAIN} and @code{REINSTATE}, 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 @code{NEXT} stack are. @anchor{GO BACK} @findex GO BACK @cindex choicepoints, activating 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 @code{GO BACK} command (which has no arguments, and is just the statement identifier, optional execution chance, @code{GO BACK}, and optional @code{ONCE} or @code{AGAIN}). 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 @code{MAYBE} is temporarily reversed for determining whether it runs or not (this reversal only lasts immediately after the @code{GO BACK}, and does not affect uses of the command in other threads or later in the same thread), so unless it has been @code{ABSTAIN}ed or @code{REINSTATE}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 @code{GO BACK} to a stale choicepoint instead causes the stale choicepoint to be deleted and the program to continue executing. (This is what gives @ical{}'s backtracking greater flexibility in some ways than some other languages; to get backtracking without the stale choicepoints having an effect, simply run @code{COME FROM} the @code{GO BACK} as the previous statement.) 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 @code{GO BACK} 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 @code{GO BACK} 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 @ical{}'s backtracking is more flexible than that of some other languages. @anchor{GO AHEAD} @findex GO AHEAD @cindex choicepoints, discarding If, on the other hand, a program decides that it likes where it is and doesn't need to @code{GO BACK}, or it wants to @code{GO BACK} to a choicepoint lower down the stack while skipping some of the ones nearer the top of the stack, it can run the @code{GO AHEAD} command, which removes the top choicepoint on the stack, whether it's a genuine choicepoint or just a stale one. Both @code{GO AHEAD} and @code{GO BACK} cause errors if an attempt is made to use them when the choicepoint stack is empty. @node Operand Overloading @chapter Operand Overloading @cindex operand overloading @findex / @cindex slat @cindex reverse assignment @portability{no, version 0.26+, version 0.05+, no} (Operand overloading in @cic{} is nowhere near as advanced as it is in @clcic{}. This chapter only explains the partial implementation used by @cic{}; for a full implementation, see @clcic{} and its documentation.) 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. At the beginning of the program, all variables stand for themselves; so @code{.1} really does mean @code{.1}, for instance. The meaning of a variable can be overloaded using the slat operator (@code{/}), which is the same in both Princeton and Atari syntax: it is a binary operator whose left argument must be a onespot or twospot 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: @example DO .1 <- .2/'.3~.4' @end example The example causes @code{.2}'s true value to be assigned to @code{.1} (unless of course @code{.1} is read-only), but also causes @code{.2} from then on to actually mean @code{'.3~.4'}, except when it's the left operand of a slat operator. So for instance, @code{DO .1 <- .2} would actually assign @code{'.3~.4'} to @code{.1}. Somewhat confusingly, this also works in the other direction; @code{DO .2 <- .1} would assign @code{.1} to @code{'.3~.4'}, which would have the effect of changing the values of @code{.3} and @code{.4} so that @code{'.3~.4'} 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 @code{DO .1 <- .1/#1} is entirely capable of changing the value of @code{#1}, although to protect new @ical{} users @cic{} will refuse to carry out operations that change the value of constants unless a command-line switch (@pxref{-v}) is used to give it permission. In @cic{}, changing the value of a constant only changes meshes with that value, but in @clcic{} it can also change non-mesh uses of that constant, so doing so is not portable anyway.) When multiple overloading rules are in effect, they are all applied; overloading @code{.1} to @code{'.2~.3'} and @code{.2} to @code{'.3$.4'} will cause @code{.1} to refer to @code{''.3$.4'~.3'}. 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 @code{.1/.2} and @code{.2/.1} together cause @code{.1} to expand to @code{.2}, which expands to @code{.1}, which cannot expand any further). In @cic{}, the expression on the right hand side of a slat is not evaluated and not expanded by operand overloading. @code{STASHING} a variable causes its overloading information to be stashed too; @code{RETRIEVING} 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). 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. 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 @code{DO .1 <- .2/'.3$.3' DO .2 <- #6} are liable to succeed assigning garbage to @code{.3} 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. @node PIC-INTERCAL @chapter PIC-INTERCAL @cindex PIC-INTERCAL @cindex embedded systems @cindex microcontrollers @portability{no, version 0.26+, no, no} PIC-INTERCAL is a simplified version of @ical{} designed especially for embedded systems, designed to minimise code and data usage by @ical{} 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.) @cic{} only compiles 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, @file{src/pick1.h} and @file{src/pick2.h}, don't have any effect 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.) There are several restrictions on PIC-INTERCAL programs: @itemize @item It's impossible to store more than one item in the STASH for any given variable. @item Many errors are not checked at runtime; it is the programmer's job to ensure that runtime errors are avoided. (The few errors that are detected will send the program into an infinite loop, as there is no sensible way to exit from a PIC program.) @item Double-oh-sevens are not randomised, but instead depend merely on whether the probability given is greater than 50% or not. @item The NEXT stack is limited to 16 entries rather than the usual 80. @item @code{ABSTAIN} and @code{REINSTATE} still work, but cannot be computed @code{ABSTAIN}s, and will not necessarily work when used to affect the system library or calls to it. @item @code{READ OUT} and @code{WRITE IN} don't work. (See below for a replacement.) @item @code{COME FROM} and @code{NEXT FROM} must aim at a label, not an expression or gerund. @item Multithreading and TriINTERCAL cannot be used on PICs. (Operand overloading can be used, but only if your PIC cross-compiler supports function pointers; some don't.) @end itemize @anchor{PIN} @findex PIN @cindex I/O, PIC-INTERCAL In order to provide I/O capabilities, a new command @code{PIN} 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 @samp{PORTA} and @samp{PORTB}; for other microcontrollers, adapting the code in @file{src/pick1.h} 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. The @code{PIN} command takes one twospot variable as its argument, like this: @example DO PIN :2 @end example The twospot variable is conceptually divided into 4 blocks of 8 bits. The highest two blocks control the directions of the pins in @code{PORTB} (most significant block) and @code{PORTA} (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 @code{PORTB} and the least significant block controls @code{PORTA}, 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 @code{PIN} 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. @node CREATE @chapter CREATE @findex CREATE @cindex creating syntax @cindex syntax, creating @portability{no, version 0.28+, see text, no} The @code{CREATE} command allows the creation of new syntax at runtime. @clcic{} has had such a command since 1.-94.-8, but its syntax is completely different and incompatible with the @cic{} version, and so is not documented here (see the @clcic{} documentation for more details). The @cic{} version is only defined if the @code{-a} option is used on the command line (and a runtime error E000 otherwise), because it forces the operand overloading code to be introduced and so slows down every variable access in the program. The syntax of the @code{CREATE} command is to write @code{CREATE}, then a line label, then anything. OK, well not quite anything; you're restricted to syntax that is supported by the `just-in-case' compiler that runs on comments at compile time just in case they gain a meaning later (see below). The anything provides an example statement to @code{CREATE}; statements which look the same (but may differ in details) are created. Typical syntax for a @code{CREATE} statement would therefore look something like this: @example DO CREATE (5) SWITCH .1 WITH .2 @end example There is also computed @code{CREATE}, working identically to ordinary @code{CREATE} except that the line number is taken from an expression and the created command must start with a letter (to avoid an ambiguity if the expression giving the line label happens to be an array reference), with a syntax like this: @example DO CREATE .5 SWITCH .1 WITH .2 @end example Here, a new @code{SWITCH WITH} statement (there is no such statement in @ical{} normally) is being created. This command makes it possible to do this: @example DO SWITCH .3 WITH .4 @end example Normally that line would be an error (E000) due to being unrecognised, but having been @code{CREATE}d, it's now a real statement. (The gerund to affect created statements is @code{COMMENT}, just like before they were created; the gerund to affect @code{CREATE} itself is @code{CREATION} (@code{CREATING} is also allowed, but not as elegant).) When the created statement is encountered, it @code{NEXT}s to line (5), the line number specified in the @code{CREATE} statement. In order for the code there to be able to affect the variables mentioned in the statement, the variables @code{:1601} (for the first variable or expression mentioned), @code{:1602} (for the second variable or expression mentioned), and so on, are @code{STASH}ed and then overloaded to the respective expressions or variables mentioned in the created command; so @code{:1601} has been overloaded to mean @code{.3} and @code{:1602} has been overloaded to mean @code{.4} at this point. Then, the code at (5) runs; if it returns via a @code{RESUME #1}, @code{:1601} and @code{:1602} will be @code{RETRIEVE}d automatically and the program will continue from after the created statement. (If you do not resume to that point, say if you're creating a flow control statement, you'll have to deal with the stashes for the 1600-range variables yourself.) So what syntax is available in created statements@? All the capital letters except @samp{V} (which is an operator in @ical{}) are available and can be used freely and as many times as desired; they match themselves literally. However, they are not allowed to spell an @ical{} keyword at any point (so watch out for @code{DO} and @code{FROM}, for instance). Whitespace is allowed, but is ignored (both in the @code{CREATE} template statement, and in the code being created; so @code{DO SW ITCH :8 WITH :50} will also have been created). Then, there are three groups of matchable data: scalar variables (onespot or twospot variables, as used in the examples above) match other scalar variables, array elements (like @code{,4 SUB '.5~.6'}) match other array elements, and other expressions match other other expressions. Two matchable data may not appear consecutively in a created command, but must be separated by at least one capital letter (to prevent array-subscript-related ambiguities; remember that the just-in-case compiler has to compile these statements at compile time without knowing what they are). The actual expressions used in the @code{CREATE} statement don't matter; they're just examples for the runtime to match against. @cindex CREATE, operators It is also possible (from @cic{} version 0.29 onwards) to create new operators. Such operators are always binary operators (that is, they take two arguments and parse like mingle or select), and always return 32-bit results. There are three types of legal names for such operators, all of which are treated equivalently: lowercase letters, punctuation marks otherwise unused in @ical{}, and overstrikes consisting of a character, a backspace, and another character (apart from overstrikes already used for built-in @ical{} operators). The syntax for creating an operator looks like one of these: @example DO CREATE (5) x DO CREATE .5 = @end example The arguments to the operator will be overloaded onto :1601 and :1602 (which are, like with @code{CREATE}d statements, stashed before the overloading happens), and the return value is read from :1603 (which is stashed, then overloaded to itself). All these three variables are retrieved again after the operator finishes evaluating. Note that it is a very unwise idea to use a @code{CREATE}d operator in the expression for a computed @code{COME FROM} or @code{NEXT FROM}, because this always leads to an infinite regress; whenever any line label is reached (including the line label that the @code{CREATE} statement pointed at), the expression needs to be evaluated in order to determine whether to @code{COME FROM} that point, which in turn involves evaluating lines which have labels. Some other points: a newer @code{CREATE} statement supercedes an older @code{CREATE} statement if they give equivalent templates, multiple @code{CREATE} statements may aim at the same line (this is the recommended technique for creating a statement that can handle expressions even if they're array elements or variables; you do this by specifying multiple templates in multiple @code{CREATE} statements), and strange things happen if a twospot variable in the 1600-range is used as an argument to a created statement itself (because of the stash/retrieve, such a variable can usually be read, but may not always be able to be written without the data being lost). @node External Calls @chapter External Calls @cindex external calls @cindex other languages @cindex foreign functions @cindex calls, external @portability{no, version 0.28+, no, no} @cic{} has a feature allowing @ical{} and non-@ical{} code to be mixed. This is achieved by causing the non-@ical{} programs to participate in the @ical{} line-numbering model. The same feature allows expansion libraries to be linked into the code. To create a combined program containing @ical{} and non-@ical{} code, use @command{ick} as the compiler as normal, but specify both the @ical{} and non-@ical{} source files on the command line, and use the @option{-e} command-line option. @command{ick} will invoke other compilers as necessary, after modifying the source files accordingly. At present, external calls are only supported to and from C and Funge-98. In each case, it will be the @ical{} program that is invoked first. (This means that it is impossible to link together more than one @ical{} program, but you probably don't want to, because concatenating the programs is likely to have a similar effect.) You can get the @ical{} program to @code{NEXT} to the non-@ical{} program immediately, or the non-@ical{} program to @code{COME FROM} or @code{NEXT FROM} the @ical{} program immediately, to obtain the effect of running the non-@ical{} program first. Note that external calls are incompatible with PIC-INTERCAL and with multithreading; note also that you must use @command{gcc} as your compiler, and @acronym{GNU} cpp and ld, for them to work in the current version of @cic{}. @menu * External Calls to C:: How to put @ical{} calls in C. * External Calls to Funge-98:: Linking Befunge-98 and @ical{}. * Miscellaneous External Calls:: Other things you can link in. * Using External Calls:: What happens when you use -e. * Expansion Libraries:: Expanding the compiler's capabilities. @end menu @node External Calls to C @section External Calls to C @cindex C @cindex other languages, C @cindex external calls, to C @portability{no, version 0.28+, no, no} Linking C and @ical{} programs is achieved by placing various constructs into the C programs that are equivalent to various @ical{} constructs. It is possible to simulate a line with a label and a dummy command (which serves as a @code{COME FROM} suckpoint and @code{NEXT} target), a command with a line label, @code{NEXT}, @code{RESUME}, and @code{FORGET}, and @code{COME FROM} and @code{NEXT FROM}. Onespot and twospot variables are accessible from inside the C program, where they can be read and written; however, the @ical{} program cannot access any variables inside the C program that weren't part of the @ical{} program originally. To prevent various logical impossibilities, there are restrictions on where these can be used and what preparation is needed before they are used. Also, the semantics are not always exactly what you might expect for technical reasons. It should be observed that the @ical{} link intrudes on the user namespace. To prevent possible namespace clashes, no identifiers starting with @code{ick_} or @code{ICK_} should be used anywhere in the linked C program for any reason, except where specified in this manual. @menu * External C Call Infrastructure:: Enabling a C program for external calls * ick_startup:: Doing things at startup * ick_linelabel:: Labelling lines... * ick_labeledblock:: ...and labelling blocks * ick_comefrom and ick_nextfrom:: Stealing control from elsewhere * ick_next:: The INTERCAL answer to subroutine calls * ick_resume:: Going back to before a NEXT * ick_forget:: Discarding NEXT stack entries * ick_get/setone/twospot:: Accessing INTERCAL variables from C * ick_create:: CREATE statements via external calls * External Calls and auto:: Considerations for auto variables @end menu @node External C Call Infrastructure @subsection External C Call Infrastructure @cindex C, external call infrastructure @cindex external calls, C infrastructure For a C program to be connected to an @ical{} program, it needs to be marked with the correct header file, and needs to have functions marked for communication with the @ical{} program. @table @code @item #include @cindex ick_ec.h The header file @file{ick_ec.h} must be included using the preprocessor in any file which uses any of the @ical{} external call functions, variables, or macros. (Note that this file may not necessarily exist, or exist in the usual place; @command{ick} will deal with making sure the correct header file is included.) This will include @file{stdint.h} (a standard C header file, which must exist on your system), so that you can access @ical{} variables (the @ical{} types onespot, twospot, tail, hybrid correspond to the C types uint16_t, uint32_t, uint16_t*, uint32_t* respectively); also, it will provide the prototypes for all the functions and definitions for all the macros needed to use the external calls system with C. @item ICK_EC_FUNC_START @itemx ICK_EC_FUNC_END @findex ICK_EC_FUNC_START @findex ICK_EC_FUNC_END Many of the @ical{} interface macros (@code{ick_linelabel}, @code{ick_comefrom}, and @code{ick_nextfrom}) make it possible to jump from an @ical{} program to a C program. Because C doesn't allow jumping into the middle of a function, there has to be some way to create a block of code which @emph{can} be jumped into. This is what these two macros achieve. This declaration and definition: @example ICK_EC_FUNC_START(identifier) @{ /* code goes here */ @} ICK_EC_FUNC_END @end example is equivalent to this: @example void identifier(void) @{ /* code goes here */ @} @end example except that it is possible to jump from an @ical{} program into the declared and defined program. (If you need to write a prototype for the function early, @code{void identifier(void);} is perfectly acceptable, but an early prototype is not required unless you call the function from earlier within the C code.) Of course, you can substitute any identifier that's legal as a function name for @code{identifier} (as long as it doesn't start with @code{ick_} or @code{ICK_}). The resulting function is a function (for instance, you can take its address or call it in the usual ways); the only differences are that it can be jumped into from @ical{} code and that it is constrained to take no arguments and return no data. (It can still access global and @ical{} variables.) If the function is jumped into from @ical{} code, but then control flow reaches the end of the function, or the function @code{return;}s but was not called from C, the resulting behaviour is undefined; @cic{} will attempt to continue by some means at that point, but may fail. If a function is unsure whether it gained control from C or from INTERCAL code, it may use @code{ick_return_or_resume} (described below). Because you are not allowed to declare two C functions with the same name (even in different modules), all functions declared with @code{ICK_EC_FUNC_START} must have unique names across the entire compilation. @end table @node ick_startup @subsection ick_startup @findex ick_startup @cindex startup code, C It is sometimes necessary for a C program to do its own initialisation before the INTERCAL program starts running. To do so, it can use the @code{ick_startup} macro inside a function declared with @code{ICK_EC_FUNC_START}; the syntax is @code{ick_startup(block)}, where the argument is an expression, statement, or compound statement to run. The argument itself must not contain any ick_-prefixed macros or functions except possibly ick_create, may have side effects, and must fit the C preprocessor's idea of what a macro argument should look like (it's more used to parsing expressions than blocks; the general rule is to avoid commas except when they're directly or indirectly inside parentheses or strings). @node ick_linelabel @subsection ick_linelabel @findex ick_linelabel @cindex line labels, C A line label is something that can be @code{NEXT}ed to and @code{COME FROM}. Unlike an @ical{} line label, it does not label a statement, and therefore attempts to @code{ABSTAIN} or @code{REINSTATE} it may be errors, or may be ignored (it's unspecified which, which means that either may happen for any or no reason, but exactly one will happen in any given case, although the choice might not be consistent). The macro @code{ick_linelabel(expression);} may appear anywhere a compound statement would normally be able to appear. (That is, it looks like a function call being used as a standalone expression, but in fact the places where it can appear are more limited.) In contrast to ordinary line labels, an expression can be used rather than just a constant; however, the behaviour is undefined if the expression has side-effects. Upon encountering the line label, any @code{COME FROM}s or @code{NEXT FROM}s aiming at the line label (including @code{ick_comefrom}s and @code{ick_nextfrom}s) will steal control from the program; @code{RESUMING} after a @code{NEXT FROM} will work, but suffers from the same caveats as setjmp/longjmp do (any auto variables that change their value between the @code{NEXT FROM} and @code{RESUME} will have their value clobbered (i.e. their value is no longer reliable and should not be accessed)). Note that the @ical{} variables are immune to this problem. You can also avoid the problem by marking variables as @code{volatile} in the C program. It is possible to @code{NEXT} or @code{ick_next} to a @code{ick_linelabel}, which has the same effect as saving the @code{NEXT} stack, calling the function containing the @code{ick_linelabel} and then immediately doing a C @code{goto} to an imaginary label preceding it. Due to this possibility, an @code{ick_linelabel} is only allowed within a function defined with @code{ICK_EC_FUNC_START}. @node ick_labeledblock @subsection ick_labeledblock @findex ick_labeledblock @cindex labeled blocks @cindex blocks, labeled In @ical{} programs, labels don't stand on their own, but instead label a statement. The difference between a standalone line label and a line label that labels a statement is that @code{COME FROM}s will come from the @emph{label itself} (which is before the next statement) when aiming at a standalone line label, but the @emph{end of the statement} when aiming at a labeled statement. To achieve the same effect in C, the macro @code{ick_labeledblock} is available; it can be used as @code{ick_labeledblock(expression,expression)} or @code{ick_labeledblock(expression,statement)}; the first argument is the label, and the second argument is an expression or statement to label (if an expression is labeled, it will be converted to a statement that evaluates it for its side effects and discards the result). It is even permitted to label a block statement in this way. Note, however, that you have to contend with the C preprocessor's ideas of where macro arguments begin and end when doing this. Other than the position of the @code{COME FROM} target created by the label, this behaves the same way as @code{ick_linelabel} (so for instance, computed line labels are allowed, but the expression that computes them must not have side effects, and it is only allowed within a function defined with @code{ICK_EC_FUNC_START}). @node ick_comefrom and ick_nextfrom @subsection ick_comefrom and ick_nextfrom @findex ick_comefrom @findex ick_nextfrom @cindex COME FROM, in C @cindex NEXT FROM, in C The @code{ick_comefrom} and @code{ick_nextfrom} macros are, like the other @ical{} flow control macros (as opposed to functions), only allowed within a function defined with @code{ICK_EC_FUNC_START}. They act almost exactly like the @ical{} statements of the same name (although note that C statements cannot be @code{ABSTAIN}ed @code{FROM} even if they act the same way as @ical{} statements); they are written as @code{ick_comefrom(expression);} and @code{ick_nextfrom(expression);} respectively (note that they must be called as statements, and cannot be used as part of an expression). Whenever a standalone line label is encountered whose expression evaluates to the same number as the expression inside the @code{ick_comefrom} or @code{ick_nextfrom}, and that number is at most 65535, then control will be transferred to the @code{ick_comefrom} or @code{ick_nextfrom}, leaving a @code{NEXT} stack entry behind in the case of @code{ick_nextfrom}; likewise, if the end of a labeled statement, expression or block is reached and the label has the right number. Some caveats: the expression need not be constant, but must not have side effects, must not be negative, and must fit into the range of an @code{unsigned long} in the C program (and the statement will do nothing if the expression evaluates to a value larger than 65535). In keeping with the best C traditions, these caveats are not checked, but instead result in undefined behaviour if breached. @findex ick_comefromif @findex ick_nextfromif There are also versions @code{ick_comefromif} and @code{ick_nextfromif}, which take a second parameter, which is a condition that specifies whether control is actually stolen from the target. The condition may have side effects, and is only run when the line numbers match; it should return 0 or NULL to leave control flow alone, or nonzero to steal control, and should be either an integral type or a pointer type. Although side effects are allowed, the condition must not look at or alter @code{auto} or @code{register} variables in the enclosing function, not even if they are also marked @code{volatile}. (Global and @code{static} variables are fine, though.) @node ick_next @subsection ick_next @findex ick_next @cindex NEXT, in C @code{ick_next} is a macro that acts like the @ical{} statement @code{NEXT}. Contrary to the other @ical{}-like macros, it can be used in any function regardless of whether it was defined with @code{ICK_EC_FUNC_START}; however, it must still be used as a statement by itself, and a call to it looks like @code{ick_next(expression);}. The expression is the label to @code{NEXT} to, and works under the same rules as the expressions for @code{ick_comefrom}; it need not be constant (unlike in @cic{}!), but must not have side effects, must not be negative, must fit into the range of an unsigned long, and is ignored if it is over 65535. If there happen to be multiple labels with the correct value at the time, the compiler will @code{NEXT} to one of them. Bear in mind that there is a limit of 80 entries to the @code{NEXT} stack, and that this limit is enforced. If the resulting @code{NEXT} stack entry is @code{RESUME}d to, the program will continue after the @code{ick_next} as if via @code{setjmp}, with all the usual restrictions that that entails; if the resulting @code{NEXT} stack entry is forgotten, then the @code{ick_next} call will never return. (Note that the 'as if via setjmp' condition allows you to preserve the vales of @code{auto} and @code{alloca}-allocated storage as long as its value has not changed since the @code{ick_next} was called, which is a significantly more lenient condition than that normally imposed on such variables (@pxref{External Calls and auto}).) @node ick_resume @subsection ick_resume @findex ick_resume @cindex RESUME, in C @code{ick_resume} is a macro, but there are few restrictions on its use; it is permitted to use it inside an expression (but it returns void, making this not particularly useful), and acts like a function which takes an unsigned short argument, returns void, and has a prototype (but you cannot take its address; if you need to be able to do that, write a wrapper function for it). It can be used within any function regardless of how it was declared, and never returns; instead, it pops the specified number of @code{NEXT} stack entries and resumes execution at the last one popped, just as the @ical{} statement does. This causes the same errors as the @ical{} statement if the number of entries popped is zero or larger than the @code{NEXT} stack. @findex ick_return_or_resume There is also a macro @code{ick_return_or_resume();}; it can only be used inside a function defined with @code{ICK_EC_FUNC_START}, and is equivalent to @code{return;} if the function was called from C, or @code{ick_resume(1);} if the function was called from @ical{}. It's therefore a safe way to return from such a C function if you don't know how control reached it in the first place. @node ick_forget @subsection ick_forget @findex ick_forget @cindex FORGET, in C The @code{ick_forget} macro removes @code{NEXT} stack entries, and the corresponding C stack entries. It must be called as a statement by itself, and its invocation looks like this: @code{ick_forget(expr);}, where the expression is the number of @code{NEXT} stack entries to forget (all of them will be forgotten if the number is higher than the number of entries). The expression will be casted to an @code{unsigned short}. @code{ick_forget} can only be used inside a function declared with @code{ICK_EC_FUNC_START}. As it is removing stack entries both in @ical{} and in C, it will clobber the value of all @code{auto} variables created since the highest remaining @code{NEXT} stack entry came into being (or since the start of the program, if the @code{NEXT} stack is emptied by the command) and also deallocate all @code{alloca} storage allocated since then. It also causes the return address of the current function to become undefined, so that function must not return; control may leave it via @code{RESUME}, or via @code{COME FROM}, or via @code{NEXT} or @code{NEXT FROM} followed by the relevant @code{NEXT} stack entry being forgotten (the function is still 'running' but suspended while the @code{NEXT} stack entry still exists). (Note that these restrictions are stronger than those on @code{RESUME}; this is because @code{RESUME} preserves most of the stack, but @code{FORGET} destroys parts of the stack and therefore cannot avoid destroying the data stored there. It could be much worse; a previous (never released) version of the code didn't remove those parts of the stack in many circumstances, leading to a stack leak that caused programs to segfault after a while.) @node ick_get/setone/twospot @subsection ick_get/setone/twospot @findex ick_getonespot @findex ick_setonespot @findex ick_gettwospot @findex ick_settwospot @cindex variables, from C This class of four functions make it possible to get and set @ical{} scalar variables from C code. Their prototypes are as follows: @example uint16_t ick_getonespot(unsigned short varnumber); void ick_setonespot(unsigned short varnumber, uint16_t newvalue); uint32_t ick_gettwospot(unsigned short varnumber); void ick_settwospot(unsigned short varnumber, uint32_t newvalue); @end example The program will error out with a fatal error (@pxref{E200}) if the variable you request is mentioned nowhere in the @ical{} program; if you attempt to set an @code{IGNORE}d variable, the attempt will silently fail (just as if you assigned to it in an @ical{} program). The get functions are safe to use in a computed line label, so you can use them to produce computed line labels that depend on @ical{} variables. (@code{uint16_t} and @code{uint32_t} are standard C data types; if your system doesn't provide them, get better system header files.) If you care about speed, note that .1 is the fastest variable of all to access, and otherwise variables first mentioned near the top of the @ical{} program will be faster to access than variables mentioned lower down. @node ick_create @subsection ick_create @cindex CREATE, in C @cindex C, CREATE The @code{ick_create} function (prototype: @code{void ick_create(char*, unsigned long)}) allows the external calls system to be used to create new @ical{} syntax; to do this, you give a `signature' representing the syntax you want to define and a line number to the function (which are its two arguments, respectively). The signature defines the syntax that you are defining; whenever that syntax is encountered within the @ical{} program, it will @code{NEXT} to the line number you specify, which can do various clever things and then @code{RESUME} back to the @ical{} program (or if you're defining a flow-control operation, you might want to leave the @code{NEXT} stack entry there and do other things). However, note that the overloading of @code{:1601}, etc.@:, will still take place as in the @ical{} version of @code{CREATE} if the @option{-a} option is used (@pxref{-a}), so care is needed when writing flow control statements that they work both with and without the option and don't cause @code{STASH} leaks (which means no @code{FORGET}ting the relevant @code{NEXT} stack entry, and no looking at 1600-range variables). This allows the external calls system to define whole new @ical{} commands, with the same power as any other programming language. There are various restrictions on what syntax you can @code{CREATE} with this method, which are best explained by an explanation of the relevant @cic{} compiler internals. When an @ical{} program is compiled by @cic{}, any unrecognised statements it comes across are compiled by a `just-in-case' compiler that attempts to compile them anyway with no knowledge of their syntax, just in case the syntax becomes defined later. (E000 (@pxref{E000}) will be thrown when such statements are encountered at runtime, unless the syntax has been @code{CREATE}d since to give a statement a meaning.) For the just-in-case compiler to run, the resulting statement must be completely unrecognised; this means that it may contain no keywords (not even a sequence of letters that forms a keyword, such as @code{FROM} or @code{DO}), it must consist only of variable names, expressions, and capital letters other than @samp{V} (because @samp{V} is a unary operator, so otherwise there would be ambiguity), and in which any two variable names or expressions are separated by at least one capital letter. The compiler will produce a `signature' for the unknown command that can be defined. @cindex signatures @cindex CREATE, signatures A signature consists of a sequence of characters (and is represented as a null-terminated string; the runtime makes a shallow copy of the string and keeps it until the end of the program, so arrangements must be made to ensure that the storage in which the string is allocated stays around that long, but this opens up interesting possibilities in which the signature that was actually @code{CREATE}d can be modified retroactively); whitespace is not allowed in a signature. Capital letters can be used (apart from @samp{V}), and match the same capital letters literally in the @ical{} syntax being created; also available are the special characters @samp{.,;~}, which match respectively a scalar variable (a onespot or twospot variable such as @code{:1}), an array variable (such as @code{;2}), an array element (such as @code{,3 SUB #4 #5}), and an expression that isn't a variable name and isn't an array element (such as @code{.4$.5}). If you want to be able to match other things (say, to be able to match all expressions), you will need to submit multiple signatures using multiple calls to @code{ick_create}; maybe you could write a library to do that automatically. @code{CREATE}d operators also have signatures, but of quite a different form. The signature for a single-character operator is a lowercase u, followed by its character code in hexadecimal (no leading zeros, and in lowercase); the signature for an overstrike is a lowercase o, followed by the lower relevant character code in hexadecimal, followed by a lowercase x, followed by the higher relevant character code in hexadecimal. The routine that is @code{NEXT}ed to will presumably want to be able to see what in the @ical{} program was matched by the signature, so a range of function-like macros is provided to access that. They must be run from within the invocation of the function which was @code{NEXT}ed into by the created syntax (@pxref{External Calls and auto} for when a function invocation ends, which could be sooner than you think when the @cic{} external calls system is used), and are undefined behaviour when that invocation did not gain control from a @code{CREATE}d statement. Here are their effective prototypes: @example int ick_c_width(int); int ick_c_isarray(int); unsigned short ick_c_varnumber(int); uint32_t ick_c_value(int); /* These require -a to work */ uint32_t ick_c_getvalue(int); void ick_c_setvalue(int, uint32_t); @end example The first argument to all these macros is the position of the match in the signature (0 for the first non-capital-letter match in the signature, 1 for the second, and so on until no more items are left in the signature to match); specifying a position that isn't in the signature is undefined behaviour. @code{ick_c_width} returns the data type, as a width in bits, of the expression (or the width in bits of an element of the passed in array), and @code{ick_c_isarray} returns 1 if the argument was an array variable or 0 if it was an expression (array elements and scalar variables are expressions). @code{ick_c_varnumber} returns the variable's number (for instance 123 for @code{.123}), or 0 if the corresponding argument was not a variable; in the cases where the argument was a variable, these three functions together provide enough information to figure out which variable (which is useful if you're writing an extension which takes a variable name as an argument). @code{ick_c_value} returns the value of the corresponding expression at the time the @code{CREATE}d command was called; @code{ick_c_getvalue} is almost equivalent, but only works if the @option{-a} option (@pxref{-a}) was used during compilation, and returns the value of the corresponding expression now. (The uint32_t return type is large enough to hold either a onespot or twospot value, and will be zero-extended if the corresponding expression had onespot type.) @code{ick_c_setvalue} also depends on @option{-a}, and will assign to the corresponding expression (be careful not to provide a value that is too large for it!@:). In the case that the corresponding expression is not a variable, this will attempt to perform a reverse assignment to the expression, and can produce ordinary @ical{} errors if it fails. It is not possible to redimension an array this way, as this is assignment, not a calculate operation. @node External Calls and auto @subsection External Calls and auto @cindex auto @cindex alloca @cindex external calls, and auto @cindex C, auto/alloca Because the external calls system merges the @ical{} @code{NEXT} stack with the C return value and data storage stack (note for pedants: the C standards nowhere mandate the existence of such a stack, or even mention one, but the restrictions stated in them imply that implementations have to act as if such a stack existed, because of the way the scoping rules and recursion work), the external calls system therefore has severe effects on data that happens to be stored there. (In @ical{} terms, imagine what would happen if data could be stored on the @code{NEXT} stack; if C used the more sensible system of having a @code{STASH} for each variable, these problems would never occur in the first place, instead causing an entirely different set of problems.) Similar considerations apply to the common nonstandard C extension @code{alloca}, which dynamically alters the size of the stack; also, in what goes below, @code{register} variables should be considered to be @code{auto}, because the compiler may choose to allocate them on the stack. Theoretical considerations would lead one to conclude that variable-length arrays should obey most of the same restrictions; in practice, though, it's unwise to attempt to mix those with @ical{} code at all, except by separating them into separate functions which aren't flagged with @code{ICK_EC_FUNC_START} and use no @code{ick_}-prefixed identifiers, even indirectly. (They may cause a compile to fail completely because they don't mix well with @code{goto}.) In the description below, @ical{} commands should be taken to include the equivalent C macros. @code{NEXT}/@code{NEXT FROM} paired with @code{RESUME} have the least effect, and the most obvious effect, on @code{auto} variables in the function that was @code{NEXT}ed from, which is the same effect that the standard C function @code{longjmp} has. That is, @code{alloca} storage stays intact, and @code{auto} variables have their values `clobbered' (that is, their value is no longer reliable and should not be used) if they changed since the corresponding @code{NEXT} and are not marked as @code{volatile}. (This is a very easy restriction to get around, because changing the values of such variables is quite difficult without using statically-allocated pointers to point to them (a dubious practice in any case), and @code{volatile} is trivial to add to the declaration.) @code{COME FROM} has more restrictions; it deallocates all @code{alloca} storage in the function that was @code{COME FROM}, and functions that called it or that called functions that called it, etc.@:, using C calls (as opposed to @code{NEXT}), and those invocations of the functions will cease to exist (thus destroying any @code{auto} variables in them), even in the case of @code{COMING FROM} a function into the same function. @code{auto} variables in the function that is come into will start uninitialised, even if initialisers are given in their declaration, and it will be a `new' invocation of that function. (It is quite possible that the uninitialised values in the @code{auto} variables will happen by chance to have the values they had in some previous invocation of the function, though, because they are likely to be stored in much the same region of memory; but it is highly unwise to rely on this.) Note that @code{volatile} will not help here. Observant or source-code-reading readers may note that there is a mention of an @code{ick_goto} in the source code to @cic{}; this is undocumented and this manual does not officially claim that such a macro exists (after all, if it did, what in @ical{} could it possibly correspond to?), but if such a macro does exist it obeys the same restrictions as @code{COME FROM}. @code{FORGET} is the worst of all in terms of preserving data on the stack; it deallocates @code{alloca} data and clobbers or deletes @code{auto} variables in all function invocations that have come into existence since the @code{NEXT} that created the topmost remaining @code{NEXT} stack entry was called, or since the start of the program if the @code{NEXT} stack is emptied, and the current function will continue in a new invocation. @code{volatile} is useless in preventing this, because the relevant parts of the stack where the data were stored are deleted by the command (that's what @code{FORGET} does, remove stack). If any of these data are required, they have to be backed up into static storage (variables declared with @code{static} or global variables), or into heap storage (as in with @code{malloc}), or other types of storage (such as temporary files) which are not on the stack. (Incidentally, suddenly deleting parts of the stack is excellent at confusing C debuggers; but even @code{RESUME} and @code{COME FROM} tend to be sufficient to confuse such debuggers. More worrying is probably the fact that the C standard provides a portable method for deleting the stack like that, and in fact the external calls runtime library is written in standard freestanding-legal C89 (with the exception of @option{+printflow} debug output which requires a hosted implementation), meaning that in theory it would be possible to split it out to create an implementation of a C-plus-COME-FROM-and-NEXT language, and doing so would not be particularly difficult.) Note that @ical{} variables are not stored on the C stack, nor are any of the metadata surrounding them, and so are not affected unduly by control flow operations. @node External Calls to Funge-98 @section External Calls to Funge-98 @cindex .b98 @cindex external calls, Funge @cindex external calls, Befunge @cindex Funge @cindex Befunge @portability{no, version 0.29+, no, no} @cic{} supports linking @ical{} programs with Funge-98 programs (to be precise, only Befunge-98 programs are currently supported). However, it does not ship with a Funge-98 interpreter, and such an interpreter needs to be linked to the resulting program in order to run the Befunge program. Therefore, you need to convert a third-party Funge-98 interpreter to a library usable by @cic{} before you can use this part of the external calls system (@pxref{Creating the Funge-98 Library}); however, this only has to be done once. Once the library has been created, you can link an @ical{} program with a Befunge-98 program by invoking @command{ick} like this: @example ick -e intercalprogram.i befungeprogram.b98 @end example You can link no more than one Befunge-98 program at once (just like you can link no more than one @ical{} program at once). Also, the @ical{} program must come first on the command line. It is legal to link @ical{}, C, and Befunge-98 simultaneously; however, the identifiers used in the third-party Funge-98 interpreter have not been mangled to avoid collisions, and therefore problems may be caused if the C program uses the same identifiers as the Funge-98 interpreter. @menu * Creating the Funge-98 Library:: How to create the Funge-98 library. * The IFFI Fingerprint:: External calls from Funge's view. @end menu @node Creating the Funge-98 Library @subsection Creating the Funge-98 Library @cindex libick_ecto_b98.a @cindex Funge, installing @cindex Befunge, installing @cindex libraries, Funge @cindex libraries, Befunge Before external calls to Funge-98 can be used, the relevant library must be compiled. (After the library has been compiled, then you will need to reinstall @cic{}; however, you will not need to recompile @cic{}.) At present, only the cfunge Funge-98 interpreter (@uref{https://launchpad.net/cfunge/+index}) can be converted into a library suitable for use by @cic{}; also, doing this is only supported on POSIX systems (although if someone gets it to work on DOS/Windows, the author of this manual would be interested to hear about it). Also, a source-code distribution (rather than a binary distribution) is needed. One way to obtain the latest cfunge sources is via the bzr version-control system, using the following command (correct as of the time of writing, but as always, links can become dead): @example bzr branch lp:cfunge @end example (As a licensing note, note that cfunge is licensed under the GNU General Public licence version 3, whereas @cic{} is licensed under version 2 and all later versions of that licence; although these terms are obviously compatible with each other, you must ensure yourself that your program has appropriate licensing terms to allow a GPLv3 library to be linked to it.) Once you have downloaded the cfunge sources, you need to compile them into a library suitable for use with @cic{} (note that this is a somewhat different process to compiling them into a standalone Funge-98 interpreter). There is a script provided in the @cic{} distribution to do this, @file{etc/cftoec.sh}. It must be run in the @file{etc} subdirectory of the @cic{} distribution (i.e. the directory the script itself is in), and must be given the path to the root directory of the cfunge source distribution (that is, the directory that contains the @file{src}, @file{lib} and @file{tools} subdirectories of that distribution) as its only argument. Note that it may give some compiler warnings on compilation; my experience is that warnings about C99 inlining can be safely ignored (they reflect a deficiency in @command{gcc} itself that luckily seems to be irrelevant in this case), but other warnings may indicate problems in the exact versions of the sources that you downloaded (and errors definitely indicate such problems). Once the library has been created, it will appear as the new file @file{lib/libick_ecto_b98.a} in the @cic{} distribution (the cfunge distribution will be left unchanged); reinstalling @cic{} will install this file to its proper location. (It is also in a valid location to be able to be run if you aren't installing @cic{} but instead just running it from the distribution's directory.) @node The IFFI Fingerprint @subsection The IFFI Fingerprint @cindex IFFI @cindex fingerprint @cindex external calls, from Funge's view @cindex Funge, fingerprint @cindex Befunge, fingerprint @i{This section will not make much sense to a non-Funge programmer; therefore, if you are not used to Funge, you probably want to skip it.} To a Funge program, the external calls interface is accessed via a Funge-98 'fingerprint' defined by the interpreter. The name of the fingerprint is 0x49464649, or as text, @samp{IFFI}. When a program formed by linking @ical{} and Befunge-98 is run, the first thing that happens is some internal @ical{} initialisation which is not visible to either program, and then initialisation routines specified in the Befunge-98 program run (if an initialisation routine is also specified in a linked C program using ick_startup, it is unspecified whether the C or Befunge-98 initialisation happens first.) In the Befunge program, the initialisation routine consists of everything that happens until the @samp{Y} command in the @samp{IFFI} fingerprint is run; the author of the Funge-98 must load the @samp{IFFI} fingerprint themselves during this initialisation to access that command. (This is so that the Befunge program ends up complying with the Funge-98 standard; commands not defined in that standard cannot be used until a fingerprint is loaded.) During initialisation, no commands from the @samp{IFFI} fingerprint may be used except @samp{Y} and @samp{A}. (If a different command is used, @samp{C}, @samp{M}, and @samp{X} remove the arguments they would use from the stack (if any) but otherwise do nothing, and the other commands in the @samp{IFFI} fingerprint reflect.) After the @samp{Y} command is called, the @ical{} program starts running; in order for the Befunge program to regain control, it has to be @code{NEXT}ed to from the @ical{} program, or @code{COME} or @code{NEXT FROM} the @ical{} program, or contain the line label to which syntax in the @ical{} program was @code{CREATE}d. (In other words, the normal @ical{} ways of transferring information between parts of a program.) In order to do this, therefore, line labels and @ical{} control flow statements must be placed into the Befunge program. @cindex marker @cindex Funge, marker @cindex Befunge, marker Code like @code{COME FROM (100)} is a single statement in @ical{}, but several statements in Funge-98; therefore, some method of telling the interpreter where to start executing to look for @code{COME FROM}s, @code{NEXT FROM}s, and line labels is needed. The method used by @cic{} is that of the 'marker'; a marker is represented by character 0xB7 (a mid-dot in Latin-1) in the input Funge-98 program, but is transformed to a capital @samp{M} by @command{ick}. (The reason for using a special character for a marker and transforming it rather than just using @samp{M} is to prevent occurences of @samp{M} in comments and string literals, etc.@:, having an effect on the control flow of the program.) Whenever a @code{NEXT} or line label is encountered (in the @ical{} program, the Funge program or elsewhere), the Funge program is executed starting from each marker in each cardinal direction to look for line labels or @code{COME}/@code{NEXT FROM}s respectively. Therefore, @code{COME FROM (100)} is written in Funge-98 as @code{Maa*C} (where the M is a marker in the source code), and likewise the line label @code{(100)} would be written as @code{Maa*L}. (This code can be written in any cardinal direction, that is left to right, top to bottom, right to left, or bottom to top, but not diagonally or flying.) There are likely to be unused directions from markers, which will be evaluated too; you can (and must) close these off by reflecting code execution back into that marker, another marker, or a non-marker @code{M}. Note also that a marker remains in Funge-space even if the @code{M} on the same square is deleted (the marker itself is not visible to the @code{g} command, though). Here are the commands in the @samp{IFFI} fingerprint: @cindex IFFI, commands @table @code @item A @cindex CREATE, in Funge This command pops a line number and then an 0"gnirts"-format string from the stack; they are used as the line number and signature to @code{CREATE} syntax in the @ical{} program; for details of the format of the signature, see @ref{ick_create}. Although using this command during speculative execution works, doing so is not recommended; if the target line number for @code{CREATE}d syntax is changed during speculative execution to find the line that that syntax corresponds to, its effect is delayed until after the original line is found and execution continues from that point. (Side effects during speculative execution are never recommended, because they might or might not be optimised away.) @item C @cindex COME FROM, in Funge During speculative execution to find @code{COME FROM}s and @code{NEXT FROM}s, pops a line label off the top of the stack and does a @code{COME FROM} that location. During speculative excution to find line labels, pops the top of the stack and ends that particular speculative execution as a failure. When not doing speculative execution, pops and discards the top element of the stack. @item D This command must only be used when the Funge program is executing a @code{CREATE}d command, and allows access to the arguments that command has. It pops an integer off the top of the stack, and treats it as an argument position (0-based, so 0 refers to the first argument, 1 refers to the second, and so on). Note that providing an invalid argument number, or running this command when not implementing a @code{CREATE}d command, leads to undefined behaviour (possibly a reflection, possibly a segfault, possibly worse). The command pushes information about the argument chosen onto the stack; the following information is pushed from bottom to top: @itemize @item The data type of the argument, in bits (16 if the argument was a onespot variable or expression of onespot type, and 32 if the argument was a twospot variable or expression of twospot type). Note that this is under the @cic{} typing rules, rather than the @icst{} typing rules (that is, select's type is always that of its right argument no matter how many bits are actually selected). @item 1 if the argument is an array variable, 0 if it is a scalar value. @item 0 if the argument is not a variable, or the variable's number if it is (e.g.@: @code{.123} would push 123 here, but @code{.1~.2} would push 0). @item The argument's value at the time that the @code{CREATE}d instruction was called. @item The argument's value now, or alternatively a repeat of the previous stack element if @option{-a} (@pxref{-a}) was not used. (Without @option{-a}, the information needed to re-evaluate the expression is not available.) @end itemize @item F @cindex FORGET, in Funge During speculative execution, this command reflects; otherwise, this command pops an integer from the top of stack, and @code{FORGET}s that many @code{NEXT} stack entries (or all of them if the argument given is negative). @item G @cindex variables, Funge, accessing This command pops an integer from the top of stack. If it is positive, the value of the onespot variable whose name is the popped integer is pushed onto the stack; if it is negative, the value of the twospot variable whose name is minus the popped integer is pushed onto the stack; and if it is zero, the command reflects. If the referenced variable is not in the @ical{} program at all, this causes an @ical{} error due to referencing a nonexistent variable. @item L @cindex line label, in Funge During speculative execution to find @code{COME FROM}s and @code{NEXT FROM}s, this command pops and discards the top stack element, then ends that speculative execution. During speculative execution to find a line label, this command pops an integer from the top of stack and succeeds with that integer as the line label (that is, it is possible to @code{NEXT} to an @code{L} in the Funge program if a marker, followed by code to push the correct line number onto the stack, precedes that @code{L}). When not doing speculative execution, the integer on the top of the stack is used as a line label (assuming it is in the range 1--65535, otherwise it is popped and discarded), and a search is made for @code{COME FROM}s and @code{NEXT FROM}s aiming for that line label (including in the @ical{} program and the Befunge program itself, as well as programs in any other language which may be linked in). Note that just as in @ical{}, it is possible to @code{NEXT} to a line label which has a @code{COME FROM} aiming for it, in which case the @code{COME FROM} will come from that line label as soon as the @code{NEXT} transfers control to it. @item M Does nothing if not in speculative execution, or ends the current speculative execution with failure. (This is so that code like @example v >M5C ^ @end example does exactly the same thing as @code{COME FROM (5)}, even when, for instance, it is entered from the left in the Funge program, rather than gaining control from the line label @code{(5)}.) @item N @cindex NEXT, in Funge During speculative execution, reflects. Otherwise, pops the top stack element, interprets it as a line label, and @code{NEXT}s to that line label (this may start speculative execution to look for line labels, but might not if it isn't needed, for instance if the line label in question is in the @ical{} program or in a C program linked to the Befunge program). @item R @cindex RESUME, in Funge During speculative execution, reflects. Otherwise, pops the top stack element, removes that many items from the @code{NEXT} stack, and @code{RESUME}s at the last item removed. (If the top stack element was zero, negative, or too large, this will cause a fatal error in the @ical{} program.) @item S @cindex variables, Funge, setting Pops a variable number (interpreted as onespot if positive, or minus the number of a twospot variable if negative) and an integer from the stack, and sets the referenced variable to the integer. This reflects if an attempt is made to set the nonexistent variable 0, causes a fatal error in the @ical{} program if an attempt is made to set a variable that doesn't exist there, and does not set read-only variables (but pops the stack anyway). If the integer is too high for the variable it is being stored in, only the least significant 16 or 32 bits from it will be used; and likewise, if it is negative, it will be treated as the two's complement of the number given. @item V Pops a @code{CREATE}d argument index and an integer from the top of stack. (This is undefined behaviour if not in the implementation of a @code{CREATE}d statement, or if the referenced argument does not exist; as with the @code{D} instruction, 0 refers to the first argument, 1 to the second, and so on.) If the @option{-a} option is not used, this command does nothing; otherwise, the value of the argument will be set to the integer. (This involves doing a reverse assignment if the argument is a non-variable expression, as usual, and causes a fatal error in the @ical{} program if the reverse assignment is impossible or an attempt is made to assign a scalar to an array.) @item X @cindex NEXT FROM, in Funge This is identical to @code{C}, except that it does a @code{NEXT FROM} rather than a @code{COME FROM}. @end table As with external calls to C, terminating any program involved (whether the @ical{} program with @code{GIVE UP}, the Befunge program with @code{@@} or @code{q}, or a C program with @code{exit()}) causes all programs involved to terminate, and likewise a fatal error will end all programs with an error. One final point which is probably worth mentioning is that flow control instructions only record the IP's position and direction, nothing else; so for instance, if the stack is modified in one part of the code, those modifications will remain even after a @code{RESUME}, for instance. @node Miscellaneous External Calls @section Miscellaneous External Calls @cindex external calls, miscellaneous @cindex miscellaneous external calls @cindex libraries, external calls @cindex external calls, libraries @cindex C99 @cindex C11 @cindex external calls, C99 @cindex external calls, C11 @portability{no, version 0.29+, no, no} It is possible to specify other information to the external calls system by using the filename list after all the options are given. To be precise, certain filename patterns are recognised and used to change the options that are used to compile the externally-called files. The @samp{.c99} extension is treated identically to @samp{.c}, except that it causes the file with that extension to be preprocessed as C99 (the more modern version of the C standard, the older C89 is more common), and that all C files involved will be compiled and linked as C99. (This corresponds to @option{-std=c99} in @command{gcc}.) Likewise, the @samp{.c11} extension can be used to indicate C11. The @samp{.a} extension indicates that an object-code library should be linked in to the final program. This is most commonly used to link in the maths library @file{libm.a} and other such system libraries. If the filename is of the form @samp{lib*.a}, then the file will be searched for in the standard directories for libraries on your system, and also where the @cic{} libraries are stored (which may be the same place); otherwise, the current directory will be searched. (Specifying @file{libm.a} on the command line corresponds to passing @option{-lm} to @command{gcc}.) @node Using External Calls @section Using External Calls @cindex using external calls @cindex external calls, using Whatever language your source files are written in, when @option{-e} is used (@pxref{-e}), the compiler will go through much the same steps. First, the @ical{} program specified is compiled into a C program that uses the @ical{} external call conventions for its control flow operations. The resulting @samp{.c} file will be left behind in the same directory (even if @option{-g} isn't used); if you look at it, you'll see the @code{#include } line, and the other hallmarks of an external call program (for instance, @ical{} @code{NEXT}s will translate into slightly modified @code{ick_next}s; the modification is simply to allow the correct line number to be displayed in case of error). After that, the resulting files are preprocessed twice. First, the C preprocessor is run on the files; then, a special @cic{} `preprocessor' is run on the files. (`Preprocessor' is a bit of a misnomer here, as it's near the end of the compilation process; `postprocessor' would likely be more accurate, or maybe `interprocessor'.) Its job is to fix line labels between the gotos that are used to implement jumping into the middle of a C function, to assign unique numbers to things that need them, and to keep track of which functions need to be checked for line labels and for @code{COME FROM}s and @code{NEXT FROM}s. The resulting file will have the extension @samp{.cio}; it is almost human-readable, especially if you run it through a C code indenter, and consists of C code (which might be a thin wrapper around some other language) and instructions to @command{gcc}. The @samp{.cio} file will be left behind for you to look at, if you like. Once the @samp{.cio} files have been produced, @command{gcc} is used to compile all the @samp{.cio} files and link them together into an executable; the executable will have the same name as the @ical{} source, minus any extension (and on DJGPP, assuming that its version of @command{gcc} could handle the resulting command line (not necessarily guaranteed), a @samp{.exe} extension is added), and will consist of all the C files linked together with the @ical{}. Any functions named @code{main} in the C files will be deleted; likewise, if there is a name clash between any two functions, the one in the file named earlier on the command line will be used. There is presumably some use for this feature, although I haven't figured out what it is yet. Extending this to other compiled languages is mostly a problem of determining how they fit into the @ical{} control structure, which is not a trivial task, and of figuring out how to link them to C code, which in some cases is trivial (especially if the language is one that @command{gcc} can compile!) and in other cases is very difficult. If anyone has any ideas of new languages that could be added to the external calls system, feel free to contact the current @cic{} maintainer with suggestions or patches. @node Expansion Libraries @section Expansion Libraries @cindex expansion libraries @cindex libraries @portability{no, version 0.28+, no, no} The @cic{} distribution comes with libraries that can be used to extend its capabilities; they are implemented using the external call mechanism, and are in effect standard files to include using that mechanism. To use an expansion library, give the @option{-e} option to @command{ick} (note that this means you cannot use them with the debugger or profiler, nor with multithreaded or backtracking programs), and specify the expansion library's name at the end of the command line (or to be precise, anywhere after the initial @ical{} file). The libraries themselves are written in C and have a @samp{.c} extension, and are human-readable; @cic{} will look for them in the same places as it looks for the system library (including in the current directory, so you can test your own expansion libraries without having to install them). Expansion libraries use C identifiers which start with the string @samp{ick_my_} (this is not used by the compiler, and is explicitly not affected by the prohibition on identifiers starting @samp{ick_} when writing an expansion library), and use line labels in the range (1600) to (1699). (Most programs will be avoiding this range anyway, because it's inside the (1000) to (1999) range reserved for the system library, but the system library doesn't use it, in much the same way that the identifiers used are inside the range reserved for the compiler, but the compiler doesn't use them.) Expansion libraries are available from @cic{} version 0.28; @clcic{} has a similar concept (that of `preloads'), but implemented a completely different way. @subheading syslibc @findex syslibc @cindex system library, in C @cindex C, system library @option{syslibc} is an implementation of the base-2 @ical{} system library in C (@pxref{System Libraries}); using it in programs running in other bases is accepted by the compiler, but likely to produce unpredictable results. When using this expansion library, you also need to give the @option{-E} option (@pxref{-E+,,-E}) so that the main system library is not included, or it will be used in preference to the expansion library. All documented features of the @ical{} base-2 system library are implemented, but most undocumented features are not, so @ical{} programs which relied on them (dubious behaviour in any case) will not work with @option{syslibc}. The main reason to use this library is to increase the speed of an @ical{} program; however, note that the speed gains in arithmetic will be accompanied by the performance penalty of using the external calls infrastructure, unless you were already using it. @subheading compunex @findex compunex @cindex computed NEXT @cindex NEXT, computed As an example of using @code{ick_create}, a very simple expansion library is provided to enable a computed NEXT capability, by defining a new command @code{COMPUNEX}. It is used as @code{DO .1 COMPUNEX} (allowing any expression in place of the .1), and is similar to an ordinary @code{NEXT}, but has two limitations: it takes up two @code{NEXT} stack entries, and the top one should not be @code{RESUMEd} past or forgotten (thus it isn't a particularly useful command, except maybe to produce the equivalent of something like function pointers). By the way, note that @cic{} avoids computed @code{NEXT} mainstream for much the same way that @clcic{} avoids @code{NEXT} altogether; it makes things too easy. This example is provided mostly just to demonstrate the syntax, and the care that needs to be taken with implementing flow control operators. @samp{compunex} is double-deprecated; an alternative is the following sequence of commands involving computed @command{CREATE}: @example DO CREATE .1 ABC DO ABC @end example This sequence emulates all features of @code{NEXT} (although it has different gerunds and is two statements, not one), making it much more useful for simulating computed @code{NEXT} than @code{COMPUNEX} is. (There's no need to avoid forgetting the return value; although this skips the @code{CREATE} cleanup, none is required because the created statement @code{ABC} (any other statement would do just as well) takes no arguments.) @node Differences to Other Compilers @chapter Differences to Other Compilers @cindex INTERCAL compilers The @cic{} compiler exists in a world of several other compilers. @subheading Differences to the Princeton compiler @cindex Princeton compiler The Princeton compiler was the first @ical{} compiler available, and compiled @icst{}. Using @command{convickt} (@pxref{convickt}) to translate its programs from the original EBCDIC to Latin-1 or Atari-syntax ASCII is required to run them under the @cic{} compiler, but apart from that there should be no problems; everything that that compiler can do can be reproduced by @cic{}, even including some of its bugs. The only potential problems may be where constructs were nonportable or dubious to begin with (such as the @code{IGNORE}/@code{RETRIEVE} interaction), or where commands intended to be syntax errors were used in the program but have a meaning in @cic{}. For extra portability, it's possible to use the @code{-t} compiler option to @command{ick} (@pxref{-t}) to tell it to interpret the program as @icst{}, but as @cic{}'s dialect of @ical{} is basically backward-compatible anyway this mostly serves to check newer programs for compatibility with older compilers. @subheading Differences to the Atari compiler @cindex Atari compiler The Atari compiler was an uncompleted implementation of @icst{}, optimistically pre-described in some 1982 additions to the original @icst{} manual. Despite the implementation's never actually existing, the documentation of the syntax provided a model for @cic{}. If any Atari 800 INTERCAL source code actually existed, there would be no need to use @command{convickt} on it. @subheading Differences to @jic{} @cindex J-INTERCAL The @jic{} compiler is an implementation of @ical{} written in Java that compiles @ical{} into Java (and so has a similar relationship with Java to that of the @cic{} compiler (which is written in C and compiles into C) with C). @jic{} has much the same feature set as older versions of @cic{}, with a few changes (such as the addition of Esperanto and error messages coming up in different situations). @jic{} programs should run fine on @cic{} without trouble (as it is also an Atari syntax compiler), except in nonportable cases such as @code{IGNORE}/@code{RETRIEVE} interaction. @subheading Differences to @clcic{} @cindex CLC-INTERCAL The @clcic{} compiler is the most modern @ical{} compiler apart from @cic{} (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 @cic{}, and is responsible for the origin of many of the features added in more recent versions of @cic{}. Generally speaking, a @clcic{} program that uses its advanced features is unlikely to run on @cic{}, or vice versa, whatever you do (apart from completely rewriting the more advanced parts of the program). 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 @clcic{} to @cic{}) or Atari syntax (if translating from @cic{} to @clcic{}), maybe using @command{convickt}, 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; @cic{} uses the options @option{-xX}, and on @clcic{} this is done by selecting the appropriate preloads, or by changing the program's file extension to @samp{.ci}. In each case other options may be needed to turn on various extensions (maybe @option{-m} or @option{-v} if translating to @cic{}, maybe the preload for gerund-based @code{COME FROM} if translating to @clcic{}), and if translating to @clcic{} you need to append the system library to your program yourself because @clcic{} doesn't load it automatically. 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}. 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 @code{IGNORE}/@code{RETRIEVE} interaction is one way to do this, as it differs between @cic{}, @jic{}, and @clcic{}. The other things to watch out for when doing this are that @clcic{} needs an explicit option to enable the use of @code{NEXT}, that @clcic{} doesn't load the system library itself (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 @clcic{}. @ifset notsplit @partheading{PART IV: APPENDICES AND INDICES} @end ifset @node Character Sets @appendix Character Sets @cindex character sets @cindex Atari, character set @cindex Baudot @cindex EBCDIC @cindex Latin-1 The following table explains the equivalences between the various character sets used for @ical{}: 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 @clcic{} versions, which are used by @ical{} 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-line tool to translate @ical{} programs from one format to another (@pxref{convickt}). 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. @multitable {@b{Atari}}{@b{Baudot}}{@b{EBCDIC}}{@b{Latin-1}} @headitem Atari @tab Baudot @tab EBCDIC @tab Latin-1 @item 09 @tab N/A @tab 09 @tab 09 @item 0a @tab * 02 @tab 0a @tab 0a @item 0d @tab * 08 @tab 0d @tab 0d @item 20 @tab * 04 @tab 40 @tab 20 @item 21 @tab 3 0d @tab 4f @tab 21 @item 22 @tab 3 11 @tab 7f @tab 22 @item 23 @tab 4 06 @tab 7b @tab 23 @item 24 @tab 4 01 @tab 4a @tab a2 @item 25 @tab 4 1c @tab 6c @tab 25 @item 26 @tab 3 1a @tab 50 @tab 26 @item 27 @tab 3 0b @tab 7d @tab 27 @item 28 @tab 3 0f @tab 4d @tab 28 @item 29 @tab 3 12 @tab 5d @tab 29 @item 2a @tab 4 09 @tab 5c @tab 2a @item 2b @tab 4 03 @tab 4e @tab 2b @item 2c @tab 3 0c @tab 6b @tab 2c @item 2d @tab 3 03 @tab 60 @tab 2d @item 2e @tab 3 1c @tab 4b @tab 2e @item 2f @tab 3 1d @tab 61 @tab 2f @item 30 @tab 3 16 @tab f0 @tab 30 @item 31 @tab 3 17 @tab f1 @tab 31 @item 32 @tab 3 13 @tab f2 @tab 32 @item 33 @tab 3 01 @tab f3 @tab 33 @item 34 @tab 3 0a @tab f4 @tab 34 @item 35 @tab 3 10 @tab f5 @tab 35 @item 36 @tab 3 15 @tab f6 @tab 36 @item 37 @tab 3 07 @tab f7 @tab 37 @item 38 @tab 3 06 @tab f8 @tab 38 @item 39 @tab 3 18 @tab f9 @tab 39 @item 3a @tab 3 0e @tab 7a @tab 3a @item 3b @tab 3 1e @tab 5e @tab 3b @item 3c @tab 4 0f @tab 4c @tab 3c @item 3d @tab 4 07 @tab 7e @tab 3d @item 3e @tab 4 12 @tab 6e @tab 3e @item 3f @tab 4 0c @tab 65 @tab a5 @item 40 @tab 3 19 @tab 6f @tab 3f @item 41 @tab 1 03 @tab c1 @tab 41 @item 42 @tab 1 19 @tab c2 @tab 42 @item 43 @tab 1 0e @tab c3 @tab 43 @item 44 @tab 1 09 @tab c4 @tab 44 @item 45 @tab 1 01 @tab c5 @tab 45 @item 46 @tab 1 0d @tab c6 @tab 46 @item 47 @tab 1 1a @tab c7 @tab 47 @item 48 @tab 1 14 @tab c8 @tab 48 @item 49 @tab 1 06 @tab c9 @tab 49 @item 4a @tab 1 0b @tab d1 @tab 4a @item 4b @tab 1 0f @tab d2 @tab 4b @item 4c @tab 1 13 @tab d3 @tab 4c @item 4d @tab 1 1c @tab d4 @tab 4d @item 4e @tab 1 0c @tab d5 @tab 4e @item 4f @tab 1 18 @tab d6 @tab 4f @item 50 @tab 1 16 @tab d7 @tab 50 @item 51 @tab 1 17 @tab d8 @tab 51 @item 52 @tab 1 0a @tab d9 @tab 52 @item 53 @tab 1 05 @tab e2 @tab 53 @item 54 @tab 1 10 @tab e3 @tab 54 @item 55 @tab 1 07 @tab e4 @tab 55 @item 56 @tab 1 1e @tab e5 @tab 56 @item 57 @tab 1 12 @tab e6 @tab 57 @item 58 @tab 1 1d @tab e7 @tab 58 @item 59 @tab 1 15 @tab e8 @tab 59 @item 5a @tab 1 11 @tab e9 @tab 5a @item 5b @tab 4 10 @tab 9e @tab 5b @item 5c @tab 4 05 @tab N/A @tab 5c @item 5d @tab 4 13 @tab 5a @tab 5d @item 5e @tab 4 0d @tab 6a @tab 7c @item 5f @tab 4 15 @tab 7c @tab 40 @item 60 @tab N/A @tab N/A @tab 60 @item 61 @tab 2 03 @tab 81 @tab 61 @item 62 @tab 2 19 @tab 82 @tab 62 @item 63 @tab 2 0e @tab 83 @tab 63 @item 64 @tab 2 09 @tab 84 @tab 64 @item 65 @tab 2 01 @tab 85 @tab 65 @item 66 @tab 2 0d @tab 86 @tab 66 @item 67 @tab 2 1a @tab 87 @tab 67 @item 68 @tab 2 14 @tab 88 @tab 68 @item 69 @tab 2 06 @tab 89 @tab 69 @item 6a @tab 2 0b @tab 91 @tab 6a @item 6b @tab 2 0f @tab 92 @tab 6b @item 6c @tab 2 13 @tab 93 @tab 6c @item 6d @tab 2 1c @tab 94 @tab 6d @item 6e @tab 2 0c @tab 95 @tab 6e @item 6f @tab 2 18 @tab 96 @tab 6f @item 70 @tab 2 16 @tab 97 @tab 70 @item 71 @tab 2 17 @tab 98 @tab 71 @item 72 @tab 2 0a @tab 99 @tab 72 @item 73 @tab 2 05 @tab a2 @tab 73 @item 74 @tab 2 10 @tab a3 @tab 74 @item 75 @tab 2 07 @tab a4 @tab 75 @item 76 @tab 2 1e @tab a5 @tab 76 @item 77 @tab 2 12 @tab a6 @tab 77 @item 78 @tab 2 1d @tab a7 @tab 78 @item 79 @tab 2 15 @tab a8 @tab 79 @item 7a @tab 2 11 @tab a9 @tab 7a @item 7b @tab 4 0a @tab 9c @tab 7b @item 7c @tab 4 1e @tab fe @tab N/A @item 7d @tab 4 11 @tab dc @tab 7d @item 7e @tab 4 0b @tab a1 @tab 7e @end multitable @node convickt @appendix convickt @cindex convickt @cindex character sets, converting @cindex converting between character sets A variety of character sets have historically been used to represent @ical{} programs. Atari syntax was designed specifically for use with ASCII-7, and all Atari-syntax-based @ical{} compilers accept that character set as possible input. (@cic{} 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 @clcic{} compiler accepts Latin-1, a custom dialect of EBCDIC, Baudot, and a punched-card format as input; @cic{} 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} is an @ical{} character set conversion program designed with these needs in mind. The syntax for using @command{convickt} is @example convickt @var{inputset} @var{outputset} [@var{padding}] @end example (that is, the input and output character sets are compulsory, but the parameter specifying what sort of padding to use is optional). The following values for @var{inputset} and @var{outputset} are permissible: @table @samp @item latin1 Latin-1, or to give it its official name ISO-8859-1, is the character set most commonly used for transmitting @clcic{} programs, and therefore nowadays the most popular character set for Princeton syntax programs. Because it is identical to ASCII-7 in all codepoints that don't have the high bit set, most of the characters in it can be read by most modern editors and terminals. It is also far more likely to be supported by modern editors than EBCDIC, Baudot, or punched cards, all of which have fallen into relative disuse since 1972. It is also the only input character set that @cic{} supports for Princeton syntax programs. It uses 8 bit characters. @item ebcdic EBCDIC is an 8-bit character set that was an alternative to ASCII in 1972, and is the character set used by the original Princeton compiler. Unfortunately, there is no single standard version; the version of EBCDIC used by @command{convickt} is the one that @clcic{} uses. It is the default input character set that @clcic{} uses (although more recent versions of @clcic{} instead try to guess the input character set based on the input program.) @item baudot Baudot is a 5-bit character set with shift codes; therefore when storing it in a file on an 8-bit computer, padding is needed to fill in the remaining three bits. The standard Baudot character set does not contain all the characters needed by @ical{}; therefore, @clcic{} uses repeated shift codes to add two more sets of characters. @command{convickt} uses the @clcic{} version of Baudot, so as to be able to translate programs designed for that compiler; however, standard Baudot is also accepted in input if it contains no redundant shift codes, and if the input contains no characters not in standard Baudot, the output will be written so that it is both correct standard Baudot and correct @clcic{} Baudot for those characters. @item atari This option causes @command{convickt} to attempt a limited conversion to or from Atari syntax; this uses ASCII-7 as the character set, but also tries to translate between Atari and Princeton syntax at the character level, which is sometimes but not always effective. For instance, @code{?} is translated from Atari to Princeton as a yen sign, and from Princeton to Atari as a whirlpool (@code{@@}); this sort of behaviour is often capable of translating expressions automatically, but will fail when characters outside ASCII-7 (Atari) or Latin-1 (Princeton) are used, and will not, for instance, translate a Princeton @code{V}, backspace, @code{-} into Atari @code{?}, but instead leave it untouched. ASCII-7 is a 7-bit character set, so on an 8 bit computer, there is one bit of padding that needs to be generated; note, however, that it is usual nowadays to clear the top bit when transmitting ASCII-7, which the `printable' and `zero' padding styles will do, but the `random' style may not do. @end table 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: @multitable {printable}{Keep the output in the range 32-126 where possible} @headitem Option @tab Meaning @item printable @tab Keep the output in the range 32-126 where possible @item zero @tab Zero the high bits in the output @item random @tab Pad with random bits (avoiding all-zero bytes) @end multitable 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 @ical{} (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 @ical{} source code into Baudot.) @node Optimizer Idiom Language @appendix Optimizer Idiom Language @cindex Optimizer Idiom Language @cindex OIL One file in the @cic{} distribution (@file{src/idiotism.oil}) is written in Optimizer Idiom Language, a programming language designed especially for expressing optimizer idioms for @ical{} 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 @ical{} compiler). @menu * Basics: OIL Basics. The basics of how an OIL program works. * Syntax: OIL Syntax. How to write comments, idioms, and groups. * Expressions: OIL Expressions. Expressions are the basis of idioms. * Patterns: OIL Patterns. Filling in the left hand side of an idiom. * Replacements: OIL Replacements. Syntax for the right hand side. * Loops: OIL Loops. Simplifying and shortening programs. * Tips: OIL Tips. Some tips about using OIL. * Example: OIL Example. An example of how OIL can work. @end menu @node OIL Basics @appendixsec OIL Basics @cindex OIL, basics @cindex @file{src/idiotism.oil} @cindex @file{idiotism.oil} @cindex OIL, execution The structure of an @acronym{OIL} file consists of a sequence of idioms. An optimizer idiom looks for a certain pattern in an expression (which could be an @ical{} expression, or an expression that has already been partly optimized and therefore contains some non-@ical{} operators), and replaces it with a replacement that's `simpler' in some sense (in the case of @cic{}, `simpler' is interpreted to mean `compiles into a faster or smaller executable when run through a C compiler'). When an @acronym{OIL} program acts on an input @ical{} 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. At present, the only place that @acronym{OIL} is used in the @cic{} compiler is when the @option{-O} option (@pxref{-O+,,-O}) is used in base 2. (Syntax is planned to extend @acronym{OIL} 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 @file{src/idiotism.oil} during the compilation of the @cic{} 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} method, also reinstall, but that will be pretty fast.) @node OIL Syntax @appendixsec OIL Syntax @cindex OIL, syntax @cindex syntax, of OIL An @acronym{OIL} file is encoded as an @acronym{ASCII} 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. @cindex OIL, comments @cindex comments, OIL Comments can be given anywhere in the file by writing lines starting with semicolons (known as hybrids to @ical{} 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 @code{/*} and @code{*/} (in such cases, the comments will be copied verbatim to the C temporary files used when building the @cic{} 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 @samp{.:#_@}}, 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. @cindex OIL, idiom groups 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: @example [nullshift] (_1 >> #0)->(_1) (_1 << #0)->(_1) @end example 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. @cindex OIL, idioms @cindex idiom As the example above shows, the syntax of an idiom itself is @example (pattern)->(replacement) @end example 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} expressions, although they both have their own special syntax elements as well. @node OIL Expressions @appendixsec OIL Expressions @cindex expressions, OIL @cindex OIL, expressions An @acronym{OIL} expression is built around subexpressions connected by infix binary operators and/or preceded by prefix unary operators, the same way as in C or @ical{} (although unary operators must be entirely before their argument; the one character later position is not allowed.) As in @ical{}, 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). The following unary and binary operators are allowed in OIL expressions: @cindex OIL, operators @cindex operators, OIL @multitable {@code{@@216..@@516}}{@ical{} unary generalised whirlpool (16-bit)} @item @code{$} @tab INTERCAL mingle @item @code{~} @tab INTERCAL select @item @code{&16} @tab INTERCAL unary AND (16-bit) @item @code{V16} @tab INTERCAL unary OR (16-bit) @item @code{?16} @tab INTERCAL unary XOR (16-bit) @item @code{^16} @tab INTERCAL unary sharkfin (16-bit) @item @code{@@16} @tab INTERCAL unary whirlpool (16-bit) @item @code{@@216..@@516} @tab INTERCAL unary generalised whirlpool (16-bit) @item @code{&32} @tab INTERCAL unary AND (32-bit) @item @code{V32} @tab INTERCAL unary OR (32-bit) @item @code{?32} @tab INTERCAL unary XOR (32-bit) @item @code{^32} @tab INTERCAL unary sharkfin (32-bit) @item @code{@@32} @tab INTERCAL unary whirlpool (32-bit) @item @code{@@232..@@532} @tab INTERCAL unary generalised whirlpool (32-bit) @item @code{&} @tab C binary bitwise AND @item @code{|} @tab C binary bitwise OR @item @code{^} @tab C binary bitwise XOR @item @code{+} @tab C addition @item @code{-} @tab C subtraction @item @code{*} @tab C multiplication @item @code{/} @tab C integer division @item @code{%} @tab C modulus @item @code{>} @tab C greater than @item @code{<} @tab C less than @item @code{~} @tab C unary bitwise complement @item @code{!=} @tab C not equals operator @item @code{==} @tab C equals operator @item @code{&&} @tab C logical AND @item @code{||} @tab C logical OR @item @code{>>} @tab C bitwise rightshift @item @code{<<} @tab C bitwise leftshift @item @code{!} @tab C unary logical NOT @end multitable (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 @ical{} unary logic operators, OIL unary logic operators must have a bitwidth stated.) 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. @node OIL Patterns @appendixsec OIL Patterns @cindex patterns @cindex OIL, patterns Patterns are simply @acronym{OIL} expressions; the expressions match either original @ical{} 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. One special simple form of match is possible: @code{#@var{NUMBER}}, where @var{NUMBER} is in decimal, matches a constant with that value. (Unlike in @ical{}, 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}.) Otherwise, an operand consists of the following parts, written in order: @cindex operands, OIL, in patterns @cindex patterns, operands @enumerate @item A character to specify the data type of what's being matched. Usually, this will be @code{_} to specify that any data type can be matched. In a few cases, you may want to use @code{.} or @code{:} to specify that you only want to match a onespot or twospot value respectively (that is, 16- or 32-bit). You can also use @code{#}; this specifies a value that can be any width, but must be known to be a constant with a known value at optimize time (either because it was hardcoded as a constant originally or because a constant was produced there by the optimizer, for instance via a constant folding optimization). @item Optionally, an expression in braces (@code{@{} and @code{@}}). This expression is written in C, not @acronym{OIL} (as are all expressions in braces), and puts an extra condition on whether the pattern matches. The exact meaning of this will be explained later. @item A reference number, which must be one decimal digit long. A reference number of 0 causes the operand to be discarded immediately after matching; normally, you will want to specify a positive reference number. Two operands with the same reference number must be exactly the same for the pattern to match (for instance, both references to the same variable, or identical subexpressions). The reference number also allows the operand to be referenced by C expressions on other operands and by replacements. Reference numbers must be unique within the idiom (unless two or more reference numbers are deliberately the same so that the operands they reference have to be identical to produce a match), and they are scoped only as far as the containing idiom; they don't carry from one idiom to another. @end enumerate Note that syntax like @code{#2} 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 @code{#@{1@}2}, using a no-op braced expression to tell them apart. This particular no-op is recommended because it's detected and optimized by the @code{OIL} compiler. 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: @cindex functions, OIL in C @cindex OIL, functions in C @cindex C, within OIL @anchor{C functions in OIL} @table @code @item c @itemx c@var{NUMBER} @findex c @findex c1--c9 This accesses a calculation made automatically by the compiled @acronym{OIL} program to identify which bits of the operand can possibly be set, and which ones cannot be. @code{c} by itself refers to the operand to which the braced expression is attached; if a number is given, it refers to another node (the number is interpreted as a reference number). The actual value of @code{c} is a 32-bit unsigned integer, each bit of which is true, or 1, if there is any chance that the corresponding bit of the operand might be 1, and false, or 0, if it's known for certain that the corresponding bit of the operand is 0. For instance: @example _@{!(c&4294901760LU)@}1 @end example The constant given here is FFFF0000 when expressed in hexadecimal; the point is that the expression matches any operand that is known to have a value no greater than 65535. Unless the operand is the argument to a unary AND, this check generally makes more sense than explicitly specifying @code{.} rather than @code{_}, because it will identify both 16- and 32-bit values as long as they're small enough to fit into a onespot variable. This code could, for instance, be used to check that an argument to a mingle must be small enough before optimising it (this is important because an optimisation shouldn't optimise an error -- in this case, an overflowing mingle -- into a non-error). @item x @itemx x@var{NUMBER} @findex x @findex x1--x9 @code{x} is like @code{c}, and refers to operands in the same way, except that it can only refer to an operand marked with @code{#}. It holds the value of that constant (a 32-bit unsigned integer), which will be known to the optimizer at optimize time. One common use of this is to detect whether a constant happens to be a power of 2, although there are many other possibilities that may be useful. @item r @findex r When inside a loop, @code{r} is the value of the loop counter. (It's almost certainly a mistake if you have a loop but don't reference the loop counter at least once, and usually at least twice, within the loop.) @xref{OIL Loops}. @item and16 @itemx and32 @itemx or16 @itemx or32 @itemx xor16 @itemx xor32 @itemx iselect @itemx mingle @findex and16 @findex and32 @findex or16 @findex or32 @findex xor16 @findex xor32 @findex iselect @findex mingle These are all functions with one argument (apart from iselect and mingle, which each take two arguments); they exist so that @ical{} operators can be used by C expressions. They all take unsigned longs as input and output, even if they are onespot operators. Note that it's entirely possible for these to cause a compile-time error if used on invalid arguments (such as mingling with an operand over 65535), or to silently truncate an invalid argument down to the right number of bits; both of these should be avoided if possible, so the optimiser should check first to make sure that it doesn't use any of these functions on invalid arguments. @item xselx @findex xselx This function returns its argument selected with itself; so @code{xselx(c)} is shorthand for @code{iselect(c,c)}. When the argument is very complicated, this can save a lot of space in the original @acronym{OIL} program. @item setbitcount @findex setbitcount This function simply returns the number of bits with value 1 in its argument. This is sometimes useful with respect to various select-related optimisations, and can be a useful alternative to having to take logarithms in various situations. @item smudgeright @itemx smudgeleft @findex smudgeright @findex smudgeleft The @code{smudgeright} function returns its argument but with all the bits less significant than the most significant bit with value 1 set to 1; likewise, @code{smudgeleft} returns its argument with all the bits more significant than the least significant bit with value 1 set to 1. @end table Note that all @acronym{OIL} calculation 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 @code{LU} 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} compiler itself will not complain. Here's a more complicated example of an optimizer operand: @example #@{!(x&2863311530LU)&&iselect(x,1431655765LU)== xselx(iselect(x,1431655765LU))@}3 @end example It helps to understand this if you know that 2863311530 in hexadecimal is AAAAAAAA and 1431655765 in hexadecimal is 55555555. (It's worth putting a comment with some frequently-used decimal constants in an @acronym{OIL} 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. @node OIL Replacements @appendixsec OIL Replacements @cindex OIL, replacements @cindex replacements 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. @ical{} 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 @ical{}'s rules, this information needs to be inserted somehow in a replacement. In @cic{}, it usually doesn't matter what the bitwidth is, and in cases where it doesn't matter the normal operators (@code{$}, @code{~}, and so on) can be used. (The bitwidth of the entire replacement may be different from the bitwidth of the original, thus leading to, say, a 32-bit unary logical operation applied to a ``16-bit'' argument; but this is not a problem, as it just means that there's an implied typecast in there somewhere.) In cases where it does matter (due to @cic{}'s lenient interpretation of bitwidth on mingle inputs, the only place it matters is in the input to @ical{} unary logical operators), both the bitwidth 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, @code{!=32} 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 @code{&32} already have a bitwidth specified, so specifying @code{&3232} (or worse, @code{&3216}) is not allowed. @cindex operands, OIL, in replacements @cindex replacements, operands Replacement operands are simpler than pattern operands, because there are only a few forms they can take. @table @code @item _@var{NUMBER} @itemx .@var{NUMBER} @itemx :@var{NUMBER} This tells the optimiser to copy the operand or expression with reference number @var{NUMBER} to this point in the replacement used for the expression matched by the pattern. The three forms are identical; the last two are provided for aesthetic reasons (it can look better and be clearer to match @code{.1} in the pattern with @code{.1} in the replacement, for instance). You cannot use @code{#@var{NUMBER}} here to copy in a constant from the left-hand side, though, nor @code{#@{1@}@var{NUMBER}}, because the first means something else and the second is undefined behaviour (that is, no behaviour for the second case has been specifically implemented in the compiler and therefore its behaviour is unpredictable and subject to change in future versions); use @code{_@var{NUMBER}} to copy over a constant with an unknown at optimizer compile time (but known at optimize time) value from the left hand side, as you can do with any other operand being copied. @item #@var{NUMBER} Insert a constant with the literal value @var{NUMBER} here. @item #@{@var{EXPRESSION}@}0 Calculate the value of @var{EXPRESSION} (a C expression, which can reference the same variables and functions as a C expression in a pattern can; see @ref{C functions in OIL}) and insert a constant with the calculated value here. (That is, a value is calculated at optimise-time and the resulting value is therefore constant at runtime.) @end table 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, whilst the shifts can all be combined into one large shift.) @example ((_1 << #@{1@}2) & #@{1@}3)->((_1 & #@{x3>>x2@}0) << _2) @end example @node OIL Loops @appendixsec OIL Loops @cindex loops, OIL @cindex OIL, loops 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: @example (_1~#@{xselx(x)<<1==x&&x@}2)->((_1&_2)>>#1) (_1~#@{xselx(x)<<2==x&&x@}2)->((_1&_2)>>#2) @end example Adding a loop to automatically generate the idioms, and placing a name for the group of idioms at the start, produces the following code: @example [rshift] <#1-#31 (_1~#@{xselx(x)<((_1&_2)>>#@{r@}0) > @end example That's 31 different idioms, generated with a loop. As the above example shows, a loop starts with @code{<#@var{NUMBER}-#@var{NUMBER}} and ends with @code{>}; a different idiom is generated for each possible value of the loop counter @code{r} 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 @code{#@{r@}0} to generate a constant whose value is equal to the value of the loop counter. @node OIL Tips @appendixsec OIL Tips @cindex tips, OIL @cindex OIL, tips Here are some tips for the best use of @acronym{OIL}: @itemize @item @findex MAXTOFREE The @acronym{OIL} compiler has a few deficiencies, such as error messages that don't give you much of an idea of what you did wrong (to compensate for this, it does give a reasonably accurate line and character number where the error happened), limits on things like how deep expressions can be nested and how many idioms are allowed (if you hit the first, you should really break it up into smaller idioms if possible, and if you hit the second, increase @code{MAXTOFREE} in oil.y; this isn't a limit on the number of idioms but on the number of strings that are allocated internally to process the idioms), and lack of error checking (invalid @acronym{OIL} may produce errors in the @acronym{OIL} compiler, or cause the output C code to contain errors or warnings, or may even appear to work). @item When you have symmetrical operators in an idiom (like C binary logical operators), you need to write the idiom both ways round (in the same group of idioms, preferably), or write another idiom to standardise the format first; the first method can get very tedious when there are many symmetrical operators in an idiom, and the second is prone to optimizer loops and subtle errors (both methods have been used in the provided @file{idiotism.oil} file). @item Idioms should preferably be as general as possible, broken down into many separate idioms rather than all as one big idiom, and match the smallest part of the expression being optimized that is necessary for the idiom to be correct in all circumstances; all of these help to improve the performance of the optimizer in terms of what it can optimize. @item If a program's optimizing incorrectly, or you just want to see how the optimizer deals with a particular program, it's possible to debug the optimizer by giving the @option{-h}, @option{-H}, or @option{-hH} (@pxref{-h}) switch to the @cic{} compiler, which will cause debug information to be output on stderr. @option{-h} will show the initial and final expressions for each expression that was given as input to the optimizer, as well as a list of all optimizations used, in a language that's a sort of mix of C, @ical{}, and @acronym{OIL}; @option{-H} will do the same, and also show the intermediate stages in the optimization. @option{-hH} is like @option{-H}, 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 @ical{}. @option{-H} can be a useful learning resource for people who want to understand how a particular @ical{} expression works. @item Make sure that the optimizer doesn't change a statement from a run-time error into something that silently succeeds@! Checking which bits can and can't be 1 is one good way to avoid this, especially with mingles. Likewise, don't optimise a run-time error into a compile-time error (although creating a compile-time warning in this situation is fine). @item You can help@! If you find an idiom that the optimizer isn't optimizing correctly, feel free to add it, or multiple idioms that come to the same thing, to @file{idiotism.oil}. In such a case, it would help other users if you would submit your new optimizer idiom to the project (@pxref{Reporting Bugs}); this will help other users and future releases of @ical{}, and also has a chance of allowing other users to check your new idioms to see if they cause problems or could be written better. @end itemize @node OIL Example @appendixsec OIL Example @cindex OIL, example @cindex examples, OIL To finish off this appendix, here's an example of the power of @acronym{OIL}; this is the optimization of an idiom from the @icst{} system library, as shown with @option{-H}; this should give a good idea of how @acronym{OIL} programs work. (All the relevant idioms are in @file{idiotism.oil} 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 @ical{}, 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 @code{c} (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. @ifhtml @smallexample .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) @end smallexample @end ifhtml @ifnothtml @quotation .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)@* @end quotation @end ifnothtml @node Copying @appendix Copying @cindex copyright @cindex copying conditions The majority of the files in the @cic{} distribution are licensed under the GNU General Public License (version 2 or later), but with some exceptions. The files @file{ick-wrap.c} and @file{pickwrap.c} 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 @ical{} source. (Note that the libraries @file{libick.a} and @file{libickmt.a} are GPL, though, so you cannot redistribute an executable produced by @command{ick} or by linking a C file to either of those libraries unless the original @ical{} source was GPL.) For similar reasons, the expansion libraries @file{syslibc.c} and @file{compunex.c} are explicitly public domain. 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 (@file{fdl-1-2.txi} and @file{COPYING.txt}) are licensed under a license that allows verbatim redistribution but not creation of derivative works. All other files, though (including the @command{man} pages, which are not part of @emph{this} manual), are licensed under the GPL. For the full text of the GPL, see the file @file{COPYING.txt} in the distribution. @menu * GNU Free Documentation License:: License for copying this manual. @end menu @node GNU Free Documentation License @appendixsec GNU Free Documentation License @cindex GFDL @cindex FDL @cindex GNU Free Documentation License @cindex Free Documentation License @include fdl-1-2.txi @node Main Index @unnumbered Index This is the index of everything in this manual. (Note that in some versions of the manual this is called @samp{Main Index} to prevent it transforming into a page called @file{index.html} in the HTML version of the manual. The complications that that caused were really odd.) @printindex cp @bye intercal-0.30/doc/PaxHeaders.27456/ick.info-20000644000000000000000000000013212507267255015343 xustar0030 mtime=1427992237.698939819 30 atime=1427992237.526940303 30 ctime=1427992237.734939724 intercal-0.30/doc/ick.info-20000664000175000017500000027430612507267255015261 0ustar00esresr00000000000000This is ick.info, produced by makeinfo version 5.2 from ick.txi. This manual is for C-INTERCAL version 0.29. 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 C-INTERCAL (unlike the other manual, it is not derived from the original INTERCAL-72 manual). Copyright © 2007 Alex Smith. 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." INFO-DIR-SECTION INTERCAL START-INFO-DIR-ENTRY * C-INTERCAL: (ick). The C-INTERCAL language and compiler. * ick: (ick) Invoking ick. Invoking the C-INTERCAL compiler. * convickt: (ick) convickt. The command-line character set converter. END-INFO-DIR-ENTRY  File: ick.info, Node: OIL Example, Prev: OIL Tips, Up: Optimizer Idiom Language C.8 OIL Example =============== To finish off this appendix, here's an example of the power of OIL; this is the optimization of an idiom from the INTERCAL-72 system library, as shown with '-H'; this should give a good idea of how OIL programs work. (All the relevant idioms are in 'idiotism.oil' 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 INTERCAL, 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 'c' (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. .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)  File: ick.info, Node: Copying, Next: Main Index, Prev: Optimizer Idiom Language, Up: Top Appendix D Copying ****************** The majority of the files in the C-INTERCAL distribution are licensed under the GNU General Public License (version 2 or later), but with some exceptions. The files 'ick-wrap.c' and 'pickwrap.c' 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 INTERCAL source. (Note that the libraries 'libick.a' and 'libickmt.a' are GPL, though, so you cannot redistribute an executable produced by 'ick' or by linking a C file to either of those libraries unless the original INTERCAL source was GPL.) For similar reasons, the expansion libraries 'syslibc.c' and 'compunex.c' are explicitly public domain. 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 ('fdl-1-2.txi' and 'COPYING.txt') are licensed under a license that allows verbatim redistribution but not creation of derivative works. All other files, though (including the 'man' pages, which are not part of _this_ manual), are licensed under the GPL. For the full text of the GPL, see the file 'COPYING.txt' in the distribution. * Menu: * GNU Free Documentation License:: License for copying this manual.  File: ick.info, Node: GNU Free Documentation License, Up: Copying D.1 GNU Free Documentation License ================================== Version 1.2, November 2002 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. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure 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 way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections 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 that the Document is released under this License. A Front-Cover Text may be 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 the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output 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 material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the 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 whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific 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 a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a 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 ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list 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 contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by 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 explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant 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 all sections Entitled "Endorsements." 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See . Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. ADDENDUM: How to use this License for your documents ==================================================== 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: Copyright (C) YEAR YOUR NAME. 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''. If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. 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.  File: ick.info, Node: Main Index, Prev: Copying, Up: Top Index ***** This is the index of everything in this manual. (Note that in some versions of the manual this is called 'Main Index' to prevent it transforming into a page called 'index.html' in the HTML version of the manual. The complications that that caused were really odd.) [index] * Menu: * ": Grouping Rules. (line 6) * #: Constants and Variables. (line 6) * $: Mingle. (line 6) * %: Execution Chance. (line 6) * &: Unary Binary Logic. (line 6) * ': Grouping Rules. (line 6) * +help: Options to Generated Programs. (line 13) * +instapipe: Options to Generated Programs. (line 37) * +mystery: Options to Generated Programs. (line 64) * +printflow: Options to Generated Programs. (line 46) * +printflow, enabling: Debug Options. (line 64) * +traditional: Options to Generated Programs. (line 32) * +wimpmode: Options to Generated Programs. (line 21) * ,: Constants and Variables. (line 6) * -@: Other Options. (line 9) * -a: Language-affecting Options. (line 70) * -b: Language-affecting Options. (line 17) * -C: Language-affecting Options. (line 92) * -c: Output Options. (line 13) * -d: Debug Options. (line 12) * -e: Language-affecting Options. (line 43) * -E: Language-affecting Options. (line 55) * -f: Optimizer Options. (line 10) * -F: Optimizer Options. (line 17) * -g: Debug Options. (line 19) * -h: Debug Options. (line 29) * -H: Debug Options. (line 29) * -help: Options to Generated Programs. (line 13) * -hH: Debug Options. (line 29) * -instapipe: Options to Generated Programs. (line 37) * -l: Debug Options. (line 40) * -m: Language-affecting Options. (line 31) * -mystery: Options to Generated Programs. (line 64) * -o: Output Options. (line 28) * -O: Optimizer Options. (line 27) * -P: Language-affecting Options. (line 97) * -p: Debug Options. (line 48) * -printflow: Options to Generated Programs. (line 46) * -t: Language-affecting Options. (line 65) * -traditional: Options to Generated Programs. (line 32) * -u: Debug Options. (line 72) * -U: Debug Options. (line 95) * -v: Language-affecting Options. (line 79) * -w: Debug Options. (line 64) * -wimpmode: Options to Generated Programs. (line 21) * -X: Language-affecting Options. (line 110) * -x: Language-affecting Options. (line 122) * -y: Debug Options. (line 82) * -Y: Debug Options. (line 88) * .: Constants and Variables. (line 6) * .b98: External Calls to Funge-98. (line 6) * .b98, no external library: Errors. (line 434) * /: Operand Overloading. (line 6) * 16 bit overflow: Errors. (line 174) * 32 bit overflow: Errors. (line 264) * :: Constants and Variables. (line 6) * ;: Constants and Variables. (line 6) * ?: Unary Binary Logic. (line 6) * @: TriINTERCAL. (line 6) * ^: TriINTERCAL. (line 6) * About this manual: About this manual. (line 6) * ABSTAIN: ABSTAIN and REINSTATE. (line 6) * abstain, at program start: Statement Identifiers. (line 6) * abstain, during execution: ABSTAIN and REINSTATE. (line 6) * 'ABSTAIN', nonexistent target: Errors. (line 88) * ABSTAIN, self-abstaining: ONCE and AGAIN. (line 6) * abstained state: Statement Identifiers. (line 6) * ABSTAINING: ABSTAIN and REINSTATE. (line 6) * add-without-carry: TriINTERCAL. (line 6) * AGAIN: ONCE and AGAIN. (line 6) * alloca: External Calls and auto. (line 6) * ampersand: Unary Binary Logic. (line 6) * and: Unary Binary Logic. (line 6) * and16: OIL Patterns. (line 117) * and32: OIL Patterns. (line 117) * Arabic numberals, enabling: Options to Generated Programs. (line 21) * array, invalid dimension: Errors. (line 139) * array, out of bounds: Errors. (line 146) * array, wrong dimension: Errors. (line 146) * arrays, dimensioning: Calculate. (line 6) * arrays, subscripting: Array Subscript. (line 6) * assigning to constants: Language-affecting Options. (line 79) * assignment: Calculate. (line 6) * Atari compiler: Differences to Other Compilers. (line 29) * Atari syntax: Princeton and Atari Syntax. (line 38) * Atari, character set: Character Sets. (line 6) * auto: External Calls and auto. (line 6) * backtracking: Backtracking. (line 6) * Backtracking INTERCAL: Multithreading and Backtracking. (line 6) * backtracking, debugging: Options to Generated Programs. (line 46) * backtracking, enabling: Language-affecting Options. (line 31) * backtracking, not enabled: Errors. (line 239) * backtracking, out of memory: Errors. (line 448) * Baudot: CLC-INTERCAL I/O. (line 6) * Baudot <1>: Character Sets. (line 6) * Befunge: External Calls to Funge-98. (line 6) * Befunge, fingerprint: The IFFI Fingerprint. (line 6) * Befunge, installing: Creating the Funge-98 Library. (line 6) * Befunge, marker: The IFFI Fingerprint. (line 40) * Befunge, no external library: Errors. (line 434) * black lagoon: Errors. (line 49) * blocks, labeled: ick_labeledblock. (line 6) * book: Unary Binary Logic. (line 6) * breakpoints, too many: Errors. (line 419) * buffer overflow: Errors. (line 276) * bugs, reporting: Reporting Bugs. (line 6) * BUT: TriINTERCAL. (line 6) * c: OIL Patterns. (line 64) * C: External Calls to C. (line 6) * C code, debugging: Debug Options. (line 19) * C code, leaving in place: Debug Options. (line 19) * C, auto/alloca: External Calls and auto. (line 6) * C, CREATE: ick_create. (line 6) * C, external call infrastructure: External C Call Infrastructure. (line 6) * C, stopping after C is generated: Output Options. (line 13) * C, system library: Expansion Libraries. (line 40) * C, within OIL: OIL Patterns. (line 62) * C-INTERCAL, distributing: Distributing. (line 6) * C-INTERCAL, I/O: C-INTERCAL I/O. (line 6) * C-INTERCAL, obtaining a copy: Obtaining. (line 6) * C-INTERCAL, unpacking: Unpacking. (line 6) * C-INTERCAL, unzipping: Unpacking. (line 6) * c1--c9: OIL Patterns. (line 64) * C11: Miscellaneous External Calls. (line 6) * C99: Miscellaneous External Calls. (line 6) * calculate: Calculate. (line 6) * CALCULATING: Calculate. (line 6) * calls, external: External Calls. (line 6) * character sets: Princeton and Atari Syntax. (line 6) * character sets <1>: Character Sets. (line 6) * character sets, converting: convickt. (line 6) * choicepoints: Backtracking. (line 6) * choicepoints, activating: Backtracking. (line 44) * choicepoints, creating: Backtracking. (line 26) * choicepoints, discarding: Backtracking. (line 80) * CLC-INTERCAL: Differences to Other Compilers. (line 52) * CLC-INTERCAL compatibility mode: Language-affecting Options. (line 122) * CLC-INTERCAL I/O: CLC-INTERCAL I/O. (line 6) * clockface mode: Language-affecting Options. (line 92) * code generation, stopping at C code: Output Options. (line 13) * COME FROM: COME FROM and NEXT FROM. (line 6) * 'COME FROM', ambiguity: Errors. (line 286) * COME FROM, in C: ick_comefrom and ick_nextfrom. (line 6) * COME FROM, in Funge: The IFFI Fingerprint. (line 79) * 'COME FROM', multithreading: Multithreading using COME FROM. (line 6) * 'COME FROM', no target: Errors. (line 255) * command line options: Invoking ick. (line 6) * command line, showing intermediates: Debug Options. (line 88) * COMMENT: Syntax Error. (line 6) * comment: Syntax Error. (line 6) * COMMENTING: Syntax Error. (line 6) * COMMENTS: Syntax Error. (line 6) * comments, OIL: OIL Syntax. (line 13) * compatibility, CLC-INTERCAL: Language-affecting Options. (line 122) * compatibility, INTERCAL-72: Language-affecting Options. (line 65) * compiling, 'ick' itself: Simple Installation. (line 6) * compiling, INTERCAL source code: Invoking ick. (line 6) * compunex: Expansion Libraries. (line 57) * computed NEXT: Expansion Libraries. (line 57) * config.sh: Simple Installation. (line 6) * configuring: Simple Installation. (line 6) * connected threads: Multithreading using WHILE. (line 6) * constant: Constants and Variables. (line 6) * constant, twospot: Errors. (line 19) * constants, assigning to: Language-affecting Options. (line 79) * controlled unary operator: TriINTERCAL. (line 6) * converting between character sets: convickt. (line 6) * convickt: convickt. (line 6) * copying conditions: Copying. (line 6) * copyright: Copying. (line 6) * CREATE: CREATE. (line 6) * CREATE, enabling: Language-affecting Options. (line 70) * CREATE, in C: ick_create. (line 6) * CREATE, in Funge: The IFFI Fingerprint. (line 67) * CREATE, operators: CREATE. (line 82) * CREATE, signatures: ick_create. (line 43) * creating syntax: CREATE. (line 6) * Debian: Simple Installation. (line 92) * debug options: Debug Options. (line 6) * debugging, C code: Debug Options. (line 19) * debugging, flow: Options to Generated Programs. (line 46) * debugging, internal errors: Debug Options. (line 95) * debugging, lexical analyser: Debug Options. (line 12) * debugging, multithreaded programs: Options to Generated Programs. (line 46) * debugging, OIL: Debug Options. (line 29) * debugging, optimizer: Debug Options. (line 29) * debugging, parser: Debug Options. (line 12) * debugging, runtime: The yuk debugger. (line 6) * debugging, yuk: The yuk debugger. (line 6) * dialect options: Language-affecting Options. (line 6) * dialects of syntax: Princeton and Atari Syntax. (line 6) * dimensioning arrays: Calculate. (line 6) * directory problems: Debug Options. (line 72) * directory problems, source file: Errors. (line 385) * distributing C-INTERCAL: Distributing. (line 6) * DJGPP: Installation on DOS. (line 6) * DO: Statement Identifiers. (line 6) * dormant thread: Backtracking. (line 6) * DOS: Installation on DOS. (line 6) * double-oh-seven: Execution Chance. (line 6) * dumping core on error: Debug Options. (line 95) * duplicate line label: Errors. (line 95) * E000: Errors. (line 10) * E017: Errors. (line 19) * E079: Errors. (line 25) * E099: Errors. (line 33) * E111: Errors. (line 40) * E123: Errors. (line 49) * E127: Errors. (line 62) * E127, debugging: Debug Options. (line 72) * E129: Errors. (line 74) * E139: Errors. (line 88) * E182: Errors. (line 95) * E197: Errors. (line 108) * E200: Errors. (line 115) * E222: Errors. (line 126) * E240: Errors. (line 139) * E241: Errors. (line 146) * E252: Errors. (line 156) * E256: Errors. (line 163) * E256, avoiding: Language-affecting Options. (line 97) * E275: Errors. (line 174) * E277: Errors. (line 185) * E281: Errors. (line 202) * E333: Errors. (line 213) * E345: Errors. (line 221) * E404: Errors. (line 230) * E405: Errors. (line 239) * E436: Errors. (line 249) * E444: Errors. (line 255) * E533: Errors. (line 264) * E553: Errors. (line 276) * E555: Errors. (line 286) * E562: Errors. (line 298) * E579: Errors. (line 308) * E621: Errors. (line 317) * E632: Errors. (line 326) * E633: Errors. (line 334) * E652: Errors. (line 348) * E652, avoiding: Language-affecting Options. (line 97) * E666: Errors. (line 358) * E774: Errors. (line 372) * E774, disabling: Language-affecting Options. (line 17) * E777: Errors. (line 385) * E778: Errors. (line 392) * E778, debugging: Debug Options. (line 95) * E810: Errors. (line 412) * E811: Errors. (line 419) * E888: Errors. (line 426) * E899: Errors. (line 433) * E990: Errors. (line 442) * E991: Errors. (line 448) * E993: Errors. (line 458) * E994: Errors. (line 466) * E995: Errors. (line 474) * E997: Errors. (line 482) * E998: Errors. (line 492) * E999: Errors. (line 501) * E999, debugging: Debug Options. (line 72) * ears: Grouping Rules. (line 6) * ears, nesting limit: Errors. (line 202) * EBCDIC: Character Sets. (line 6) * embedded systems: PIC-INTERCAL. (line 6) * end of file: Errors. (line 298) * environment variables: Environment Variables. (line 6) * EOF: Errors. (line 298) * errors: Errors. (line 6) * errors and warnings: Errors and Warnings. (line 6) * examples, OIL: OIL Example. (line 6) * exclusive or: Unary Binary Logic. (line 6) * execution chance: Execution Chance. (line 6) * exiting: GIVE UP. (line 6) * exor: Unary Binary Logic. (line 6) * expansion libraries: Expansion Libraries. (line 6) * expressions: Expressions. (line 6) * expressions, OIL: OIL Expressions. (line 6) * external calls: External Calls. (line 6) * external calls, and auto: External Calls and auto. (line 6) * external calls, Befunge: External Calls to Funge-98. (line 6) * external calls, C infrastructure: External C Call Infrastructure. (line 6) * external calls, C11: Miscellaneous External Calls. (line 6) * external calls, C99: Miscellaneous External Calls. (line 6) * external calls, debugging: Debug Options. (line 88) * external calls, enabling: Language-affecting Options. (line 43) * external calls, from Funge's view: The IFFI Fingerprint. (line 6) * external calls, Funge: External Calls to Funge-98. (line 6) * external calls, libraries: Miscellaneous External Calls. (line 6) * external calls, miscellaneous: Miscellaneous External Calls. (line 6) * external calls, to C: External Calls to C. (line 6) * external calls, using: Using External Calls. (line 6) * external libraries, unavailable: Errors. (line 434) * extreme optimization: Optimizer Options. (line 17) * FDL: GNU Free Documentation License. (line 6) * file type, unsupported: Errors. (line 492) * fingerprint: The IFFI Fingerprint. (line 6) * floatlib: floatlib. (line 6) * flow control, INTERCAL-72: NEXT FORGET and RESUME. (line 6) * flow optimization: Optimizer Options. (line 10) * flow, printing: Options to Generated Programs. (line 46) * flushing: Options to Generated Programs. (line 37) * foreign functions: External Calls. (line 6) * FORGET: NEXT FORGET and RESUME. (line 6) * FORGET, in C: ick_forget. (line 6) * FORGET, in Funge: The IFFI Fingerprint. (line 116) * FORGETTING: NEXT FORGET and RESUME. (line 6) * Free Documentation License: GNU Free Documentation License. (line 6) * functions, OIL in C: OIL Patterns. (line 62) * Funge: External Calls to Funge-98. (line 6) * Funge, fingerprint: The IFFI Fingerprint. (line 6) * Funge, installing: Creating the Funge-98 Library. (line 6) * Funge, marker: The IFFI Fingerprint. (line 40) * Funge, no external library: Errors. (line 434) * generated programs, options: Options to Generated Programs. (line 6) * GFDL: GNU Free Documentation License. (line 6) * GIVE UP: GIVE UP. (line 6) * GNU Free Documentation License: GNU Free Documentation License. (line 6) * GO AHEAD: Backtracking. (line 80) * 'GO AHEAD', no choicepoint: Errors. (line 230) * 'GO AHEAD', not enabled: Errors. (line 239) * GO BACK: Backtracking. (line 44) * 'GO BACK', no choicepoint: Errors. (line 230) * 'GO BACK', not enabled: Errors. (line 239) * goto, time-reversed: COME FROM and NEXT FROM. (line 6) * grouping rules: Grouping Rules. (line 6) * help with options: Other Options. (line 9) * hybrid: Constants and Variables. (line 6) * I/O: READ OUT and WRITE IN. (line 6) * I/O, Baudot: CLC-INTERCAL I/O. (line 6) * I/O, C-INTERCAL: C-INTERCAL I/O. (line 6) * I/O, CLC-INTERCAL: CLC-INTERCAL I/O. (line 6) * I/O, INTERCAL-72: INTERCAL-72 I/O. (line 6) * I/O, out of memory: Errors. (line 156) * I/O, PIC-INTERCAL: PIC-INTERCAL. (line 55) * 'ick', command line options: Invoking ick. (line 6) * 'ick', errors: Errors. (line 6) * 'ick', errors and warnings: Errors and Warnings. (line 6) * 'ick', installing: Installation. (line 6) * 'ick', invoking: Invoking ick. (line 6) * 'ick', options: Invoking ick. (line 6) * 'ick', uninstalling: Uninstalling. (line 6) * 'ick', warnings: Warnings. (line 6) * ick-0-29.pax.*: Unpacking. (line 6) * ick_comefrom: ick_comefrom and ick_nextfrom. (line 6) * ick_comefromif: ick_comefrom and ick_nextfrom. (line 28) * ick_ec.h: External C Call Infrastructure. (line 11) * ICK_EC_FUNC_END: External C Call Infrastructure. (line 25) * ICK_EC_FUNC_START: External C Call Infrastructure. (line 25) * ick_forget: ick_forget. (line 6) * ick_getonespot: ick_get/setone/twospot. (line 6) * ick_gettwospot: ick_get/setone/twospot. (line 6) * ick_labeledblock: ick_labeledblock. (line 6) * ick_linelabel: ick_linelabel. (line 6) * ick_next: ick_next. (line 6) * ick_nextfrom: ick_comefrom and ick_nextfrom. (line 6) * ick_nextfromif: ick_comefrom and ick_nextfrom. (line 28) * ick_resume: ick_resume. (line 6) * ick_return_or_resume: ick_resume. (line 18) * ick_setonespot: ick_get/setone/twospot. (line 6) * ick_settwospot: ick_get/setone/twospot. (line 6) * ick_startup: ick_startup. (line 6) * idiom: OIL Syntax. (line 48) * idiom optimization: Optimizer Options. (line 27) * 'idiotism.oil': OIL Basics. (line 6) * IFFI: The IFFI Fingerprint. (line 6) * IFFI, commands: The IFFI Fingerprint. (line 65) * IGNORE: IGNORE and REMEMBER. (line 6) * 'IGNORE'/'RETRIEVE' interaction: STASH and RETRIEVE. (line 34) * IGNORING: IGNORE and REMEMBER. (line 6) * ignorret test: STASH and RETRIEVE. (line 34) * illegal array dimension: Errors. (line 139) * illegal line label value: Errors. (line 108) * illegal opcode: Errors. (line 466) * illegal variable number: Errors. (line 115) * impossible reverse assignment: Errors. (line 185) * initial abstention: Statement Identifiers. (line 6) * input: READ OUT and WRITE IN. (line 6) * input, C-INTERCAL: C-INTERCAL I/O. (line 6) * input, CLC-INTERCAL: CLC-INTERCAL I/O. (line 6) * input, EOF: Errors. (line 298) * input, in Arabic numerals: Options to Generated Programs. (line 21) * input, INTERCAL-72: INTERCAL-72 I/O. (line 6) * input, invalid: Errors. (line 308) * installation: Installation. (line 6) * installation, Debian: Simple Installation. (line 92) * installation, simple: Simple Installation. (line 6) * installation, Ubuntu: Simple Installation. (line 92) * installation, via autoconf and make: Simple Installation. (line 6) * installing, DOS: Installation on DOS. (line 6) * INTERCAL compilers: Differences to Other Compilers. (line 6) * INTERCAL, syntax: Syntax. (line 6) * INTERCAL-72 compatibility mode: Language-affecting Options. (line 65) * INTERCAL-72, I/O: INTERCAL-72 I/O. (line 6) * interleave: Mingle. (line 6) * internal errors: Errors. (line 392) * internal errors, debugging: Debug Options. (line 95) * internal errors, dumping core: Debug Options. (line 95) * invalid array dimension: Errors. (line 139) * invalid line label value: Errors. (line 108) * invalid variable number: Errors. (line 115) * invocation flag, unnown: Errors. (line 442) * iselect: OIL Patterns. (line 117) * J-INTERCAL: Differences to Other Compilers. (line 39) * labeled blocks: ick_labeledblock. (line 6) * language-affecting options: Language-affecting Options. (line 6) * Latin-1: Character Sets. (line 6) * lexical analyser, debugging: Debug Options. (line 12) * libick_ecto_b98.a: Creating the Funge-98 Library. (line 6) * libraries: Expansion Libraries. (line 6) * libraries, Befunge: Creating the Funge-98 Library. (line 6) * libraries, external calls: Miscellaneous External Calls. (line 6) * libraries, Funge: Creating the Funge-98 Library. (line 6) * line label: Line Labels. (line 6) * line label, duplicate: Errors. (line 95) * line label, illegal value: Errors. (line 108) * line label, in Funge: The IFFI Fingerprint. (line 130) * line labels, C: ick_linelabel. (line 6) * line number: Line Labels. (line 6) * line too long: Errors. (line 358) * loops, entire program: TRY AGAIN. (line 6) * loops, OIL: OIL Loops. (line 6) * make: Simple Installation. (line 6) * make install: Simple Installation. (line 6) * marker: The IFFI Fingerprint. (line 40) * MAXTOFREE: OIL Tips. (line 8) * MAYBE: Backtracking. (line 26) * 'MAYBE', not enabled: Errors. (line 239) * mesh: Constants and Variables. (line 6) * microcontrollers: PIC-INTERCAL. (line 6) * mingle: OIL Patterns. (line 117) * mingle <1>: Mingle. (line 6) * miscellaneous external calls: Miscellaneous External Calls. (line 6) * multithreading: Multithreading and Backtracking. (line 6) * multithreading, connected threads: Multithreading using WHILE. (line 6) * multithreading, debugging: Options to Generated Programs. (line 46) * multithreading, enabling: Language-affecting Options. (line 31) * multithreading, not enabled: Errors. (line 239) * multithreading, out of memory: Errors. (line 448) * multithreading, separate threads: Multithreading using COME FROM. (line 6) * N'T: Statement Identifiers. (line 6) * nesting limit: Errors. (line 202) * NEXT: NEXT FORGET and RESUME. (line 6) * NEXT FROM: COME FROM and NEXT FROM. (line 6) * NEXT FROM, in C: ick_comefrom and ick_nextfrom. (line 6) * NEXT FROM, in Funge: The IFFI Fingerprint. (line 193) * 'NEXT FROM', multithreading: Multithreading using COME FROM. (line 6) * 'NEXT FROM', no target: Errors. (line 255) * NEXT stack: NEXT FORGET and RESUME. (line 6) * NEXT, computed: Expansion Libraries. (line 57) * NEXT, in C: ick_next. (line 6) * NEXT, in Funge: The IFFI Fingerprint. (line 157) * 'NEXT', nonexistent target: Errors. (line 74) * 'NEXT', stack overflow: Errors. (line 49) * NEXTING: NEXT FORGET and RESUME. (line 6) * no source file: Errors. (line 385) * non-INTERCAL-72 warning: Warnings. (line 32) * NOT: Statement Identifiers. (line 6) * obtaining C-INTERCAL: Obtaining. (line 6) * OIL: Optimizer Idiom Language. (line 6) * OIL, basics: OIL Basics. (line 6) * OIL, comments: OIL Syntax. (line 13) * OIL, debugging: Debug Options. (line 29) * OIL, example: OIL Example. (line 6) * OIL, execution: OIL Basics. (line 6) * OIL, expressions: OIL Expressions. (line 6) * OIL, functions in C: OIL Patterns. (line 62) * OIL, idiom groups: OIL Syntax. (line 29) * OIL, idioms: OIL Syntax. (line 48) * OIL, loops: OIL Loops. (line 6) * OIL, operators: OIL Expressions. (line 19) * OIL, optimizing code: Optimizer Options. (line 27) * OIL, patterns: OIL Patterns. (line 6) * OIL, replacements: OIL Replacements. (line 6) * OIL, syntax: OIL Syntax. (line 6) * OIL, tips: OIL Tips. (line 6) * ONCE: ONCE and AGAIN. (line 6) * onespot: Constants and Variables. (line 6) * onespot overflow: Errors. (line 174) * onespot, overflow warning: Warnings. (line 53) * operand overloading: Operand Overloading. (line 6) * operand overloading, impossible: Errors. (line 185) * operands, OIL, in patterns: OIL Patterns. (line 20) * operands, OIL, in replacements: OIL Replacements. (line 35) * operator: Operators. (line 6) * operators, OIL: OIL Expressions. (line 19) * optimization: Optimizer Options. (line 6) * optimization, control flow: Optimizer Options. (line 10) * optimization, extreme: Optimizer Options. (line 17) * optimization, flow: Optimizer Options. (line 10) * optimization, idioms: Optimizer Options. (line 27) * optimization, OIL: Optimizer Options. (line 27) * Optimizer Idiom Language: Optimizer Idiom Language. (line 6) * optimizer options: Optimizer Options. (line 6) * optimizer, debugging: Debug Options. (line 29) * options, debug: Debug Options. (line 6) * options, dialect: Language-affecting Options. (line 6) * options, help: Other Options. (line 9) * options, language-affecting: Language-affecting Options. (line 6) * options, optimizer: Optimizer Options. (line 6) * options, other: Other Options. (line 6) * options, output: Output Options. (line 6) * options, to generated programs: Options to Generated Programs. (line 6) * options, to 'ick': Invoking ick. (line 6) * or: Unary Binary Logic. (line 6) * or16: OIL Patterns. (line 117) * or32: OIL Patterns. (line 117) * other languages: External Calls. (line 6) * other languages, C: External Calls to C. (line 6) * other options: Other Options. (line 6) * out of bounds: Errors. (line 146) * out of memory: Errors. (line 221) * out of memory, backtracking: Errors. (line 448) * out of memory, during compile: Errors. (line 358) * out of memory, during 'STASH': Errors. (line 126) * out of memory, I/O: Errors. (line 156) * out of memory, multithreading: Errors. (line 448) * output: READ OUT and WRITE IN. (line 6) * output file, failure to write: Errors. (line 427) * output options: Output Options. (line 6) * output, C only: Output Options. (line 13) * output, C-INTERCAL: C-INTERCAL I/O. (line 6) * output, CLC-INTERCAL: CLC-INTERCAL I/O. (line 6) * output, flushing: Options to Generated Programs. (line 37) * output, in Arabic numerals: Options to Generated Programs. (line 21) * output, INTERCAL-72: INTERCAL-72 I/O. (line 6) * output, to standard output: Output Options. (line 28) * overflow, in constant: Errors. (line 19) * overflow, over 16 bits: Errors. (line 174) * overflow, over 32 bits: Errors. (line 264) * overflow, over onespot: Errors. (line 174) * overflow, over twospot: Errors. (line 264) * overflow, warning: Warnings. (line 53) * parser, debugging: Debug Options. (line 12) * patches, submitting: Reporting Bugs. (line 6) * patterns: OIL Patterns. (line 6) * patterns, operands: OIL Patterns. (line 20) * PIC-INTERCAL: PIC-INTERCAL. (line 6) * PIC-INTERCAL, command line option: Language-affecting Options. (line 97) * PIC-INTERCAL, unsupported command: Errors. (line 163) * PIN: PIC-INTERCAL. (line 55) * 'PIN', in a non-PIC program: Errors. (line 348) * PLEASE: Statement Identifiers. (line 6) * 'PLEASE', proportion required: Errors. (line 25) * politesse: Errors. (line 25) * portability, unary operators: Warnings. (line 93) * positional precedence: Grouping Rules. (line 6) * Princeton compiler: Differences to Other Compilers. (line 11) * Princeton syntax: Princeton and Atari Syntax. (line 11) * Princeton syntax, option: Language-affecting Options. (line 110) * printflow, enabling: Debug Options. (line 64) * profiling: Debug Options. (line 48) * quitting: GIVE UP. (line 6) * r: OIL Patterns. (line 103) * rabbit-ears: Grouping Rules. (line 6) * rabbit-ears, nesting limit: Errors. (line 202) * random bug: Language-affecting Options. (line 17) * random bug, error message: Errors. (line 372) * READ OUT: READ OUT and WRITE IN. (line 6) * read-only variables: IGNORE and REMEMBER. (line 6) * read-write variables: IGNORE and REMEMBER. (line 6) * READING OUT: READ OUT and WRITE IN. (line 6) * REINSTATE: ABSTAIN and REINSTATE. (line 6) * reinstate, at program start: Statement Identifiers. (line 6) * reinstate, during execution: ABSTAIN and REINSTATE. (line 6) * REINSTATE, self-reinstating: ONCE and AGAIN. (line 6) * reinstated state: Statement Identifiers. (line 6) * REINSTATING: ABSTAIN and REINSTATE. (line 6) * 'REINTSTATE', nonexistent target: Errors. (line 88) * releasing C-INTERCAL: Distributing. (line 6) * REMEMBER: IGNORE and REMEMBER. (line 6) * REMEMBERING: IGNORE and REMEMBER. (line 6) * replacements: OIL Replacements. (line 6) * replacements, operands: OIL Replacements. (line 35) * reporting bugs: Reporting Bugs. (line 6) * RESUME: NEXT FORGET and RESUME. (line 6) * 'RESUME', by 0: Errors. (line 317) * RESUME, in C: ick_resume. (line 6) * RESUME, in Funge: The IFFI Fingerprint. (line 164) * RESUMING: NEXT FORGET and RESUME. (line 6) * RETRIEVE: STASH and RETRIEVE. (line 6) * 'RETRIEVE', without stashing: Errors. (line 249) * 'RETRIEVE'/'IGNORE' interaction: STASH and RETRIEVE. (line 34) * RETRIEVING: STASH and RETRIEVE. (line 6) * reverse assignment: Operand Overloading. (line 6) * reverse assignment, error: Errors. (line 185) * reverse assignment, impossible: Errors. (line 185) * reverse goto: COME FROM and NEXT FROM. (line 6) * Roman numerals: INTERCAL-72 I/O. (line 6) * Roman numerals, disabling: Options to Generated Programs. (line 21) * runtime debugger: The yuk debugger. (line 6) * self-abstaining: ONCE and AGAIN. (line 6) * self-reinstating: ONCE and AGAIN. (line 6) * SENESTMAX: Errors. (line 202) * separate threads: Multithreading using COME FROM. (line 6) * setbitcount: OIL Patterns. (line 137) * sharkfin: TriINTERCAL. (line 6) * sharkfin, in base 2: Errors. (line 482) * signatures: ick_create. (line 43) * simple installation: Simple Installation. (line 6) * skeleton file, directory problems: Debug Options. (line 72) * skeleton file, errors: Errors. (line 501) * slat: Operand Overloading. (line 6) * smudgeleft: OIL Patterns. (line 145) * smudgeright: OIL Patterns. (line 145) * spark: Grouping Rules. (line 6) * spark, nesting limit: Errors. (line 202) * 'src/idiotism.oil': OIL Basics. (line 6) * stack overflow: Errors. (line 49) * stack, instruction pointer: NEXT FORGET and RESUME. (line 6) * stack, NEXT: NEXT FORGET and RESUME. (line 6) * stack, variable: STASH and RETRIEVE. (line 6) * standard output: Output Options. (line 28) * startup code, C: ick_startup. (line 6) * STASH: STASH and RETRIEVE. (line 6) * stash failure: Errors. (line 249) * stashes: STASH and RETRIEVE. (line 6) * STASHING: STASH and RETRIEVE. (line 6) * statement identifier: Statement Identifiers. (line 6) * statements: Statements. (line 6) * statements, INTERCAL: Statements. (line 6) * SUB: Array Subscript. (line 6) * submitting patches: Reporting Bugs. (line 6) * subscripts: Array Subscript. (line 6) * subtract-without-borrow: TriINTERCAL. (line 6) * syntax error: Errors. (line 10) * syntax error <1>: Syntax Error. (line 6) * syntax, Atari: Princeton and Atari Syntax. (line 38) * syntax, creating: CREATE. (line 6) * syntax, dialects: Princeton and Atari Syntax. (line 6) * syntax, INTERCAL: Syntax. (line 6) * syntax, of OIL: OIL Syntax. (line 6) * syntax, Princeton: Language-affecting Options. (line 110) * syntax, Princeton <1>: Princeton and Atari Syntax. (line 11) * syslib: syslib. (line 6) * syslib, directory problems: Debug Options. (line 72) * syslib, errors: Errors. (line 62) * syslibc: Expansion Libraries. (line 40) * system libraries: System Libraries. (line 6) * system library, directory problems: Debug Options. (line 72) * system library, disabling: Language-affecting Options. (line 55) * system library, errors: Errors. (line 62) * system library, in C: Expansion Libraries. (line 40) * tail: Constants and Variables. (line 6) * ternary: TriINTERCAL. (line 6) * Threaded INTERCAL: Multithreading and Backtracking. (line 6) * threading: Multithreading and Backtracking. (line 6) * threading, connected: Multithreading using WHILE. (line 6) * threading, dormant: Backtracking. (line 6) * threading, in series: Backtracking. (line 6) * threading, separate: Multithreading using COME FROM. (line 6) * threading, unwoven: Multithreading using COME FROM. (line 6) * threading, woven: Multithreading using WHILE. (line 6) * time-reversed goto: COME FROM and NEXT FROM. (line 6) * tips, OIL: OIL Tips. (line 6) * too many input files: Errors. (line 358) * TriINTERCAL: TriINTERCAL. (line 6) * TriINTERCAL, operators in base 2: Errors. (line 482) * TRY AGAIN: TRY AGAIN. (line 6) * 'TRY AGAIN', not last: Errors. (line 458) * Turing Tape: C-INTERCAL I/O. (line 6) * twospot: Constants and Variables. (line 6) * twospot overflow: Errors. (line 264) * Ubuntu: Simple Installation. (line 92) * unary binary logic: Unary Binary Logic. (line 6) * unary operator, infix: Grouping Rules. (line 69) * unary operator, prefix: Grouping Rules. (line 69) * unary operators, portability: Warnings. (line 93) * uninstalling: Uninstalling. (line 6) * unpacking C-INTERCAL: Unpacking. (line 6) * unsupported file type: Errors. (line 442) * unsupported file type <1>: Errors. (line 492) * unwoven threads: Multithreading using COME FROM. (line 6) * unzipping C-INTERCAL: Unpacking. (line 6) * usage instructions, printing: Other Options. (line 9) * using external calls: Using External Calls. (line 6) * V: Unary Binary Logic. (line 6) * variable: Constants and Variables. (line 6) * variable, illegal number: Errors. (line 115) * variables, assignment: Calculate. (line 6) * variables, from C: ick_get/setone/twospot. (line 6) * variables, Funge, accessing: The IFFI Fingerprint. (line 121) * variables, Funge, setting: The IFFI Fingerprint. (line 170) * variables, ignoring: IGNORE and REMEMBER. (line 6) * variables, limit: Errors. (line 213) * variables, read-only: IGNORE and REMEMBER. (line 6) * variables, read-write: IGNORE and REMEMBER. (line 6) * variables, remembering: IGNORE and REMEMBER. (line 6) * variables, stashes: STASH and RETRIEVE. (line 6) * W016: Warnings. (line 12) * W018: Warnings. (line 19) * W112: Warnings. (line 32) * W128: Warnings. (line 42) * W239: Warnings. (line 64) * W276: Warnings. (line 53) * W278: Warnings. (line 73) * W450: Warnings. (line 84) * W534: Warnings. (line 93) * W622: Warnings. (line 104) * warnings: Warnings. (line 6) * warnings, enabling: Debug Options. (line 40) * warnings, non-INTERCAL-72: Warnings. (line 32) * what: Unary Binary Logic. (line 6) * WHILE: Multithreading using WHILE. (line 6) * 'WHILE', not enabled: Errors. (line 239) * whirlpool: TriINTERCAL. (line 6) * whirlpool, in base 2: Errors. (line 482) * wimpmode: Options to Generated Programs. (line 21) * woven threads: Multithreading using WHILE. (line 6) * WRITE IN: READ OUT and WRITE IN. (line 6) * WRITING IN: READ OUT and WRITE IN. (line 6) * wrong array dimension: Errors. (line 146) * x: OIL Patterns. (line 94) * x1--x9: OIL Patterns. (line 94) * xor: Unary Binary Logic. (line 6) * xor16: OIL Patterns. (line 117) * xor32: OIL Patterns. (line 117) * xselx: OIL Patterns. (line 130) * yuk: The yuk debugger. (line 6) * yuk, breakpoint overflow: Errors. (line 419) * yuk, command line option: Debug Options. (line 82) * yuk, commands: The yuk debugger. (line 33) * yuk, input overflow: Errors. (line 412) * yuk, profiling: Debug Options. (line 48) * yuk, too many breakpoints: Errors. (line 419) intercal-0.30/doc/PaxHeaders.27456/fixtoc.pl0000644000000000000000000000007411437550756015421 xustar0030 atime=1427954558.347140885 30 ctime=1427992235.626945589 intercal-0.30/doc/fixtoc.pl0000755000175000017500000000050111437550756015313 0ustar00esresr00000000000000#!/bin/perl -w # Deindent and delink part headings in the TOC, and remove the initial # H2 entry. my $f=1; while(<>) { $f and /

$1

    %; print; last if $_ eq "\n"; } while(<>) {print;} intercal-0.30/doc/PaxHeaders.27456/THEORY.txt0000644000000000000000000000013212507155722015327 xustar0030 mtime=1427954642.774849006 30 atime=1427954642.862848705 30 ctime=1427992235.634945567 intercal-0.30/doc/THEORY.txt0000664000175000017500000002114612507155722015235 0ustar00esresr00000000000000= INTERCAL IMPLEMENTOR'S NOTES = Eric S. Raymond & Alex Smith The C-INTERCAL compiler has a very conventional implementation using YACC and LEX (latterly, bison and flex). It generates C, which is then passed to your C compiler. == Lexical issues == The spectacular ugliness of INTERCAL syntax requires that the lexical analyzer have two levels. One, embedded in the input() function, handles the backquote and bang constructs, and stashes the input line away in a buffer for the splat construct's benefit. The upper level is generated by lex(1) and does normal tokenizing for YACC. The upper level of the lexer also does a bit of syntax analysis, by distinguishing it from an ordinary COME FROM and passing different symbols to the parser. The lexer is also responsible for helping the parser to match sparks and ears in complicated array situations, by distinguishing possibly closing sparkears from definitely opening sparkears. In order to splatter erroneous statements correctly, the generated code has to track both logical and physical lines. That's the reason for the 'lineno' variable in the generated C, it's actually tracking physical lines. Numeral tokens for input are defined in a symbol table (numerals.c) that is directly included in the run-time library module (cesspool.c). This avoids having to put the the size of the numerals array in an extern. To add new numeral tokens, simply put them in the numerals initializer. == Compilation == The parser builds an array of tuples, one for each INTERCAL statement. Most tuples have node trees attached. Once all tuples have been generated, the compile-time checker and optimizer phases can do consistency checks and expression-tree rewrites. Finally, the tuples are ground out as C code by the emit() function. Calculations are fully type-checked at compile time; they have to be because (as I read the manual) the 16- and 32-bit versions of the unary ops do different things. The only potential problem here is that the typechecker has to assume that :m ~ :n has the type of :n (32-bit) even though the result might fit in 16 bits. At run-time everything is calculated in 32 bits. When INTERCAL-72 was designed 32 bits was expensive; now it's cheap. Really, the only reason for retaining a 16-bit type at all is for the irritation value of it (yes, C-INTERCAL *does* enforce the 16-bit limit on constants). Labels are mapped to tuple indices (logical line numbers) in the code checker, just before optimization. == Code Generation == Each line of INTERCAL is translated into a C if()-then; the guard part is used to implement abstentions and RESUMES, and the arm part translates the `body' of the corresponding INTERCAL statement. The generated C code is plugged into the template file ick-wrap.c inside main(). It needs to be linked with cesspool.o, fiddle.o and lose.o (these are in libick.a, with the support for runtime switches, arrgghh.o). Cesspool.o is the code that implements the storage manager; fiddle.o implements the INTERCAL operators; and lose.o is the code that generates INTERCAL's error messages. The routine arrgghh.o parses the runtime command line arguments. The abstain[] array in the generated C is used to track line and label abstentions; if member i is on, the statement on line i is being abstained from. If gerund abstentions/reinstatements are present in the code, a second array recording the type of each statement in generated into the runtime, and used to ensure that these operations are translated into abstention-guard changes on all appropriate line numbers. RESUMES are implemented with a branch to a generated switch statement that executes a goto to the appropriate label. If there are no RESUMES, no such switch is generated. The compiler places a simple label at the location of each COME FROM in the program, while all of the machinery for checking for abstention and conditional execution and actually performing the jump is placed immediately after the code for the target statement. AIS adds: The additions to the language [since 0.24] have made code generation potentially more complicated, depending on which switches are on. Each INTERCAL command is still translated into an if()-then, but with extra guards around it. COME FROM is still handled the same way, but only in singlethreaded programs with no computed COME FROMs. For anything more complicated than that, a general COMING FROM mechanism is invoked. C's most confusing control-flow identifiers, setjmp and longjmp, are used. When computed COME FROMs are involved, after every labeled statement, a set of gotos are done to check each in turn. A jmp_buf, cjb, is used to store the point in the program where the check started. Each COME FROM leading to that line and computed COME FROM anywhere in the program is checked, and modifies cjb to aim for its suckpoint if neccesary. In the case of a multithreaded program, one cjb will be stored in a linked ring of threads, and the other will be the one in the main program. Extra guards are also added for ONCE/AGAIN; the position of this guard depends on whether the command is a NEXT or something else. ONCE/AGAIN are quite legal even in singlethreaded programs. Computed ABSTAIN is dealt with by allowing the abstain[] array to hold values other than 0 or 1. Multithreading is supported by a new library, libickmt.a, to hold the multithread versions of libick.a functions. See unravel.c for an explanation of the full gory details of the multithread implementation (it has many comments explaining the implementation at the top). == Optimization == The optimizer core does full recursive folding of all constant expressions at compile time (evaluating away all the irritating little kluges you have to use to generate 32-bit constants). It also checks for known INTERCAL idioms for `test for equality', `test for nonzeroness', and the C logical operators &, |, ^, and ~. Here are the constant-folding optimizations from the original optimizer core: 'Vx$y'~"#0x55555555" into (x | y) '?x$y'~"#0x55555555" into (x ^ y) '&x$y'~"#0x55555555" into (x & y) (x ^ 0xFFFF) or (x ^ 0xFFFFFFFF) into ~x AIS adds: When I got my C-INTERCAL distribution, it only had a rudimentary optimiser. Constant folding had already been done, and the following optimisations. The following is mixed INTERCAL and C, sometimes in the same statement. It should be clear from context and whether I have used INTERCAL spark-ears or C brackets which language is which, although in some places I've mixed them. Note that the optimizer is only run in binary. ESR adds: After 0.24, Alex Smith, assisted by Joris Huizer, wrote a program that interprets an Optimizer Idiom Language and uses it to generate a library implementing those optimizations to be linked to the compiler. This subsumes all the stuff that used to be in the optimizer code. AIS adds: Optimizations available with -f (I wrote all these) Guard removal (if a line can't be abstained, the if(!abstained[x]) line is removed when possible) Ignorance checks (if a variable can't be ignored and it can't overflow, assignment is done with C's = rather than a function) Recognition of NEXT...NEXT...computed RESUME as an idiom for if() (currently disabled because the rest of the optimiser can't handle it) Optimizations available with -F (I wrote this one) This optimization should mean that INTERCAL suddenly becomes the best language for various benchmark programs. Basically, the file is analysed to try to determine whether it takes no input and always produces the same output. If that is the case, the output is simply a shell-script (with executable permissions set and a #! line) that outputs the correct output! Therefore, the time required for one run of the program is taken up during compilation, and whenever the program is executed, it just copies out the predetermined output. This means (for instance) that primes.i runs in only a fraction of a second when optimized with -F. Of course, this tends to slow down the compiler and often produces a large object file, which is why it has a command-line option of its own. == Credits == ESR wrote the first version of this compiler over a weekend using a pre-ANSI C compiler. It worked, but it wasn't pretty. Louis Howell added the array support later; he also torture-tested the COME FROM implementation by actually using it for the life2.i program included in this distribution, and fixed some bugs. Brian Raiter did a much-needed delinting while porting it for ANSI C, flex and Linux. He also improved the lexical analyzer's line tracking. Alex Smith, assisted by Joris Huizer, did a lot of heavy-duty work on optimization, including designing and implementing OIL, after 0.24. intercal-0.30/doc/PaxHeaders.27456/tidy.cfg0000644000000000000000000000007411437550756015222 xustar0030 atime=1427954558.347140885 30 ctime=1427992235.634945567 intercal-0.30/doc/tidy.cfg0000644000175000017500000000164711437550756015125 0ustar00esresr00000000000000accessibility-check: 0 break-before-br: yes char-encoding: latin1 doctype: transitional drop-empty-paras: yes drop-font-tags: yes drop-proprietary-attributes: yes fix-bad-comments: yes hide-comments: no hide-endtags: no indent: yes indent-attributes: no indent-cdata: yes indent-spaces: 2 input-encoding: latin1 input-xml: no join-classes: yes join-styles: yes keep-time: no logical-emphasis: yes lower-literals: yes merge-divs: yes newline: LF numeric-entities: no output-bom: no output-encoding: latin1 output-html: yes output-xhtml: no output-xml: no punctuation-wrap: no quiet: yes quote-ampersand: yes quote-marks: no quote-nbsp: yes repeated-attributes: keep-last show-errors: 50 show-warnings: no split: no tab-size: 2 tidy-mark: no uppercase-attributes: no uppercase-tags: no vertical-space: yes wrap: 78 wrap-asp: yes wrap-attributes: no wrap-jste: yes wrap-php: yes wrap-script-literals: no wrap-sections: no write-back: yes intercal-0.30/doc/PaxHeaders.27456/chipspec.txt0000644000000000000000000000007411440130756016113 xustar0030 atime=1427954558.343140896 30 ctime=1427992235.646945528 intercal-0.30/doc/chipspec.txt0000644000175000017500000003404011440130756016007 0ustar00esresr00000000000000 The Intercal Machine Machine Language Specification File (c) 1990 Christian Brunschen, a. k. a. d89cb@efd.lth.se This file contains the specifications for the Machine / Assembly Language used by the Intercal Machine Microprocesor, which closely follows the definition of the Intercal Compiler Language as defined by Woods/Lyon in 1972. It also contains ideas as to the actual implementation, hard- or softwarewise, of the Processor Instruction Set in an actual environment. It should be noted that the Intercal Machine Microprocessor is the first actual RISC processor (RISC being, of course, the acronym for Ridiculous Instruction Set Computer). Overview of processor capabilities / requirements Schematic overview of processor I/O busses: +----------------\ /--------------+ _| \_/ |_ D +--- |_| D0 A04 |_| ---+ a | _| |_ | t | |_| D1 A05 |_| | a | _| |_ | | |_| D2 A06 |_| | b | _| |_ | u | |_| D3 A07 |_| | s ---+ _| |_ | | |_| D4 A08 |_| | 8 | _| |_ | A | |_| D5 A09 |_| | d b | _| |_ | d i | |_| D6 A10 |_| | r t | _| |_ | e s +--- |_| D7 A11 |_| | s _| |_ | s |_| DACK A12 |_| | _| |_ | |_| GND A13 |_| | _| _____ |_ | b |_| RESET A14 |_| +--- u _| ____ |_ | s |_| MEM/WRLD A15 |_| | _| _ |_ | 2 |_| R/W A16 |_| | 4 _| |_ | |_| CLK A17 |_| | b _| |_ | i |_| VCC A18 |_| | t _| |_ | s |_| ERROR A19 |_| | _| |_ | +--- |_| A00 A20 |_| | | _| |_ | | |_| A01 A21 |_| | | _| |_ | | |_| A02 A22 |_| | | _| |_ | | |_| A03 A23 |_| | | | | | | +-----------------------------------+ | | | | | +-------------------------------------------------+ The only signals that might require some explanation are probably _ R/W : When this signal is low, The processor is reading data from the databus. When it is high, the processor is driving the the databus. _____ RESET : When this signal goes low, the processor is reset, and starts reading incoming data from the databus, one byte each clock cycle, until the line goes high again, at which time the processor will resume execution of the program at memory location (Hex) 000000 (24 bits, remeber ?) ____ MEM/WRLD : _ Indicates the `target' or `source' (depending on the status of the R/W line) of the data bus, sort of like an additional address bit. If this line is low, the processor is communicating with the outside world. If it is high, the processor is talking to its memory. DACK : Data ACKnowledge. Used when the processor communicates with the outside world. Two cases: a) Processor Talking After the processor put the data on the databus, it will wait until the DACK has been raised, and then dropped again. Then it will put the next byte of data (if any) on the bus, or proceed to the next instruction. b) Processor listening The same procedure as above, but in the other direction : After the processor has read one byte of data, it quickly raises & drops the line, and then expects the next data item to be present. ERROR : Indicates the fact that an error condition has occurred somewhere in the program. The error number is present on the data bus. After the error number has ben read, the address of the next statement to be executed, had the eror not occurred, can be read in three consecutive bytes from the databus. Processor Memory Management Since the Intercal Language provides quite a few interesting ways to manipulate arrays, stash and retrieve data, etc, all of which operations require manipulations of memory, and it was the intention of this implementation to provide an instruction set which immediately makes the average Intercal programmer feel right at home, quite a few very complex instructions have been provided. Intercal Machine Language Reference Part Summary of instructions: ABG ABstain from Gerund ABL ABstain from Label ALA ALlocate Aray BAA Begin Array Allocation BIA Begin Indexing Array BIN BINary operator CAL CALculate DLD Data LoaD EAA End Array Allocation FRG FoRGet IDA InDex Array IGN IGNore INS INitiate Statement NEX NEXt OST Open STorage PCT PerCenTage qualifier POP POP PPA PoP Array pointers PSA PuSh Array pointers PSH PuSH RDO ReaD Out REG Reinstate Gerund REL Reinstate Label RMB ReMemBer RSM ReSuMe RTV ReTrieVe STS STaSh UNO UNary Operator WRI WRite In General Format: i i i i i p p s where i = instruction field p = private field s = size field ABstain from Label ABL Label 0 1 1 1 1 0 0 0 Sets the abstain bit of instruction at Label ABstain from Gerund ABG mnm 0 1 1 1 1 1 0 0 Sets the abstain bit of all statements whosde main instruction is mnm Allocate Array ALA #num ALA .var ALA :var ALA , ALA ; ALA RES 0 0 0 1 1 p p s where p p specifies the source, 0 0 : immediate data <16 bits> 0 1 : Variable 1 0 : Array, as pointed to by the Read Array Pointer 1 1 : the contents of the RES register Takes the ALA argument, multiplies it with the current contents of the Temproary Register, and puts the result in the Temporary Register. Begin Allocating Array BAA ,var BAA ;var 0 0 0 1 0 0 0 s array specifier, 16 bits jump offset, 16 bits Deallocates the memory block currently allocated to array `var', opens the Arrray Entry for array `var' for writing, and puts a pointer to the Array Entry in the Wite Array Data pointer register. If the array is being ignored, none of these things actually happen -- instead, the jump offset is added to the program counter. Begin Indexing Array BIA R ,var BIA W ,var BIA R ;var BIA W ;var 0 0 1 0 1 0 t s array specifier, 16 bits where t = type, 0 = Read or 1 = Write Sets the Read Array Data pointer to the address of the first array element, and the Read Array Dimension pointer to the first Dimension entry in the Array Table, thus preparing for further indexing. BINary operator BIN ~ Select BIN c/ Interleave, BIN $ aka Mingle 0 1 1 0 0 t 0 0 where t is the operation specifier: 0 : Select 1 : Interleave / Mingle The operation is performed on the OP1 and OP2 registers, and the result is placed in the RES register. CALculate CAL . CAL : CAL , CAL ; 0 1 0 1 0 0 0 s Puts the contents of the RES register in the memory location pointed to by the Write Array Data pointer Data LoaD DLD t #num DLD t .var DLD t :var DLD t , DLD t ; DLD t RES 0 1 0 0 t p p s where t = target register, 0 = OP1 or 1 = OP2 p p = source : 0 0 : Immediate data <16 bits> 0 1 : Variable 1 0 : Array item (as indexed by the Read Array Data pointer) 1 1 : RES register Loads the target register with the contents of the source End Allocating Array EAA 0 0 1 0 0 0 0 0 Allocates a chunk of memory to the size of FoRGet FRG #num FRG .var FRG :var FRG , FRG ; FRG RES 1 0 0 0 0 p p s where p p = source : 0 0 : Immediate <16 bits> 0 1 : variable 1 0 : array (as indexed by the Read Array Data pointer) 1 1 : RES register Pops source number of addresses from the stack, discarding them. InDex Array IDA R #num IDA W #num IDA R .var IDA W .var IDA R :var IDA W :var IDA R RES IDA W RES 0 0 1 1 t p p s where t = type, 0 = Read or 1 = Write p p = source : 0 0 : Immediate Data <16 bits> 0 1 : variable 1 0 : ILLEGAL 1 1 : RES register Takes the Array Dimension (i.e, what the Array Dimension Pointer points to), adds (#num or RES) instances of it to the Array Data Pointer, and adds 2 to the Array Dimension Pointer. IGNore IGN .var IGN :var IGN ,var IGN ;var 1 0 1 0 1 0 0 s variable specifier, 16 bits Sets the ignore flag of the variable specified INitiate Statement INS mnm Label where `mnm' is one of the following 3-character mnemonics: ABS ABStain REI REInstate CAL CALculate NEX NEXt FRG FoRGet RES RESume STS STaSh RTV ReTrieVe IGN IGNore RMB ReMemBer WRI WRite In RDO ReaD Out 1 1 1 p p p p p 2 bytes : a o o o o o o o o o o o o o o o where p p p p p = major instruction opcode where a is the abstain bit of the instruction : set if this instruction is to be abstained from. The remaining 15 bits are the jump offset, which will be added to the program counter should the instruction be abstained from. It is presumed that no statement will result in code exceeding 32.767 bytes. NEXt NEX Label 0 1 1 0 1 0 0 0 Target Address, 24 bits Pushes the address of the next instruction on the return stack and puts the Target addres in the Program counter Open STorage OST .var Label OST :var Label OST ,var Label OST ;var Label 0 0 0 0 1 0 0 s variable/array specifier, 16 bits jump offset, 8 bits Trys to open the specified variable for writing. If it being ignored (i.e, its ignore flag is set) the jump offset is added to the program counter. If it is an array, the Write Array Data pointer is set to the address of the first element of the array, and the Write Array Dimension pointer to the first dimension entry in the Array Table. If it is a Variable, the Write Array Data pointer is set to the address of the Variable. PerCenTage qualifier PCT #num Label 0 0 0 0 0 0 0 0 0 c c c c c c c Jump offset, 16 bits where c c c c c c c is a 7 bit binary number between 0 and 100 Gets a random number in the range 0 .. 99, compares it to the percent chance and acts on the result: - if the random number is less than the percent chance, nothing is done - if it is equal or greater, the jump offset is added to the program counter POP POP 1 1 0 0 0 0 1 0 Gets the top item on the stack and puts it in the RES register -- 32 bits PoP Array pointers PPA 1 1 0 0 1 0 1 0 Retrieves the contents of the Read Array Data pointer from the stack PuSh Array pointers PSA 1 1 0 0 1 0 0 0 Pushes the contents of the Read Array Data pointer to an internal stack PuSH PSH 1 1 0 0 0 0 0 0 Pushes the RES register to the stack -- 32 bits ReaD Out RDO #num RDO .var RDO :var RDO , RDO ; RDO RES 1 0 1 1 1 p p s where p p = source: 0 0 : Immediate <16 bits> 0 1 : Variable 1 0 : Array (as pointed to by the Read Array Data pointer) 1 1 : RES register Writes 2 or 4 bytes (16 or 32 bits) on the data bus REinstate Gerund REG mnm 0 1 1 1 0 1 0 0 operation specifier, 8 bits In this form, the hole program will be searched to find instructions of the specified type, and their abstain bits will be reset. REinstate Label REL Label 0 1 1 1 0 0 0 0 Label, 24 bits In this form, the instruction at the address of Label will have its abstain bit set/reset. ReMemBer RMB .var RMB :var RMB ,var RMB ;var 1 0 1 0 0 0 0 s variable specifier, 16 bits Clears the specified variable's ignore flag ReSuMe RSM #num RSM .var RSM :var RSM , RSM ; RSM RES 1 0 0 0 1 p p s where p p = source : 0 0 : Immediate <16 bits> 0 1 : variable 1 0 : array (as indexed by the Read Array Data pointer) 1 1 : RES register Pops source number of addresses from the stack. If there are less than `source' items on the stack, the procesor is halted and an error signaled If no error occurs, the last popped address is NOT discarded, but instead placed in the Program counter. ReTrieVe RTV .var RTV :var RTV ,var RTV ;var 1 0 0 1 1 0 0 s Variable/Array Specifier, 16 bits Retrieves the latest stashed instance of the variable or array specified STaSh STS .var STS :var STS ,var STS ;var 1 0 0 1 0 0 0 s Variable/Array specifier, 16 bits Stashes the variable or array specified UNary Operator UNO & AND UNO V OR UNO V- XOR UNO ? XOR 0 1 0 1 1 t t s where t is the operation specifier: 00 : AND 01 : OR 10 : XOR 11 : Illegal The specified operation is performed on the RESult register, leaving it there. WRite In WRI . WRI : WRI , WRI ; 1 0 1 1 0 0 0 s Reads 2 or 4 bytes (16 or 32 bits) from the data bus and puts them in the variable pointed to by the Write Array Data pointer intercal-0.30/doc/PaxHeaders.27456/ick.info0000644000000000000000000000013212507267255015204 xustar0030 mtime=1427992237.710939791 30 atime=1427992237.698939819 30 ctime=1427992237.726939747 intercal-0.30/doc/ick.info0000664000175000017500000001410512507267255015107 0ustar00esresr00000000000000This is ick.info, produced by makeinfo version 5.2 from ick.txi. This manual is for C-INTERCAL version 0.29. 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 C-INTERCAL (unlike the other manual, it is not derived from the original INTERCAL-72 manual). Copyright © 2007 Alex Smith. 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." INFO-DIR-SECTION INTERCAL START-INFO-DIR-ENTRY * C-INTERCAL: (ick). The C-INTERCAL language and compiler. * ick: (ick) Invoking ick. Invoking the C-INTERCAL compiler. * convickt: (ick) convickt. The command-line character set converter. END-INFO-DIR-ENTRY  Indirect: ick.info-1: 1118 ick.info-2: 303881  Tag Table: (Indirect) Node: Top1118 Node: About this manual3587 Node: Installation5362 Node: Obtaining6473 Node: Unpacking7983 Node: Simple Installation12111 Node: Installation on DOS18166 Node: Uninstalling21847 Node: Reporting Bugs23936 Node: Distributing27688 Node: Invoking ick29914 Node: Language-affecting Options31112 Ref: -b31901 Ref: -m32711 Ref: -e33383 Ref: -E+34063 Ref: -t34581 Ref: -a34795 Ref: -v35286 Ref: -C+36068 Ref: -P+36231 Ref: -X+36944 Ref: -x37595 Node: Debug Options38384 Ref: -d38802 Ref: -g39070 Ref: -h39416 Ref: -H+39416 Ref: -hH39416 Ref: -l39933 Ref: -p40266 Ref: -w41152 Ref: -u41508 Ref: -y42002 Ref: -Y+42211 Ref: -U+42496 Node: Output Options43384 Ref: -c43869 Ref: -o44619 Node: Optimizer Options45029 Ref: -f45301 Ref: -F+45596 Ref: -O+46053 Node: Other Options46485 Ref: -at46690 Node: Options to Generated Programs46941 Ref: +help47384 Ref: -help47384 Ref: +wimpmode47644 Ref: -wimpmode47644 Ref: +traditional48138 Ref: -traditional48138 Ref: +instapipe48224 Ref: -instapipe48224 Ref: +printflow48570 Ref: -printflow48570 Ref: +mystery49558 Ref: -mystery49558 Node: Environment Variables49744 Node: Errors and Warnings51401 Node: Errors53142 Ref: E00053367 Ref: E01753753 Ref: E07953945 Ref: E09954239 Ref: E11154478 Ref: E12354865 Ref: E12755505 Ref: E12956137 Ref: E13956866 Ref: E18257116 Ref: E19757772 Ref: E20058038 Ref: E22258578 Ref: E24059184 Ref: E24159420 Ref: E25259887 Ref: E25660121 Ref: E27560606 Ref: E27761135 Ref: E28162010 Ref: E33362523 Ref: E34562845 Ref: E40463190 Ref: E40563560 Ref: E43664019 Ref: E44464191 Ref: E53364561 Ref: E55365142 Ref: E55565562 Ref: E56266155 Ref: E57966576 Ref: E62166958 Ref: E63267325 Ref: E63367674 Ref: E65268428 Ref: E66668831 Ref: E77469518 Ref: E77770171 Ref: E77870422 Ref: E81071552 Ref: E81171768 Ref: E88871990 Ref: E89972217 Ref: E99072607 Ref: E99172765 Ref: E99373215 Ref: E99473528 Ref: E99573864 Ref: E99774162 Ref: E99874604 Ref: E99974985 Node: Warnings75443 Ref: W01675778 Ref: W01876030 Ref: W11276685 Ref: W12877164 Ref: W27677706 Ref: W23978246 Ref: W27878612 Ref: W45079102 Ref: W53479446 Ref: W62279944 Node: The yuk debugger80258 Ref: yuk80393 Node: Syntax87183 Node: Princeton and Atari Syntax88340 Node: Line Labels91840 Node: Statement Identifiers93891 Ref: DO94495 Ref: PLEASE94495 Ref: NOT95044 Ref: N'T95044 Node: Execution Chance96642 Node: ONCE and AGAIN98007 Ref: ONCE98125 Ref: AGAIN98125 Node: Expressions100466 Node: Constants and Variables101260 Node: Grouping Rules103607 Ref: Prefix and infix unary operators107187 Node: Operators108864 Node: Mingle109995 Node: Select114313 Node: Unary Binary Logic116852 Node: Array Subscript121161 Node: Statements122811 Node: Syntax Error124130 Node: Calculate126680 Node: NEXT FORGET and RESUME128889 Ref: NEXT129057 Ref: FORGET129057 Ref: RESUME129057 Node: STASH and RETRIEVE132363 Ref: STASH132531 Ref: RETRIEVE132531 Node: IGNORE and REMEMBER135076 Ref: IGNORE135245 Ref: REMEMBER135245 Node: ABSTAIN and REINSTATE136789 Ref: ABSTAIN136965 Ref: REINSTATE136965 Node: READ OUT and WRITE IN141670 Ref: READ OUT141834 Ref: WRITE IN141834 Node: INTERCAL-72 I/O142819 Node: C-INTERCAL I/O146013 Node: CLC-INTERCAL I/O148459 Node: GIVE UP151408 Node: TRY AGAIN152298 Node: COME FROM and NEXT FROM153180 Ref: COME FROM153324 Ref: NEXT FROM153324 Node: System Libraries156835 Node: syslib157932 Node: floatlib163491 Node: TriINTERCAL166779 Node: Multithreading and Backtracking171602 Node: Multithreading using COME FROM173585 Node: Multithreading using WHILE177859 Ref: WHILE178075 Node: Backtracking183320 Ref: MAYBE184661 Ref: GO BACK185618 Ref: GO AHEAD187933 Node: Operand Overloading188410 Node: PIC-INTERCAL192923 Ref: PIN195413 Node: CREATE197737 Node: External Calls204129 Node: External Calls to C206176 Node: External C Call Infrastructure208380 Node: ick_startup211719 Node: ick_linelabel212583 Node: ick_labeledblock214511 Node: ick_comefrom and ick_nextfrom215976 Node: ick_next218211 Node: ick_resume219780 Node: ick_forget221028 Node: ick_get/setone/twospot222773 Node: ick_create224097 Node: External Calls and auto230877 Node: External Calls to Funge-98236290 Node: Creating the Funge-98 Library238028 Node: The IFFI Fingerprint240847 Node: Miscellaneous External Calls252702 Node: Using External Calls254309 Node: Expansion Libraries257327 Node: Differences to Other Compilers261565 Node: Character Sets266892 Node: convickt271103 Node: Optimizer Idiom Language276788 Node: OIL Basics277906 Node: OIL Syntax279923 Node: OIL Expressions282880 Node: OIL Patterns285480 Ref: C functions in OIL288685 Node: OIL Replacements293489 Node: OIL Loops297545 Node: OIL Tips299025 Node: OIL Example303881 Node: Copying308269 Node: GNU Free Documentation License309779 Node: Main Index332132  End Tag Table  Local Variables: coding: iso-8859-1 End: intercal-0.30/doc/PaxHeaders.27456/ick.txt0000644000000000000000000000013112507267253015065 xustar0029 mtime=1427992235.44694609 30 atime=1417959276.069224317 30 ctime=1427992235.630945573 intercal-0.30/doc/ick.txt0000644000175000017500000136151612507267253015003 0ustar00esresr00000000000000C-INTERCAL 0.29 About this manual PART I: THE C-INTERCAL COMPILER 1 Installation 1.1 Obtaining 1.2 Unpacking 1.3 Simple Installation 1.4 Installation on DOS 1.5 Uninstalling 1.6 Reporting Bugs 1.7 Distributing 2 Invoking ick 2.1 Language-affecting Options 2.2 Debug Options 2.3 Output Options 2.4 Optimizer Options 2.5 Other Options 2.6 Options to Generated Programs 2.7 Environment Variables 3 Errors and Warnings 3.1 Errors 3.2 Warnings 4 The yuk debugger PART II: THE INTERCAL LANGUAGE 5 Syntax 5.1 Princeton and Atari Syntax 5.2 Line Labels 5.3 Statement Identifiers 5.4 Execution Chance 5.5 ONCE and AGAIN 6 Expressions 6.1 Constants and Variables 6.2 Grouping Rules 6.3 Operators 6.3.1 Mingle 6.3.2 Select 6.3.3 Unary Binary Logic 6.3.4 Array Subscript 7 Statements 7.1 Syntax Error 7.2 Calculate 7.3 NEXT, FORGET and RESUME 7.4 STASH and RETRIEVE 7.5 IGNORE and REMEMBER 7.6 ABSTAIN and REINSTATE 7.7 READ OUT and WRITE IN 7.7.1 INTERCAL-72 I/O 7.7.2 C-INTERCAL I/O 7.7.3 CLC-INTERCAL I/O 7.8 GIVE UP 7.9 TRY AGAIN 7.10 COME FROM and NEXT FROM 8 System Libraries 8.1 syslib 8.2 floatlib PART III: INTERCAL DIALECTS AND EXTENSIONS 9 TriINTERCAL 10 Multithreading and Backtracking 10.1 Multithreading using COME FROM 10.2 Multithreading using WHILE 10.3 Backtracking 11 Operand Overloading 12 PIC-INTERCAL 13 CREATE 14 External Calls 14.1 External Calls to C 14.1.1 External C Call Infrastructure 14.1.2 ick_startup 14.1.3 ick_linelabel 14.1.4 ick_labeledblock 14.1.5 ick_comefrom and ick_nextfrom 14.1.6 ick_next 14.1.7 ick_resume 14.1.8 ick_forget 14.1.9 ick_get/setone/twospot 14.1.10 ick_create 14.1.11 External Calls and auto 14.2 External Calls to Funge-98 14.2.1 Creating the Funge-98 Library 14.2.2 The IFFI Fingerprint 14.3 Miscellaneous External Calls 14.4 Using External Calls 14.5 Expansion Libraries 15 Differences to Other Compilers PART IV: APPENDICES AND INDICES Appendix A Character Sets Appendix B convickt Appendix C Optimizer Idiom Language C.1 OIL Basics C.2 OIL Syntax C.3 OIL Expressions C.4 OIL Patterns C.5 OIL Replacements C.6 OIL Loops C.7 OIL Tips C.8 OIL Example Appendix D Copying D.1 GNU Free Documentation License Index C-INTERCAL 0.29 *************** This manual is for C-INTERCAL version 0.29. 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 C-INTERCAL (unlike the other manual, it is not derived from the original INTERCAL-72 manual). Copyright © 2007 Alex Smith. 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." About this manual ***************** This is the Revamped Instruction Manual for C-INTERCAL (this version is distributed with C-INTERCAL version 0.29). It is divided into four parts. The first part is about the C-INTERCAL compiler 'ick', 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. The second part is about the core INTERCAL 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 (*note Copying::), so if you disagree you can move the commands from section to section yourself.) Mostly only commands that are implemented in C-INTERCAL are covered here (if you're interested in the other commands implemented in other compilers, read CLC-INTERCAL's documentation). However, a comprehensive guide to portability of these commands between C-INTERCAL and other INTERCAL compilers is given. The third part covers the INTERCAL extensions and dialects that are implemented by C-INTERCAL, such as TriINTERCAL and Threaded INTERCAL. Again, extensions and dialects not implemented have been mostly left out. The final part contains appendices (which were known as 'tonsils' in the original INTERCAL manual), such as character sets used by INTERCAL, programs other than 'ick' in the C-INTERCAL distribution, information on how to read and update the list of optimizer idioms used by the compiler, and the copyright. PART I: THE C-INTERCAL COMPILER ******************************* 1 Installation ************** The C-INTERCAL 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. 1.1 Obtaining ============= C-INTERCAL 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 C-INTERCAL compiler ought to be announced there. (If you are interested in what other INTERCAL 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 (http://groups.google.com), and a search for 'alt.lang.intercal' there should tell you where to find a copy. 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.) 1.2 Unpacking ============= C-INTERCAL is distributed in compressed pax format; for instance, you may find it as a '.pax.lzma' file if you have the 'unlzma' decompression program (this is advised, as it's the smallest); '.pax.bz2' is larger and '.pax.gz' is larger still. Most computers can decompress files in this format, even if they don't realise it, because pax is forwards-compatible with tar; try renaming the extension from '.pax' to '.tar' after decompressing to see if you have a progam that can decompress it. (If you're wondering why such an apparently non-standard format is being used, this is is actually a case where C-INTERCAL is being perfectly nonstandard by conforming to the standards; tar is no longer specified by POSIX, and pax is its replacement. It's just that pax never really caught on.) 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 _are_ an administrator, or at least have the same privileges, and can extract it anywhere). Some commands that you might use to extract it: Generic UNIX/Linux unlzma ick-0-29.pax.lzma tar xvf ick-0-29.pax or bunzip2 ick-0-29.pax.bz2 tar xvf ick-0-29.pax or gunzip ick-0-29.pax.gz tar xvf ick-0-29.pax On most UNIX-based and Linux-based systems, 'tar' will be available to unpack the installation files once they've been uncompressed with 'gunzip'. (I've heard that some BSD systems have 'pax' itself to decompress the files, although have not been able to verify this; some Linux distributions also have 'pax' in their package managers. Both tar and pax should work fine, though.) 'gunzip' is also likely to be available (and 'bunzip2' and 'unlzma' are less likely, but use those versions if you have them to save on your bandwidth); if it isn't, you will need to download a copy from the Internet. Using GNU tar tar xzvf ick-0-29.pax.gz or tar xqvf ick-0-29.pax.bz2 If you are using the GNU version of 'tar' (which is very likely on Linux), you can combine the two steps into one as shown here, except when using the lzma-compressed version. Using DJGPP djtar -x ick-0-29.pax.gz On a DOS system, you will have to install DJGPP anyway to be able to compile the distribution, and once you've done that you will be able to use DJGPP's decompressing and unpacking utility to extract the files needed to install the distribution. (You will need to type this at the command line; on Windows 95 and later, try choosing Run... from the start menu then typing 'cmd' (or 'command' if that fails) in the dialog box that opens to get a command prompt, which you can exit by typing 'exit'. After typing any command at a command line, press to tell the shell to execute that command.) On Windows If you're running a Windows system, you could always try double-clicking on the ick-0-29.pax.gz file; probably renaming it to have the extension '.tgz' is likely to give the best results. It's quite possible that you'll have a program installed that's capable of decompressing and unpacking it. Unfortunately, I can't guess what program that might be, so I can't give you any instructions for using it. Whatever method you use, you should end up with a directory created called 'ick-0.29'; 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 'cd ick-0.29'). 1.3 Simple Installation ======================= There are scripts included in the distribution to automate the process of installing, in various ways. The simplest method of installing on most operating systems (on DOS, *note Installation on DOS::) is to use the following routine: 1. Configure C-INTERCAL, by running 'configure'. Although building in the distribution directory works, it is recommended that you build elsewhere; create a directory to build in (using 'mkdir' on most operating systems), then run 'configure' from inside that directory (for instance, you could do this from inside the main installation directory: mkdir build cd build ../configure to build in a subdirectory of the distribution called "build"). You also specify where you want the files to be installed at this stage; the default of '/usr/local' is good for many people, but you may want to install elsewhere (in particular, if you want to test out C-INTERCAL without installing it, create a new directory somewhere you own and specify that as the place to install it, so the install will actually just copy the files into the right structure for use instead of installing them). To specify a location, give the option '--prefix=LOCATION' to configure; for instance, 'configure --prefix=/usr' would install in /usr. 2. Compile the source code, with the command 'make'. The Makefile will be set up for your version of 'make', and to automatically recompile only what needs compiling (it will even recompile the build system if you change that). 3. Optionally, create libraries from third-party interpreters to add support for more languages to the C-INTERCAL external calls system; see *note Creating the Funge-98 Library::. (This step can be skipped; you can also do it later, but if you do so you need to run the next step again.) 4. Install the executables, help files, include files, and libraries, using 'make install'. (This is the only step that needs root/administrator permissions; so on a system that uses sudo to elevate permissions, for instance, write it as 'sudo make install' if you're installing into a directory that you can't write to as a non-administrative user.) This step is optional; if you do not install C-INTERCAL, you can still run it by directly referencing the exact location of the 'ick' command. 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 (configure); its autoconf source code is available in the file 'configure.ac'.) 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 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 'ick'. 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 'sh', and don't have the shell 'bash' which can emulate it, and so can't run 'configure' 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 (C-INTERCAL was designed to work with 'gcc' and is tested mostly with that compiler, but in theory it should work with other C compilers too, and this is tested on occasion) and the associated software needed to compile C files to object files and executables, combine object files into libraries, etc.; but this requires trying to do the build by hand, so it's generally easier just to install a UNIX-like shell and associated tools. Another possibility 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 'lex' 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. 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 'binutils', 'cpp', 'gcc', 'libc6-dev', 'make' to compile C-INTERCAL, and if you want to modify it, you may also need 'autoconf', 'automake', 'bison', and 'flex'. For debugging help, you may also want 'gdb', and to recompile the documentation, you may need 'groff', 'texlive', 'texinfo', and 'tidy'. 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 'configure --help' to view the options that you can set on 'configure'; there's a wide range of settings that you can set available there, and one of them may be what you want. 1.4 Installation on DOS ======================= On DOS-based systems, it's possible to install C-INTERCAL via compiling it using DJGPP, a free DOS development system. (You can obtain DJGPP via its homepage, at .) The process for installing it works like this: 1. To start with, you will need to install DJGPP and various utilities (especially many of the GNU utilities) that come with it. To do this, see the instructions on DJGPP's website, and download and unpack any additional packages on this list that you did not install as part of those instructions (a filename by which the package can be found on DJGPP mirrors is given, and a version number with which C-INTERCAL was tested is given as part of the filename, but other versions are likely to work as well): * Unzip32 ('unzip32.exe') -- to unpack the other packages * DJGPP development kit ('v2/djdev203.zip') -- needed for all DJGPP compiles * CS's DPMI Provider ('v2misc/csdpmi7b.zip') -- you need some DPMI provider to run C-INTERCAL on a plain DOS system, although this is not needed on systems such as Microsoft Windows' emulation of DOS which already include a DPMI provider * GNU Binutils ('v2gnu/bnu219b.zip') -- needed to produce executables * gcc ('v2gnu/gcc444b.zip') -- used to compile C code * GNU make ('v2gnu/mak3791b.zip') -- used to resolve dependencies within the build system * GNU bash ('v2gnu/bsh204b.zip') -- used to interpret build scripts * GNU Diffutils ('v2gnu/dif20b.zip') -- used by the build scripts * GNU Fileutils ('v2gnu/fil41b.zip') -- used by the build scripts * GNU Findutils ('v2gnu/find41b.zip') -- used by the build scripts * GNU awk ('v2gnu/gwk318b.zip') -- used by the build scripts * GNU sed ('v2gnu/sed421b.zip') -- used by the build scripts * GNU Shellutils ('v2gnu/shl2011b.zip') -- used by the build scripts * GNU Textutils ('v2gnu/txt20b.zip') -- used by the build scripts, and sometimes by C-INTERCAL itself too You might want to install other packages, particularly GNU Bison and GNU Flex, in order to be able to rebuild certain parts of the compiler if you change them. This is not necessary to simply be able to run C-INTERCAL without changing it, though. 2. Test your DJGPP install to ensure it works, and make sure you have environment variables set up correctly. In addition to the 'DJGPP' variable that points to your 'DJGPP.ENV' file, and the 'PATH' variable that needs to contain DJGPP's binaries directory, you also need to set the 'DJDIR' environment variable to point to the main DJGPP installation directory. 3. Unpack a copy of C-INTERCAL in its own directory, if you haven't already (*note Unpacking::). 4. Load up a 'bash' session, change to the 'buildaux' subdirectory of your main C-INTERCAL directory, and run the command 'build-dj.sh'. This will run the entire C-INTERCAL build system, and hopefully end up with executables you can run in the 'build' subdirectory that will be created in your main C-INTERCAL directory. 5. If you wish, you can install C-INTERCAL by using the command 'make install' from the new 'build' subdirectory. It will run just fine in-place without a need to install, though, if you prefer. 1.5 Uninstalling ================ It may happen that you decide to uninstall C-INTERCAL 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 C-INTERCAL because this will save some disk space; you cannot install two versions of C-INTERCAL at once (at least, not in the same directory; but you can change the '--prefix' of one of the installations to get two versions at once). If you installed C-INTERCAL using 'make install', you can uninstall it by using 'make uninstall' 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 'ick' and 'convickt' where your computer installs binaries (with an extension like '.exe' added if that's usual for binaries on your operating system), 'libick.a', 'libickmt.a', 'libickec.a', and 'libyuk.a' where your computer installs libraries, and the subdirectories 'ick-0.29' in the places where your computer installs data files and include files, and their contents. You can go further than uninstalling. Running 'make clean' will delete any files created by compilation; 'make distclean' will delete those files, and also any files created by configuring. It's probably a wise idea to uninstall before doing a distclean, though, as otherwise information needed to uninstall will be deleted, as that information is generated by 'configure'. You can go even further and use 'make veryclean' which will delete not only files created by configuring, but the entire build system; doing so is not recommended unless you have some method of rebuilding the build system from its original sources (a script to do this is provided in repository versions of C-INTERCAL, because the generated part of the build system is not stored in the repository). 1.6 Reporting Bugs ================== If you can't get C-INTERCAL 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 C-INTERCAL version (which you can determine by looking at that newsgroup). 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 (*note E778::) 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 (*note Debug Options::) 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. 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, '-H' (*note -H: -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 '-U' (*note -U: -U+.), it helps if you can load a debugger (such as 'gdb') on the core dump, use the debugger to produce a backtrace, and send that backtrace. 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 C-INTERCAL), 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 'diff -u'; 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 C-INTERCAL. If you have a suggestion for a new feature, it makes sense to first discuss it on the alt.lang.intercal news group; other INTERCAL compiler maintainers may also want to implement that feature. If you have developed code to implement that feature in C-INTERCAL, you can submit it the same way that you would submit a patch for a bug. 1.7 Distributing ================ Due to the licensing conditions of C-INTERCAL, 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: 1. Make sure the new version is based on the most recent existing version. Looking at the alt.lang.intercal newsgroup will normally let you know what version is most recent. 2. Increment the version number; if you add any new features, increment the major version number (after the decimal point) and drop the minor version number (before the decimal point) to 0, and otherwise increment the minor version number. You have to update the version number in the following files: 'configure.ac', 'configure', and 'doc/ick.txi'. You also have to rename the installation directory to reflect the new version number. 3. Add an entry to the 'NEWS' file explaining what's new in the version that you're releasing, following the same format as the other entries. 4. Update the 'README' with a description of any new files you may have added. 5. Remove any autosave or backup files that may be littering the installation directory or its subdirectories. 6. Run 'make distcheck', which will make the distribution paxballs, and rename them to have the correct extensions (Automake thinks they're tarballs, so will use '.tar' rather than '.pax', and you have to fix this by hand). 'make distcheck' will also perform some sanity checks on the build system of the resulting paxball, which will help to ensure that nothing important is missing from it; and some regression tests on a version of C-INTERCAL built from the distribution tarball itself, to prove that it runs correctly and produces plausible output. (A failure of the regression checks will not stop the build, but should stop you distributing the resulting compiler.) 7. Place the new version somewhere on the Internet, and announce the location and the fact that a new version has been released on alt.lang.intercal. 2 Invoking ick ************** All operations on INTERCAL source code available in C-INTERCAL, other than the conversion from one character set to another, are currently carried out by the compiler 'ick'. The syntax is ick -options INPUTFILE (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 INTERCAL 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. 2.1 Language-affecting Options ============================== The following command-line options to 'ick' affect what dialect of the INTERCAL language is compiled by the compiler; you may need to set one or more of these options if your input is not the default C-INTERCAL but instead some other language like INTERCAL-72 or CLC-INTERCAL, 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 TriINTERCAL (or the base 4-7 versions); instead, the numeric base to use is determined by looking at the filename extension ('.i' for base 2, the default, or '.3i' to '.7i' for the base 3-7 versions.) '-b' If this option is _not_ given, there is a small chance that a random bug appears in the compiler, which causes the programs it creates to manifest a bug that causes error E774 (*note E774::). Giving the option means that this bug will not happen. (You may wonder why this bug was preserved; it is in fact a bug that was carefully preserved since the days of INTERCAL-72, in this case, but the option to turn it off is available as a workaround. (There are no plans to fix this or any of the other carefully preserved bugs any time soon, because that would kind of defeat the point of having preserved them.) Interestingly, the INTERCAL-72 compiler documentation mentions a similar command-line option that is a workaround for the same bug.) '-m' This option needs to be given to allow any multithreading or backtracking commands or identifiers to be used. (Unlike with other language features, this is not autodetected because it's legal to have a program with multiple COME FROM (*note COME FROM::) commands aiming at the same line even when it isn't multithreaded, in which case the commands cause error E555 (*note E555::) when that line is encountered (with the usual caveats about both commands having to be active at the time).) Attempts to use non-COME FROM multithreading or backtracking commands without this option produce error E405 (*note E405::). '-e' This option makes it possible to link non-INTERCAL programs with INTERCAL programs; instead of giving INTERCAL programs only on the command line, give one INTERCAL program, followed by any number of programs in other languages that have been written to be able to link to INTERCAL programs. It also allows expansion libraries to be specified on the command line, after the INTERCAL program (expansion libraries are given with no extension). For more information, see *note External Calls::. Also, both the '-a' and '-e' options must be set to use CREATEd operators (regardless of whether external calls are used or not). '-E' This option causes the system library to never be linked; this option is only useful if your program references a line number in the range 1000 to 1999, contains no line numbers in that range, and yet still doesn't want the system library to be linked in; therefore, it is mostly useful with '-e' when adding in a custom replacement system library written in a non-INTERCAL language, especially the expansion library 'syslibc' (a system library replacement written in C). '-t' This option tells the compiler to treat the source code as INTERCAL-72; as a result, any language constructs that are used but weren't available in 1972 will trigger error E111 (*note E111::). '-a' This option allows the CREATE statement (*note CREATE::) to be used. Note that enabling it carries a run-time penalty, as it means that operand overloading code has to be generated for every variable in the program. (This option is not necessarily needed for the external call version of CREATE to work, but the external call version has fewer features without it.) Note that '-e' (*note -e::) also needs to be set to be able to CREATE operators. '-v' It is possible to write INTERCAL code sufficiently tortuous that it ends up assigning to a constant. Generally speaking, this isn't what you wanted to do, so the compiler will kindly cause an error (E277; *note E277::) that stops the insanity at that point, but at the cost of a significant amount of performance you can give this option to tell the compiler to simply change the constant and keep on going anyway. (Note that unlike CLC-INTERCAL, this only changes uses of the constant preceded by '#' in your program, not things like line numbers; you want Forte (http://esolangs.org/wiki/Forte) for that.) This option also allows you to write arbitary expressions on the left of an assignment statement if you wish. '-C' When this option is given, the generated programs will write the number 4 as 'IIII' rather than 'IV', in case you're writing a clock program. '-P' This tells the compiler to treat the input as PIC-INTERCAL (*note PIC-INTERCAL::) rather than ordinary C-INTERCAL input, and generate PIC output code accordingly. There are a lot of options that are incompatible with this, as well as many language features, due to the limited memory available on a PIC. If you get error E256 (*note E256::), you have this option given when it shouldn't be; likewise, if you get error E652 (*note E652::), you should be using this option but aren't. (A few simple programs are C-INTERCAL/PIC-INTERCAL polyglots, but such programs are incapable of doing input or output, meaning that they aren't particularly useful.) '-X' The C-INTERCAL and CLC-INTERCAL compilers use different notation for various things, sometimes to the extent where the same notation is legal in both cases but has a different meaning. As this is the C-INTERCAL compiler, it rather guessably uses its own notation by default; however, the CLC-INTERCAL notation can be used as the default instead using this option. (In most situations where there isn't an ambiguity about what something means, you can use the 'wrong' syntax freely.) The option causes ambiguous characters like '?' to be interpreted with Princeton rather than Atari meanings. '-x' This option causes some constructs with different meanings in C-INTERCAL and CLC-INTERCAL to use the CLC-INTERCAL meaning rather than the C-INTERCAL meaning. At present, it affects the abstention of a GIVE UP (*note GIVE UP::) command by line number, which is possible as long as this switch isn't given; reading through the INTERCAL-72 manual, there are a lot of things that imply that this probably wasn't intended to be possible, but as far as I can tell that manual doesn't actually _say_ anywhere that this particular case is disallowed, even though it rules out all other similar cases. It also causes I/O on array variables to be done in CLC-INTERCAL's extended Baudot syntax, rather than using the Turing Tape method. 2.2 Debug Options ================= Sometimes things will go wrong with your program, or with the way 'ick' was installed. There may even be unknown bugs in 'ick' itself (if you find one of these, please report it). The following options are used to debug the whole system on various levels. '-d' If you think that something has gone wrong with the parser, or you want to see how your program is being parsed, you can give this option on the command line. All the debug output produced by the parser and lexical analyser will be output. '-g' This option allows debugging of the final executable at the C code level. Any C code generated will be left in place, and the '-g' 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 the executable will be present there. '-h' '-H' '-hH' These options allow debugging of the optimiser, or produce output helpful for understanding how your program has been summarised. '-h' produces a summary of what optimiser rules were used, the initial expression and what it was optimised to; '-H' produces a more expanded view that shows each intermediate step of optimisation, and '-hH' shows the same output as '-H', but written completely using C syntax (the other options output in a strange mix of INTERCAL and C). '-l' This option turns on generation of warnings (*note Warnings::). To make sure that they aren't actually useful, or are only marginally useful, the warning generator is far too sensitive, and there is no way to decide which warnings are given and which ones aren't; you either get all of them or none. '-p' 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 on the computer and operating system; DOS, in particular, is really bad with timer resolution. The output will be saved in a file called 'yuk.out' when the program finishes running. It's legal to turn on both the profiler and the interactive debugger at the same time, but if you do this the profiler will also identify bottlenecks in the person typing in commands to step through the program! The profiler will, in fact, identify all the timings that particular commands in the program take; so 'WRITE IN' instructions will often show up as taking a long time due to their need to wait for input. '-w' This option causes the produced program to support the 'printflow' option fully; when this option is not given, 'printflow' will in most cases have partial or no support (except in multithreaded programs, where this option is redundant), because not all the code needed for it will be included in the program to save space. '-u' When you are getting problems with finding files - for instance, the compiler can't find the skeleton file (*note E999::) or the system library (*note E127::) - this option will let you know, on standard error, where the compiler is looking for files. This may hopefully help you pin down where the file-finding problems are coming from, and also offers the option of simply placing copies of the files where the compiler is looking as a last resort. '-y' This is the main debugging option: it loads yuk, an interactive INTERCAL debugger with ability to step through the program, set breakpoints, view and modify variables, etc. *Note yuk::. '-Y' This options causes the command line to be displayed for all calls to other programs that 'ick' makes (mostly to 'gcc'); it is therefore useful for debugging problems with the command lines used when using the external calls system (*note External Calls::). '-U' The internal error E778 (*note E778::) should never happen. However, there are all sorts of potential problems that may come up, and if part of the code detects something impossible, or more usually when the operating system detects things have got too insane and segfaults, normally this error will just be generated and that's that. (I most often get this when I've been writing a new section of code and have made a mistake; hopefully, all or at least most of these errors are fixed before release, though.) If you want more information as to what's going on, you can give the '-U' option, which will cause the compiler to raise an abort signal when an internal error happens. This can generally be caught by a debugger that's being run on 'ick' itself at the time; on many systems, it will also cause a core dump. 2.3 Output Options ================== 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. '-c' By default, the original INTERCAL code will be compiled all the way to an executable, and the intermediate C and object files produced will be deleted. Giving this option causes the compiler to stop when it has finished producing the C file, leaving the C file there as the final output of the compiler. (Its filename is the same as the source file, but with '.c' as its extension/suffix rather than the source file's extension.) Without this option, an executable will be produced with the extension 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. '-o' This option causes the compiler to progress no further than producing the C output file, but instead of writing it to a file writes it directly to standard output. This might occasionally be useful when using 'ick' as part of a pipe; it can also be useful to see how far the compiler gets with compiling code before an error happens, when you're trying to track down an error. 2.4 Optimizer Options ===================== There are various command line options that can be used to tell 'ick' whether and in what ways to optimize code. '-f' This option requests the compiler to attempt to analyse the flow of the program and optimize accordingly; for instance, it will detect which commands can't possibly be 'ABSTAINED' from and refrain from generating code to check the abstention status of those commands. '-F' This option tells the compiler to optimize the output for speed. This is done to crazy extremes; the compiler may take several hours/days analysing the program in some cases and still not come up with an improvement. It turns on all the other optimizer options. Note that not all systems accept this option, because it sometimes outputs a shell script disguised as an executable rather than an actual executable. '-O' This option tells the compiler to apply optimizer idioms to the expressions in the code given, when appropriate. The list of idioms is stored in the file 'src/idiotism.oil'; note that it is compiled into the compiler, though, so you will have to rebuild and reinstall the compiler if you change it. For more information about changing the list of idioms, see *note Optimizer Idiom Language::. 2.5 Other Options ================= Some options just can't be classified. '-@' If this option is given, the compiler doesn't run at all, but instead prints a set of instructions for using it, explaining which options are available on the system you're on and which options conflict with which other options. 2.6 Options to Generated Programs ================================= 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. '+help' '-help' Whether '+' or '-' is given at the start of this option, it will cause the program to print out what options are available and what state they are in. It will then cause the program to exit via an internal error. '+wimpmode' '-wimpmode' If the '+' version of this is given (rather than the default '-'), then the program will print a message explaining that you are a wimp (the mode itself is known as wimpmode), and for the rest of execution will input in Arabic numerals ('123' rather than 'ONE TWO THREE') and likewise will output in Arabic numerals rather than Roman numerals (such as 'CXXIII'). True INTERCAL programmers should rarely have to use this mode. '+traditional' '-traditional' This option does not actually appear to do anything. '+instapipe' '-instapipe' This option causes standard output to be flushed whenever any characters are output when the '+' version is used, rather than on each newline (the default '-' version). It is most useful for more responsive pipes when outputting binary data, and also useful for debugging very slow programs. '+printflow' '-printflow' The usual debugging methods don't work with multithreaded or backtracking programs. This option exists to give at least a slim chance of working out what is going on with them. It causes the program to print the line number of the command it thinks it may be executing next (i.e. the line number that would be printed if that line had an error) immediately after executing each command, and also an internal identifier for the thread that that command was in. It also prints a trace of what parts of the multithreader are being activated; so for instance, it will tell you when a thread is being forked into multiple threads or when a choicepoint has been deleted. Note that the '-w' option (*note -w::) must be given to gain full support for flow printing in non-multithreaded non-backtracking programs, because otherwise the required code to print this information will not be generated. '+mystery' '-mystery' This option is occasionally capable of doing something, but is deliberately undocumented. Normally changing it will have no effect, but changing it is not recommended. 2.7 Environment Variables ========================= Various environment variables can be set to affect the operation of 'ick'. Variable Meaning -------------------------------------------------------------------------- ICKINCLUDEDIR These four environment variables suggest ICKLIBDIR locations in which 'ick' should look to find ICKSYSDIR various files that it needs: the skeleton file, ICKCSKELDIR 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). CC The name of a C compiler to use (defaults to 'gcc'; C-INTERCAL has recently been tested only with 'gcc' and 'clang'). This option has no effect on DJGPP, where 'gcc' is always used. ICKTEMP On DJGPP, 'ick' creates temporary files to pass TMPDIR options to gcc as a method of getting around the TEMP limit on the length of a command line that can TMP 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. 3 Errors and Warnings ********************* 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 INTERCAL. Errors and warnings appear as an error code starting with 'ICL', followed by a three digit number, followed by 'I' for an error or 'W' for a warning. However, they will be notated here as 'E000', etc., to save space and because consistency was never a strong point of INTERCAL. 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 'COME FROM's or computed 'COME FROM'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 (*note E633::). 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.) 3.1 Errors ========== This is a list of the error messages that might be produced during the compilation or execution of an INTERCAL program. E000 This is an unusual error; it's what's printed when a syntax error is encounted at runtime, in a situation in which it would be executed. (An 'ABSTAIN'ed syntax error, for instance, would not be executed; this is one of the mechanisms available for writing comments.) The text of the error message is simply the statement that couldn't be decoded. E017 DO YOU EXPECT ME TO FIGURE THIS OUT? This error occurs when there is an attempt to use a constant with a value outside the onespot range; it's a compile-time error. E079 PROGRAMMER IS INSUFFICIENTLY POLITE The balance between various statement identifiers is important. If less than approximately one fifth of the statement identifiers used are the polite versions containing 'PLEASE', that causes this error at compile time. E099 PROGRAMMER IS OVERLY POLITE Of course, the same problem can happen in the other direction; this error is caused at compile time if more than about one third of the statement identifiers are the polite form. E111 COMMUNIST PLOT DETECTED, COMPILER IS SUICIDING This error happens when you give the '-t' option (*note -t::) but you use a language construct that wasn't available in INTERCAL-72. If this happens, then either there's a mistake in the program that prevents it being INTERCAL-72 or you shouldn't be compiling it as INTERCAL-72 in the first place. E123 PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON There is a hard limit of 80 'NEXT's at a time; this is to discourage excessive use of 'NEXTING' for things like recursion. (Recursive programs are entirely legal; you simply have to figure out how to do it with computed 'COME FROM' instead. (For the record, it is possible. (Using lots of nested brackets when talking about recursion is great (yay!).))) Another problem with writing the source code that can cause this error is a failure to properly 'FORGET' the entry on the 'NEXT' stack created when trying to simulate a goto. E127 SAYING 'ABRACADABRA' WITHOUT A MAGIC WAND WON'T DO YOU ANY GOOD Your program asked to include a system library (by specifying a line number in a magic range without including a line with that number), but due to installation problems the compiler couldn't find the system library to include. You could try using the '-u' (*note -u::) option to see where the compiler's looking; that may give you an idea of where you need to copy the system library so that the compilation will work. This error happens at compile time and doesn't give a next command line number. E129 PROGRAM HAS GOTTEN LOST This error happens at compile time when the compiler can't figure out where a 'NEXT' command is actually aiming (normally due to a typo in either the line label given or the line label on the line aimed for). The logic behind this error means that the next line to be executed is unknown (after all, that's the whole point of the error) and is therefore not given. The '-e' command-line option (*note -e::) makes this error into a run-time error, because it allows 'NEXT' commands to dynamically change targets at runtime, as well as line labels to dynamically change values, and thus the error is impossible to detect at compile time. E139 I WASN'T PLANNING TO GO THERE ANYWAY This error happens at compile time when an 'ABSTAIN' or 'REINSTATE' references a non-existent target line. This generally happens for much the same reasons as E129 (*note E129::). E182 YOU MUST LIKE THIS LABEL A LOT! At present, it's impossible to have more than one line with the same line number. That would make 'NEXT' act too much like 'COME FROM' in reverse to be interesting. This error happens at compile time. (For inconsistency, it is possible to have multiple lines with the same number as long as at most one of them is in an INTERCAL program (the others have to be in programs in other languages included via the external calls system). The resulting behaviour is entirely inconsistent with the rest of the language, though, for what I hope are obvious reasons.) E197 SO! 65535 LABELS AREN'T ENOUGH FOR YOU? Legal values for line labels are 1 to 65535 (certain subranges are reserved for system and expansion libraries). This error comes up if you use nonpositive or twospot values for a line label. E200 NOTHING VENTURED, NOTHING GAINED You used a variable that isn't actually in your program. Failing that (which, contrary to previous versions of this manual, is indeed possible in the present version of C-INTERCAL, although I'm not telling how; a hint: what mechanism in C-INTERCAL allows for a computed variable number?), you specified an illegal number for a variable (legal numbers are positive and onespot). This error happens at compile time, at least for illegal variable numbers. E222 BUMMER, DUDE! In INTERCAL, you're allowed to 'STASH' as much as you like; this makes the language Turing-complete and allows for unlimited recursion when combined with computed 'COME FROM' in the right way. Unfortunately, real computers aren't so idealised; if you manage to write a program so memory-intensive that the computer runs out of memory to store stashes, it causes this error at runtime. To fix this error, you either have to simplify the program or upgrade your computer's memory, and even then that will only help to some extent. E240 ERROR HANDLER PRINTED SNIDE REMARK Arrays have to be large enough to hold at least one element; you tried to dimension an array which isn't large enough to hold any data. This error happens at run time. E241 VARIABLES MAY NOT BE STORED IN WEST HYPERSPACE This error happens at run time when the subscripts given to an array are inconsistent with the way the array was dimensioned, either because there were the wrong number of subscripts or because a subscript was too large to fit in the array. It can also happen when a multidimensional array is given to a command, such as 'WRITE IN', that expects it to be monodimensional. E252 I'VE FORGOTTEN WHAT I WAS ABOUT TO SAY This run-time error message is caused by the compiler running out of memory whilst trying to do I/O; at present, it can only happen during CLC-INTERCAL-style I/O. E256 THAT'S TOO HARD FOR MY TINY BRAIN Some commands simply aren't available in PIC-INTERCAL. I mean, PICs generally have less than a kilobyte of memory; you're not going to be able to use some of the more confusing language features with that sort of resource limitation. The solution is to replace the affected command, or to not give the '-P' option (*note -P: -P+.) if you didn't mean to compile as PIC-INTERCAL in the first place. E275 DON'T BYTE OFF MORE THAN YOU CAN CHEW This error happens when there is an attempt to store a twospot value in a onespot variable. The actual size of the value is what matters when counting its spots; so you can store the output of a mingle in a onespot variable if it happens to be less than or equal to 65535, for instance. (This is not necessarily the case in versions of INTERCAL other than C-INTERCAL, though, so you have to be careful with portability when doing this.) E277 YOU CAN ONLY DISTORT THE LAWS OF MATHEMATICS SO FAR Reverse assignments are not always mathematically possible. Also, sometimes they require changing the value of a constant; this is only legal if you specifically specified that it was legal by using the '-v' option. In the case of an impossible reverse assignment (including a situation in which operand overloading causes a reverse assignment to happen), this error happens at runtime. This error can also come up when a scalar variable is overloaded to an array (which doesn't make sense, but could happen if someone exploited bugs in the CREATE statement (*note CREATE::)), and an attempt is made to read or assign to that variable. (Subscripting a scalar variable is a syntax error, so there is no use for doing such an overload anyway.) E281 THAT MUCH QUOTATION AMOUNTS TO PLAGIARISM There is a limit of 3200 on the number of nested spark/ears groups allowed. If you somehow manage to exceed that limit, that will cause this error. Try breaking the expression up into smaller expressions. (The limit is trivial to increase by changing 'SENESTMAX' in 'ick.h'; if you ever actually come across a program that hits the limit but wasn't designed to, just email the maintainer to request a higher limit.) E333 YOU CAN'T HAVE EVERYTHING, WHERE WOULD YOU PUT IT? Your program references so many variables that the compiler couldn't cope. This error is unlikely to ever happen; if it does, try reducing the number of variables you use by combining some into arrays. This is a compile-time error. E345 THAT'S TOO COMPLEX FOR ME TO GRASP This is another compile-time error that's unlikely to ever happen; this one signifies the compiler itself running out of memory trying to compile your program. The only solutions to this are to simplify your program, or to make more memory available to the compiler. E404 I'M ALL OUT OF CHOICES! Your program asked that a choicepoint be backtracked to or removed, but there aren't any choicepoints at the moment. This runtime error usually indicates a logic mistake in your program. In backtracking programs translated from other backtracking languages, this indicates that the program has failed. E405 PROGRAM REJECTED FOR MENTAL HEALTH REASONS Your program used a construct that only makes sense when multithreading or backtracking ('WHILE', 'MAYBE', 'GO BACK', or 'GO AHEAD'), but you didn't specify the '-m' option (*note -m::). If you meant to write a multithreaded or backtracking program, just give that option; if you didn't, be careful what words you use in comments! This error happens at compile-time. E436 THROW STICK BEFORE RETRIEVING! In order to 'RETRIEVE' a variable, it has to be 'STASH'ed first; if it isn't, then this error happens at runtime. E444 IT CAME FROM BEYOND SPACE A 'COME FROM' aiming at a line label -- as opposed to a computed 'COME FROM', which is allowed to be pointing at a nonexistent line -- must point to a valid line label. The same applies to 'NEXT FROM'. This error happens at compile time if a nonexistent line label is found in one of these contexts. E533 YOU WANT MAYBE WE SHOULD IMPLEMENT 64-BIT VARIABLES? This error is like E275 (*note E275::), but applies when an attempt is made at runtime to store a threespot value (or even a fourspot or morespot value) in a twospot variable, or a threespot or greater value is produced as an intermediate during a calculation (for instance by a mingle operation). No values above twospot are allowed at any point during an INTERCAL program; if you want to process higher numbers, you have to figure out a different way of storing them. E553 BETTER LATE THAN NEVER Oops! The compiler just noticed that it had a buffer overflow. (Normally programs catch buffer overflows before they happen; C-INTERCAL catches them just afterwards instead.) This only happens on systems which don't have a modern C standard library. Try using shorter or fewer filenames on the command line, to reduce the risk of such an overflow. E555 FLOW DIAGRAM IS EXCESSIVELY CONNECTED Aiming two 'COME FROM's at the same line only makes sense in a multithreaded program. In a non-multithread program, doing that will cause this error at compile time (if neither 'COME FROM' is computed) or at run time (if the command that has just finished running is simultaneously the target of two or more 'COME FROM's). This either indicates an error in your program or that you've forgotten to use the '-m' option (*note -m::) if you are actually trying to split the program into two threads. E562 I DO NOT COMPUTE The program asked for input, but for some reason it wasn't available. (This is a runtime error, obviously.) The error may happen because the input is being piped in from a command or file which has reached end-of-file, or because the user typed '-' (UNIX/Linux) or '-' (DOS/Windows) while the program was trying to 'WRITE IN' some data. E579 WHAT BASE AND/OR LANGUAGE INCLUDES STRING? When reading spelt-out-digit input, the input didn't seem to be a valid digit in English, Sanskrit, Basque, Tagalog, Classical Nahuatl, Georgian, Kwakiutl, Volapük, or Latin. This seems to have languages covered pretty well; what on earth were you using, or did you just make a spelling mistake? E621 ERROR TYPE 621 ENCOUNTERED The compiler encountered error E621 (*note E621::). This happens at runtime when the program requests that no entries are removed from the 'NEXT' stack (which is possible), but that the last entry removed should be jumped to (which given the circumstances isn't, because no entries were removed). E632 THE NEXT STACK RUPTURES. ALL DIE. OH, THE EMBARRASSMENT! When an attempt is made to 'RESUME' past the end of the 'NEXT' stack, the program ends; however, this cause the program to end in a manner other than via 'GIVE UP' or 'DON'T TRY AGAIN', so an error message must be printed, and this is that error message. E633 PROGRAM FELL OFF THE EDGE You can't just let execution run off the end of the program. At least, that is, if it doesn't end with 'TRY AGAIN'. An attempt to do that causes this error at runtime. Note that if your program references the system library, then it counts as being appended to your program and so the program will run into the first line of the system library rather than cause this error. As it happens, the first line of the system library is a syntax error, so doing this will cause E000 (*note E000::) with the error text 'PLEASE KNOCK BEFORE ENTERING'. There isn't a next statement to be executed with E633, so the next statement won't be given in the error message. E652 HOW DARE YOU INSULT ME! The 'PIN' command doesn't make much sense for anything bigger than a PIC; using it in a non-PIC program causes this error at compile-time. Try using the normal input and output mechanisms instead. This error may also be a clue that you are trying to compile a PIC-INTERCAL program without giving the '-P' option (*note -P: -P+.). E666 COMPILER HAS INDIGESTION There isn't a limit on the length of an input program other than your computer's memory; if your computer does run out of memory during compilation, it causes this error. This error can also be caused if too many input files are specified on the command line; if you suspect this is the problem, split the compilation into separate compilations if you can, or otherwise you may be able to concatenate together your input files into larger but fewer files. Yet another potential cause of this error is if a line in an input program is too long; sensible line-wrapping techniques are encouraged. E774 RANDOM COMPILER BUG No compiler is perfect; sometimes errors just happen at random. In this case, the random error is E774. If you don't like the idea that your program may be shot down by a random compiler bug, or you are doing something important, you can use the '-b' option (*note -b::) to prevent this bug happening. (You may wonder why this bug is in there at all if it's so easily prevented. The answer is that such a bug was present in the original INTERCAL-72 compiler, which also had an option to turn the bug off. It's also a reward for people who actually read the manual.) E777 A SOURCE IS A SOURCE, OF COURSE, OF COURSE You specified a file to compile on the command line, but the compiler couldn't find or couldn't open it. This is almost certainly because you made a typo specifying the file. E778 UNEXPLAINED COMPILER BUG This should never come up, either at compile time or at run time. It could come up at either when an internal check by the compiler or the runtime libraries realises that something has gone badly wrong; mistakes happen, and in such cases the mistake will have been detected. (If this happens at compile time you can use the '-U' option (*note -U: -U+.) to cause the compiler to send an abort signal - which normally causes a core dump - when the error happens, to help debug what's causing it.) More often, this error comes up when the operating system has noticed something impossible, like an attempt to free allocated memory twice or to write to a null pointer, and tells the compiler an error has occured, in which case the same response of putting up this error happens. The point is that in all cases this error 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 it and send a bug report (*note Reporting Bugs::). E810 ARE ONE-CHARACTER COMMANDS TOO SHORT FOR YOU? This is a debug-time error caused when you give too much input to the debugger when all it wanted was to know what you wanted to do next. E811 PROGRAM IS TOO BADLY BROKEN TO RUN 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 a debug-time error. E888 I HAVE NO FILE AND I MUST SCREAM The output file couldn't be written, maybe because the disk is full or because there's already a read-only file with the same name. This is a compile-time error. E899 HELLO? CAN ANYONE GIVE ME A HAND HERE? This error occurs at compile-time if a file type was requested for which the required libraries are unavailable. (Support for Funge does not ship with the compiler; instead, you need to generate the library yourself from the cfunge sources. For more information, see *note Creating the Funge-98 Library::.) E990 FLAG ETIQUETTE FAILURE BAD SCOUT NO BISCUIT This error occurs at runtime if an INTERCAL program was passed an unknown option flag. E991 YOU HAVE TOO MUCH ROPE TO HANG YOURSELF There is no limit on the number of threads or choicepoints that you can have in a multithreaded or backtracking program (in a program that isn't multithreaded or backtracking, these are obviously limited to 1 and 0 respectively). However, your computer may not be able to cope; if it runs out of memory in the multithreader, it will cause this error at runtime. E993 I GAVE UP LONG AGO 'TRY AGAIN' has to be the last command in a program, if it's there at all; you can't even follow it by comments, not even if you know in advance that they won't be 'REINSTATE'd. This error happens at compile time if a command is found after a 'TRY AGAIN'. E994 NOCTURNAL EMISSION, PLEASE LAUNDER SHEETS IMMEDIATELY This error should never happen, and if it does indicates a compiler bug. It means the emitter function in the code degenerator has encountered an unknown opcode. Please send a copy of the program that triggered it to the INTERCAL maintainers. E995 DO YOU REALLY EXPECT ME TO HAVE IMPLEMENTED THAT? Some parts of the code haven't been written yet. There ought to be no way to cause those to actually run; however, if you do somehow find a way to cause them to run, they will cause this error at compile time. E997 ILLEGAL POSSESSION OF A CONTROLLED UNARY OPERATOR Some operators (such as whirlpool ('@') and sharkfin ('^')) only make sense in TriINTERCAL programs, and some have a minimum base in which they make sense. This error happens at compile-time if you try to use an operator that conflicts with the base you're in (such as using TriINTERCAL operators in an INTERCAL program in the default base 2). E998 EXCUSE ME, YOU MUST HAVE ME CONFUSED WITH SOME OTHER COMPILER This error occurs just before compile-time if a file is encountered on the command line that C-INTERCAL doesn't recognise. (If this error occurs due to a '.a', '.b98', '.c', '.c99', or '.c11' file, then you forgot to enable the external calls system using '-e' (*note -e::).) E999 NO SKELETON IN MY CLOSET, WOE IS ME! The skeleton file 'ick-wrap.c' or 'pickwrap.c' is needed to be able to compile INTERCAL to C. If the compiler can't find it, it will give this error message. This indicates a problem with the way the compiler has been installed; try using the '-u' option (*note -u::) to find out where it's looking (you may be able to place a copy of the skeleton file in one of those places). 3.2 Warnings ============ This is a list of the warnings stored in the warning database. Warnings only come up when the '-l' option (*note -l::) is given; even then, some of the warnings are not currently implemented and therefore will never come up. W016 DON'T TYPE THAT SO HASTILY The positional precedence rules for unary operators are somewhat complicated, and it's easy to make a mistake. This warning is meant to detect such mistakes, but is not currently implemented. W018 THAT WAS MEANT TO BE A JOKE If an INTERCAL expression has been translated from another language such as C, the optimiser is generally capable of translating it back into something similar to the original, at least in base 2. When after optimisation there are still INTERCAL operators left in an expression, then this warning is produced. (Therefore, it's likely to come up quite a lot if optimisation isn't used!) The system library produces some of these warnings (you can tell if a warning has come up in the system library because you'll get a line number after the end of your program). W112 THAT RELIES ON THE NEW WORLD ORDER This warning comes up whenever the compiler recognises that you've added some code that didn't exist in INTERCAL-72. This allows you to check whether your code is valid INTERCAL-72 (although '-t' (*note -t::) is more useful for that); it also warns you that code might not be portable (because INTERCAL-72 is implemented by most INTERCAL compilers, but more recent language features may not be). W128 SYSLIB IS OPTIMIZED FOR OBUSCATION There is an idiom used in the system library that does a right-shift by selecting alternate bits from a twospot number and then mingling them the other way round. A rightshift can much more easily be done with a single rightshift, so this is a silly way to do it, and this warning warns that this idiom was used. However, the present optimizer is incapable of recognising whether this problem exists or not, so the warning is not currently implemented. W276 YOU CAN'T EXPECT ME TO CHECK BACK THAT FAR It's an error to assign a twospot value (a value over 65535) to a onespot variable, or to use it as an argument to a mingle. If the optimizer can't guarantee at compile time that there won't be an overflow, it issues this warning. (Note that this doesn't necessarily mean there's a problem -- for instance, the system library generates some of these warnings -- only that the optimiser couldn't work out for sure that there wasn't a problem.) W239 WARNING HANDLER PRINTED SNIDE REMARK Your code looks like it's trying to assign 0 to an array, giving it no dimension; this is an error. This warning is produced at compile time if it looks like a line in your code will cause this error, but it isn't necessarily an error because that line of code might never be executed. W278 FROM A CONTRADICTION, ANYTHING FOLLOWS It's sometimes impossible to reverse an assignment (a reverse assignment can happen if the '-v' option (*note -v::) is used and an expression is placed on the left of an assignment, or in operand overloading); if the compiler detects that a reversal failure is inevitable, it will cause this warning. Note that this doesn't always cause an error, because the relevant code might never be executed. W450 THE DOCUMENTOR IS NOT ALWAYS RIGHT There is no way to get this warning to come up; it isn't even written anywhere in C-INTERCAL's source code, is not implemented by anything, and there are no circumstances in which it is even meant to come up. It is therefore not at all obvious why it is documented. W534 KEEP LOOKING AT THE TOP BIT C-INTERCAL uses a slightly different typing mechanism to some other INTERCAL 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 a case has come up or not, but if the compiler or optimizer thinks that such a case might have come up, it will issue this warning. W622 WARNING TYPE 622 ENCOUNTERED Your code looks like it's trying to resume by 0; this is an error. This warning is produced at compile time if it looks like a line in your code will cause this error, but it isn't necessarily an error because that line of code might never be executed. 4 The yuk debugger ****************** The C-INTERCAL 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 '-y' (*note -y::) to the command line of 'ick' 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.) yuk can also be used as a profiler using the '-p' option (*note -p::); this produces a file 'yuk.out' containing information on how much time was spent running each command in your program, and does not prompt for debugger commands. Note that some command line arguments are incompatible with the debugger, such as '-m' and '-f'. In particular, this means that multithreaded programs and programs that use backtracking cannot be debugged using this method; the '+printflow' option (*note +printflow::) to a compiled program may or may not be useful for debugging multithreaded programs. 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, 'yuk007 ', to let you know you can input a command. 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 '.', ',', ':' or ';' followed by a number in decimal; note that some commands only allow onespot and twospot variables as arguments). Command Description -------------------------------------------------------------------------- aLINE All non-abstained commands on line LINE become abstained from once. bLINE A breakpoint is set on line LINE. The breakpoint causes execution with 'c' to stop when it is reached. c The program is run until it ends (which also ends the debugger) or a breakpoint is reached. dLINE Any breakpoint that may be on line LINE is removed. eLINE An explanation of the main expression in each command on line LINE is printed to the screen. The explanation is in the same format as the format produced by '-h' (*note -h::) and shows what the optimiser optimised the expression to (or the original expression if the optimiser wasn't used). fLINE Removes the effect of the 'm' command on line LINE. gLINE Causes the current command to be the first command on LINE (if not on that line already) or the next command on LINE, as if that line was 'NEXT'ed to and then that 'NEXT' stack item was forgotten. h 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. iVAR Causes variable VAR to become 'IGNORE'd, making it read-only. jVAR Causes variable VAR to become 'REMEMBER'ed, making it no longer read-only. k Continues executing commands until the 'NEXT' stack is the same size or smaller than it was before. In other words, if the current command is not a 'NEXT' and doesn't have a 'NEXT FROM' aiming at it, one command is executed; but if a 'NEXT' does happen, execution will continue until that 'NEXT' returns or is forgotten. A breakpoint or the end of the program also end this. lLINE Lists 10 lines of source code either side of line LINE, the same way as with 'h', but using a line stated in the command rather than the current line. mLINE Produces a message onscreen every time a command on line LINE is executed, but without interrupting the program. n Show the 'NEXT' stack on the screen. o Continue executing commands until the 'NEXT' stack is smaller than it was before. If you are using 'NEXT'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. p Displays the value of all onespot and twospot variables. q Aborts the current program and exits the debugger. rLINE Reinstates once all abstained commands on line LINE. s Executes one command. t Continues execution until the end of the program or a breakpoint: each command that executes is displayed while this command is running. uLINE Continues execution of the program until just before a command on line LINE is run (or a breakpoint or the end of the program). vVAR Adds a 'view' on variable VAR (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 'm' or 't' commands). w Displays the current line and current command onscreen. xVAR Removes any view and any action that may be associated with it on variable VAR (which must be onespot or twospot). yVAR Adds a view on variable VAR; also causes a break, as if a breakpoint was reached, whenever the value of that variable changes. zVAR Adds a view on variable VAR; also causes a break, as if a breakpoint was reached, whenever that variable's value becomes 0. VAR A onespot or twospot variable written by itself prints out the value of that variable. -' (on UNIX/Linux) or '-' (on Windows/DOS); this will cause the current command to finish running and the debugger prompt to come back up. PART II: THE INTERCAL LANGUAGE ****************************** 5 Syntax ******** INTERCAL 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. Whitespace is generally insignificant in INTERCAL 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. An INTERCAL statement consists of an optional line label, a statement identifier, an optional execution chance, the statement itself (*note Statements::), and optionally 'ONCE' or 'AGAIN'. 5.1 Princeton and Atari Syntax ============================== The history of INTERCAL 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). Princeton syntax ---------------- INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ some versions version 0.18+ all versions no The original INTERCAL-72 compiler was the Princeton compiler, which introduced what has become known as the Princeton syntax for INTERCAL; this is the syntax used in the original manual, for instance, and can be considered to be the 'original' or 'official' INTERCAL 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 'V', backspace, '-', 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 CLC-INTERCAL compiler, which is the de facto standard for expanding the Princeton syntax to modern INTERCAL features that are not found in INTERCAL-72; 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, CLC-INTERCAL uses the Latin-1 yen symbol for this, which just to make things confusing, refers to a mingle in modern Atari syntax). Atari syntax ------------ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ some versions yes version 0.05+ yes The other main syntax is the Atari syntax, so called because it was originally described in notes about an "Atari implementation" added to the paper INTERCAL-72 manual when it was softcopied in 1982. These notes describe a never-completed compiler implementation for 6502 by Mike Albaugh and Karlina Ott; it was meant to use the Atari 800 cartrtidge and screen editor, but that portion was never written. The syntax was designed to work better on ASCII-based systems, by avoiding the change character (although it can still be written as 'c', backspace, '/', which the Atari compiler documentation claims that the Princeton compiler supported) in favour of a 'big money' character ('$'), and using the 'what' ('?') as an alternative character for exclusive-or. This is the syntax that C-INTERCAL and J-INTERCAL have always used, and is the one most commonly used for communicating INTERCAL 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 INTERCAL-72 is normally taken to be that used by the C-INTERCAL compiler, because it is the only Atari-syntax-based compiler that contains non-INTERCAL-72 constructs that actually need their own notation. 5.2 Line Labels =============== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions The first part of an INTERCAL statement is a line label that specifies what its line number is. This is optional; it's legal 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. A line label is a integer expressed in decimal within a wax/wane pair ('(' and ')'). For instance, this is a valid line label: (1000) 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. It has become reasonably customary for people writing INTERCAL 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 INTERCAL library, it may be a good idea to look at the existing libraries (in the 'pit/lib' directory in the C-INTERCAL 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. 5.3 Statement Identifiers ========================= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions 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. The main statement identifier is 'DO'. It also has two synonyms, 'PLEASE' and 'PLEASE DO'; 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. Adding 'NOT' or 'N'T' to the end of any of these identifiers, to create a statement identifier such as 'DO NOT' or 'PLEASE DON'T', 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: PLEASE NOTE: This is a comment. The statement identifier ('PLEASE NOT') is the only part of this statement that is valid INTERCAL; however, because the statement identifier is in the negated form that contains 'NOT', the syntax error won't be executed, and therefore this is a valid statement. (In INTERCAL, syntax errors happen at runtime, so a program containing a statement like 'DOUBT THIS WILL WORK' will still compile, and will not end due to the syntax error unless that statement is actually executed. *Note E000::.) The 'ABSTAIN' and 'REINSTATE' statements can override the 'NOT' or otherwise on a statement identifier; see *note ABSTAIN::. In backtracking programs, 'MAYBE' is also a valid statement identifier; see *note MAYBE::. It comes before the other keywords in the statement identifier, and an implicit 'DO' is added if there wasn't one already in the statement identifier (so 'MAYBE', 'MAYBE DO', 'MAYBE DON'T', 'MAYBE PLEASE', and so on are all valid statement identifiers). 5.4 Execution Chance ==================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions version 0.02+ all versions 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 INTERCAL, although it is the only way to introduce randomness into a program. (The C-INTERCAL 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 ('%') 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 'DO %40 WRITE OUT #1' has a 40% chance of writing out 'I', but the statement 'DON'T %40 WRITE OUT #1' has no chance of writing out 'I' or anything else, because the 'N'T' prevents it running and the double-oh-seven cannot override that. 5.5 ONCE and AGAIN ================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.25+ no no The last part of a statement is an optional 'ONCE' or 'AGAIN'. 'ONCE' specifies that the statement is self-abstaining or self-reinstating (this will be explained below); 'AGAIN' 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 'ONCE' on an initially reinstated statement or 'AGAIN' on an initially abstained statement indicates a self-abstention, and a 'ONCE' on an initially abstained statement or 'AGAIN' on an initially reinstated statement indicates a self-reinstatement. 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 a 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 'ONCE' effectively changes to an 'AGAIN'; the 'ONCE' only happens once, as might be expected. 'REINSTATING' a currently abstained self-abstaining statement or 'ABSTAINING' (that is, with the 'ABSTAIN' or 'REINSTATE' commands) a currently reinstated self-reinstating statement causes the 'AGAIN' on the statement to change back into a 'ONCE', so the statement will again self-abstain or self-reinstate. Likewise, 'REINSTATING' a currently abstained self-reinstating statement or 'ABSTAINING' a currently reinstated self-abstaining statement causes its 'ONCE' to turn into an 'AGAIN'. Historical note: 'ONCE' was devised by Malcom Ryan as a method of allowing synchronisation between threads in a multithreaded program ('ONCE' is atomic with the statement it modifies, that is, there is no chance that threads will change between the statement and the 'ONCE'). 'AGAIN' 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 'ONCE's to happen multiple times, which is needed to implement some multithreaded algorithms). 6 Expressions ************* Many INTERCAL statements take expressions as arguments. Expressions are made up out of operands and operators between them. Note that there is no operator precedence in INTERCAL; different compilers resolve ambiguities different ways, and some versions of some compilers (including the original INTERCAL-72 compiler) will cause error messages on compiling or executing an ambiguous expression, so it's safest to fully group each expression. 6.1 Constants and Variables =========================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions The basic operands in INTERCAL 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 INTERCAL, but by default C-INTERCAL turns this off because it carries an efficiency penalty and can be confusing; this can be turned on with the '-v' option (*note -v::).) 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 *note Mingle::.) A constant is written as a mesh ('#') 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, '#100' has 100 as its value, and it's strongly advised not to change the value of a constant during the execution of a program. 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 ('.', ':', ',', and ';') 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 C-INTERCAL before version 0.7.) 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, '.1' and '.001' are the same variable, onespot number 1. Array variables need to be dimensioned before they are used, by assigning dimensions to them; see *note Calculate::. 6.2 Grouping Rules ================== Because there are no operator precedences in INTERCAL, there are various solutions to specifying what precedences actually are. The portable solution All known versions of INTERCAL accept the INTERCAL-72 grouping rules. These state that it's possible to specify that an operator takes precedence by grouping it inside sparks (''') or rabbit-ears ('"'), the same way as wax/wane pairs (parentheses) are used in other programming languages. INTERCAL-72 and earlier C-INTERCAL versions demanded that expressions were grouped fully like this, and this practice is still recommended because it leads to portable programs and is easier to understand. Whether sparks or rabbit-ears (often called just 'ears' for short) are used normally doesn't matter, and programmers can use one or the other for clarity or for aesthetic appeal. (One common technique is to use just sparks at the outermost level of grouping, just ears at the next level, just sparks at the next level, and so on; but expressions like '''#1~#2'~"#3~#4"'~#5' are completely unambiguous, at least to the compiler.) There are, however, some complicated situations involving array subscripting where it is necessary to use sparks and ears at alternate levels, if you want to write a portable program. This limitation is in C-INTERCAL to simplify the parsing process; INTERCAL-72 has the same limitation, probably for the same reason. Compare these two statements: DO .1 <- ,3SUB",2SUB.1".2 DO .1 <- ,3SUB",2SUB.1".2~.3"".4 The problem is that in the first statement, the ears close a group, and in the second statement, the ears open a group, and it's impossible to tell the difference without unlimited lookahead in the expression. Therefore, in similar situations (to be precise, in situations where a group is opened inside an array subscript), it's necessary to use the other grouping character to the one that opened the current group if you want a portable program. One final comment about sparks and rabbit-ears; if the next character in the program is a spot, as often happens because onespot variables are common choices for operands, a spark and the following spot can be combined into a wow ('!'). Unfortunately, the rabbit-ear/spot combination has no one-character equivalent in any of the character sets that C-INTERCAL accepts as input (UTF-8, Latin-1, and ASCII-7) as none of these contain the rabbit character, although the Hollerith input format that CLC-INTERCAL can use does. Positional precedences: CLC-INTERCAL rules The precedence rules used by CLC-INTERCAL for grouping when full grouping isn't used are simple to explain: the largest part of the input that looks like an expression is taken to be that expression. The main practical upshot of this is that binary operators right-associate; that is, '.1~.2~.3' is equivalent to '.1~'.2~.3''. C-INTERCAL versions 0.26 and later also right-associate binary operators so as to produce the same results as CLC-INTERCAL rules in this situation, but as nobody has yet tried to work out what the other implications of CLC-INTERCAL rules are they are not emulated in C-INTERCAL, except possibly by chance. Prefix and infix unary operators In INTERCAL-72 and versions of C-INTERCAL before 0.26, unary operators were always in the 'infix' position. (If you're confused about how you can have an infix unary operator: they go one character inside a group that they apply to, or one character after the start of a constant or variable representation; so for instance, to portably apply the unary operator '&' to the variable ':1', write ':&1', and to portably apply it to the expression ''.1~.2'', write ''&.1~.2''.) CLC-INTERCAL, and versions of C-INTERCAL from 0.26 onwards, allow the 'prefix' position of a unary operator, which is just before whatever it applies to (as in '&:1'). This leads to ambiguities as to whether an operator is prefix or infix. The portable solution is, of course, to use only infix operators and fully group everything, but when writing for recent versions of C-INTERCAL, it's possible to rely on its grouping rule, which is: unary operators are interpreted as infix where possible, but at most one infix operator is allowed to apply to each variable, constant, or group, and infix operators can't apply to anything else. So for instance, the C-INTERCAL ''&&&.1~.2'' is equivalent to the portable ''&"&.&1"~.2'' (or the more readable version of this, '"&'"&.&1"~.2'"', which is also portable). If these rules are counter-intuitive to you, remember that this is INTERCAL we're talking about; note also that this rule is unique to C-INTERCAL, at least at the time of writing, and in particular CLC-INTERCAL is likely to interpret this expression differently. 6.3 Operators ============= 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 *note Prefix and infix unary operators:: 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 INTERCAL-72 operators; many INTERCAL extensions add their own operators. 6.3.1 Mingle ------------ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions Mingle, or interleave, is one of the two binary operators in INTERCAL-72. However, different INTERCAL 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. The original INTERCAL-72 compiler (the Princeton compiler) used the 'change' (cent) character for a mingle, represented as 'c', backspace, '/'. (By the way, this is still the most portable way to write a mingle; both C-INTERCAL and CLC-INTERCAL accept it, at least if a lowercase 'c' is used, the Atari compiler was to accept it, and its documentation claimed that the Princeton compiler also accepted it; CLC-INTERCAL also accepts a capital 'C' before the backspace and '/', and allows '|' rather than '/'.) The uncompleted Atari compiler intended to use a 'big money' character ('$') as the mingle character; this character is also the only one accepted for mingle by the J-INTERCAL compiler. C-INTERCAL originally also used the '$' character for mingle, and this character is the one most commonly seen in existing C-INTERCAL programs, and most often used when giving examples of INTERCAL on Usenet, because it exists in the ASCII-7 character set, and because it doesn't contain control characters. From version 0.18 of C-INTERCAL 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. CLC-INTERCAL 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 '$', but it's important to bear in mind that this character is not the most portable choice. 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; C-INTERCAL 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; C-INTERCAL 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 a mingle.) 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. One of the most common uses of interleaving is to create a constant with a value greater than 65535; for instance, 65536 is '#0$#256'. 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. 6.3.2 Select ------------ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions The select operator is one of the two binary operators in INTERCAL-72; unlike mingle, every known implementation of INTERCAL ever has used the sqiggle character ('~') as the representation of the select operator, meaning that writing it portably is easy. The select operator takes two arguments, which can be of either datatype (that is, 16- or 32-bit). It returns a value made by selecting certain bits of its first operand indicated by the second operand, and right-justifying them. What it does is 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 INTERCAL-72 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 '#21~:1' produces a 32-bit result because 17 bits were selected, even though many of the leading bits were zeros; in C-INTERCAL the data type of the result is the same as of the right operand of the select, so that it can be determined at compile 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, '#21~:1' produces 21 as its result if :1 has the value 131061, 10 as its result if :1 has the value 30 (1E in hex; the least significant bit of 21 is removed because it corresponds to a 0 in :1), and 7 as its result if :1 has the value 21 (because three bits in 21 are set, and those three bits from 21 are therefore selected by 21). Select is used for right-shifts, to select every second bit from a number (either to produce what will eventually become an argument to 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. 6.3.3 Unary Binary Logic ------------------------ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions There are three unary operators in INTERCAL-72, 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 ('&') and book ('V') 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 'V', backspace, '-', in the Princeton INTERCAL-72 implementation, and this is still the most portable way to write it (C-INTERCAL and CLC-INTERCAL accept it). The Atari implementation of INTERCAL-72 wrote it with a what ('?'), and this is the representation originally used by C-INTERCAL (and still accepted), the only representation accepted by J-INTERCAL, 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). CLC-INTERCAL approximates a bookworm with the yen character, which being a currency character is one of the possible representations for mingle in C-INTERCAL; C-INTERCAL 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 CLC-INTERCAL doesn't support UTF-8.) In the same way, CLC-INTERCAL has a C-INTERCAL compatibility option to allow the use of '?' for exclusive-or. 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, '#&26' is 16 (26 is 1A in hexadecimal or 11010 in binary); '#V26' is 31 (11111 in binary), and '#?26' is 23 (10111 in binary). 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 INTERCAL, 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 INTERCAL-72 system library: 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 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): ((_1~:2)~((?32(:2~:2))^#2147483648))->(_1>(:2^_1)) (Here, the ^ refers to a bitwise exclusive or, an operation found in OIL but not in INTERCAL, which is why the INTERCAL version is so much longer.) The INTERCAL version also has some extra code to check for equality and to produce 1 or 2 as the output rather than 0 or 1. 6.3.4 Array Subscript --------------------- INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes version 0.7+ all versions all versions 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 'SUB'. Note that an array element is not a variable, so it is not accepted as an acceptable argument to statements like 'IGNORE'; however, it can be assigned to. The syntax for an array element is the array, followed by the keyword 'SUB', 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 'SUB' 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. For instance, this is a legal (but not particularly useful) INTERCAL program with no syntax errors that shows some of the syntaxes possible with array subscripting: 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 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 *note Grouping Rules::. 7 Statements ************ There is a wide range of statements available to INTERCAL programs; some identifiably belong to a particular variant or dialect (such as Backtracking INTERCAL), but others can be considered to be part of the 'core language'. The statements listed here are those that the C-INTERCAL 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 INTERCAL; known incompatibilities are listed here, but it's important to check your program on multiple compilers when attempting to write a portable program. 7.1 Syntax Error ================ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes version 0.15+ all versions all versions One of the more commonly-used commands in INTERCAL is the syntax error. A properly-written syntax error looks nothing like any known INTERCAL command; a syntax error that looks vaguely like a command but isn't may confuse C-INTERCAL before version 0.28, 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. 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: DOUBLE OR SINGLE PRECISION ARITHMETIC OVERFLOW This is a valid INTERCAL command, that produces an error when run (note the 'DO' at the start). An even more common use is to produce an initially abstained syntax error by using an appropriate statement identifier, for instance PLEASE NOTE THAT THIS IS A COMMENT 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 'PLEASE NOT'; the extra 'E' causes the command to be a syntax error, and this particular construction is idiomatic.) 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 CLC-INTERCAL (version 1.-94.-3 and later, with 'COMMENT', 'COMMENTS', or 'COMMENTING'), and C-INTERCAL ('COMMENT' in version 0.26 and later, and also 'COMMENTS' and 'COMMENTING' 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. 7.2 Calculate ============= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions At present, the only INTERCAL command that contains no keywords (apart from the statement identifier and possibly 'ONCE' or 'AGAIN') 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: DO .1 <- ':2~:3'~#55 That is, the command is written as a variable or array element, then the '<-' 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 'BY' to cause the array to become multidimensional; so for a 3 by 4 by 5 array, it would be possible to write DO ,1 <- #3 BY #4 BY #5 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. The gerund to refer to calculations is 'CALCULATING'; however, if you are planning to use this, note that a bug in older versions of C-INTERCAL means that assignments to arrays are not affected by this gerund before version 0.27. CLC-INTERCAL from 1.-94.-4 onwards, and C-INTERCAL from 0.26 onwards, allow arbitrary expressions on the left hand side of an assignment (C-INTERCAL only if the '-v' option is used); for more information on how such 'reverse assignments' work, see *note Operand Overloading::. 7.3 NEXT, FORGET and RESUME =========================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions see text all versions The only flow-control commands in INTERCAL-72 were 'NEXT', 'RESUME', and 'FORGET'; together these manipulate a stack of locations in the program known as the 'NEXT stack'. Although all INTERCAL compilers have implemented these, from CLC-INTERCAL version 0.05 onwards CLC-INTERCAL 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 INTERCAL-72 implements nothing else.) Note that there is a strict limit of 80 locations on the NEXT stack, enforced by all known INTERCAL compilers; this helps to enforce good programming style, by discouraging NEXT-stack leaks (which are otherwise quite easy to write). Here are examples to show the syntax of these three statements: DO (1000) NEXT DO FORGET '.1~.1'~#1 DO RESUME .5 The 'NEXT' command takes a line label as its argument (unlike most other INTERCAL commands, it comes after its argument rather than before); both 'FORGET' and 'RESUME' take expressions. (CLC-INTERCAL from version 0.05 onwards also allows an expression in 'NEXT', rather than a label, to give a computed 'NEXT', but this behaviour was not implemented in other compilers, and is deprecated in CLC-INTERCAL along with noncomputed 'NEXT'; if computed 'NEXT' is ever implemented in C-INTERCAL, it will likely likewise be deprecated upon introduction). (Update: it was implemented in C-INTERCAL version 0.28, but only as part of the external calls system, so it cannot be used in ordinary programs; a sample expansion library gives in-program access to a limited form of computed 'NEXT', but should probably not be used.) Running a 'NEXT' 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 'NEXT' command on the top of the NEXT stack. In order to remove items from the 'NEXT' stack, to prevent it filling up (which is what happens with a naive attempt to use the 'NEXT' command as an equivalent to what some other languages call GOTO), it is possible to use the 'FORGET' or 'RESUME' commands. They each remove a number of items from the NEXT stack equal to their argument; 'RESUME' also transfers control flow to the last location removed from the 'NEXT' stack this way. Trying to remove no items, or more items than there are in the stack, does not cause an error when 'FORGET' is used (no items or all the items are removed respectively); however, both of these cases are errors in a 'RESUME' statement. Traditionally, boolean values in INTERCAL 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 INTERCAL-72 is by 'NEXTING', then 'NEXTING' again, then 'RESUMING' either by 1 or 2 according to an expression, and then if the expression evaluated to 1 'FORGETTING' the remaining NEXT stack entry. By the way, the previous sentence also explained what the appropriate gerunds are for 'NEXT', 'RESUME', and 'FORGET'. 7.4 STASH and RETRIEVE ====================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions The NEXT stack is not the only stack available in an INTERCAL program; each variable used in the program also has its own stack, which holds values of the same type as the variable. The 'STASH' command pushes a variable's value onto that variable's stack; 'RETRIEVE' 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 INTERCAL commands, with the word 'STASH' or 'RETRIEVE' followed by the variable or variables to stash or retrieve: DO STASH .1 + ;2 DO RETRIEVE ,3 Note that it is possible to stash or retrieve multiple variables at once, by listing their names separated by intersections ('+'); it's even possible to stash or retrieve a variable twice in the same statement. It is not entirely clear how 'RETRIEVE' interacts with 'IGNORE' in historical INTERCAL-72 compilers; the three modern INTERCAL compilers all use different rules for the interaction (and the C-INTERCAL maintainers recommend that if anyone decides to write their own compiler, they choose yet another different rule so that looking at the interaction (the so-called 'ignorret test') can be used as a method of determining which compiler is running): * C-INTERCAL treats a retrieval just like an assignment. That is, a read-only variable will not be changed by a retrieval, and will remain read-only, but the side-effect of popping that variable's stash will still happen. * J-INTERCAL ignores the read-only status of a variable when retrieving it from a stash; the value of the variable changes despite being read-only. The variable remains read-only; the 'RETRIEVE' simply allows a change to its value despite the read-only status. * CLC-INTERCAL is the most complicated; it stores read-only status or otherwise in the stash, along with the variable's value. This means that if a variable was stashed when read-only, retrieving it will retrieve its value and set it to read-only regardless of its previous read-only status; likewise, if a variable was stashed when read-write, retrieving it will retrieve its value and set it to read-write even if it was previously read-only. The appropriate gerunds for 'STASH' and 'RETRIEVE' are 'STASHING' and 'RETRIEVING' respectively. 7.5 IGNORE and REMEMBER ======================= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions Variables in INTERCAL can be either read-write or read-only. At the start of a program, all variables are read-write, but this status can be changed dynamically during execution of a program using the 'IGNORE' and 'REMEMBER' statements (whose gerunds are 'IGNORING' and 'REMEMBERING' respectively). The syntax is the same as for 'STASH' and 'RETRIEVE': the command's name followed by an intersection-separated list of variables. For instance: DO IGNORE .4 DO REMEMBER ,4 + ;5 Using the 'IGNORE' statement sets a variable to be read-only (or does nothing if it's read-only already); 'REMEMBER' 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. The interaction between 'IGNORE' and 'RETRIEVE' was never defined very clearly, and is in fact different in C-INTERCAL, CLC-INTERCAL and J-INTERCAL; for more details, see *note RETRIEVE::. 7.6 ABSTAIN and REINSTATE ========================= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions 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 'ABSTAIN' and 'REINSTATE'. 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 CLC-INTERCAL versions), and one which takes an intersection-delimited list of gerunds. They look like this: DO ABSTAIN FROM ABSTAINING + REINSTATING DO ABSTAIN FROM (10) DO REINSTATE CALCULATING DO REINSTATE (22) (This also illustrates the gerunds used for these commands; note that 'ABSTAINING' from 'REINSTATING' 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 'ABSTAIN' and/or 'REINSTATE' won't abstain from a command that's already abstained, or reinstate a command that's already reinstated. There is a strange set of restrictions on 'ABSTAIN' and 'REINSTATE' that has existed since INTERCAL-72; historically such restrictions have not always been implemented, or have not been implemented properly. They together define an unusual interaction of 'ABSTAIN' and 'GIVE UP' (note, for instance, that there isn't a gerund for 'GIVE UP'). The wording used in the INTERCAL-72 manual is: [...] 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. This restriction was not implemented at all in the only CLC-INTERCAL version before 0.02 (i.e. version 0.01), or in C-INTERCAL versions before 1.26. The restriction was implemented in C-INTERCAL version 1.26 and CLC-INTERCAL versions 0.02 and later as "'GIVE UP' cannot be 'REINSTATED' or 'ABSTAINED FROM'"; however, this is not strictly the same as the definition used by INTERCAL-72 (C-INTERCAL still uses this definition in CLC-INTERCAL compatibility mode). The J-INTERCAL implementation of this restriction is to make 'REINSTATING' or 'ABSTAINING' from a line label that refers to a 'GIVE UP' statement a compile-time error, but this does not fit the INTERCAL-72 definition either. The definition adopted with version 0.27 and later of C-INTERCAL, which is hopefully correct, is to allow abstaining from a 'GIVE UP' 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). As well as CLC-INTERCAL's extension to abstain/reinstate by computed line number, there is also (since version 0.25) a C-INTERCAL-specific extension to 'ABSTAIN', also known as 'computed abstain', but with a different syntax and different semantics. It's written like an ordinary 'ABSTAIN', but with an expression between the words 'ABSTAIN' and 'FROM', for instance: DO ABSTAIN #1 FROM (1000) DO ABSTAIN .2 FROM WRITING IN Unlike non-computed 'ABSTAIN', this form 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. There are many uses for 'ABSTAIN' (both the computed and non-computed versions) and 'REINSTATE', especially when interacting with 'ONCE' and 'AGAIN' (*note ONCE and AGAIN::); 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. 7.7 READ OUT and WRITE IN ========================= The 'READ OUT' and 'WRITE IN' commands are the output and input commands in INTERCAL; they allow communication between the program and its user. There was a numeric I/O mechanism implemented in INTERCAL-72, 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 C-INTERCAL and CLC-INTERCAL. The syntax of 'READ OUT' and 'WRITE IN' 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 be different for different elements in the list. 7.7.1 INTERCAL-72 I/O --------------------- INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions see text all versions INTERCAL-72 had its own versions of I/O commands; these commands are available in all modern INTERCAL compilers as well (but CLC-INTERCAL implements output slightly differently). To distinguish INTERCAL-72 input and output from the other more modern types of I/O, the 'READ OUT' and 'WRITE IN' 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 'READ OUT') a constant, meaning that these are some examples of the possible forms: READ OUT .1 READ OUT ;2 SUB .3:4 READ OUT #3 WRITE IN :4 WRITE IN ,5 SUB #6 The statements do what you would expect; 'READ OUT' outputs its argument to the user, and 'WRITE IN' 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 'WRITE IN' 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. 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 'ONE TWO THREE FOUR FIVE' as input (if they were using English, the most portable choice of language). In INTERCAL-72 only English is accepted as a language, but other compilers accept other languages in addition. C-INTERCAL 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. J-INTERCAL accepts the same languages, except with Esperanto instead of Latin; from version 0.05 of CLC-INTERCAL onwards, the same list of languages as C-INTERCAL is supported (apart from Latin, which was added in version 1.-94.-8), plus Scottish Gaelic. The format that output can be read in is a modified form of Roman numerals, known as 'butchered' Roman numerals. INTERCAL-72, C-INTERCAL and J-INTERCAL do this the same way; CLC-INTERCAL is somewhat different. The characters 'I', 'V', 'X', 'L', 'C', 'D', and 'M' 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 'XI' is 11 and 'IX' is 9, for instance. In INTERCAL-72, C-INTERCAL, and J-INTERCAL, a bar over a numeral multiplies its value by 1000, and writing a letter in lowercase multiplies its value by 1000000; however, CLC-INTERCAL uses lowercase to represent multiplication by 1000 and for multiplication by 1000000 writes a backslash before the relevant numeral. 7.7.2 C-INTERCAL I/O -------------------- INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.07+ version 0.05+ no C-INTERCAL'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 C-INTERCAL-style I/O is being used, an array must be used as the argument to 'READ OUT' or 'WRITE IN'; as the syntax is the same as for CLC-INTERCAL's I/O, command-line arguments and the capabilities of the version of the compiler being used serve to distinguish the two mechanisms. 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 'WRITE IN' to the next. 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 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 'src/cesspool.c') or at some example C-INTERCAL programs that do text-based I/O.) 7.7.3 CLC-INTERCAL I/O ---------------------- INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no see text all versions no There are also two CLC-INTERCAL-specific I/O mechanisms. These are Baudot-based text I/O (which is also implemented from C-INTERCAL version 0.27 onwards), and CLC-INTERCAL generalised binary I/O (not implemented in C-INTERCAL). Baudot text-based I/O is specified by using a tail array as an argument to 'WRITE IN' or 'READ OUT'. (A tail array can also be used to specify C-INTERCAL-style Turing Tape I/O. In order to determine which is used: both C-INTERCAL and CLC-INTERCAL use their own sort of I/O unless a command-line argument instructs them to use the other.) In the case of 'WRITE IN', one line of input is requested from the user (C-INTERCAL requires this to be input in Latin-1, and will then automatically convert it; CLC-INTERCAL 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; CLC-INTERCAL pads with zeros, C-INTERCAL pads with random bits. Trying to input at end-of-file will act as if the input were a blank line. 'READ OUT' is the reverse; it interprets the array as extended Baudot and converts it to an appropriate character set (Latin-1 for C-INTERCAL, or whatever was specified on the command line for CLC-INTERCAL), 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, *note Character Sets::. Generalised binary I/O is specified using a hybrid array as an argument to 'WRITE IN' or 'READ OUT'. 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. 7.8 GIVE UP =========== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions The 'GIVE UP' command causes the program to end (or, in a multithreaded program, causes the current thread to end). It is written simply as 'GIVE UP'. 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 'TRY AGAIN', and that it has an unusual interaction with 'ABSTAIN'; for details of this, see *note ABSTAIN::. (Going past the last command in the program is an error.) There is no gerund for 'GIVE UP'; in particular, 'GIVING UP' is a syntax error. 7.9 TRY AGAIN ============= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.25+ no no The 'TRY AGAIN' 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 'TRY AGAIN' 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. The gerund for 'TRY AGAIN' is 'TRYING AGAIN'. 7.10 COME FROM and NEXT FROM ============================ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no see text see text see text The 'COME FROM' statement (incidentally also invented in 1972, but not in connection with INTERCAL) is the main control-flow command in CLC-INTERCAL (which deprecates 'NEXT'), and one of two main control flow structures in other modern INTERCAL compilers. It takes either a label or an expression as its argument; these forms are noncomputed 'COME FROM' and computed 'COME FROM'. Noncomputed 'COME FROM' was implemented in version 0.5 of C-INTERCAL, but did not conform to modern-day semantics until version 0.7; it is available in every version of CLC-INTERCAL and J-INTERCAL. Computed 'COME FROM' support is available in every version of CLC-INTERCAL and in C-INTERCAL from version 0.25 onwards, but not in J-INTERCAL; the variant 'NEXT FROM' of 'COME FROM' is available from CLC-INTERCAL version 1.-94.-8 and C-INTERCAL version 0.26 (both computed and noncomputed). C-INTERCAL and CLC-INTERCAL also have a from-gerund form of 'COME FROM' and 'NEXT FROM', which was also implemented from CLC-INTERCAL version 1.-94.-8 and C-INTERCAL version 0.26. The basic rule of 'COME FROM' is that if a 'COME FROM' statement references another statement, whenever that statement is reached, control flow will be transferred to the 'COME FROM' after that statement finishes executing. ('NEXT FROM' is identical except that in addition to the 'COME FROM' 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 itself a 'NEXT'.) Here are examples of noncomputed, computed, and from-gerund 'COME FROM': DO COME FROM (10) DO COME FROM #2$'.1~#1' DO COME FROM COMING FROM (The last example is an infinite loop. If it said 'DO NEXT FROM NEXTING FROM', it would not be an infinite loop because the NEXT stack would overflow and cause an error. This also establishes the gerunds used for 'COME FROM' and 'NEXT FROM'.) There are some things to be careful with involving 'COME FROM' and 'NEXT FROM'. First, if the statement come from or nexted from happens to be a 'NEXT', the 'NEXT' doesn't count as 'finishing executing' until the NEXT stack entry created by the 'NEXT' is 'RESUME'd to. In particular, this means that if 'FORGET' is used to remove the entry, or a 'RESUME' with a large argument resumes a lower entry, the 'COME FROM' doesn't steal execution at all. Second, you may be wondering what happens if two 'COME FROM's or 'NEXT FROM'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 'COME FROM's or 'NEXT FROM'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 'COME FROM's or 'NEXT FROM's are noncomputed, however, a compiler can (but does not have to) give a compile time error if two 'COME FROM's or 'NEXT FROM's share a label, and so that situation should be avoided in portable code. (If it is wanted, one solution that works for C-INTERCAL and CLC-INTERCAL is to use computed 'COME FROM's or 'NEXT FROM's with a constant expression.) 8 System Libraries ****************** Some programming support libraries may be included automatically at the end of your program by the C-INTERCAL compiler. While such a convenience feature might be judged not in the spirit of INTERCAL, the required level of perversity is arguably restored by the way inclusion is triggered: whenever your program refers to a line from specified magic ranges without defining any line in those ranges in the program. (CLC-INTERCAL does not have this feature, but it is trivial to concatenate a copy of any desire library onto the end of the program.) The following table maps magic line ranges to systen libraries. Descriptions of the libraries follow it. From To Versions Description --------------------------------------------------------------------- (1000) (1999) All Basic System Library (5000) (5999) >=0.29 Floatring Point Library 8.1 syslib ========== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions no all versions INTERCAL has a system library, called 'syslib' (versions for bases other than 2 will have a numeric suffix on the name). The intention of the system library is to provide a range of useful capabilities, like multiplication, that can otherwise be hard to write in INTERCAL. System library routines are used by 'NEXTING' to their line number (*note NEXT::), where they will make changes to certain variables depending on certain other variables (depending on which routine is called), and 'RESUME' back to the original program. As the system library is itself written in INTERCAL, there are some restrictions that need to be obeyed for calls to it to be guaranteed to work; none of the variables it uses ('.1' to '.6' and ':1' to ':5') 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 'DO ABSTAIN FROM (1500)' or more subtle problems like gerund-abstention) or have 'COME FROM's or 'NEXT FROM's aiming at them. The system library is currently available in all bases from 2 to 7 (*note TriINTERCAL::), but not every command is available in every base, and C-INTERCAL is the only one of the three compilers listed above that has the system library to ship with a version in bases other than 2. (This table was originally based on the INTERCAL-72 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. Line Description Bases ----------------------------------------------------------------------- (1000) .3 <- .1 plus .2, error exit on overflow 2, 3, 4, 5, 6, 7 (1009) .3 <- .1 plus .2, overflow checked 2, 3, 4, 5, 6, 7 (1010) .3 <- .1 minus .2, no action on overflow 2, 3, 4, 5, 6, 7 (1020) .1 <- .1 plus #1, no action on overflow 2, 3, 4, 5, 6, 7 (1030) .3 <- .1 times .2, error exit on overflow 2, 3, 4, 5, 6, 7 (1039) .3 <- .1 times .2, overflow checked 2, 3, 4, 5, 6, 7 (1040) .3 <- .1 divided by .2 2, 3, 4, 5, 6, 7 (1050) .2 <- :1 divided by .1, error exit on overflow 2, 3, 4, 5, 6, 7 (1200) .2 <- .1 times #2, overflow captured in .3 4, 6 (1210) .2 <- .1 divided by #2, one digit after the 4, 6 quartic or sextic point stored in .3 (1500) :3 <- :1 plus :2, error exit on overflow 2, 3, 4, 5, 6, 7 (1509) :3 <- :1 plus :2, overflow checked 2, 3, 4, 5, 6, 7 (1510) :3 <- :1 minus :2, no action on overflow 2, 3, 4, 5, 6, 7 (1520) :1 <- .1 concatenated with .2 2, 3, 4, 5, 6, 7 (1530) :1 <- .1 times .2 2, 3, 4, 5, 6, 7 (1540) :3 <- :1 times :2, error exit on overflow 2, 3, 4, 5, 6, 7 (1549) :3 <- :1 times :2, overflow checked 2, 3, 4, 5, 6, 7 (1550) :3 <- :1 divided by :2 2, 3, 4, 5, 6, 7 (1700) :2 <- :1 times #2, overflow captured in .1 4, 6 (1710) :2 <- :1 divided by #2, one digit after the 4, 6 quartic or sextic point stored in .1 (1720) :2 <- :1 times the least significant digit of 5, 7 .1, overflow captured in .2 (1900) .1 <- uniform random number from #0 to #65535 2, 3, 4, 5, 6, 7 (1910) .2 <- normal random number from #0 to .1, with 2, 3, 4, standard deviation .1 divided by #12 5, 6, 7 If you happen to be using base 2, and are either using the external call system (*note External Calls::) or are willing to use it, it is possible to use a version of the system library written in C for speed, rather than the default version (which is written in INTERCAL). To do this, use the command line options '-eE' (before the INTERCAL file), and 'syslibc' (at the end of the command line). 8.2 floatlib ============ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions no all versions INTERCAL also has a floating-point library, called 'floatlib', presently available only in base 2. It is used by several of the demonstration programs shipped with the distribution. In versions after 0.28 it is included automatically at the end of your program by the compiler whenever your program refers to a line from (5000) to (5999) without defining any line in that range in the program. Here is a summary of routines in floatlib.i: Line Description ------------------------------------------------------------------- (5000) :3 <- :1 plus :2 (5010) :3 <- :1 minus :2 (5020) :2 <- the integer part of :1, :3 <- the fractional part of :1 (5030) :3 <- :1 times :2 (5040) :3 <- :1 divided by :2 (5050) :3 <- :1 modulo :2 (5060) :2 <- :1 cast from a two's-complement integer into a floating-point number (5070) :2 <- :1 cast from a floating-point number into the nearest two's-complement ineger (5080) :2 <- :1 cast from a floating-point number into a decimal representation in scientific notation (5090) :2 <- :1 cast from a decimal representation in scientific notation into a floating-point number (5100) :2 <- the square root of :1 (5110) :2 <- the natural logarithm of :1 (5120) :2 <- e to the power of :1 (the exponential function) (5130) :3 <- :1 to the power of :2 (5200) :2 <- sin :1 (5210) :2 <- cos :1 (5220) :2 <- tan :1 (5400) :1 <- uniform random number between zero and one exclusive (5410) :2 <- :1 times phi (5419) :2 <- :1 divided by phi Note: All of the above routines except (5020), (5060), (5080), (5200), (5210), and (5400) also modify .5 as follows: .5 will contain #3 if the result overflowed or if the arguments were out of domain, #2 if the result underflowed, #1 otherwise. (See below.) The INTERCAL floating-point library uses the IEEE format for 32-bit floating-point numbers, which uses bit 31 as a sign bit (1 being negative), bits 30 through 23 hold the exponent with a bias of 127, and bits 22 through 0 contain the fractional part of the mantissa with an implied leading 1. In mathematical notation: 'N = (1.0 + fraction) * 2^(exponent - 127) * -1^sign' Thus the range of floating-point magnitudes is, roughly, from 5.877472*10^-39 up to 6.805647*10^38, positive and negative. Zero is specially defined as all bits 0. (Actually, to be precise, zero is defined as bits 30 through 0 as being 0. Bit 31 can be 1 to represent negative zero, which the library generally treats as equivalent to zero, though don't hold me to that.) Note that, contrary to the IEEE standard, exponents 0 and 255 are not given special treatment (besides the representation for zero). Thus there is no representation for infinity or not-a-numbers, and there is no gradual underflow capability. Conformance with widely-accepted standards was not considered to be a priority for an INTERCAL library. (The fact that the general format conforms to IEEE at all is due to sheer pragmatism.) PART III: INTERCAL DIALECTS AND EXTENSIONS ****************************************** 9 TriINTERCAL ************* INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.7+ version no 1.-94.-8+ One extension to INTERCAL that is implemented by both C-INTERCAL and CLC-INTERCAL is known as TriINTERCAL, and extends INTERCAL to bases other than binary. Unlike ordinary INTERCAL programs, which have the extension '.i', TriINTERCAL programs in bases from 3 to 7 (the only allowed bases) have extensions from '.3i' to '.7i' respectively. 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: * Exclusive-or becomes two operators, known either as subtract-without-borrow and add-without-carry due to their mathematical interpretations, or what and sharkfin after their Atari syntax representations ('?' and '^'). (In Princeton syntax, these are the bookworm or yen sign, and a spike ('|').) The two operators do the same thing in binary, but differ in higher bases. (Nevertheless, it is an error to use a sharkfin in binary, because it is a so-called 'controlled unary operator', as are the rest of the new operators defined in this section, which has a lower limit on which base it is allowed in.) Instead of doing the exclusive-or operation, the bits being combined are either subtracted or added; if the result is out of range for the base being used, the base is added or subtracted from the result until it is in range. (For the subtraction, the bit that was less significant is subtracted from the bit that was more significant in any given pair of bits, except for the subtraction between the most and least significant bits, where the most significant bit is subtracted from the least.) * The AND and OR operators are generalised into an entire sequence of operators; the number of operators available is the same as the base that is being used. In base 3, the third operator is known as BUT; in other bases, there are no commonly accepted names for the extra operators, 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 0 if either argument is a 0, and otherwise a 1, and likewise, an OR gives the result 1 if either argument is a 1, and otherwise a 0; they could be said to favour 0 over 1 and 1 over 0 respectively. In base 3, AND favours 0 over 2 over 1, OR favours 2 over 1 over 0, and BUT favours 1 over 0 over 2. (The symbol for BUT is '@' (a 'whirlpool', which is another name for the BUT operation) in Atari syntax, and '?' in Princeton syntax.) The pattern continues: in base 4, AND favours 0 over 3 over 2 over 1, BUT favours 1 over 0 over 3 over 2, 2BUT (written '2@' or '2?') favours 2 over 1 over 0 over 3, and OR favours 3 over 2 over 1 over 0. (This can be extended to higher bases following the same pattern, introducing operators '3@' or '3?', etc., to favour 3, etc., when neither AND (which always favours 0) nor OR (which favours the highest digit in the base) are available.) All the whirlpool operators are controlled unary operators, which are only legal when both the base contains the favoured digit, and they aren't redundant to AND nor OR. * Select has its semantics modified to deal with more than one nonzero digit in the base. It starts off by doing an AND (in whatever base is being used) between the two numbers being selected; then the bits of the result are sorted by the bits of the right-hand argument to the select, with bits corresponding to 0s in the right-hand argument ending up more significant than bits corresponding to high digits in the right-hand argument. In base 2, this has the same effect as a traditional-style select. 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.) 10 Multithreading and Backtracking ********************************** The multithreading and backtracking extensions to INTERCAL were originally invented by Malcom Ryan, who implemented 'COME FROM'-based multithreading as a modified version of C-INTERCAL, known as Threaded INTERCAL, but did not implement backtracking. (The same functionality is implemented in C-INTERCAL today, but with different code. Most likely, this means that the original code was better.) He also invented the original version of Backtracking INTERCAL, but did not implement it; the only known implementation is the C-INTERCAL one. A different version of multithreading, using 'WHILE', was implemented as part of CLC-INTERCAL (like all extensions first available in CLC-INTERCAL, it is most likely due to Claudio Calvelli) and then added to C-INTERCAL, although its implications were not noticed for some time afterwards. So nowadays, three freely-mixable threading-like extensions to INTERCAL exist, all of which are implemented in C-INTERCAL. (A fourth, Quantum INTERCAL, is implemented in CLC-INTERCAL but not C-INTERCAL, 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 C-INTERCAL, because the INTERCAL 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 INTERCAL as a whole, for that matter.) 10.1 Multithreading using COME FROM =================================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.25+ version 0.05+ no 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 'COME FROM's or 'NEXT FROM's (or a mixture of these) 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. 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 'COME FROM' and a 'NEXT FROM' aim at the same line, for instance, the 'NEXT FROM' thread will end up with a NEXT stack entry that isn't in the 'COME FROM' thread, created by the 'NEXT FROM' 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 INTERCAL.) In C-INTERCAL, 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, 'COME FROM's and 'NEXT FROM'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 'COME FROM' or 'NEXT FROM' 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 C-INTERCAL from 0.27 onwards, there is a third guarantee; that if a 'COME FROM' 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 'COME FROM' could block all threads if it aimed for itself due to the speed restrictions and the fact that 'COME FROM's need not count towards the total command count.) Also, all commands, including any 'ONCE' or 'AGAIN' 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 INTERCAL status quo, these guarantees are somewhat _better_ than in most other languages that implement threading, amusingly continuing to leave INTERCAL with the status of being unlike any other mainstream language.) 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 'ABSTAIN' and 'ONCE' is one way to communicate atomically, due to the atomic nature of 'ONCE'.) If there are at least two threads, the 'GIVE UP' command ends the current thread, rather than the current program. 10.2 Multithreading using WHILE =============================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.27+ version 0.05+ no The 'WHILE' 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 CLC-INTERCAL, there are at least two other meanings for 'WHILE', but only the one implemented in C-INTERCAL is discussed here.) The syntax is somewhat unusual, and consists of two commands separated by the 'WHILE' keyword, but sharing the statement identifier, execution chance, and any 'ONCE'/'AGAIN' keyword that may be present. For instance: (1) DO COME FROM ".2~.2"~#1 WHILE :1 <- "'?.1$.2'~'"':1/.1$.2'~#0"$#65535'"$ "'"'&.1$.2'~'#0$#65535'"$#0'~#32767$#1" (OK, maybe that's an unnecessarily complicated example, and maybe it shouldn't have included the '/' operator which is part of another INTERCAL extension (*note Operand Overloading::). Still, I thought that maybe you'd want to see how addition can be implemented in INTERCAL.) A 'WHILE' 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 'WHILE' 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. 'NEXTING FROM', 'ABSTAINING FROM' or similar behaviour with respect to the 'WHILE' 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 'WHILE' 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 'NEXTING', 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 'NEXT'), that thread loops and reruns that command as long as the left command has not finished; 'COMING FROM' that command, or a 'NEXT'/'NEXT FROM' from/aiming at that command, doesn't count as finishing that command until it is 'RESUME'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 'GIVE's 'UP' or the loop ends due to the command ending later in another thread). A 'WHILE' 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 of the same 'WHILE' 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 'WHILE' ends, they together only cause one right-hand command to end. (What, did you expect the logical and orthogonal behaviour?) The two threads produced by a 'WHILE' (the original thread and a new copy of it) have more in common than ordinary INTERCAL threads created by 'COME FROM'; ordinary threads share only 'ABSTAIN'/'REINSTATE' information, whereas the 'WHILE'-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. Ordinary multithreading cannot create woven threads. When threads are created by multiple 'COME FROM'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 (*note Backtracking::) 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 'MAYBE', 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 'WHILE' inside one of the threads that is already woven, which causes all the new threads to be woven together (the weaving relationship is transitive). 10.3 Backtracking ================= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.25+ no no 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 'MAYBE' 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 'GO AHEAD' and get rid of the dormant thread, or decide that it didn't like the consquences of the command and 'GO BACK' 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.) To create a choicepoint, the statement identifier 'MAYBE' is used, rather than the more usual 'DO' or 'PLEASE'. (Combination statement identifiers are still allowed, but must be in the order 'MAYBE PLEASE DO NOT' with optionally some parts omitted, or different versions of 'NOT' used, or both.) Here's an example: MAYBE DON'T GIVE UP When a command whose statement identifer contains 'MAYBE' 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 'ABSTAIN' and 'REINSTATE', 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 'NEXT' stack are. 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 'GO BACK' command (which has no arguments, and is just the statement identifier, optional execution chance, 'GO BACK', and optional 'ONCE' or 'AGAIN'). 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 'MAYBE' is temporarily reversed for determining whether it runs or not (this reversal only lasts immediately after the 'GO BACK', and does not affect uses of the command in other threads or later in the same thread), so unless it has been 'ABSTAIN'ed or 'REINSTATE'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 'GO BACK' to a stale choicepoint instead causes the stale choicepoint to be deleted and the program to continue executing. (This is what gives INTERCAL's backtracking greater flexibility in some ways than some other languages; to get backtracking without the stale choicepoints having an effect, simply run 'COME FROM' the 'GO BACK' as the previous statement.) 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 'GO BACK' 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 'GO BACK' 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 INTERCAL's backtracking is more flexible than that of some other languages. If, on the other hand, a program decides that it likes where it is and doesn't need to 'GO BACK', or it wants to 'GO BACK' to a choicepoint lower down the stack while skipping some of the ones nearer the top of the stack, it can run the 'GO AHEAD' command, which removes the top choicepoint on the stack, whether it's a genuine choicepoint or just a stale one. Both 'GO AHEAD' and 'GO BACK' cause errors if an attempt is made to use them when the choicepoint stack is empty. 11 Operand Overloading ********************** INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.26+ version 0.05+ no (Operand overloading in C-INTERCAL is nowhere near as advanced as it is in CLC-INTERCAL. This chapter only explains the partial implementation used by C-INTERCAL; for a full implementation, see CLC-INTERCAL and its documentation.) 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. At the beginning of the program, all variables stand for themselves; so '.1' really does mean '.1', for instance. The meaning of a variable can be overloaded using the slat operator ('/'), which is the same in both Princeton and Atari syntax: it is a binary operator whose left argument must be a onespot or twospot 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: DO .1 <- .2/'.3~.4' The example causes '.2''s true value to be assigned to '.1' (unless of course '.1' is read-only), but also causes '.2' from then on to actually mean ''.3~.4'', except when it's the left operand of a slat operator. So for instance, 'DO .1 <- .2' would actually assign ''.3~.4'' to '.1'. Somewhat confusingly, this also works in the other direction; 'DO .2 <- .1' would assign '.1' to ''.3~.4'', which would have the effect of changing the values of '.3' and '.4' so that ''.3~.4'' 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 'DO .1 <- .1/#1' is entirely capable of changing the value of '#1', although to protect new INTERCAL users C-INTERCAL will refuse to carry out operations that change the value of constants unless a command-line switch (*note -v::) is used to give it permission. In C-INTERCAL, changing the value of a constant only changes meshes with that value, but in CLC-INTERCAL it can also change non-mesh uses of that constant, so doing so is not portable anyway.) When multiple overloading rules are in effect, they are all applied; overloading '.1' to ''.2~.3'' and '.2' to ''.3$.4'' will cause '.1' to refer to '''.3$.4'~.3''. 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 '.1/.2' and '.2/.1' together cause '.1' to expand to '.2', which expands to '.1', which cannot expand any further). In C-INTERCAL, the expression on the right hand side of a slat is not evaluated and not expanded by operand overloading. 'STASHING' a variable causes its overloading information to be stashed too; 'RETRIEVING' 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). 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. 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 'DO .1 <- .2/'.3$.3' DO .2 <- #6' are liable to succeed assigning garbage to '.3' 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. 12 PIC-INTERCAL *************** INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.26+ no no PIC-INTERCAL is a simplified version of INTERCAL designed especially for embedded systems, designed to minimise code and data usage by INTERCAL 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.) C-INTERCAL only compiles 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, 'src/pick1.h' and 'src/pick2.h', don't have any effect 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.) There are several restrictions on PIC-INTERCAL programs: * It's impossible to store more than one item in the STASH for any given variable. * Many errors are not checked at runtime; it is the programmer's job to ensure that runtime errors are avoided. (The few errors that are detected will send the program into an infinite loop, as there is no sensible way to exit from a PIC program.) * Double-oh-sevens are not randomised, but instead depend merely on whether the probability given is greater than 50% or not. * The NEXT stack is limited to 16 entries rather than the usual 80. * 'ABSTAIN' and 'REINSTATE' still work, but cannot be computed 'ABSTAIN's, and will not necessarily work when used to affect the system library or calls to it. * 'READ OUT' and 'WRITE IN' don't work. (See below for a replacement.) * 'COME FROM' and 'NEXT FROM' must aim at a label, not an expression or gerund. * Multithreading and TriINTERCAL cannot be used on PICs. (Operand overloading can be used, but only if your PIC cross-compiler supports function pointers; some don't.) In order to provide I/O capabilities, a new command 'PIN' 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 'PORTA' and 'PORTB'; for other microcontrollers, adapting the code in 'src/pick1.h' 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. The 'PIN' command takes one twospot variable as its argument, like this: DO PIN :2 The twospot variable is conceptually divided into 4 blocks of 8 bits. The highest two blocks control the directions of the pins in 'PORTB' (most significant block) and 'PORTA' (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 'PORTB' and the least significant block controls 'PORTA', 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 'PIN' 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. 13 CREATE ********* INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.28+ see text no The 'CREATE' command allows the creation of new syntax at runtime. CLC-INTERCAL has had such a command since 1.-94.-8, but its syntax is completely different and incompatible with the C-INTERCAL version, and so is not documented here (see the CLC-INTERCAL documentation for more details). The C-INTERCAL version is only defined if the '-a' option is used on the command line (and a runtime error E000 otherwise), because it forces the operand overloading code to be introduced and so slows down every variable access in the program. The syntax of the 'CREATE' command is to write 'CREATE', then a line label, then anything. OK, well not quite anything; you're restricted to syntax that is supported by the 'just-in-case' compiler that runs on comments at compile time just in case they gain a meaning later (see below). The anything provides an example statement to 'CREATE'; statements which look the same (but may differ in details) are created. Typical syntax for a 'CREATE' statement would therefore look something like this: DO CREATE (5) SWITCH .1 WITH .2 There is also computed 'CREATE', working identically to ordinary 'CREATE' except that the line number is taken from an expression and the created command must start with a letter (to avoid an ambiguity if the expression giving the line label happens to be an array reference), with a syntax like this: DO CREATE .5 SWITCH .1 WITH .2 Here, a new 'SWITCH WITH' statement (there is no such statement in INTERCAL normally) is being created. This command makes it possible to do this: DO SWITCH .3 WITH .4 Normally that line would be an error (E000) due to being unrecognised, but having been 'CREATE'd, it's now a real statement. (The gerund to affect created statements is 'COMMENT', just like before they were created; the gerund to affect 'CREATE' itself is 'CREATION' ('CREATING' is also allowed, but not as elegant).) When the created statement is encountered, it 'NEXT's to line (5), the line number specified in the 'CREATE' statement. In order for the code there to be able to affect the variables mentioned in the statement, the variables ':1601' (for the first variable or expression mentioned), ':1602' (for the second variable or expression mentioned), and so on, are 'STASH'ed and then overloaded to the respective expressions or variables mentioned in the created command; so ':1601' has been overloaded to mean '.3' and ':1602' has been overloaded to mean '.4' at this point. Then, the code at (5) runs; if it returns via a 'RESUME #1', ':1601' and ':1602' will be 'RETRIEVE'd automatically and the program will continue from after the created statement. (If you do not resume to that point, say if you're creating a flow control statement, you'll have to deal with the stashes for the 1600-range variables yourself.) So what syntax is available in created statements? All the capital letters except 'V' (which is an operator in INTERCAL) are available and can be used freely and as many times as desired; they match themselves literally. However, they are not allowed to spell an INTERCAL keyword at any point (so watch out for 'DO' and 'FROM', for instance). Whitespace is allowed, but is ignored (both in the 'CREATE' template statement, and in the code being created; so 'DO SW ITCH :8 WITH :50' will also have been created). Then, there are three groups of matchable data: scalar variables (onespot or twospot variables, as used in the examples above) match other scalar variables, array elements (like ',4 SUB '.5~.6'') match other array elements, and other expressions match other other expressions. Two matchable data may not appear consecutively in a created command, but must be separated by at least one capital letter (to prevent array-subscript-related ambiguities; remember that the just-in-case compiler has to compile these statements at compile time without knowing what they are). The actual expressions used in the 'CREATE' statement don't matter; they're just examples for the runtime to match against. It is also possible (from C-INTERCAL version 0.29 onwards) to create new operators. Such operators are always binary operators (that is, they take two arguments and parse like mingle or select), and always return 32-bit results. There are three types of legal names for such operators, all of which are treated equivalently: lowercase letters, punctuation marks otherwise unused in INTERCAL, and overstrikes consisting of a character, a backspace, and another character (apart from overstrikes already used for built-in INTERCAL operators). The syntax for creating an operator looks like one of these: DO CREATE (5) x DO CREATE .5 = The arguments to the operator will be overloaded onto :1601 and :1602 (which are, like with 'CREATE'd statements, stashed before the overloading happens), and the return value is read from :1603 (which is stashed, then overloaded to itself). All these three variables are retrieved again after the operator finishes evaluating. Note that it is a very unwise idea to use a 'CREATE'd operator in the expression for a computed 'COME FROM' or 'NEXT FROM', because this always leads to an infinite regress; whenever any line label is reached (including the line label that the 'CREATE' statement pointed at), the expression needs to be evaluated in order to determine whether to 'COME FROM' that point, which in turn involves evaluating lines which have labels. Some other points: a newer 'CREATE' statement supercedes an older 'CREATE' statement if they give equivalent templates, multiple 'CREATE' statements may aim at the same line (this is the recommended technique for creating a statement that can handle expressions even if they're array elements or variables; you do this by specifying multiple templates in multiple 'CREATE' statements), and strange things happen if a twospot variable in the 1600-range is used as an argument to a created statement itself (because of the stash/retrieve, such a variable can usually be read, but may not always be able to be written without the data being lost). 14 External Calls ***************** INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.28+ no no C-INTERCAL has a feature allowing INTERCAL and non-INTERCAL code to be mixed. This is achieved by causing the non-INTERCAL programs to participate in the INTERCAL line-numbering model. The same feature allows expansion libraries to be linked into the code. To create a combined program containing INTERCAL and non-INTERCAL code, use 'ick' as the compiler as normal, but specify both the INTERCAL and non-INTERCAL source files on the command line, and use the '-e' command-line option. 'ick' will invoke other compilers as necessary, after modifying the source files accordingly. At present, external calls are only supported to and from C and Funge-98. In each case, it will be the INTERCAL program that is invoked first. (This means that it is impossible to link together more than one INTERCAL program, but you probably don't want to, because concatenating the programs is likely to have a similar effect.) You can get the INTERCAL program to 'NEXT' to the non-INTERCAL program immediately, or the non-INTERCAL program to 'COME FROM' or 'NEXT FROM' the INTERCAL program immediately, to obtain the effect of running the non-INTERCAL program first. Note that external calls are incompatible with PIC-INTERCAL and with multithreading; note also that you must use 'gcc' as your compiler, and GNU cpp and ld, for them to work in the current version of C-INTERCAL. 14.1 External Calls to C ======================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.28+ no no Linking C and INTERCAL programs is achieved by placing various constructs into the C programs that are equivalent to various INTERCAL constructs. It is possible to simulate a line with a label and a dummy command (which serves as a 'COME FROM' suckpoint and 'NEXT' target), a command with a line label, 'NEXT', 'RESUME', and 'FORGET', and 'COME FROM' and 'NEXT FROM'. Onespot and twospot variables are accessible from inside the C program, where they can be read and written; however, the INTERCAL program cannot access any variables inside the C program that weren't part of the INTERCAL program originally. To prevent various logical impossibilities, there are restrictions on where these can be used and what preparation is needed before they are used. Also, the semantics are not always exactly what you might expect for technical reasons. It should be observed that the INTERCAL link intrudes on the user namespace. To prevent possible namespace clashes, no identifiers starting with 'ick_' or 'ICK_' should be used anywhere in the linked C program for any reason, except where specified in this manual. 14.1.1 External C Call Infrastructure ------------------------------------- For a C program to be connected to an INTERCAL program, it needs to be marked with the correct header file, and needs to have functions marked for communication with the INTERCAL program. '#include ' The header file 'ick_ec.h' must be included using the preprocessor in any file which uses any of the INTERCAL external call functions, variables, or macros. (Note that this file may not necessarily exist, or exist in the usual place; 'ick' will deal with making sure the correct header file is included.) This will include 'stdint.h' (a standard C header file, which must exist on your system), so that you can access INTERCAL variables (the INTERCAL types onespot, twospot, tail, hybrid correspond to the C types uint16_t, uint32_t, uint16_t*, uint32_t* respectively); also, it will provide the prototypes for all the functions and definitions for all the macros needed to use the external calls system with C. 'ICK_EC_FUNC_START' 'ICK_EC_FUNC_END' Many of the INTERCAL interface macros ('ick_linelabel', 'ick_comefrom', and 'ick_nextfrom') make it possible to jump from an INTERCAL program to a C program. Because C doesn't allow jumping into the middle of a function, there has to be some way to create a block of code which _can_ be jumped into. This is what these two macros achieve. This declaration and definition: ICK_EC_FUNC_START(identifier) { /* code goes here */ } ICK_EC_FUNC_END is equivalent to this: void identifier(void) { /* code goes here */ } except that it is possible to jump from an INTERCAL program into the declared and defined program. (If you need to write a prototype for the function early, 'void identifier(void);' is perfectly acceptable, but an early prototype is not required unless you call the function from earlier within the C code.) Of course, you can substitute any identifier that's legal as a function name for 'identifier' (as long as it doesn't start with 'ick_' or 'ICK_'). The resulting function is a function (for instance, you can take its address or call it in the usual ways); the only differences are that it can be jumped into from INTERCAL code and that it is constrained to take no arguments and return no data. (It can still access global and INTERCAL variables.) If the function is jumped into from INTERCAL code, but then control flow reaches the end of the function, or the function 'return;'s but was not called from C, the resulting behaviour is undefined; C-INTERCAL will attempt to continue by some means at that point, but may fail. If a function is unsure whether it gained control from C or from INTERCAL code, it may use 'ick_return_or_resume' (described below). Because you are not allowed to declare two C functions with the same name (even in different modules), all functions declared with 'ICK_EC_FUNC_START' must have unique names across the entire compilation. 14.1.2 ick_startup ------------------ It is sometimes necessary for a C program to do its own initialisation before the INTERCAL program starts running. To do so, it can use the 'ick_startup' macro inside a function declared with 'ICK_EC_FUNC_START'; the syntax is 'ick_startup(block)', where the argument is an expression, statement, or compound statement to run. The argument itself must not contain any ick_-prefixed macros or functions except possibly ick_create, may have side effects, and must fit the C preprocessor's idea of what a macro argument should look like (it's more used to parsing expressions than blocks; the general rule is to avoid commas except when they're directly or indirectly inside parentheses or strings). 14.1.3 ick_linelabel -------------------- A line label is something that can be 'NEXT'ed to and 'COME FROM'. Unlike an INTERCAL line label, it does not label a statement, and therefore attempts to 'ABSTAIN' or 'REINSTATE' it may be errors, or may be ignored (it's unspecified which, which means that either may happen for any or no reason, but exactly one will happen in any given case, although the choice might not be consistent). The macro 'ick_linelabel(expression);' may appear anywhere a compound statement would normally be able to appear. (That is, it looks like a function call being used as a standalone expression, but in fact the places where it can appear are more limited.) In contrast to ordinary line labels, an expression can be used rather than just a constant; however, the behaviour is undefined if the expression has side-effects. Upon encountering the line label, any 'COME FROM's or 'NEXT FROM's aiming at the line label (including 'ick_comefrom's and 'ick_nextfrom's) will steal control from the program; 'RESUMING' after a 'NEXT FROM' will work, but suffers from the same caveats as setjmp/longjmp do (any auto variables that change their value between the 'NEXT FROM' and 'RESUME' will have their value clobbered (i.e. their value is no longer reliable and should not be accessed)). Note that the INTERCAL variables are immune to this problem. You can also avoid the problem by marking variables as 'volatile' in the C program. It is possible to 'NEXT' or 'ick_next' to a 'ick_linelabel', which has the same effect as saving the 'NEXT' stack, calling the function containing the 'ick_linelabel' and then immediately doing a C 'goto' to an imaginary label preceding it. Due to this possibility, an 'ick_linelabel' is only allowed within a function defined with 'ICK_EC_FUNC_START'. 14.1.4 ick_labeledblock ----------------------- In INTERCAL programs, labels don't stand on their own, but instead label a statement. The difference between a standalone line label and a line label that labels a statement is that 'COME FROM's will come from the _label itself_ (which is before the next statement) when aiming at a standalone line label, but the _end of the statement_ when aiming at a labeled statement. To achieve the same effect in C, the macro 'ick_labeledblock' is available; it can be used as 'ick_labeledblock(expression,expression)' or 'ick_labeledblock(expression,statement)'; the first argument is the label, and the second argument is an expression or statement to label (if an expression is labeled, it will be converted to a statement that evaluates it for its side effects and discards the result). It is even permitted to label a block statement in this way. Note, however, that you have to contend with the C preprocessor's ideas of where macro arguments begin and end when doing this. Other than the position of the 'COME FROM' target created by the label, this behaves the same way as 'ick_linelabel' (so for instance, computed line labels are allowed, but the expression that computes them must not have side effects, and it is only allowed within a function defined with 'ICK_EC_FUNC_START'). 14.1.5 ick_comefrom and ick_nextfrom ------------------------------------ The 'ick_comefrom' and 'ick_nextfrom' macros are, like the other INTERCAL flow control macros (as opposed to functions), only allowed within a function defined with 'ICK_EC_FUNC_START'. They act almost exactly like the INTERCAL statements of the same name (although note that C statements cannot be 'ABSTAIN'ed 'FROM' even if they act the same way as INTERCAL statements); they are written as 'ick_comefrom(expression);' and 'ick_nextfrom(expression);' respectively (note that they must be called as statements, and cannot be used as part of an expression). Whenever a standalone line label is encountered whose expression evaluates to the same number as the expression inside the 'ick_comefrom' or 'ick_nextfrom', and that number is at most 65535, then control will be transferred to the 'ick_comefrom' or 'ick_nextfrom', leaving a 'NEXT' stack entry behind in the case of 'ick_nextfrom'; likewise, if the end of a labeled statement, expression or block is reached and the label has the right number. Some caveats: the expression need not be constant, but must not have side effects, must not be negative, and must fit into the range of an 'unsigned long' in the C program (and the statement will do nothing if the expression evaluates to a value larger than 65535). In keeping with the best C traditions, these caveats are not checked, but instead result in undefined behaviour if breached. There are also versions 'ick_comefromif' and 'ick_nextfromif', which take a second parameter, which is a condition that specifies whether control is actually stolen from the target. The condition may have side effects, and is only run when the line numbers match; it should return 0 or NULL to leave control flow alone, or nonzero to steal control, and should be either an integral type or a pointer type. Although side effects are allowed, the condition must not look at or alter 'auto' or 'register' variables in the enclosing function, not even if they are also marked 'volatile'. (Global and 'static' variables are fine, though.) 14.1.6 ick_next --------------- 'ick_next' is a macro that acts like the INTERCAL statement 'NEXT'. Contrary to the other INTERCAL-like macros, it can be used in any function regardless of whether it was defined with 'ICK_EC_FUNC_START'; however, it must still be used as a statement by itself, and a call to it looks like 'ick_next(expression);'. The expression is the label to 'NEXT' to, and works under the same rules as the expressions for 'ick_comefrom'; it need not be constant (unlike in C-INTERCAL!), but must not have side effects, must not be negative, must fit into the range of an unsigned long, and is ignored if it is over 65535. If there happen to be multiple labels with the correct value at the time, the compiler will 'NEXT' to one of them. Bear in mind that there is a limit of 80 entries to the 'NEXT' stack, and that this limit is enforced. If the resulting 'NEXT' stack entry is 'RESUME'd to, the program will continue after the 'ick_next' as if via 'setjmp', with all the usual restrictions that that entails; if the resulting 'NEXT' stack entry is forgotten, then the 'ick_next' call will never return. (Note that the 'as if via setjmp' condition allows you to preserve the vales of 'auto' and 'alloca'-allocated storage as long as its value has not changed since the 'ick_next' was called, which is a significantly more lenient condition than that normally imposed on such variables (*note External Calls and auto::).) 14.1.7 ick_resume ----------------- 'ick_resume' is a macro, but there are few restrictions on its use; it is permitted to use it inside an expression (but it returns void, making this not particularly useful), and acts like a function which takes an unsigned short argument, returns void, and has a prototype (but you cannot take its address; if you need to be able to do that, write a wrapper function for it). It can be used within any function regardless of how it was declared, and never returns; instead, it pops the specified number of 'NEXT' stack entries and resumes execution at the last one popped, just as the INTERCAL statement does. This causes the same errors as the INTERCAL statement if the number of entries popped is zero or larger than the 'NEXT' stack. There is also a macro 'ick_return_or_resume();'; it can only be used inside a function defined with 'ICK_EC_FUNC_START', and is equivalent to 'return;' if the function was called from C, or 'ick_resume(1);' if the function was called from INTERCAL. It's therefore a safe way to return from such a C function if you don't know how control reached it in the first place. 14.1.8 ick_forget ----------------- The 'ick_forget' macro removes 'NEXT' stack entries, and the corresponding C stack entries. It must be called as a statement by itself, and its invocation looks like this: 'ick_forget(expr);', where the expression is the number of 'NEXT' stack entries to forget (all of them will be forgotten if the number is higher than the number of entries). The expression will be casted to an 'unsigned short'. 'ick_forget' can only be used inside a function declared with 'ICK_EC_FUNC_START'. As it is removing stack entries both in INTERCAL and in C, it will clobber the value of all 'auto' variables created since the highest remaining 'NEXT' stack entry came into being (or since the start of the program, if the 'NEXT' stack is emptied by the command) and also deallocate all 'alloca' storage allocated since then. It also causes the return address of the current function to become undefined, so that function must not return; control may leave it via 'RESUME', or via 'COME FROM', or via 'NEXT' or 'NEXT FROM' followed by the relevant 'NEXT' stack entry being forgotten (the function is still 'running' but suspended while the 'NEXT' stack entry still exists). (Note that these restrictions are stronger than those on 'RESUME'; this is because 'RESUME' preserves most of the stack, but 'FORGET' destroys parts of the stack and therefore cannot avoid destroying the data stored there. It could be much worse; a previous (never released) version of the code didn't remove those parts of the stack in many circumstances, leading to a stack leak that caused programs to segfault after a while.) 14.1.9 ick_get/setone/twospot ----------------------------- This class of four functions make it possible to get and set INTERCAL scalar variables from C code. Their prototypes are as follows: uint16_t ick_getonespot(unsigned short varnumber); void ick_setonespot(unsigned short varnumber, uint16_t newvalue); uint32_t ick_gettwospot(unsigned short varnumber); void ick_settwospot(unsigned short varnumber, uint32_t newvalue); The program will error out with a fatal error (*note E200::) if the variable you request is mentioned nowhere in the INTERCAL program; if you attempt to set an 'IGNORE'd variable, the attempt will silently fail (just as if you assigned to it in an INTERCAL program). The get functions are safe to use in a computed line label, so you can use them to produce computed line labels that depend on INTERCAL variables. ('uint16_t' and 'uint32_t' are standard C data types; if your system doesn't provide them, get better system header files.) If you care about speed, note that .1 is the fastest variable of all to access, and otherwise variables first mentioned near the top of the INTERCAL program will be faster to access than variables mentioned lower down. 14.1.10 ick_create ------------------ The 'ick_create' function (prototype: 'void ick_create(char*, unsigned long)') allows the external calls system to be used to create new INTERCAL syntax; to do this, you give a 'signature' representing the syntax you want to define and a line number to the function (which are its two arguments, respectively). The signature defines the syntax that you are defining; whenever that syntax is encountered within the INTERCAL program, it will 'NEXT' to the line number you specify, which can do various clever things and then 'RESUME' back to the INTERCAL program (or if you're defining a flow-control operation, you might want to leave the 'NEXT' stack entry there and do other things). However, note that the overloading of ':1601', etc., will still take place as in the INTERCAL version of 'CREATE' if the '-a' option is used (*note -a::), so care is needed when writing flow control statements that they work both with and without the option and don't cause 'STASH' leaks (which means no 'FORGET'ting the relevant 'NEXT' stack entry, and no looking at 1600-range variables). This allows the external calls system to define whole new INTERCAL commands, with the same power as any other programming language. There are various restrictions on what syntax you can 'CREATE' with this method, which are best explained by an explanation of the relevant C-INTERCAL compiler internals. When an INTERCAL program is compiled by C-INTERCAL, any unrecognised statements it comes across are compiled by a 'just-in-case' compiler that attempts to compile them anyway with no knowledge of their syntax, just in case the syntax becomes defined later. (E000 (*note E000::) will be thrown when such statements are encountered at runtime, unless the syntax has been 'CREATE'd since to give a statement a meaning.) For the just-in-case compiler to run, the resulting statement must be completely unrecognised; this means that it may contain no keywords (not even a sequence of letters that forms a keyword, such as 'FROM' or 'DO'), it must consist only of variable names, expressions, and capital letters other than 'V' (because 'V' is a unary operator, so otherwise there would be ambiguity), and in which any two variable names or expressions are separated by at least one capital letter. The compiler will produce a 'signature' for the unknown command that can be defined. A signature consists of a sequence of characters (and is represented as a null-terminated string; the runtime makes a shallow copy of the string and keeps it until the end of the program, so arrangements must be made to ensure that the storage in which the string is allocated stays around that long, but this opens up interesting possibilities in which the signature that was actually 'CREATE'd can be modified retroactively); whitespace is not allowed in a signature. Capital letters can be used (apart from 'V'), and match the same capital letters literally in the INTERCAL syntax being created; also available are the special characters '.,;~', which match respectively a scalar variable (a onespot or twospot variable such as ':1'), an array variable (such as ';2'), an array element (such as ',3 SUB #4 #5'), and an expression that isn't a variable name and isn't an array element (such as '.4$.5'). If you want to be able to match other things (say, to be able to match all expressions), you will need to submit multiple signatures using multiple calls to 'ick_create'; maybe you could write a library to do that automatically. 'CREATE'd operators also have signatures, but of quite a different form. The signature for a single-character operator is a lowercase u, followed by its character code in hexadecimal (no leading zeros, and in lowercase); the signature for an overstrike is a lowercase o, followed by the lower relevant character code in hexadecimal, followed by a lowercase x, followed by the higher relevant character code in hexadecimal. The routine that is 'NEXT'ed to will presumably want to be able to see what in the INTERCAL program was matched by the signature, so a range of function-like macros is provided to access that. They must be run from within the invocation of the function which was 'NEXT'ed into by the created syntax (*note External Calls and auto:: for when a function invocation ends, which could be sooner than you think when the C-INTERCAL external calls system is used), and are undefined behaviour when that invocation did not gain control from a 'CREATE'd statement. Here are their effective prototypes: int ick_c_width(int); int ick_c_isarray(int); unsigned short ick_c_varnumber(int); uint32_t ick_c_value(int); /* These require -a to work */ uint32_t ick_c_getvalue(int); void ick_c_setvalue(int, uint32_t); The first argument to all these macros is the position of the match in the signature (0 for the first non-capital-letter match in the signature, 1 for the second, and so on until no more items are left in the signature to match); specifying a position that isn't in the signature is undefined behaviour. 'ick_c_width' returns the data type, as a width in bits, of the expression (or the width in bits of an element of the passed in array), and 'ick_c_isarray' returns 1 if the argument was an array variable or 0 if it was an expression (array elements and scalar variables are expressions). 'ick_c_varnumber' returns the variable's number (for instance 123 for '.123'), or 0 if the corresponding argument was not a variable; in the cases where the argument was a variable, these three functions together provide enough information to figure out which variable (which is useful if you're writing an extension which takes a variable name as an argument). 'ick_c_value' returns the value of the corresponding expression at the time the 'CREATE'd command was called; 'ick_c_getvalue' is almost equivalent, but only works if the '-a' option (*note -a::) was used during compilation, and returns the value of the corresponding expression now. (The uint32_t return type is large enough to hold either a onespot or twospot value, and will be zero-extended if the corresponding expression had onespot type.) 'ick_c_setvalue' also depends on '-a', and will assign to the corresponding expression (be careful not to provide a value that is too large for it!). In the case that the corresponding expression is not a variable, this will attempt to perform a reverse assignment to the expression, and can produce ordinary INTERCAL errors if it fails. It is not possible to redimension an array this way, as this is assignment, not a calculate operation. 14.1.11 External Calls and auto ------------------------------- Because the external calls system merges the INTERCAL 'NEXT' stack with the C return value and data storage stack (note for pedants: the C standards nowhere mandate the existence of such a stack, or even mention one, but the restrictions stated in them imply that implementations have to act as if such a stack existed, because of the way the scoping rules and recursion work), the external calls system therefore has severe effects on data that happens to be stored there. (In INTERCAL terms, imagine what would happen if data could be stored on the 'NEXT' stack; if C used the more sensible system of having a 'STASH' for each variable, these problems would never occur in the first place, instead causing an entirely different set of problems.) Similar considerations apply to the common nonstandard C extension 'alloca', which dynamically alters the size of the stack; also, in what goes below, 'register' variables should be considered to be 'auto', because the compiler may choose to allocate them on the stack. Theoretical considerations would lead one to conclude that variable-length arrays should obey most of the same restrictions; in practice, though, it's unwise to attempt to mix those with INTERCAL code at all, except by separating them into separate functions which aren't flagged with 'ICK_EC_FUNC_START' and use no 'ick_'-prefixed identifiers, even indirectly. (They may cause a compile to fail completely because they don't mix well with 'goto'.) In the description below, INTERCAL commands should be taken to include the equivalent C macros. 'NEXT'/'NEXT FROM' paired with 'RESUME' have the least effect, and the most obvious effect, on 'auto' variables in the function that was 'NEXT'ed from, which is the same effect that the standard C function 'longjmp' has. That is, 'alloca' storage stays intact, and 'auto' variables have their values 'clobbered' (that is, their value is no longer reliable and should not be used) if they changed since the corresponding 'NEXT' and are not marked as 'volatile'. (This is a very easy restriction to get around, because changing the values of such variables is quite difficult without using statically-allocated pointers to point to them (a dubious practice in any case), and 'volatile' is trivial to add to the declaration.) 'COME FROM' has more restrictions; it deallocates all 'alloca' storage in the function that was 'COME FROM', and functions that called it or that called functions that called it, etc., using C calls (as opposed to 'NEXT'), and those invocations of the functions will cease to exist (thus destroying any 'auto' variables in them), even in the case of 'COMING FROM' a function into the same function. 'auto' variables in the function that is come into will start uninitialised, even if initialisers are given in their declaration, and it will be a 'new' invocation of that function. (It is quite possible that the uninitialised values in the 'auto' variables will happen by chance to have the values they had in some previous invocation of the function, though, because they are likely to be stored in much the same region of memory; but it is highly unwise to rely on this.) Note that 'volatile' will not help here. Observant or source-code-reading readers may note that there is a mention of an 'ick_goto' in the source code to C-INTERCAL; this is undocumented and this manual does not officially claim that such a macro exists (after all, if it did, what in INTERCAL could it possibly correspond to?), but if such a macro does exist it obeys the same restrictions as 'COME FROM'. 'FORGET' is the worst of all in terms of preserving data on the stack; it deallocates 'alloca' data and clobbers or deletes 'auto' variables in all function invocations that have come into existence since the 'NEXT' that created the topmost remaining 'NEXT' stack entry was called, or since the start of the program if the 'NEXT' stack is emptied, and the current function will continue in a new invocation. 'volatile' is useless in preventing this, because the relevant parts of the stack where the data were stored are deleted by the command (that's what 'FORGET' does, remove stack). If any of these data are required, they have to be backed up into static storage (variables declared with 'static' or global variables), or into heap storage (as in with 'malloc'), or other types of storage (such as temporary files) which are not on the stack. (Incidentally, suddenly deleting parts of the stack is excellent at confusing C debuggers; but even 'RESUME' and 'COME FROM' tend to be sufficient to confuse such debuggers. More worrying is probably the fact that the C standard provides a portable method for deleting the stack like that, and in fact the external calls runtime library is written in standard freestanding-legal C89 (with the exception of '+printflow' debug output which requires a hosted implementation), meaning that in theory it would be possible to split it out to create an implementation of a C-plus-COME-FROM-and-NEXT language, and doing so would not be particularly difficult.) Note that INTERCAL variables are not stored on the C stack, nor are any of the metadata surrounding them, and so are not affected unduly by control flow operations. 14.2 External Calls to Funge-98 =============================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.29+ no no C-INTERCAL supports linking INTERCAL programs with Funge-98 programs (to be precise, only Befunge-98 programs are currently supported). However, it does not ship with a Funge-98 interpreter, and such an interpreter needs to be linked to the resulting program in order to run the Befunge program. Therefore, you need to convert a third-party Funge-98 interpreter to a library usable by C-INTERCAL before you can use this part of the external calls system (*note Creating the Funge-98 Library::); however, this only has to be done once. Once the library has been created, you can link an INTERCAL program with a Befunge-98 program by invoking 'ick' like this: ick -e intercalprogram.i befungeprogram.b98 You can link no more than one Befunge-98 program at once (just like you can link no more than one INTERCAL program at once). Also, the INTERCAL program must come first on the command line. It is legal to link INTERCAL, C, and Befunge-98 simultaneously; however, the identifiers used in the third-party Funge-98 interpreter have not been mangled to avoid collisions, and therefore problems may be caused if the C program uses the same identifiers as the Funge-98 interpreter. 14.2.1 Creating the Funge-98 Library ------------------------------------ Before external calls to Funge-98 can be used, the relevant library must be compiled. (After the library has been compiled, then you will need to reinstall C-INTERCAL; however, you will not need to recompile C-INTERCAL.) At present, only the cfunge Funge-98 interpreter () can be converted into a library suitable for use by C-INTERCAL; also, doing this is only supported on POSIX systems (although if someone gets it to work on DOS/Windows, the author of this manual would be interested to hear about it). Also, a source-code distribution (rather than a binary distribution) is needed. One way to obtain the latest cfunge sources is via the bzr version-control system, using the following command (correct as of the time of writing, but as always, links can become dead): bzr branch lp:cfunge (As a licensing note, note that cfunge is licensed under the GNU General Public licence version 3, whereas C-INTERCAL is licensed under version 2 and all later versions of that licence; although these terms are obviously compatible with each other, you must ensure yourself that your program has appropriate licensing terms to allow a GPLv3 library to be linked to it.) Once you have downloaded the cfunge sources, you need to compile them into a library suitable for use with C-INTERCAL (note that this is a somewhat different process to compiling them into a standalone Funge-98 interpreter). There is a script provided in the C-INTERCAL distribution to do this, 'etc/cftoec.sh'. It must be run in the 'etc' subdirectory of the C-INTERCAL distribution (i.e. the directory the script itself is in), and must be given the path to the root directory of the cfunge source distribution (that is, the directory that contains the 'src', 'lib' and 'tools' subdirectories of that distribution) as its only argument. Note that it may give some compiler warnings on compilation; my experience is that warnings about C99 inlining can be safely ignored (they reflect a deficiency in 'gcc' itself that luckily seems to be irrelevant in this case), but other warnings may indicate problems in the exact versions of the sources that you downloaded (and errors definitely indicate such problems). Once the library has been created, it will appear as the new file 'lib/libick_ecto_b98.a' in the C-INTERCAL distribution (the cfunge distribution will be left unchanged); reinstalling C-INTERCAL will install this file to its proper location. (It is also in a valid location to be able to be run if you aren't installing C-INTERCAL but instead just running it from the distribution's directory.) 14.2.2 The IFFI Fingerprint --------------------------- This section will not make much sense to a non-Funge programmer; therefore, if you are not used to Funge, you probably want to skip it. To a Funge program, the external calls interface is accessed via a Funge-98 'fingerprint' defined by the interpreter. The name of the fingerprint is 0x49464649, or as text, 'IFFI'. When a program formed by linking INTERCAL and Befunge-98 is run, the first thing that happens is some internal INTERCAL initialisation which is not visible to either program, and then initialisation routines specified in the Befunge-98 program run (if an initialisation routine is also specified in a linked C program using ick_startup, it is unspecified whether the C or Befunge-98 initialisation happens first.) In the Befunge program, the initialisation routine consists of everything that happens until the 'Y' command in the 'IFFI' fingerprint is run; the author of the Funge-98 must load the 'IFFI' fingerprint themselves during this initialisation to access that command. (This is so that the Befunge program ends up complying with the Funge-98 standard; commands not defined in that standard cannot be used until a fingerprint is loaded.) During initialisation, no commands from the 'IFFI' fingerprint may be used except 'Y' and 'A'. (If a different command is used, 'C', 'M', and 'X' remove the arguments they would use from the stack (if any) but otherwise do nothing, and the other commands in the 'IFFI' fingerprint reflect.) After the 'Y' command is called, the INTERCAL program starts running; in order for the Befunge program to regain control, it has to be 'NEXT'ed to from the INTERCAL program, or 'COME' or 'NEXT FROM' the INTERCAL program, or contain the line label to which syntax in the INTERCAL program was 'CREATE'd. (In other words, the normal INTERCAL ways of transferring information between parts of a program.) In order to do this, therefore, line labels and INTERCAL control flow statements must be placed into the Befunge program. Code like 'COME FROM (100)' is a single statement in INTERCAL, but several statements in Funge-98; therefore, some method of telling the interpreter where to start executing to look for 'COME FROM's, 'NEXT FROM's, and line labels is needed. The method used by C-INTERCAL is that of the 'marker'; a marker is represented by character 0xB7 (a mid-dot in Latin-1) in the input Funge-98 program, but is transformed to a capital 'M' by 'ick'. (The reason for using a special character for a marker and transforming it rather than just using 'M' is to prevent occurences of 'M' in comments and string literals, etc., having an effect on the control flow of the program.) Whenever a 'NEXT' or line label is encountered (in the INTERCAL program, the Funge program or elsewhere), the Funge program is executed starting from each marker in each cardinal direction to look for line labels or 'COME'/'NEXT FROM's respectively. Therefore, 'COME FROM (100)' is written in Funge-98 as 'Maa*C' (where the M is a marker in the source code), and likewise the line label '(100)' would be written as 'Maa*L'. (This code can be written in any cardinal direction, that is left to right, top to bottom, right to left, or bottom to top, but not diagonally or flying.) There are likely to be unused directions from markers, which will be evaluated too; you can (and must) close these off by reflecting code execution back into that marker, another marker, or a non-marker 'M'. Note also that a marker remains in Funge-space even if the 'M' on the same square is deleted (the marker itself is not visible to the 'g' command, though). Here are the commands in the 'IFFI' fingerprint: 'A' This command pops a line number and then an 0"gnirts"-format string from the stack; they are used as the line number and signature to 'CREATE' syntax in the INTERCAL program; for details of the format of the signature, see *note ick_create::. Although using this command during speculative execution works, doing so is not recommended; if the target line number for 'CREATE'd syntax is changed during speculative execution to find the line that that syntax corresponds to, its effect is delayed until after the original line is found and execution continues from that point. (Side effects during speculative execution are never recommended, because they might or might not be optimised away.) 'C' During speculative execution to find 'COME FROM's and 'NEXT FROM's, pops a line label off the top of the stack and does a 'COME FROM' that location. During speculative excution to find line labels, pops the top of the stack and ends that particular speculative execution as a failure. When not doing speculative execution, pops and discards the top element of the stack. 'D' This command must only be used when the Funge program is executing a 'CREATE'd command, and allows access to the arguments that command has. It pops an integer off the top of the stack, and treats it as an argument position (0-based, so 0 refers to the first argument, 1 refers to the second, and so on). Note that providing an invalid argument number, or running this command when not implementing a 'CREATE'd command, leads to undefined behaviour (possibly a reflection, possibly a segfault, possibly worse). The command pushes information about the argument chosen onto the stack; the following information is pushed from bottom to top: * The data type of the argument, in bits (16 if the argument was a onespot variable or expression of onespot type, and 32 if the argument was a twospot variable or expression of twospot type). Note that this is under the C-INTERCAL typing rules, rather than the INTERCAL-72 typing rules (that is, select's type is always that of its right argument no matter how many bits are actually selected). * 1 if the argument is an array variable, 0 if it is a scalar value. * 0 if the argument is not a variable, or the variable's number if it is (e.g. '.123' would push 123 here, but '.1~.2' would push 0). * The argument's value at the time that the 'CREATE'd instruction was called. * The argument's value now, or alternatively a repeat of the previous stack element if '-a' (*note -a::) was not used. (Without '-a', the information needed to re-evaluate the expression is not available.) 'F' During speculative execution, this command reflects; otherwise, this command pops an integer from the top of stack, and 'FORGET's that many 'NEXT' stack entries (or all of them if the argument given is negative). 'G' This command pops an integer from the top of stack. If it is positive, the value of the onespot variable whose name is the popped integer is pushed onto the stack; if it is negative, the value of the twospot variable whose name is minus the popped integer is pushed onto the stack; and if it is zero, the command reflects. If the referenced variable is not in the INTERCAL program at all, this causes an INTERCAL error due to referencing a nonexistent variable. 'L' During speculative execution to find 'COME FROM's and 'NEXT FROM's, this command pops and discards the top stack element, then ends that speculative execution. During speculative execution to find a line label, this command pops an integer from the top of stack and succeeds with that integer as the line label (that is, it is possible to 'NEXT' to an 'L' in the Funge program if a marker, followed by code to push the correct line number onto the stack, precedes that 'L'). When not doing speculative execution, the integer on the top of the stack is used as a line label (assuming it is in the range 1-65535, otherwise it is popped and discarded), and a search is made for 'COME FROM's and 'NEXT FROM's aiming for that line label (including in the INTERCAL program and the Befunge program itself, as well as programs in any other language which may be linked in). Note that just as in INTERCAL, it is possible to 'NEXT' to a line label which has a 'COME FROM' aiming for it, in which case the 'COME FROM' will come from that line label as soon as the 'NEXT' transfers control to it. 'M' Does nothing if not in speculative execution, or ends the current speculative execution with failure. (This is so that code like v >M5C ^ does exactly the same thing as 'COME FROM (5)', even when, for instance, it is entered from the left in the Funge program, rather than gaining control from the line label '(5)'.) 'N' During speculative execution, reflects. Otherwise, pops the top stack element, interprets it as a line label, and 'NEXT's to that line label (this may start speculative execution to look for line labels, but might not if it isn't needed, for instance if the line label in question is in the INTERCAL program or in a C program linked to the Befunge program). 'R' During speculative execution, reflects. Otherwise, pops the top stack element, removes that many items from the 'NEXT' stack, and 'RESUME's at the last item removed. (If the top stack element was zero, negative, or too large, this will cause a fatal error in the INTERCAL program.) 'S' Pops a variable number (interpreted as onespot if positive, or minus the number of a twospot variable if negative) and an integer from the stack, and sets the referenced variable to the integer. This reflects if an attempt is made to set the nonexistent variable 0, causes a fatal error in the INTERCAL program if an attempt is made to set a variable that doesn't exist there, and does not set read-only variables (but pops the stack anyway). If the integer is too high for the variable it is being stored in, only the least significant 16 or 32 bits from it will be used; and likewise, if it is negative, it will be treated as the two's complement of the number given. 'V' Pops a 'CREATE'd argument index and an integer from the top of stack. (This is undefined behaviour if not in the implementation of a 'CREATE'd statement, or if the referenced argument does not exist; as with the 'D' instruction, 0 refers to the first argument, 1 to the second, and so on.) If the '-a' option is not used, this command does nothing; otherwise, the value of the argument will be set to the integer. (This involves doing a reverse assignment if the argument is a non-variable expression, as usual, and causes a fatal error in the INTERCAL program if the reverse assignment is impossible or an attempt is made to assign a scalar to an array.) 'X' This is identical to 'C', except that it does a 'NEXT FROM' rather than a 'COME FROM'. As with external calls to C, terminating any program involved (whether the INTERCAL program with 'GIVE UP', the Befunge program with '@' or 'q', or a C program with 'exit()') causes all programs involved to terminate, and likewise a fatal error will end all programs with an error. One final point which is probably worth mentioning is that flow control instructions only record the IP's position and direction, nothing else; so for instance, if the stack is modified in one part of the code, those modifications will remain even after a 'RESUME', for instance. 14.3 Miscellaneous External Calls ================================= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.29+ no no It is possible to specify other information to the external calls system by using the filename list after all the options are given. To be precise, certain filename patterns are recognised and used to change the options that are used to compile the externally-called files. The '.c99' extension is treated identically to '.c', except that it causes the file with that extension to be preprocessed as C99 (the more modern version of the C standard, the older C89 is more common), and that all C files involved will be compiled and linked as C99. (This corresponds to '-std=c99' in 'gcc'.) Likewise, the '.c11' extension can be used to indicate C11. The '.a' extension indicates that an object-code library should be linked in to the final program. This is most commonly used to link in the maths library 'libm.a' and other such system libraries. If the filename is of the form 'lib*.a', then the file will be searched for in the standard directories for libraries on your system, and also where the C-INTERCAL libraries are stored (which may be the same place); otherwise, the current directory will be searched. (Specifying 'libm.a' on the command line corresponds to passing '-lm' to 'gcc'.) 14.4 Using External Calls ========================= Whatever language your source files are written in, when '-e' is used (*note -e::), the compiler will go through much the same steps. First, the INTERCAL program specified is compiled into a C program that uses the INTERCAL external call conventions for its control flow operations. The resulting '.c' file will be left behind in the same directory (even if '-g' isn't used); if you look at it, you'll see the '#include ' line, and the other hallmarks of an external call program (for instance, INTERCAL 'NEXT's will translate into slightly modified 'ick_next's; the modification is simply to allow the correct line number to be displayed in case of error). After that, the resulting files are preprocessed twice. First, the C preprocessor is run on the files; then, a special C-INTERCAL 'preprocessor' is run on the files. ('Preprocessor' is a bit of a misnomer here, as it's near the end of the compilation process; 'postprocessor' would likely be more accurate, or maybe 'interprocessor'.) Its job is to fix line labels between the gotos that are used to implement jumping into the middle of a C function, to assign unique numbers to things that need them, and to keep track of which functions need to be checked for line labels and for 'COME FROM's and 'NEXT FROM's. The resulting file will have the extension '.cio'; it is almost human-readable, especially if you run it through a C code indenter, and consists of C code (which might be a thin wrapper around some other language) and instructions to 'gcc'. The '.cio' file will be left behind for you to look at, if you like. Once the '.cio' files have been produced, 'gcc' is used to compile all the '.cio' files and link them together into an executable; the executable will have the same name as the INTERCAL source, minus any extension (and on DJGPP, assuming that its version of 'gcc' could handle the resulting command line (not necessarily guaranteed), a '.exe' extension is added), and will consist of all the C files linked together with the INTERCAL. Any functions named 'main' in the C files will be deleted; likewise, if there is a name clash between any two functions, the one in the file named earlier on the command line will be used. There is presumably some use for this feature, although I haven't figured out what it is yet. Extending this to other compiled languages is mostly a problem of determining how they fit into the INTERCAL control structure, which is not a trivial task, and of figuring out how to link them to C code, which in some cases is trivial (especially if the language is one that 'gcc' can compile!) and in other cases is very difficult. If anyone has any ideas of new languages that could be added to the external calls system, feel free to contact the current C-INTERCAL maintainer with suggestions or patches. 14.5 Expansion Libraries ======================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.28+ no no The C-INTERCAL distribution comes with libraries that can be used to extend its capabilities; they are implemented using the external call mechanism, and are in effect standard files to include using that mechanism. To use an expansion library, give the '-e' option to 'ick' (note that this means you cannot use them with the debugger or profiler, nor with multithreaded or backtracking programs), and specify the expansion library's name at the end of the command line (or to be precise, anywhere after the initial INTERCAL file). The libraries themselves are written in C and have a '.c' extension, and are human-readable; C-INTERCAL will look for them in the same places as it looks for the system library (including in the current directory, so you can test your own expansion libraries without having to install them). Expansion libraries use C identifiers which start with the string 'ick_my_' (this is not used by the compiler, and is explicitly not affected by the prohibition on identifiers starting 'ick_' when writing an expansion library), and use line labels in the range (1600) to (1699). (Most programs will be avoiding this range anyway, because it's inside the (1000) to (1999) range reserved for the system library, but the system library doesn't use it, in much the same way that the identifiers used are inside the range reserved for the compiler, but the compiler doesn't use them.) Expansion libraries are available from C-INTERCAL version 0.28; CLC-INTERCAL has a similar concept (that of 'preloads'), but implemented a completely different way. syslibc ------- 'syslibc' is an implementation of the base-2 INTERCAL system library in C (*note System Libraries::); using it in programs running in other bases is accepted by the compiler, but likely to produce unpredictable results. When using this expansion library, you also need to give the '-E' option (*note -E: -E+.) so that the main system library is not included, or it will be used in preference to the expansion library. All documented features of the INTERCAL base-2 system library are implemented, but most undocumented features are not, so INTERCAL programs which relied on them (dubious behaviour in any case) will not work with 'syslibc'. The main reason to use this library is to increase the speed of an INTERCAL program; however, note that the speed gains in arithmetic will be accompanied by the performance penalty of using the external calls infrastructure, unless you were already using it. compunex -------- As an example of using 'ick_create', a very simple expansion library is provided to enable a computed NEXT capability, by defining a new command 'COMPUNEX'. It is used as 'DO .1 COMPUNEX' (allowing any expression in place of the .1), and is similar to an ordinary 'NEXT', but has two limitations: it takes up two 'NEXT' stack entries, and the top one should not be 'RESUMEd' past or forgotten (thus it isn't a particularly useful command, except maybe to produce the equivalent of something like function pointers). By the way, note that C-INTERCAL avoids computed 'NEXT' mainstream for much the same way that CLC-INTERCAL avoids 'NEXT' altogether; it makes things too easy. This example is provided mostly just to demonstrate the syntax, and the care that needs to be taken with implementing flow control operators. 'compunex' is double-deprecated; an alternative is the following sequence of commands involving computed 'CREATE': DO CREATE .1 ABC DO ABC This sequence emulates all features of 'NEXT' (although it has different gerunds and is two statements, not one), making it much more useful for simulating computed 'NEXT' than 'COMPUNEX' is. (There's no need to avoid forgetting the return value; although this skips the 'CREATE' cleanup, none is required because the created statement 'ABC' (any other statement would do just as well) takes no arguments.) 15 Differences to Other Compilers ********************************* The C-INTERCAL compiler exists in a world of several other compilers. Differences to the Princeton compiler ------------------------------------- The Princeton compiler was the first INTERCAL compiler available, and compiled INTERCAL-72. Using 'convickt' (*note convickt::) to translate its programs from the original EBCDIC to Latin-1 or Atari-syntax ASCII is required to run them under the C-INTERCAL compiler, but apart from that there should be no problems; everything that that compiler can do can be reproduced by C-INTERCAL, even including some of its bugs. The only potential problems may be where constructs were nonportable or dubious to begin with (such as the 'IGNORE'/'RETRIEVE' interaction), or where commands intended to be syntax errors were used in the program but have a meaning in C-INTERCAL. For extra portability, it's possible to use the '-t' compiler option to 'ick' (*note -t::) to tell it to interpret the program as INTERCAL-72, but as C-INTERCAL's dialect of INTERCAL is basically backward-compatible anyway this mostly serves to check newer programs for compatibility with older compilers. Differences to the Atari compiler --------------------------------- The Atari compiler was an uncompleted implementation of INTERCAL-72, optimistically pre-described in some 1982 additions to the original INTERCAL-72 manual. Despite the implementation's never actually existing, the documentation of the syntax provided a model for C-INTERCAL. If any Atari 800 INTERCAL source code actually existed, there would be no need to use 'convickt' on it. Differences to J-INTERCAL ------------------------- The J-INTERCAL compiler is an implementation of INTERCAL written in Java that compiles INTERCAL into Java (and so has a similar relationship with Java to that of the C-INTERCAL compiler (which is written in C and compiles into C) with C). J-INTERCAL has much the same feature set as older versions of C-INTERCAL, with a few changes (such as the addition of Esperanto and error messages coming up in different situations). J-INTERCAL programs should run fine on C-INTERCAL without trouble (as it is also an Atari syntax compiler), except in nonportable cases such as 'IGNORE'/'RETRIEVE' interaction. Differences to CLC-INTERCAL --------------------------- The CLC-INTERCAL compiler is the most modern INTERCAL compiler apart from C-INTERCAL (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 C-INTERCAL, and is responsible for the origin of many of the features added in more recent versions of C-INTERCAL. Generally speaking, a CLC-INTERCAL program that uses its advanced features is unlikely to run on C-INTERCAL, or vice versa, whatever you do (apart from completely rewriting the more advanced parts of the program). 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 CLC-INTERCAL to C-INTERCAL) or Atari syntax (if translating from C-INTERCAL to CLC-INTERCAL), maybe using 'convickt', 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; C-INTERCAL uses the options '-xX', and on CLC-INTERCAL this is done by selecting the appropriate preloads, or by changing the program's file extension to '.ci'. In each case other options may be needed to turn on various extensions (maybe '-m' or '-v' if translating to C-INTERCAL, maybe the preload for gerund-based 'COME FROM' if translating to CLC-INTERCAL), and if translating to CLC-INTERCAL you need to append the system library to your program yourself because CLC-INTERCAL doesn't load it automatically. 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 'convickt'. 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 'IGNORE'/'RETRIEVE' interaction is one way to do this, as it differs between C-INTERCAL, J-INTERCAL, and CLC-INTERCAL. The other things to watch out for when doing this are that CLC-INTERCAL needs an explicit option to enable the use of 'NEXT', that CLC-INTERCAL doesn't load the system library itself (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 CLC-INTERCAL. PART IV: APPENDICES AND INDICES ******************************* Appendix A Character Sets ************************* The following table explains the equivalences between the various character sets used for INTERCAL: 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 CLC-INTERCAL versions, which are used by INTERCAL 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 'convickt' command-line tool to translate INTERCAL programs from one format to another (*note convickt::). 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. Atari Baudot EBCDIC Latin-1 ------------------------------------ 09 N/A 09 09 0a * 02 0a 0a 0d * 08 0d 0d 20 * 04 40 20 21 3 0d 4f 21 22 3 11 7f 22 23 4 06 7b 23 24 4 01 4a a2 25 4 1c 6c 25 26 3 1a 50 26 27 3 0b 7d 27 28 3 0f 4d 28 29 3 12 5d 29 2a 4 09 5c 2a 2b 4 03 4e 2b 2c 3 0c 6b 2c 2d 3 03 60 2d 2e 3 1c 4b 2e 2f 3 1d 61 2f 30 3 16 f0 30 31 3 17 f1 31 32 3 13 f2 32 33 3 01 f3 33 34 3 0a f4 34 35 3 10 f5 35 36 3 15 f6 36 37 3 07 f7 37 38 3 06 f8 38 39 3 18 f9 39 3a 3 0e 7a 3a 3b 3 1e 5e 3b 3c 4 0f 4c 3c 3d 4 07 7e 3d 3e 4 12 6e 3e 3f 4 0c 65 a5 40 3 19 6f 3f 41 1 03 c1 41 42 1 19 c2 42 43 1 0e c3 43 44 1 09 c4 44 45 1 01 c5 45 46 1 0d c6 46 47 1 1a c7 47 48 1 14 c8 48 49 1 06 c9 49 4a 1 0b d1 4a 4b 1 0f d2 4b 4c 1 13 d3 4c 4d 1 1c d4 4d 4e 1 0c d5 4e 4f 1 18 d6 4f 50 1 16 d7 50 51 1 17 d8 51 52 1 0a d9 52 53 1 05 e2 53 54 1 10 e3 54 55 1 07 e4 55 56 1 1e e5 56 57 1 12 e6 57 58 1 1d e7 58 59 1 15 e8 59 5a 1 11 e9 5a 5b 4 10 9e 5b 5c 4 05 N/A 5c 5d 4 13 5a 5d 5e 4 0d 6a 7c 5f 4 15 7c 40 60 N/A N/A 60 61 2 03 81 61 62 2 19 82 62 63 2 0e 83 63 64 2 09 84 64 65 2 01 85 65 66 2 0d 86 66 67 2 1a 87 67 68 2 14 88 68 69 2 06 89 69 6a 2 0b 91 6a 6b 2 0f 92 6b 6c 2 13 93 6c 6d 2 1c 94 6d 6e 2 0c 95 6e 6f 2 18 96 6f 70 2 16 97 70 71 2 17 98 71 72 2 0a 99 72 73 2 05 a2 73 74 2 10 a3 74 75 2 07 a4 75 76 2 1e a5 76 77 2 12 a6 77 78 2 1d a7 78 79 2 15 a8 79 7a 2 11 a9 7a 7b 4 0a 9c 7b 7c 4 1e fe N/A 7d 4 11 dc 7d 7e 4 0b a1 7e Appendix B convickt ******************* A variety of character sets have historically been used to represent INTERCAL programs. Atari syntax was designed specifically for use with ASCII-7, and all Atari-syntax-based INTERCAL compilers accept that character set as possible input. (C-INTERCAL 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 CLC-INTERCAL compiler accepts Latin-1, a custom dialect of EBCDIC, Baudot, and a punched-card format as input; C-INTERCAL 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. 'convickt' is an INTERCAL character set conversion program designed with these needs in mind. The syntax for using 'convickt' is convickt INPUTSET OUTPUTSET [PADDING] (that is, the input and output character sets are compulsory, but the parameter specifying what sort of padding to use is optional). The following values for INPUTSET and OUTPUTSET are permissible: 'latin1' Latin-1, or to give it its official name ISO-8859-1, is the character set most commonly used for transmitting CLC-INTERCAL programs, and therefore nowadays the most popular character set for Princeton syntax programs. Because it is identical to ASCII-7 in all codepoints that don't have the high bit set, most of the characters in it can be read by most modern editors and terminals. It is also far more likely to be supported by modern editors than EBCDIC, Baudot, or punched cards, all of which have fallen into relative disuse since 1972. It is also the only input character set that C-INTERCAL supports for Princeton syntax programs. It uses 8 bit characters. 'ebcdic' EBCDIC is an 8-bit character set that was an alternative to ASCII in 1972, and is the character set used by the original Princeton compiler. Unfortunately, there is no single standard version; the version of EBCDIC used by 'convickt' is the one that CLC-INTERCAL uses. It is the default input character set that CLC-INTERCAL uses (although more recent versions of CLC-INTERCAL instead try to guess the input character set based on the input program.) 'baudot' Baudot is a 5-bit character set with shift codes; therefore when storing it in a file on an 8-bit computer, padding is needed to fill in the remaining three bits. The standard Baudot character set does not contain all the characters needed by INTERCAL; therefore, CLC-INTERCAL uses repeated shift codes to add two more sets of characters. 'convickt' uses the CLC-INTERCAL version of Baudot, so as to be able to translate programs designed for that compiler; however, standard Baudot is also accepted in input if it contains no redundant shift codes, and if the input contains no characters not in standard Baudot, the output will be written so that it is both correct standard Baudot and correct CLC-INTERCAL Baudot for those characters. 'atari' This option causes 'convickt' to attempt a limited conversion to or from Atari syntax; this uses ASCII-7 as the character set, but also tries to translate between Atari and Princeton syntax at the character level, which is sometimes but not always effective. For instance, '?' is translated from Atari to Princeton as a yen sign, and from Princeton to Atari as a whirlpool ('@'); this sort of behaviour is often capable of translating expressions automatically, but will fail when characters outside ASCII-7 (Atari) or Latin-1 (Princeton) are used, and will not, for instance, translate a Princeton 'V', backspace, '-' into Atari '?', but instead leave it untouched. ASCII-7 is a 7-bit character set, so on an 8 bit computer, there is one bit of padding that needs to be generated; note, however, that it is usual nowadays to clear the top bit when transmitting ASCII-7, which the 'printable' and 'zero' padding styles will do, but the 'random' style may not do. 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: Option Meaning ----------------------------------------------------------------- printable Keep the output in the range 32-126 where possible zero Zero the high bits in the output random Pad with random bits (avoiding all-zero bytes) 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 INTERCAL (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 INTERCAL source code into Baudot.) Appendix C Optimizer Idiom Language *********************************** One file in the C-INTERCAL distribution ('src/idiotism.oil') is written in Optimizer Idiom Language, a programming language designed especially for expressing optimizer idioms for INTERCAL 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 INTERCAL compiler). C.1 OIL Basics ============== The structure of an OIL file consists of a sequence of idioms. An optimizer idiom looks for a certain pattern in an expression (which could be an INTERCAL expression, or an expression that has already been partly optimized and therefore contains some non-INTERCAL operators), and replaces it with a replacement that's 'simpler' in some sense (in the case of C-INTERCAL, 'simpler' is interpreted to mean 'compiles into a faster or smaller executable when run through a C compiler'). When an OIL program acts on an input INTERCAL 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. At present, the only place that OIL is used in the C-INTERCAL compiler is when the '-O' option (*note -O: -O+.) is used in base 2. (Syntax is planned to extend OIL 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 'src/idiotism.oil' during the compilation of the C-INTERCAL from sources; you can change the idioms, but you will then have to recompile the distribution (and if you are using the 'config.sh' method, also reinstall, but that will be pretty fast.) C.2 OIL Syntax ============== An OIL file is encoded as an ASCII 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. Comments can be given anywhere in the file by writing lines starting with semicolons (known as hybrids to INTERCAL 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 '/*' and '*/' (in such cases, the comments will be copied verbatim to the C temporary files used when building the C-INTERCAL 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 '.:#_}', 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. 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: [nullshift] (_1 >> #0)->(_1) (_1 << #0)->(_1) 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. As the example above shows, the syntax of an idiom itself is (pattern)->(replacement) 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 OIL expressions, although they both have their own special syntax elements as well. C.3 OIL Expressions =================== An OIL expression is built around subexpressions connected by infix binary operators and/or preceded by prefix unary operators, the same way as in C or INTERCAL (although unary operators must be entirely before their argument; the one character later position is not allowed.) As in INTERCAL, 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). The following unary and binary operators are allowed in OIL expressions: '$' INTERCAL mingle '~' INTERCAL select '&16' INTERCAL unary AND (16-bit) 'V16' INTERCAL unary OR (16-bit) '?16' INTERCAL unary XOR (16-bit) '^16' INTERCAL unary sharkfin (16-bit) '@16' INTERCAL unary whirlpool (16-bit) '@216..@516' INTERCAL unary generalised whirlpool (16-bit) '&32' INTERCAL unary AND (32-bit) 'V32' INTERCAL unary OR (32-bit) '?32' INTERCAL unary XOR (32-bit) '^32' INTERCAL unary sharkfin (32-bit) '@32' INTERCAL unary whirlpool (32-bit) '@232..@532' INTERCAL unary generalised whirlpool (32-bit) '&' C binary bitwise AND '|' C binary bitwise OR '^' C binary bitwise XOR '+' C addition '-' C subtraction '*' C multiplication '/' C integer division '%' C modulus '>' C greater than '<' C less than '~' C unary bitwise complement '!=' C not equals operator '==' C equals operator '&&' C logical AND '||' C logical OR '>>' C bitwise rightshift '<<' C bitwise leftshift '!' C unary logical NOT (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 INTERCAL unary logic operators, OIL unary logic operators must have a bitwidth stated.) 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. C.4 OIL Patterns ================ Patterns are simply OIL expressions; the expressions match either original INTERCAL 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. One special simple form of match is possible: '#NUMBER', where NUMBER is in decimal, matches a constant with that value. (Unlike in INTERCAL, 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 OIL.) Otherwise, an operand consists of the following parts, written in order: 1. A character to specify the data type of what's being matched. Usually, this will be '_' to specify that any data type can be matched. In a few cases, you may want to use '.' or ':' to specify that you only want to match a onespot or twospot value respectively (that is, 16- or 32-bit). You can also use '#'; this specifies a value that can be any width, but must be known to be a constant with a known value at optimize time (either because it was hardcoded as a constant originally or because a constant was produced there by the optimizer, for instance via a constant folding optimization). 2. Optionally, an expression in braces ('{' and '}'). This expression is written in C, not OIL (as are all expressions in braces), and puts an extra condition on whether the pattern matches. The exact meaning of this will be explained later. 3. A reference number, which must be one decimal digit long. A reference number of 0 causes the operand to be discarded immediately after matching; normally, you will want to specify a positive reference number. Two operands with the same reference number must be exactly the same for the pattern to match (for instance, both references to the same variable, or identical subexpressions). The reference number also allows the operand to be referenced by C expressions on other operands and by replacements. Reference numbers must be unique within the idiom (unless two or more reference numbers are deliberately the same so that the operands they reference have to be identical to produce a match), and they are scoped only as far as the containing idiom; they don't carry from one idiom to another. Note that syntax like '#2' 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 '#{1}2', using a no-op braced expression to tell them apart. This particular no-op is recommended because it's detected and optimized by the 'OIL' compiler. 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: 'c' 'cNUMBER' This accesses a calculation made automatically by the compiled OIL program to identify which bits of the operand can possibly be set, and which ones cannot be. 'c' by itself refers to the operand to which the braced expression is attached; if a number is given, it refers to another node (the number is interpreted as a reference number). The actual value of 'c' is a 32-bit unsigned integer, each bit of which is true, or 1, if there is any chance that the corresponding bit of the operand might be 1, and false, or 0, if it's known for certain that the corresponding bit of the operand is 0. For instance: _{!(c&4294901760LU)}1 The constant given here is FFFF0000 when expressed in hexadecimal; the point is that the expression matches any operand that is known to have a value no greater than 65535. Unless the operand is the argument to a unary AND, this check generally makes more sense than explicitly specifying '.' rather than '_', because it will identify both 16- and 32-bit values as long as they're small enough to fit into a onespot variable. This code could, for instance, be used to check that an argument to a mingle must be small enough before optimising it (this is important because an optimisation shouldn't optimise an error - in this case, an overflowing mingle - into a non-error). 'x' 'xNUMBER' 'x' is like 'c', and refers to operands in the same way, except that it can only refer to an operand marked with '#'. It holds the value of that constant (a 32-bit unsigned integer), which will be known to the optimizer at optimize time. One common use of this is to detect whether a constant happens to be a power of 2, although there are many other possibilities that may be useful. 'r' When inside a loop, 'r' is the value of the loop counter. (It's almost certainly a mistake if you have a loop but don't reference the loop counter at least once, and usually at least twice, within the loop.) *Note OIL Loops::. 'and16' 'and32' 'or16' 'or32' 'xor16' 'xor32' 'iselect' 'mingle' These are all functions with one argument (apart from iselect and mingle, which each take two arguments); they exist so that INTERCAL operators can be used by C expressions. They all take unsigned longs as input and output, even if they are onespot operators. Note that it's entirely possible for these to cause a compile-time error if used on invalid arguments (such as mingling with an operand over 65535), or to silently truncate an invalid argument down to the right number of bits; both of these should be avoided if possible, so the optimiser should check first to make sure that it doesn't use any of these functions on invalid arguments. 'xselx' This function returns its argument selected with itself; so 'xselx(c)' is shorthand for 'iselect(c,c)'. When the argument is very complicated, this can save a lot of space in the original OIL program. 'setbitcount' This function simply returns the number of bits with value 1 in its argument. This is sometimes useful with respect to various select-related optimisations, and can be a useful alternative to having to take logarithms in various situations. 'smudgeright' 'smudgeleft' The 'smudgeright' function returns its argument but with all the bits less significant than the most significant bit with value 1 set to 1; likewise, 'smudgeleft' returns its argument with all the bits more significant than the least significant bit with value 1 set to 1. Note that all OIL calculation 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 'LU' 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 OIL compiler itself will not complain. Here's a more complicated example of an optimizer operand: #{!(x&2863311530LU)&&iselect(x,1431655765LU)== xselx(iselect(x,1431655765LU))}3 It helps to understand this if you know that 2863311530 in hexadecimal is AAAAAAAA and 1431655765 in hexadecimal is 55555555. (It's worth putting a comment with some frequently-used decimal constants in an OIL 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. C.5 OIL Replacements ==================== 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. INTERCAL 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 INTERCAL's rules, this information needs to be inserted somehow in a replacement. In C-INTERCAL, it usually doesn't matter what the bitwidth is, and in cases where it doesn't matter the normal operators ('$', '~', and so on) can be used. (The bitwidth of the entire replacement may be different from the bitwidth of the original, thus leading to, say, a 32-bit unary logical operation applied to a "16-bit" argument; but this is not a problem, as it just means that there's an implied typecast in there somewhere.) In cases where it does matter (due to C-INTERCAL's lenient interpretation of bitwidth on mingle inputs, the only place it matters is in the input to INTERCAL unary logical operators), both the bitwidth 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, '!=32' 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 '&32' already have a bitwidth specified, so specifying '&3232' (or worse, '&3216') is not allowed. Replacement operands are simpler than pattern operands, because there are only a few forms they can take. '_NUMBER' '.NUMBER' ':NUMBER' This tells the optimiser to copy the operand or expression with reference number NUMBER to this point in the replacement used for the expression matched by the pattern. The three forms are identical; the last two are provided for aesthetic reasons (it can look better and be clearer to match '.1' in the pattern with '.1' in the replacement, for instance). You cannot use '#NUMBER' here to copy in a constant from the left-hand side, though, nor '#{1}NUMBER', because the first means something else and the second is undefined behaviour (that is, no behaviour for the second case has been specifically implemented in the compiler and therefore its behaviour is unpredictable and subject to change in future versions); use '_NUMBER' to copy over a constant with an unknown at optimizer compile time (but known at optimize time) value from the left hand side, as you can do with any other operand being copied. '#NUMBER' Insert a constant with the literal value NUMBER here. '#{EXPRESSION}0' Calculate the value of EXPRESSION (a C expression, which can reference the same variables and functions as a C expression in a pattern can; see *note C functions in OIL::) and insert a constant with the calculated value here. (That is, a value is calculated at optimise-time and the resulting value is therefore constant at runtime.) 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, whilst the shifts can all be combined into one large shift.) ((_1 << #{1}2) & #{1}3)->((_1 & #{x3>>x2}0) << _2) C.6 OIL Loops ============= 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: (_1~#{xselx(x)<<1==x&&x}2)->((_1&_2)>>#1) (_1~#{xselx(x)<<2==x&&x}2)->((_1&_2)>>#2) Adding a loop to automatically generate the idioms, and placing a name for the group of idioms at the start, produces the following code: [rshift] <#1-#31 (_1~#{xselx(x)<((_1&_2)>>#{r}0) > That's 31 different idioms, generated with a loop. As the above example shows, a loop starts with '<#NUMBER-#NUMBER' and ends with '>'; a different idiom is generated for each possible value of the loop counter 'r' 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 '#{r}0' to generate a constant whose value is equal to the value of the loop counter. C.7 OIL Tips ============ Here are some tips for the best use of OIL: * The OIL compiler has a few deficiencies, such as error messages that don't give you much of an idea of what you did wrong (to compensate for this, it does give a reasonably accurate line and character number where the error happened), limits on things like how deep expressions can be nested and how many idioms are allowed (if you hit the first, you should really break it up into smaller idioms if possible, and if you hit the second, increase 'MAXTOFREE' in oil.y; this isn't a limit on the number of idioms but on the number of strings that are allocated internally to process the idioms), and lack of error checking (invalid OIL may produce errors in the OIL compiler, or cause the output C code to contain errors or warnings, or may even appear to work). * When you have symmetrical operators in an idiom (like C binary logical operators), you need to write the idiom both ways round (in the same group of idioms, preferably), or write another idiom to standardise the format first; the first method can get very tedious when there are many symmetrical operators in an idiom, and the second is prone to optimizer loops and subtle errors (both methods have been used in the provided 'idiotism.oil' file). * Idioms should preferably be as general as possible, broken down into many separate idioms rather than all as one big idiom, and match the smallest part of the expression being optimized that is necessary for the idiom to be correct in all circumstances; all of these help to improve the performance of the optimizer in terms of what it can optimize. * If a program's optimizing incorrectly, or you just want to see how the optimizer deals with a particular program, it's possible to debug the optimizer by giving the '-h', '-H', or '-hH' (*note -h::) switch to the C-INTERCAL compiler, which will cause debug information to be output on stderr. '-h' will show the initial and final expressions for each expression that was given as input to the optimizer, as well as a list of all optimizations used, in a language that's a sort of mix of C, INTERCAL, and OIL; '-H' will do the same, and also show the intermediate stages in the optimization. '-hH' is like '-H', 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 INTERCAL. '-H' can be a useful learning resource for people who want to understand how a particular INTERCAL expression works. * Make sure that the optimizer doesn't change a statement from a run-time error into something that silently succeeds! Checking which bits can and can't be 1 is one good way to avoid this, especially with mingles. Likewise, don't optimise a run-time error into a compile-time error (although creating a compile-time warning in this situation is fine). * You can help! If you find an idiom that the optimizer isn't optimizing correctly, feel free to add it, or multiple idioms that come to the same thing, to 'idiotism.oil'. In such a case, it would help other users if you would submit your new optimizer idiom to the project (*note Reporting Bugs::); this will help other users and future releases of INTERCAL, and also has a chance of allowing other users to check your new idioms to see if they cause problems or could be written better. C.8 OIL Example =============== To finish off this appendix, here's an example of the power of OIL; this is the optimization of an idiom from the INTERCAL-72 system library, as shown with '-H'; this should give a good idea of how OIL programs work. (All the relevant idioms are in 'idiotism.oil' 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 INTERCAL, 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 'c' (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. .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) Appendix D Copying ****************** The majority of the files in the C-INTERCAL distribution are licensed under the GNU General Public License (version 2 or later), but with some exceptions. The files 'ick-wrap.c' and 'pickwrap.c' 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 INTERCAL source. (Note that the libraries 'libick.a' and 'libickmt.a' are GPL, though, so you cannot redistribute an executable produced by 'ick' or by linking a C file to either of those libraries unless the original INTERCAL source was GPL.) For similar reasons, the expansion libraries 'syslibc.c' and 'compunex.c' are explicitly public domain. 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 ('fdl-1-2.txi' and 'COPYING.txt') are licensed under a license that allows verbatim redistribution but not creation of derivative works. All other files, though (including the 'man' pages, which are not part of _this_ manual), are licensed under the GPL. For the full text of the GPL, see the file 'COPYING.txt' in the distribution. D.1 GNU Free Documentation License ================================== Version 1.2, November 2002 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. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure 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 way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections 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 that the Document is released under this License. A Front-Cover Text may be 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 the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output 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 material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the 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 whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific 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 a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a 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 ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list 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 contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by 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 explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant 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 all sections Entitled "Endorsements." 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See . Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. ADDENDUM: How to use this License for your documents ==================================================== 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: Copyright (C) YEAR YOUR NAME. 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''. If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. 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. Index ***** This is the index of everything in this manual. (Note that in some versions of the manual this is called 'Main Index' to prevent it transforming into a page called 'index.html' in the HTML version of the manual. The complications that that caused were really odd.) * Menu: * ": Grouping Rules. (line 2099) * #: Constants and Variables. (line 2058) * $: Mingle. (line 2207) * %: Execution Chance. (line 1980) * &: Unary Binary Logic. (line 2320) * ': Grouping Rules. (line 2099) * +help: Options to Generated Programs. (line 954) * +instapipe: Options to Generated Programs. (line 978) * +mystery: Options to Generated Programs. (line 1005) * +printflow: Options to Generated Programs. (line 987) * +printflow, enabling: Debug Options. (line 820) * +traditional: Options to Generated Programs. (line 973) * +wimpmode: Options to Generated Programs. (line 962) * ,: Constants and Variables. (line 2058) * -@: Other Options. (line 938) * -a: Language-affecting Options. (line 694) * -b: Language-affecting Options. (line 641) * -C: Language-affecting Options. (line 716) * -c: Output Options. (line 876) * -d: Debug Options. (line 768) * -e: Language-affecting Options. (line 667) * -E: Language-affecting Options. (line 679) * -f: Optimizer Options. (line 906) * -F: Optimizer Options. (line 913) * -g: Debug Options. (line 775) * -h: Debug Options. (line 785) * -H: Debug Options. (line 785) * -help: Options to Generated Programs. (line 954) * -hH: Debug Options. (line 785) * -instapipe: Options to Generated Programs. (line 978) * -l: Debug Options. (line 796) * -m: Language-affecting Options. (line 655) * -mystery: Options to Generated Programs. (line 1005) * -o: Output Options. (line 891) * -O: Optimizer Options. (line 923) * -P: Language-affecting Options. (line 721) * -p: Debug Options. (line 804) * -printflow: Options to Generated Programs. (line 987) * -t: Language-affecting Options. (line 689) * -traditional: Options to Generated Programs. (line 973) * -u: Debug Options. (line 828) * -U: Debug Options. (line 851) * -v: Language-affecting Options. (line 703) * -w: Debug Options. (line 820) * -wimpmode: Options to Generated Programs. (line 962) * -X: Language-affecting Options. (line 734) * -x: Language-affecting Options. (line 746) * -y: Debug Options. (line 838) * -Y: Debug Options. (line 844) * .: Constants and Variables. (line 2058) * .b98: External Calls to Funge-98. (line 4410) * .b98, no external library: Errors. (line 1497) * /: Operand Overloading. (line 3586) * 16 bit overflow: Errors. (line 1237) * 32 bit overflow: Errors. (line 1327) * :: Constants and Variables. (line 2058) * ;: Constants and Variables. (line 2058) * ?: Unary Binary Logic. (line 2320) * @: TriINTERCAL. (line 3232) * ^: TriINTERCAL. (line 3232) * About this manual: About this manual. (line 120) * ABSTAIN: ABSTAIN and REINSTATE. (line 2687) * abstain, at program start: Statement Identifiers. (line 1929) * abstain, during execution: ABSTAIN and REINSTATE. (line 2687) * 'ABSTAIN', nonexistent target: Errors. (line 1151) * ABSTAIN, self-abstaining: ONCE and AGAIN. (line 2003) * abstained state: Statement Identifiers. (line 1929) * ABSTAINING: ABSTAIN and REINSTATE. (line 2687) * add-without-carry: TriINTERCAL. (line 3232) * AGAIN: ONCE and AGAIN. (line 2003) * alloca: External Calls and auto. (line 4323) * ampersand: Unary Binary Logic. (line 2320) * and: Unary Binary Logic. (line 2320) * and16: OIL Patterns. (line 5445) * and32: OIL Patterns. (line 5445) * Arabic numberals, enabling: Options to Generated Programs. (line 962) * array, invalid dimension: Errors. (line 1202) * array, out of bounds: Errors. (line 1209) * array, wrong dimension: Errors. (line 1209) * arrays, dimensioning: Calculate. (line 2496) * arrays, subscripting: Array Subscript. (line 2395) * assigning to constants: Language-affecting Options. (line 703) * assignment: Calculate. (line 2496) * Atari compiler: Differences to Other Compilers. (line 4876) * Atari syntax: Princeton and Atari Syntax. (line 1860) * Atari, character set: Character Sets. (line 4950) * auto: External Calls and auto. (line 4323) * backtracking: Backtracking. (line 3499) * Backtracking INTERCAL: Multithreading and Backtracking. (line 3312) * backtracking, debugging: Options to Generated Programs. (line 987) * backtracking, enabling: Language-affecting Options. (line 655) * backtracking, not enabled: Errors. (line 1302) * backtracking, out of memory: Errors. (line 1511) * Baudot: CLC-INTERCAL I/O. (line 2892) * Baudot <1>: Character Sets. (line 4950) * Befunge: External Calls to Funge-98. (line 4410) * Befunge, fingerprint: The IFFI Fingerprint. (line 4490) * Befunge, installing: Creating the Funge-98 Library. (line 4440) * Befunge, marker: The IFFI Fingerprint. (line 4524) * Befunge, no external library: Errors. (line 1497) * black lagoon: Errors. (line 1112) * blocks, labeled: ick_labeledblock. (line 4048) * book: Unary Binary Logic. (line 2320) * breakpoints, too many: Errors. (line 1482) * buffer overflow: Errors. (line 1339) * bugs, reporting: Reporting Bugs. (line 507) * BUT: TriINTERCAL. (line 3232) * c: OIL Patterns. (line 5392) * C: External Calls to C. (line 3905) * C code, debugging: Debug Options. (line 775) * C code, leaving in place: Debug Options. (line 775) * C, auto/alloca: External Calls and auto. (line 4323) * C, CREATE: ick_create. (line 4208) * C, external call infrastructure: External C Call Infrastructure. (line 3932) * C, stopping after C is generated: Output Options. (line 876) * C, system library: Expansion Libraries. (line 4807) * C, within OIL: OIL Patterns. (line 5390) * C-INTERCAL, distributing: Distributing. (line 568) * C-INTERCAL, I/O: C-INTERCAL I/O. (line 2850) * C-INTERCAL, obtaining a copy: Obtaining. (line 170) * C-INTERCAL, unpacking: Unpacking. (line 196) * C-INTERCAL, unzipping: Unpacking. (line 196) * c1--c9: OIL Patterns. (line 5392) * C11: Miscellaneous External Calls. (line 4694) * C99: Miscellaneous External Calls. (line 4694) * calculate: Calculate. (line 2496) * CALCULATING: Calculate. (line 2496) * calls, external: External Calls. (line 3873) * character sets: Princeton and Atari Syntax. (line 1828) * character sets <1>: Character Sets. (line 4950) * character sets, converting: convickt. (line 5072) * choicepoints: Backtracking. (line 3499) * choicepoints, activating: Backtracking. (line 3537) * choicepoints, creating: Backtracking. (line 3519) * choicepoints, discarding: Backtracking. (line 3573) * CLC-INTERCAL: Differences to Other Compilers. (line 4899) * CLC-INTERCAL compatibility mode: Language-affecting Options. (line 746) * CLC-INTERCAL I/O: CLC-INTERCAL I/O. (line 2892) * clockface mode: Language-affecting Options. (line 716) * code generation, stopping at C code: Output Options. (line 876) * COME FROM: COME FROM and NEXT FROM. (line 2978) * 'COME FROM', ambiguity: Errors. (line 1349) * COME FROM, in C: ick_comefrom and ick_nextfrom. (line 4071) * COME FROM, in Funge: The IFFI Fingerprint. (line 4563) * 'COME FROM', multithreading: Multithreading using COME FROM. (line 3340) * 'COME FROM', no target: Errors. (line 1318) * command line options: Invoking ick. (line 613) * command line, showing intermediates: Debug Options. (line 844) * COMMENT: Syntax Error. (line 2447) * comment: Syntax Error. (line 2447) * COMMENTING: Syntax Error. (line 2447) * COMMENTS: Syntax Error. (line 2447) * comments, OIL: OIL Syntax. (line 5226) * compatibility, CLC-INTERCAL: Language-affecting Options. (line 746) * compatibility, INTERCAL-72: Language-affecting Options. (line 689) * compiling, 'ick' itself: Simple Installation. (line 284) * compiling, INTERCAL source code: Invoking ick. (line 613) * compunex: Expansion Libraries. (line 4824) * computed NEXT: Expansion Libraries. (line 4824) * config.sh: Simple Installation. (line 284) * configuring: Simple Installation. (line 284) * connected threads: Multithreading using WHILE. (line 3411) * constant: Constants and Variables. (line 2058) * constant, twospot: Errors. (line 1082) * constants, assigning to: Language-affecting Options. (line 703) * controlled unary operator: TriINTERCAL. (line 3232) * converting between character sets: convickt. (line 5072) * convickt: convickt. (line 5072) * copying conditions: Copying. (line 5767) * copyright: Copying. (line 5767) * CREATE: CREATE. (line 3756) * CREATE, enabling: Language-affecting Options. (line 694) * CREATE, in C: ick_create. (line 4208) * CREATE, in Funge: The IFFI Fingerprint. (line 4551) * CREATE, operators: CREATE. (line 3832) * CREATE, signatures: ick_create. (line 4245) * creating syntax: CREATE. (line 3756) * Debian: Simple Installation. (line 370) * debug options: Debug Options. (line 762) * debugging, C code: Debug Options. (line 775) * debugging, flow: Options to Generated Programs. (line 987) * debugging, internal errors: Debug Options. (line 851) * debugging, lexical analyser: Debug Options. (line 768) * debugging, multithreaded programs: Options to Generated Programs. (line 987) * debugging, OIL: Debug Options. (line 785) * debugging, optimizer: Debug Options. (line 785) * debugging, parser: Debug Options. (line 768) * debugging, runtime: The yuk debugger. (line 1684) * debugging, yuk: The yuk debugger. (line 1684) * dialect options: Language-affecting Options. (line 630) * dialects of syntax: Princeton and Atari Syntax. (line 1828) * dimensioning arrays: Calculate. (line 2496) * directory problems: Debug Options. (line 828) * directory problems, source file: Errors. (line 1448) * distributing C-INTERCAL: Distributing. (line 568) * DJGPP: Installation on DOS. (line 389) * DO: Statement Identifiers. (line 1929) * dormant thread: Backtracking. (line 3499) * DOS: Installation on DOS. (line 389) * double-oh-seven: Execution Chance. (line 1980) * dumping core on error: Debug Options. (line 851) * duplicate line label: Errors. (line 1158) * E000: Errors. (line 1073) * E017: Errors. (line 1082) * E079: Errors. (line 1088) * E099: Errors. (line 1096) * E111: Errors. (line 1103) * E123: Errors. (line 1112) * E127: Errors. (line 1125) * E127, debugging: Debug Options. (line 828) * E129: Errors. (line 1137) * E139: Errors. (line 1151) * E182: Errors. (line 1158) * E197: Errors. (line 1171) * E200: Errors. (line 1178) * E222: Errors. (line 1189) * E240: Errors. (line 1202) * E241: Errors. (line 1209) * E252: Errors. (line 1219) * E256: Errors. (line 1226) * E256, avoiding: Language-affecting Options. (line 721) * E275: Errors. (line 1237) * E277: Errors. (line 1248) * E281: Errors. (line 1265) * E333: Errors. (line 1276) * E345: Errors. (line 1284) * E404: Errors. (line 1293) * E405: Errors. (line 1302) * E436: Errors. (line 1312) * E444: Errors. (line 1318) * E533: Errors. (line 1327) * E553: Errors. (line 1339) * E555: Errors. (line 1349) * E562: Errors. (line 1361) * E579: Errors. (line 1371) * E621: Errors. (line 1380) * E632: Errors. (line 1389) * E633: Errors. (line 1397) * E652: Errors. (line 1411) * E652, avoiding: Language-affecting Options. (line 721) * E666: Errors. (line 1421) * E774: Errors. (line 1435) * E774, disabling: Language-affecting Options. (line 641) * E777: Errors. (line 1448) * E778: Errors. (line 1455) * E778, debugging: Debug Options. (line 851) * E810: Errors. (line 1475) * E811: Errors. (line 1482) * E888: Errors. (line 1489) * E899: Errors. (line 1496) * E990: Errors. (line 1505) * E991: Errors. (line 1511) * E993: Errors. (line 1521) * E994: Errors. (line 1529) * E995: Errors. (line 1537) * E997: Errors. (line 1545) * E998: Errors. (line 1555) * E999: Errors. (line 1564) * E999, debugging: Debug Options. (line 828) * ears: Grouping Rules. (line 2099) * ears, nesting limit: Errors. (line 1265) * EBCDIC: Character Sets. (line 4950) * embedded systems: PIC-INTERCAL. (line 3665) * end of file: Errors. (line 1361) * environment variables: Environment Variables. (line 1013) * EOF: Errors. (line 1361) * errors: Errors. (line 1069) * errors and warnings: Errors and Warnings. (line 1042) * examples, OIL: OIL Example. (line 5675) * exclusive or: Unary Binary Logic. (line 2320) * execution chance: Execution Chance. (line 1980) * exiting: GIVE UP. (line 2942) * exor: Unary Binary Logic. (line 2320) * expansion libraries: Expansion Libraries. (line 4773) * expressions: Expressions. (line 2047) * expressions, OIL: OIL Expressions. (line 5275) * external calls: External Calls. (line 3873) * external calls, and auto: External Calls and auto. (line 4323) * external calls, Befunge: External Calls to Funge-98. (line 4410) * external calls, C infrastructure: External C Call Infrastructure. (line 3932) * external calls, C11: Miscellaneous External Calls. (line 4694) * external calls, C99: Miscellaneous External Calls. (line 4694) * external calls, debugging: Debug Options. (line 844) * external calls, enabling: Language-affecting Options. (line 667) * external calls, from Funge's view: The IFFI Fingerprint. (line 4490) * external calls, Funge: External Calls to Funge-98. (line 4410) * external calls, libraries: Miscellaneous External Calls. (line 4694) * external calls, miscellaneous: Miscellaneous External Calls. (line 4694) * external calls, to C: External Calls to C. (line 3905) * external calls, using: Using External Calls. (line 4722) * external libraries, unavailable: Errors. (line 1497) * extreme optimization: Optimizer Options. (line 913) * FDL: GNU Free Documentation License. (line 5790) * file type, unsupported: Errors. (line 1555) * fingerprint: The IFFI Fingerprint. (line 4490) * floatlib: floatlib. (line 3156) * flow control, INTERCAL-72: NEXT FORGET and RESUME. (line 2540) * flow optimization: Optimizer Options. (line 906) * flow, printing: Options to Generated Programs. (line 987) * flushing: Options to Generated Programs. (line 978) * foreign functions: External Calls. (line 3873) * FORGET: NEXT FORGET and RESUME. (line 2540) * FORGET, in C: ick_forget. (line 4155) * FORGET, in Funge: The IFFI Fingerprint. (line 4600) * FORGETTING: NEXT FORGET and RESUME. (line 2540) * Free Documentation License: GNU Free Documentation License. (line 5790) * functions, OIL in C: OIL Patterns. (line 5390) * Funge: External Calls to Funge-98. (line 4410) * Funge, fingerprint: The IFFI Fingerprint. (line 4490) * Funge, installing: Creating the Funge-98 Library. (line 4440) * Funge, marker: The IFFI Fingerprint. (line 4524) * Funge, no external library: Errors. (line 1497) * generated programs, options: Options to Generated Programs. (line 947) * GFDL: GNU Free Documentation License. (line 5790) * GIVE UP: GIVE UP. (line 2942) * GNU Free Documentation License: GNU Free Documentation License. (line 5790) * GO AHEAD: Backtracking. (line 3573) * 'GO AHEAD', no choicepoint: Errors. (line 1293) * 'GO AHEAD', not enabled: Errors. (line 1302) * GO BACK: Backtracking. (line 3537) * 'GO BACK', no choicepoint: Errors. (line 1293) * 'GO BACK', not enabled: Errors. (line 1302) * goto, time-reversed: COME FROM and NEXT FROM. (line 2978) * grouping rules: Grouping Rules. (line 2099) * help with options: Other Options. (line 938) * hybrid: Constants and Variables. (line 2058) * I/O: READ OUT and WRITE IN. (line 2776) * I/O, Baudot: CLC-INTERCAL I/O. (line 2892) * I/O, C-INTERCAL: C-INTERCAL I/O. (line 2850) * I/O, CLC-INTERCAL: CLC-INTERCAL I/O. (line 2892) * I/O, INTERCAL-72: INTERCAL-72 I/O. (line 2793) * I/O, out of memory: Errors. (line 1219) * I/O, PIC-INTERCAL: PIC-INTERCAL. (line 3714) * 'ick', command line options: Invoking ick. (line 613) * 'ick', errors: Errors. (line 1069) * 'ick', errors and warnings: Errors and Warnings. (line 1042) * 'ick', installing: Installation. (line 158) * 'ick', invoking: Invoking ick. (line 613) * 'ick', options: Invoking ick. (line 613) * 'ick', uninstalling: Uninstalling. (line 472) * 'ick', warnings: Warnings. (line 1576) * ick-0-29.pax.*: Unpacking. (line 196) * ick_comefrom: ick_comefrom and ick_nextfrom. (line 4071) * ick_comefromif: ick_comefrom and ick_nextfrom. (line 4093) * ick_ec.h: External C Call Infrastructure. (line 3937) * ICK_EC_FUNC_END: External C Call Infrastructure. (line 3951) * ICK_EC_FUNC_START: External C Call Infrastructure. (line 3951) * ick_forget: ick_forget. (line 4155) * ick_getonespot: ick_get/setone/twospot. (line 4183) * ick_gettwospot: ick_get/setone/twospot. (line 4183) * ick_labeledblock: ick_labeledblock. (line 4048) * ick_linelabel: ick_linelabel. (line 4015) * ick_next: ick_next. (line 4107) * ick_nextfrom: ick_comefrom and ick_nextfrom. (line 4071) * ick_nextfromif: ick_comefrom and ick_nextfrom. (line 4093) * ick_resume: ick_resume. (line 4133) * ick_return_or_resume: ick_resume. (line 4145) * ick_setonespot: ick_get/setone/twospot. (line 4183) * ick_settwospot: ick_get/setone/twospot. (line 4183) * ick_startup: ick_startup. (line 4000) * idiom: OIL Syntax. (line 5261) * idiom optimization: Optimizer Options. (line 923) * 'idiotism.oil': OIL Basics. (line 5186) * IFFI: The IFFI Fingerprint. (line 4490) * IFFI, commands: The IFFI Fingerprint. (line 4549) * IGNORE: IGNORE and REMEMBER. (line 2654) * 'IGNORE'/'RETRIEVE' interaction: STASH and RETRIEVE. (line 2629) * IGNORING: IGNORE and REMEMBER. (line 2654) * ignorret test: STASH and RETRIEVE. (line 2629) * illegal array dimension: Errors. (line 1202) * illegal line label value: Errors. (line 1171) * illegal opcode: Errors. (line 1529) * illegal variable number: Errors. (line 1178) * impossible reverse assignment: Errors. (line 1248) * initial abstention: Statement Identifiers. (line 1929) * input: READ OUT and WRITE IN. (line 2776) * input, C-INTERCAL: C-INTERCAL I/O. (line 2850) * input, CLC-INTERCAL: CLC-INTERCAL I/O. (line 2892) * input, EOF: Errors. (line 1361) * input, in Arabic numerals: Options to Generated Programs. (line 962) * input, INTERCAL-72: INTERCAL-72 I/O. (line 2793) * input, invalid: Errors. (line 1371) * installation: Installation. (line 158) * installation, Debian: Simple Installation. (line 370) * installation, simple: Simple Installation. (line 284) * installation, Ubuntu: Simple Installation. (line 370) * installation, via autoconf and make: Simple Installation. (line 284) * installing, DOS: Installation on DOS. (line 389) * INTERCAL compilers: Differences to Other Compilers. (line 4853) * INTERCAL, syntax: Syntax. (line 1810) * INTERCAL-72 compatibility mode: Language-affecting Options. (line 689) * INTERCAL-72, I/O: INTERCAL-72 I/O. (line 2793) * interleave: Mingle. (line 2207) * internal errors: Errors. (line 1455) * internal errors, debugging: Debug Options. (line 851) * internal errors, dumping core: Debug Options. (line 851) * invalid array dimension: Errors. (line 1202) * invalid line label value: Errors. (line 1171) * invalid variable number: Errors. (line 1178) * invocation flag, unnown: Errors. (line 1505) * iselect: OIL Patterns. (line 5445) * J-INTERCAL: Differences to Other Compilers. (line 4886) * labeled blocks: ick_labeledblock. (line 4048) * language-affecting options: Language-affecting Options. (line 630) * Latin-1: Character Sets. (line 4950) * lexical analyser, debugging: Debug Options. (line 768) * libick_ecto_b98.a: Creating the Funge-98 Library. (line 4440) * libraries: Expansion Libraries. (line 4773) * libraries, Befunge: Creating the Funge-98 Library. (line 4440) * libraries, external calls: Miscellaneous External Calls. (line 4694) * libraries, Funge: Creating the Funge-98 Library. (line 4440) * line label: Line Labels. (line 1891) * line label, duplicate: Errors. (line 1158) * line label, illegal value: Errors. (line 1171) * line label, in Funge: The IFFI Fingerprint. (line 4614) * line labels, C: ick_linelabel. (line 4015) * line number: Line Labels. (line 1891) * line too long: Errors. (line 1421) * loops, entire program: TRY AGAIN. (line 2960) * loops, OIL: OIL Loops. (line 5579) * make: Simple Installation. (line 284) * make install: Simple Installation. (line 284) * marker: The IFFI Fingerprint. (line 4524) * MAXTOFREE: OIL Tips. (line 5613) * MAYBE: Backtracking. (line 3519) * 'MAYBE', not enabled: Errors. (line 1302) * mesh: Constants and Variables. (line 2058) * microcontrollers: PIC-INTERCAL. (line 3665) * mingle: OIL Patterns. (line 5445) * mingle <1>: Mingle. (line 2207) * miscellaneous external calls: Miscellaneous External Calls. (line 4694) * multithreading: Multithreading and Backtracking. (line 3312) * multithreading, connected threads: Multithreading using WHILE. (line 3411) * multithreading, debugging: Options to Generated Programs. (line 987) * multithreading, enabling: Language-affecting Options. (line 655) * multithreading, not enabled: Errors. (line 1302) * multithreading, out of memory: Errors. (line 1511) * multithreading, separate threads: Multithreading using COME FROM. (line 3340) * N'T: Statement Identifiers. (line 1929) * nesting limit: Errors. (line 1265) * NEXT: NEXT FORGET and RESUME. (line 2540) * NEXT FROM: COME FROM and NEXT FROM. (line 2978) * NEXT FROM, in C: ick_comefrom and ick_nextfrom. (line 4071) * NEXT FROM, in Funge: The IFFI Fingerprint. (line 4677) * 'NEXT FROM', multithreading: Multithreading using COME FROM. (line 3340) * 'NEXT FROM', no target: Errors. (line 1318) * NEXT stack: NEXT FORGET and RESUME. (line 2540) * NEXT, computed: Expansion Libraries. (line 4824) * NEXT, in C: ick_next. (line 4107) * NEXT, in Funge: The IFFI Fingerprint. (line 4641) * 'NEXT', nonexistent target: Errors. (line 1137) * 'NEXT', stack overflow: Errors. (line 1112) * NEXTING: NEXT FORGET and RESUME. (line 2540) * no source file: Errors. (line 1448) * non-INTERCAL-72 warning: Warnings. (line 1602) * NOT: Statement Identifiers. (line 1929) * obtaining C-INTERCAL: Obtaining. (line 170) * OIL: Optimizer Idiom Language. (line 5176) * OIL, basics: OIL Basics. (line 5186) * OIL, comments: OIL Syntax. (line 5226) * OIL, debugging: Debug Options. (line 785) * OIL, example: OIL Example. (line 5675) * OIL, execution: OIL Basics. (line 5186) * OIL, expressions: OIL Expressions. (line 5275) * OIL, functions in C: OIL Patterns. (line 5390) * OIL, idiom groups: OIL Syntax. (line 5242) * OIL, idioms: OIL Syntax. (line 5261) * OIL, loops: OIL Loops. (line 5579) * OIL, operators: OIL Expressions. (line 5288) * OIL, optimizing code: Optimizer Options. (line 923) * OIL, patterns: OIL Patterns. (line 5334) * OIL, replacements: OIL Replacements. (line 5504) * OIL, syntax: OIL Syntax. (line 5219) * OIL, tips: OIL Tips. (line 5611) * ONCE: ONCE and AGAIN. (line 2003) * onespot: Constants and Variables. (line 2058) * onespot overflow: Errors. (line 1237) * onespot, overflow warning: Warnings. (line 1623) * operand overloading: Operand Overloading. (line 3586) * operand overloading, impossible: Errors. (line 1248) * operands, OIL, in patterns: OIL Patterns. (line 5348) * operands, OIL, in replacements: OIL Replacements. (line 5533) * operator: Operators. (line 2192) * operators, OIL: OIL Expressions. (line 5288) * optimization: Optimizer Options. (line 902) * optimization, control flow: Optimizer Options. (line 906) * optimization, extreme: Optimizer Options. (line 913) * optimization, flow: Optimizer Options. (line 906) * optimization, idioms: Optimizer Options. (line 923) * optimization, OIL: Optimizer Options. (line 923) * Optimizer Idiom Language: Optimizer Idiom Language. (line 5176) * optimizer options: Optimizer Options. (line 902) * optimizer, debugging: Debug Options. (line 785) * options, debug: Debug Options. (line 762) * options, dialect: Language-affecting Options. (line 630) * options, help: Other Options. (line 938) * options, language-affecting: Language-affecting Options. (line 630) * options, optimizer: Optimizer Options. (line 902) * options, other: Other Options. (line 935) * options, output: Output Options. (line 869) * options, to generated programs: Options to Generated Programs. (line 947) * options, to 'ick': Invoking ick. (line 613) * or: Unary Binary Logic. (line 2320) * or16: OIL Patterns. (line 5445) * or32: OIL Patterns. (line 5445) * other languages: External Calls. (line 3873) * other languages, C: External Calls to C. (line 3905) * other options: Other Options. (line 935) * out of bounds: Errors. (line 1209) * out of memory: Errors. (line 1284) * out of memory, backtracking: Errors. (line 1511) * out of memory, during compile: Errors. (line 1421) * out of memory, during 'STASH': Errors. (line 1189) * out of memory, I/O: Errors. (line 1219) * out of memory, multithreading: Errors. (line 1511) * output: READ OUT and WRITE IN. (line 2776) * output file, failure to write: Errors. (line 1490) * output options: Output Options. (line 869) * output, C only: Output Options. (line 876) * output, C-INTERCAL: C-INTERCAL I/O. (line 2850) * output, CLC-INTERCAL: CLC-INTERCAL I/O. (line 2892) * output, flushing: Options to Generated Programs. (line 978) * output, in Arabic numerals: Options to Generated Programs. (line 962) * output, INTERCAL-72: INTERCAL-72 I/O. (line 2793) * output, to standard output: Output Options. (line 891) * overflow, in constant: Errors. (line 1082) * overflow, over 16 bits: Errors. (line 1237) * overflow, over 32 bits: Errors. (line 1327) * overflow, over onespot: Errors. (line 1237) * overflow, over twospot: Errors. (line 1327) * overflow, warning: Warnings. (line 1623) * parser, debugging: Debug Options. (line 768) * patches, submitting: Reporting Bugs. (line 507) * patterns: OIL Patterns. (line 5334) * patterns, operands: OIL Patterns. (line 5348) * PIC-INTERCAL: PIC-INTERCAL. (line 3665) * PIC-INTERCAL, command line option: Language-affecting Options. (line 721) * PIC-INTERCAL, unsupported command: Errors. (line 1226) * PIN: PIC-INTERCAL. (line 3714) * 'PIN', in a non-PIC program: Errors. (line 1411) * PLEASE: Statement Identifiers. (line 1929) * 'PLEASE', proportion required: Errors. (line 1088) * politesse: Errors. (line 1088) * portability, unary operators: Warnings. (line 1663) * positional precedence: Grouping Rules. (line 2099) * Princeton compiler: Differences to Other Compilers. (line 4858) * Princeton syntax: Princeton and Atari Syntax. (line 1833) * Princeton syntax, option: Language-affecting Options. (line 734) * printflow, enabling: Debug Options. (line 820) * profiling: Debug Options. (line 804) * quitting: GIVE UP. (line 2942) * r: OIL Patterns. (line 5431) * rabbit-ears: Grouping Rules. (line 2099) * rabbit-ears, nesting limit: Errors. (line 1265) * random bug: Language-affecting Options. (line 641) * random bug, error message: Errors. (line 1435) * READ OUT: READ OUT and WRITE IN. (line 2776) * read-only variables: IGNORE and REMEMBER. (line 2654) * read-write variables: IGNORE and REMEMBER. (line 2654) * READING OUT: READ OUT and WRITE IN. (line 2776) * REINSTATE: ABSTAIN and REINSTATE. (line 2687) * reinstate, at program start: Statement Identifiers. (line 1929) * reinstate, during execution: ABSTAIN and REINSTATE. (line 2687) * REINSTATE, self-reinstating: ONCE and AGAIN. (line 2003) * reinstated state: Statement Identifiers. (line 1929) * REINSTATING: ABSTAIN and REINSTATE. (line 2687) * 'REINTSTATE', nonexistent target: Errors. (line 1151) * releasing C-INTERCAL: Distributing. (line 568) * REMEMBER: IGNORE and REMEMBER. (line 2654) * REMEMBERING: IGNORE and REMEMBER. (line 2654) * replacements: OIL Replacements. (line 5504) * replacements, operands: OIL Replacements. (line 5533) * reporting bugs: Reporting Bugs. (line 507) * RESUME: NEXT FORGET and RESUME. (line 2540) * 'RESUME', by 0: Errors. (line 1380) * RESUME, in C: ick_resume. (line 4133) * RESUME, in Funge: The IFFI Fingerprint. (line 4648) * RESUMING: NEXT FORGET and RESUME. (line 2540) * RETRIEVE: STASH and RETRIEVE. (line 2601) * 'RETRIEVE', without stashing: Errors. (line 1312) * 'RETRIEVE'/'IGNORE' interaction: STASH and RETRIEVE. (line 2629) * RETRIEVING: STASH and RETRIEVE. (line 2601) * reverse assignment: Operand Overloading. (line 3586) * reverse assignment, error: Errors. (line 1248) * reverse assignment, impossible: Errors. (line 1248) * reverse goto: COME FROM and NEXT FROM. (line 2978) * Roman numerals: INTERCAL-72 I/O. (line 2793) * Roman numerals, disabling: Options to Generated Programs. (line 962) * runtime debugger: The yuk debugger. (line 1684) * self-abstaining: ONCE and AGAIN. (line 2003) * self-reinstating: ONCE and AGAIN. (line 2003) * SENESTMAX: Errors. (line 1265) * separate threads: Multithreading using COME FROM. (line 3340) * setbitcount: OIL Patterns. (line 5465) * sharkfin: TriINTERCAL. (line 3232) * sharkfin, in base 2: Errors. (line 1545) * signatures: ick_create. (line 4245) * simple installation: Simple Installation. (line 284) * skeleton file, directory problems: Debug Options. (line 828) * skeleton file, errors: Errors. (line 1564) * slat: Operand Overloading. (line 3586) * smudgeleft: OIL Patterns. (line 5473) * smudgeright: OIL Patterns. (line 5473) * spark: Grouping Rules. (line 2099) * spark, nesting limit: Errors. (line 1265) * 'src/idiotism.oil': OIL Basics. (line 5186) * stack overflow: Errors. (line 1112) * stack, instruction pointer: NEXT FORGET and RESUME. (line 2540) * stack, NEXT: NEXT FORGET and RESUME. (line 2540) * stack, variable: STASH and RETRIEVE. (line 2601) * standard output: Output Options. (line 891) * startup code, C: ick_startup. (line 4000) * STASH: STASH and RETRIEVE. (line 2601) * stash failure: Errors. (line 1312) * stashes: STASH and RETRIEVE. (line 2601) * STASHING: STASH and RETRIEVE. (line 2601) * statement identifier: Statement Identifiers. (line 1929) * statements: Statements. (line 2433) * statements, INTERCAL: Statements. (line 2433) * SUB: Array Subscript. (line 2395) * submitting patches: Reporting Bugs. (line 507) * subscripts: Array Subscript. (line 2395) * subtract-without-borrow: TriINTERCAL. (line 3232) * syntax error: Errors. (line 1073) * syntax error <1>: Syntax Error. (line 2447) * syntax, Atari: Princeton and Atari Syntax. (line 1860) * syntax, creating: CREATE. (line 3756) * syntax, dialects: Princeton and Atari Syntax. (line 1828) * syntax, INTERCAL: Syntax. (line 1810) * syntax, of OIL: OIL Syntax. (line 5219) * syntax, Princeton: Language-affecting Options. (line 734) * syntax, Princeton <1>: Princeton and Atari Syntax. (line 1833) * syslib: syslib. (line 3065) * syslib, directory problems: Debug Options. (line 828) * syslib, errors: Errors. (line 1125) * syslibc: Expansion Libraries. (line 4807) * system libraries: System Libraries. (line 3044) * system library, directory problems: Debug Options. (line 828) * system library, disabling: Language-affecting Options. (line 679) * system library, errors: Errors. (line 1125) * system library, in C: Expansion Libraries. (line 4807) * tail: Constants and Variables. (line 2058) * ternary: TriINTERCAL. (line 3232) * Threaded INTERCAL: Multithreading and Backtracking. (line 3312) * threading: Multithreading and Backtracking. (line 3312) * threading, connected: Multithreading using WHILE. (line 3411) * threading, dormant: Backtracking. (line 3499) * threading, in series: Backtracking. (line 3499) * threading, separate: Multithreading using COME FROM. (line 3340) * threading, unwoven: Multithreading using COME FROM. (line 3340) * threading, woven: Multithreading using WHILE. (line 3411) * time-reversed goto: COME FROM and NEXT FROM. (line 2978) * tips, OIL: OIL Tips. (line 5611) * too many input files: Errors. (line 1421) * TriINTERCAL: TriINTERCAL. (line 3232) * TriINTERCAL, operators in base 2: Errors. (line 1545) * TRY AGAIN: TRY AGAIN. (line 2960) * 'TRY AGAIN', not last: Errors. (line 1521) * Turing Tape: C-INTERCAL I/O. (line 2850) * twospot: Constants and Variables. (line 2058) * twospot overflow: Errors. (line 1327) * Ubuntu: Simple Installation. (line 370) * unary binary logic: Unary Binary Logic. (line 2320) * unary operator, infix: Grouping Rules. (line 2162) * unary operator, prefix: Grouping Rules. (line 2162) * unary operators, portability: Warnings. (line 1663) * uninstalling: Uninstalling. (line 472) * unpacking C-INTERCAL: Unpacking. (line 196) * unsupported file type: Errors. (line 1505) * unsupported file type <1>: Errors. (line 1555) * unwoven threads: Multithreading using COME FROM. (line 3340) * unzipping C-INTERCAL: Unpacking. (line 196) * usage instructions, printing: Other Options. (line 938) * using external calls: Using External Calls. (line 4722) * V: Unary Binary Logic. (line 2320) * variable: Constants and Variables. (line 2058) * variable, illegal number: Errors. (line 1178) * variables, assignment: Calculate. (line 2496) * variables, from C: ick_get/setone/twospot. (line 4183) * variables, Funge, accessing: The IFFI Fingerprint. (line 4605) * variables, Funge, setting: The IFFI Fingerprint. (line 4654) * variables, ignoring: IGNORE and REMEMBER. (line 2654) * variables, limit: Errors. (line 1276) * variables, read-only: IGNORE and REMEMBER. (line 2654) * variables, read-write: IGNORE and REMEMBER. (line 2654) * variables, remembering: IGNORE and REMEMBER. (line 2654) * variables, stashes: STASH and RETRIEVE. (line 2601) * W016: Warnings. (line 1582) * W018: Warnings. (line 1589) * W112: Warnings. (line 1602) * W128: Warnings. (line 1612) * W239: Warnings. (line 1634) * W276: Warnings. (line 1623) * W278: Warnings. (line 1643) * W450: Warnings. (line 1654) * W534: Warnings. (line 1663) * W622: Warnings. (line 1674) * warnings: Warnings. (line 1576) * warnings, enabling: Debug Options. (line 796) * warnings, non-INTERCAL-72: Warnings. (line 1602) * what: Unary Binary Logic. (line 2320) * WHILE: Multithreading using WHILE. (line 3411) * 'WHILE', not enabled: Errors. (line 1302) * whirlpool: TriINTERCAL. (line 3232) * whirlpool, in base 2: Errors. (line 1545) * wimpmode: Options to Generated Programs. (line 962) * woven threads: Multithreading using WHILE. (line 3411) * WRITE IN: READ OUT and WRITE IN. (line 2776) * WRITING IN: READ OUT and WRITE IN. (line 2776) * wrong array dimension: Errors. (line 1209) * x: OIL Patterns. (line 5422) * x1--x9: OIL Patterns. (line 5422) * xor: Unary Binary Logic. (line 2320) * xor16: OIL Patterns. (line 5445) * xor32: OIL Patterns. (line 5445) * xselx: OIL Patterns. (line 5458) * yuk: The yuk debugger. (line 1684) * yuk, breakpoint overflow: Errors. (line 1482) * yuk, command line option: Debug Options. (line 838) * yuk, commands: The yuk debugger. (line 1711) * yuk, input overflow: Errors. (line 1475) * yuk, profiling: Debug Options. (line 804) * yuk, too many breakpoints: Errors. (line 1482) intercal-0.30/doc/PaxHeaders.27456/ick.info-10000644000000000000000000000013112507267255015341 xustar0030 mtime=1427992237.526940303 30 atime=1427992236.646942752 29 ctime=1427992237.73093973 intercal-0.30/doc/ick.info-10000664000175000017500000111725312507267255015256 0ustar00esresr00000000000000This is ick.info, produced by makeinfo version 5.2 from ick.txi. This manual is for C-INTERCAL version 0.29. 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 C-INTERCAL (unlike the other manual, it is not derived from the original INTERCAL-72 manual). Copyright © 2007 Alex Smith. 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." INFO-DIR-SECTION INTERCAL START-INFO-DIR-ENTRY * C-INTERCAL: (ick). The C-INTERCAL language and compiler. * ick: (ick) Invoking ick. Invoking the C-INTERCAL compiler. * convickt: (ick) convickt. The command-line character set converter. END-INFO-DIR-ENTRY  File: ick.info, Node: Top, Next: About this manual, Up: (dir) C-INTERCAL 0.29 *************** This manual is for C-INTERCAL version 0.29. 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 C-INTERCAL (unlike the other manual, it is not derived from the original INTERCAL-72 manual). Copyright © 2007 Alex Smith. 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." * Menu: * About this manual:: What is covered in this manual The C-INTERCAL compiler * Installation:: How to install C-INTERCAL * Invoking ick:: Options to give to the compiler ick * Errors and Warnings:: Error messages, and what to do about them * The yuk debugger:: How to use the runtime debugger Basic INTERCAL features * Syntax:: Holding statements together * Expressions:: Operators, operands, and grouping * Statements:: What an INTERCAL statement can do * System Libraries:: Pre-existing INTERCAL routines INTERCAL dialects and extensions * TriINTERCAL:: INTERCAL in non-binary bases * Multithreading and Backtracking:: Running INTERCAL programs in parallel * Operand Overloading:: Where one expression stands for another * PIC-INTERCAL:: INTERCAL on embedded systems * CREATE:: Creating new syntax at runtime * External Calls:: Linking INTERCAL with other languages * Differences to Other Compilers:: C-INTERCAL vs. CLC-INTERCAL Appendices and indices * Character Sets:: A list of character sets used by INTERCAL * convickt:: The command-line character set converter * Optimizer Idiom Language:: The syntax to specify optimizer idioms * Copying:: License information for the code and manual * Main Index:: An index of all the pages in this manual  File: ick.info, Node: About this manual, Next: Installation, Prev: Top, Up: Top About this manual ***************** This is the Revamped Instruction Manual for C-INTERCAL (this version is distributed with C-INTERCAL version 0.29). It is divided into four parts. The first part is about the C-INTERCAL compiler 'ick', 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. The second part is about the core INTERCAL 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 (*note Copying::), so if you disagree you can move the commands from section to section yourself.) Mostly only commands that are implemented in C-INTERCAL are covered here (if you're interested in the other commands implemented in other compilers, read CLC-INTERCAL's documentation). However, a comprehensive guide to portability of these commands between C-INTERCAL and other INTERCAL compilers is given. The third part covers the INTERCAL extensions and dialects that are implemented by C-INTERCAL, such as TriINTERCAL and Threaded INTERCAL. Again, extensions and dialects not implemented have been mostly left out. The final part contains appendices (which were known as 'tonsils' in the original INTERCAL manual), such as character sets used by INTERCAL, programs other than 'ick' in the C-INTERCAL distribution, information on how to read and update the list of optimizer idioms used by the compiler, and the copyright.  File: ick.info, Node: Installation, Next: Invoking ick, Prev: About this manual, Up: Top 1 Installation ************** The C-INTERCAL 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. * Menu: * Obtaining:: How to get a C-INTERCAL distribution to install * Unpacking:: What to do with the distribution file * Simple Installation:: How to install things the easy way * Installation on DOS:: For users of DOS with DJGPP * Uninstalling:: If you don't want to use the software * Reporting Bugs:: If it doesn't work or you know how to fix it * Distributing:: How to make your own C-INTERCAL distribution  File: ick.info, Node: Obtaining, Next: Unpacking, Up: Installation 1.1 Obtaining ============= C-INTERCAL 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 C-INTERCAL compiler ought to be announced there. (If you are interested in what other INTERCAL 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 (http://groups.google.com), and a search for 'alt.lang.intercal' there should tell you where to find a copy. 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.)  File: ick.info, Node: Unpacking, Next: Simple Installation, Prev: Obtaining, Up: Installation 1.2 Unpacking ============= C-INTERCAL is distributed in compressed pax format; for instance, you may find it as a '.pax.lzma' file if you have the 'unlzma' decompression program (this is advised, as it's the smallest); '.pax.bz2' is larger and '.pax.gz' is larger still. Most computers can decompress files in this format, even if they don't realise it, because pax is forwards-compatible with tar; try renaming the extension from '.pax' to '.tar' after decompressing to see if you have a progam that can decompress it. (If you're wondering why such an apparently non-standard format is being used, this is is actually a case where C-INTERCAL is being perfectly nonstandard by conforming to the standards; tar is no longer specified by POSIX, and pax is its replacement. It's just that pax never really caught on.) 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 _are_ an administrator, or at least have the same privileges, and can extract it anywhere). Some commands that you might use to extract it: Generic UNIX/Linux unlzma ick-0-29.pax.lzma tar xvf ick-0-29.pax or bunzip2 ick-0-29.pax.bz2 tar xvf ick-0-29.pax or gunzip ick-0-29.pax.gz tar xvf ick-0-29.pax On most UNIX-based and Linux-based systems, 'tar' will be available to unpack the installation files once they've been uncompressed with 'gunzip'. (I've heard that some BSD systems have 'pax' itself to decompress the files, although have not been able to verify this; some Linux distributions also have 'pax' in their package managers. Both tar and pax should work fine, though.) 'gunzip' is also likely to be available (and 'bunzip2' and 'unlzma' are less likely, but use those versions if you have them to save on your bandwidth); if it isn't, you will need to download a copy from the Internet. Using GNU tar tar xzvf ick-0-29.pax.gz or tar xqvf ick-0-29.pax.bz2 If you are using the GNU version of 'tar' (which is very likely on Linux), you can combine the two steps into one as shown here, except when using the lzma-compressed version. Using DJGPP djtar -x ick-0-29.pax.gz On a DOS system, you will have to install DJGPP anyway to be able to compile the distribution, and once you've done that you will be able to use DJGPP's decompressing and unpacking utility to extract the files needed to install the distribution. (You will need to type this at the command line; on Windows 95 and later, try choosing Run... from the start menu then typing 'cmd' (or 'command' if that fails) in the dialog box that opens to get a command prompt, which you can exit by typing 'exit'. After typing any command at a command line, press to tell the shell to execute that command.) On Windows If you're running a Windows system, you could always try double-clicking on the ick-0-29.pax.gz file; probably renaming it to have the extension '.tgz' is likely to give the best results. It's quite possible that you'll have a program installed that's capable of decompressing and unpacking it. Unfortunately, I can't guess what program that might be, so I can't give you any instructions for using it. Whatever method you use, you should end up with a directory created called 'ick-0.29'; 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 'cd ick-0.29').  File: ick.info, Node: Simple Installation, Next: Installation on DOS, Prev: Unpacking, Up: Installation 1.3 Simple Installation ======================= There are scripts included in the distribution to automate the process of installing, in various ways. The simplest method of installing on most operating systems (on DOS, *note Installation on DOS::) is to use the following routine: 1. Configure C-INTERCAL, by running 'configure'. Although building in the distribution directory works, it is recommended that you build elsewhere; create a directory to build in (using 'mkdir' on most operating systems), then run 'configure' from inside that directory (for instance, you could do this from inside the main installation directory: mkdir build cd build ../configure to build in a subdirectory of the distribution called "build"). You also specify where you want the files to be installed at this stage; the default of '/usr/local' is good for many people, but you may want to install elsewhere (in particular, if you want to test out C-INTERCAL without installing it, create a new directory somewhere you own and specify that as the place to install it, so the install will actually just copy the files into the right structure for use instead of installing them). To specify a location, give the option '--prefix=LOCATION' to configure; for instance, 'configure --prefix=/usr' would install in /usr. 2. Compile the source code, with the command 'make'. The Makefile will be set up for your version of 'make', and to automatically recompile only what needs compiling (it will even recompile the build system if you change that). 3. Optionally, create libraries from third-party interpreters to add support for more languages to the C-INTERCAL external calls system; see *note Creating the Funge-98 Library::. (This step can be skipped; you can also do it later, but if you do so you need to run the next step again.) 4. Install the executables, help files, include files, and libraries, using 'make install'. (This is the only step that needs root/administrator permissions; so on a system that uses sudo to elevate permissions, for instance, write it as 'sudo make install' if you're installing into a directory that you can't write to as a non-administrative user.) This step is optional; if you do not install C-INTERCAL, you can still run it by directly referencing the exact location of the 'ick' command. 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 (configure); its autoconf source code is available in the file 'configure.ac'.) 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 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 'ick'. 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 'sh', and don't have the shell 'bash' which can emulate it, and so can't run 'configure' 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 (C-INTERCAL was designed to work with 'gcc' and is tested mostly with that compiler, but in theory it should work with other C compilers too, and this is tested on occasion) and the associated software needed to compile C files to object files and executables, combine object files into libraries, etc.; but this requires trying to do the build by hand, so it's generally easier just to install a UNIX-like shell and associated tools. Another possibility 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 'lex' 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. 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 'binutils', 'cpp', 'gcc', 'libc6-dev', 'make' to compile C-INTERCAL, and if you want to modify it, you may also need 'autoconf', 'automake', 'bison', and 'flex'. For debugging help, you may also want 'gdb', and to recompile the documentation, you may need 'groff', 'texlive', 'texinfo', and 'tidy'. 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 'configure --help' to view the options that you can set on 'configure'; there's a wide range of settings that you can set available there, and one of them may be what you want.  File: ick.info, Node: Installation on DOS, Next: Uninstalling, Prev: Simple Installation, Up: Installation 1.4 Installation on DOS ======================= On DOS-based systems, it's possible to install C-INTERCAL via compiling it using DJGPP, a free DOS development system. (You can obtain DJGPP via its homepage, at .) The process for installing it works like this: 1. To start with, you will need to install DJGPP and various utilities (especially many of the GNU utilities) that come with it. To do this, see the instructions on DJGPP's website, and download and unpack any additional packages on this list that you did not install as part of those instructions (a filename by which the package can be found on DJGPP mirrors is given, and a version number with which C-INTERCAL was tested is given as part of the filename, but other versions are likely to work as well): * Unzip32 ('unzip32.exe') -- to unpack the other packages * DJGPP development kit ('v2/djdev203.zip') -- needed for all DJGPP compiles * CS's DPMI Provider ('v2misc/csdpmi7b.zip') -- you need some DPMI provider to run C-INTERCAL on a plain DOS system, although this is not needed on systems such as Microsoft Windows' emulation of DOS which already include a DPMI provider * GNU Binutils ('v2gnu/bnu219b.zip') -- needed to produce executables * gcc ('v2gnu/gcc444b.zip') -- used to compile C code * GNU make ('v2gnu/mak3791b.zip') -- used to resolve dependencies within the build system * GNU bash ('v2gnu/bsh204b.zip') -- used to interpret build scripts * GNU Diffutils ('v2gnu/dif20b.zip') -- used by the build scripts * GNU Fileutils ('v2gnu/fil41b.zip') -- used by the build scripts * GNU Findutils ('v2gnu/find41b.zip') -- used by the build scripts * GNU awk ('v2gnu/gwk318b.zip') -- used by the build scripts * GNU sed ('v2gnu/sed421b.zip') -- used by the build scripts * GNU Shellutils ('v2gnu/shl2011b.zip') -- used by the build scripts * GNU Textutils ('v2gnu/txt20b.zip') -- used by the build scripts, and sometimes by C-INTERCAL itself too You might want to install other packages, particularly GNU Bison and GNU Flex, in order to be able to rebuild certain parts of the compiler if you change them. This is not necessary to simply be able to run C-INTERCAL without changing it, though. 2. Test your DJGPP install to ensure it works, and make sure you have environment variables set up correctly. In addition to the 'DJGPP' variable that points to your 'DJGPP.ENV' file, and the 'PATH' variable that needs to contain DJGPP's binaries directory, you also need to set the 'DJDIR' environment variable to point to the main DJGPP installation directory. 3. Unpack a copy of C-INTERCAL in its own directory, if you haven't already (*note Unpacking::). 4. Load up a 'bash' session, change to the 'buildaux' subdirectory of your main C-INTERCAL directory, and run the command 'build-dj.sh'. This will run the entire C-INTERCAL build system, and hopefully end up with executables you can run in the 'build' subdirectory that will be created in your main C-INTERCAL directory. 5. If you wish, you can install C-INTERCAL by using the command 'make install' from the new 'build' subdirectory. It will run just fine in-place without a need to install, though, if you prefer.  File: ick.info, Node: Uninstalling, Next: Reporting Bugs, Prev: Installation on DOS, Up: Installation 1.5 Uninstalling ================ It may happen that you decide to uninstall C-INTERCAL 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 C-INTERCAL because this will save some disk space; you cannot install two versions of C-INTERCAL at once (at least, not in the same directory; but you can change the '--prefix' of one of the installations to get two versions at once). If you installed C-INTERCAL using 'make install', you can uninstall it by using 'make uninstall' 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 'ick' and 'convickt' where your computer installs binaries (with an extension like '.exe' added if that's usual for binaries on your operating system), 'libick.a', 'libickmt.a', 'libickec.a', and 'libyuk.a' where your computer installs libraries, and the subdirectories 'ick-0.29' in the places where your computer installs data files and include files, and their contents. You can go further than uninstalling. Running 'make clean' will delete any files created by compilation; 'make distclean' will delete those files, and also any files created by configuring. It's probably a wise idea to uninstall before doing a distclean, though, as otherwise information needed to uninstall will be deleted, as that information is generated by 'configure'. You can go even further and use 'make veryclean' which will delete not only files created by configuring, but the entire build system; doing so is not recommended unless you have some method of rebuilding the build system from its original sources (a script to do this is provided in repository versions of C-INTERCAL, because the generated part of the build system is not stored in the repository).  File: ick.info, Node: Reporting Bugs, Next: Distributing, Prev: Uninstalling, Up: Installation 1.6 Reporting Bugs ================== If you can't get C-INTERCAL 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 C-INTERCAL version (which you can determine by looking at that newsgroup). 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 (*note E778::) 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 (*note Debug Options::) 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. 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, '-H' (*note -H: -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 '-U' (*note -U: -U+.), it helps if you can load a debugger (such as 'gdb') on the core dump, use the debugger to produce a backtrace, and send that backtrace. 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 C-INTERCAL), 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 'diff -u'; 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 C-INTERCAL. If you have a suggestion for a new feature, it makes sense to first discuss it on the alt.lang.intercal news group; other INTERCAL compiler maintainers may also want to implement that feature. If you have developed code to implement that feature in C-INTERCAL, you can submit it the same way that you would submit a patch for a bug.  File: ick.info, Node: Distributing, Prev: Reporting Bugs, Up: Installation 1.7 Distributing ================ Due to the licensing conditions of C-INTERCAL, 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: 1. Make sure the new version is based on the most recent existing version. Looking at the alt.lang.intercal newsgroup will normally let you know what version is most recent. 2. Increment the version number; if you add any new features, increment the major version number (after the decimal point) and drop the minor version number (before the decimal point) to 0, and otherwise increment the minor version number. You have to update the version number in the following files: 'configure.ac', 'configure', and 'doc/ick.txi'. You also have to rename the installation directory to reflect the new version number. 3. Add an entry to the 'NEWS' file explaining what's new in the version that you're releasing, following the same format as the other entries. 4. Update the 'README' with a description of any new files you may have added. 5. Remove any autosave or backup files that may be littering the installation directory or its subdirectories. 6. Run 'make distcheck', which will make the distribution paxballs, and rename them to have the correct extensions (Automake thinks they're tarballs, so will use '.tar' rather than '.pax', and you have to fix this by hand). 'make distcheck' will also perform some sanity checks on the build system of the resulting paxball, which will help to ensure that nothing important is missing from it; and some regression tests on a version of C-INTERCAL built from the distribution tarball itself, to prove that it runs correctly and produces plausible output. (A failure of the regression checks will not stop the build, but should stop you distributing the resulting compiler.) 7. Place the new version somewhere on the Internet, and announce the location and the fact that a new version has been released on alt.lang.intercal.  File: ick.info, Node: Invoking ick, Next: Errors and Warnings, Prev: Installation, Up: Top 2 Invoking ick ************** All operations on INTERCAL source code available in C-INTERCAL, other than the conversion from one character set to another, are currently carried out by the compiler 'ick'. The syntax is ick -options INPUTFILE (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 INTERCAL 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. * Menu: * Language-affecting Options:: Options that specify language dialect * Debug Options:: Debug your code or ick itself * Output Options:: Specifying output format and location * Optimizer Options:: Yes, you can optimize INTERCAL! * Other Options:: Options not covered in other sections * Options to Generated Programs:: Generated executables allow options too * Environment Variables:: What environment variables affect ick  File: ick.info, Node: Language-affecting Options, Next: Debug Options, Up: Invoking ick 2.1 Language-affecting Options ============================== The following command-line options to 'ick' affect what dialect of the INTERCAL language is compiled by the compiler; you may need to set one or more of these options if your input is not the default C-INTERCAL but instead some other language like INTERCAL-72 or CLC-INTERCAL, 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 TriINTERCAL (or the base 4-7 versions); instead, the numeric base to use is determined by looking at the filename extension ('.i' for base 2, the default, or '.3i' to '.7i' for the base 3-7 versions.) '-b' If this option is _not_ given, there is a small chance that a random bug appears in the compiler, which causes the programs it creates to manifest a bug that causes error E774 (*note E774::). Giving the option means that this bug will not happen. (You may wonder why this bug was preserved; it is in fact a bug that was carefully preserved since the days of INTERCAL-72, in this case, but the option to turn it off is available as a workaround. (There are no plans to fix this or any of the other carefully preserved bugs any time soon, because that would kind of defeat the point of having preserved them.) Interestingly, the INTERCAL-72 compiler documentation mentions a similar command-line option that is a workaround for the same bug.) '-m' This option needs to be given to allow any multithreading or backtracking commands or identifiers to be used. (Unlike with other language features, this is not autodetected because it's legal to have a program with multiple COME FROM (*note COME FROM::) commands aiming at the same line even when it isn't multithreaded, in which case the commands cause error E555 (*note E555::) when that line is encountered (with the usual caveats about both commands having to be active at the time).) Attempts to use non-COME FROM multithreading or backtracking commands without this option produce error E405 (*note E405::). '-e' This option makes it possible to link non-INTERCAL programs with INTERCAL programs; instead of giving INTERCAL programs only on the command line, give one INTERCAL program, followed by any number of programs in other languages that have been written to be able to link to INTERCAL programs. It also allows expansion libraries to be specified on the command line, after the INTERCAL program (expansion libraries are given with no extension). For more information, see *note External Calls::. Also, both the '-a' and '-e' options must be set to use CREATEd operators (regardless of whether external calls are used or not). '-E' This option causes the system library to never be linked; this option is only useful if your program references a line number in the range 1000 to 1999, contains no line numbers in that range, and yet still doesn't want the system library to be linked in; therefore, it is mostly useful with '-e' when adding in a custom replacement system library written in a non-INTERCAL language, especially the expansion library 'syslibc' (a system library replacement written in C). '-t' This option tells the compiler to treat the source code as INTERCAL-72; as a result, any language constructs that are used but weren't available in 1972 will trigger error E111 (*note E111::). '-a' This option allows the CREATE statement (*note CREATE::) to be used. Note that enabling it carries a run-time penalty, as it means that operand overloading code has to be generated for every variable in the program. (This option is not necessarily needed for the external call version of CREATE to work, but the external call version has fewer features without it.) Note that '-e' (*note -e::) also needs to be set to be able to CREATE operators. '-v' It is possible to write INTERCAL code sufficiently tortuous that it ends up assigning to a constant. Generally speaking, this isn't what you wanted to do, so the compiler will kindly cause an error (E277; *note E277::) that stops the insanity at that point, but at the cost of a significant amount of performance you can give this option to tell the compiler to simply change the constant and keep on going anyway. (Note that unlike CLC-INTERCAL, this only changes uses of the constant preceded by '#' in your program, not things like line numbers; you want Forte (http://esolangs.org/wiki/Forte) for that.) This option also allows you to write arbitary expressions on the left of an assignment statement if you wish. '-C' When this option is given, the generated programs will write the number 4 as 'IIII' rather than 'IV', in case you're writing a clock program. '-P' This tells the compiler to treat the input as PIC-INTERCAL (*note PIC-INTERCAL::) rather than ordinary C-INTERCAL input, and generate PIC output code accordingly. There are a lot of options that are incompatible with this, as well as many language features, due to the limited memory available on a PIC. If you get error E256 (*note E256::), you have this option given when it shouldn't be; likewise, if you get error E652 (*note E652::), you should be using this option but aren't. (A few simple programs are C-INTERCAL/PIC-INTERCAL polyglots, but such programs are incapable of doing input or output, meaning that they aren't particularly useful.) '-X' The C-INTERCAL and CLC-INTERCAL compilers use different notation for various things, sometimes to the extent where the same notation is legal in both cases but has a different meaning. As this is the C-INTERCAL compiler, it rather guessably uses its own notation by default; however, the CLC-INTERCAL notation can be used as the default instead using this option. (In most situations where there isn't an ambiguity about what something means, you can use the 'wrong' syntax freely.) The option causes ambiguous characters like '?' to be interpreted with Princeton rather than Atari meanings. '-x' This option causes some constructs with different meanings in C-INTERCAL and CLC-INTERCAL to use the CLC-INTERCAL meaning rather than the C-INTERCAL meaning. At present, it affects the abstention of a GIVE UP (*note GIVE UP::) command by line number, which is possible as long as this switch isn't given; reading through the INTERCAL-72 manual, there are a lot of things that imply that this probably wasn't intended to be possible, but as far as I can tell that manual doesn't actually _say_ anywhere that this particular case is disallowed, even though it rules out all other similar cases. It also causes I/O on array variables to be done in CLC-INTERCAL's extended Baudot syntax, rather than using the Turing Tape method.  File: ick.info, Node: Debug Options, Next: Output Options, Prev: Language-affecting Options, Up: Invoking ick 2.2 Debug Options ================= Sometimes things will go wrong with your program, or with the way 'ick' was installed. There may even be unknown bugs in 'ick' itself (if you find one of these, please report it). The following options are used to debug the whole system on various levels. '-d' If you think that something has gone wrong with the parser, or you want to see how your program is being parsed, you can give this option on the command line. All the debug output produced by the parser and lexical analyser will be output. '-g' This option allows debugging of the final executable at the C code level. Any C code generated will be left in place, and the '-g' 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 the executable will be present there. '-h' '-H' '-hH' These options allow debugging of the optimiser, or produce output helpful for understanding how your program has been summarised. '-h' produces a summary of what optimiser rules were used, the initial expression and what it was optimised to; '-H' produces a more expanded view that shows each intermediate step of optimisation, and '-hH' shows the same output as '-H', but written completely using C syntax (the other options output in a strange mix of INTERCAL and C). '-l' This option turns on generation of warnings (*note Warnings::). To make sure that they aren't actually useful, or are only marginally useful, the warning generator is far too sensitive, and there is no way to decide which warnings are given and which ones aren't; you either get all of them or none. '-p' 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 on the computer and operating system; DOS, in particular, is really bad with timer resolution. The output will be saved in a file called 'yuk.out' when the program finishes running. It's legal to turn on both the profiler and the interactive debugger at the same time, but if you do this the profiler will also identify bottlenecks in the person typing in commands to step through the program! The profiler will, in fact, identify all the timings that particular commands in the program take; so 'WRITE IN' instructions will often show up as taking a long time due to their need to wait for input. '-w' This option causes the produced program to support the 'printflow' option fully; when this option is not given, 'printflow' will in most cases have partial or no support (except in multithreaded programs, where this option is redundant), because not all the code needed for it will be included in the program to save space. '-u' When you are getting problems with finding files - for instance, the compiler can't find the skeleton file (*note E999::) or the system library (*note E127::) - this option will let you know, on standard error, where the compiler is looking for files. This may hopefully help you pin down where the file-finding problems are coming from, and also offers the option of simply placing copies of the files where the compiler is looking as a last resort. '-y' This is the main debugging option: it loads yuk, an interactive INTERCAL debugger with ability to step through the program, set breakpoints, view and modify variables, etc. *Note yuk::. '-Y' This options causes the command line to be displayed for all calls to other programs that 'ick' makes (mostly to 'gcc'); it is therefore useful for debugging problems with the command lines used when using the external calls system (*note External Calls::). '-U' The internal error E778 (*note E778::) should never happen. However, there are all sorts of potential problems that may come up, and if part of the code detects something impossible, or more usually when the operating system detects things have got too insane and segfaults, normally this error will just be generated and that's that. (I most often get this when I've been writing a new section of code and have made a mistake; hopefully, all or at least most of these errors are fixed before release, though.) If you want more information as to what's going on, you can give the '-U' option, which will cause the compiler to raise an abort signal when an internal error happens. This can generally be caught by a debugger that's being run on 'ick' itself at the time; on many systems, it will also cause a core dump.  File: ick.info, Node: Output Options, Next: Optimizer Options, Prev: Debug Options, Up: Invoking ick 2.3 Output Options ================== 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. '-c' By default, the original INTERCAL code will be compiled all the way to an executable, and the intermediate C and object files produced will be deleted. Giving this option causes the compiler to stop when it has finished producing the C file, leaving the C file there as the final output of the compiler. (Its filename is the same as the source file, but with '.c' as its extension/suffix rather than the source file's extension.) Without this option, an executable will be produced with the extension 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. '-o' This option causes the compiler to progress no further than producing the C output file, but instead of writing it to a file writes it directly to standard output. This might occasionally be useful when using 'ick' as part of a pipe; it can also be useful to see how far the compiler gets with compiling code before an error happens, when you're trying to track down an error.  File: ick.info, Node: Optimizer Options, Next: Other Options, Prev: Output Options, Up: Invoking ick 2.4 Optimizer Options ===================== There are various command line options that can be used to tell 'ick' whether and in what ways to optimize code. '-f' This option requests the compiler to attempt to analyse the flow of the program and optimize accordingly; for instance, it will detect which commands can't possibly be 'ABSTAINED' from and refrain from generating code to check the abstention status of those commands. '-F' This option tells the compiler to optimize the output for speed. This is done to crazy extremes; the compiler may take several hours/days analysing the program in some cases and still not come up with an improvement. It turns on all the other optimizer options. Note that not all systems accept this option, because it sometimes outputs a shell script disguised as an executable rather than an actual executable. '-O' This option tells the compiler to apply optimizer idioms to the expressions in the code given, when appropriate. The list of idioms is stored in the file 'src/idiotism.oil'; note that it is compiled into the compiler, though, so you will have to rebuild and reinstall the compiler if you change it. For more information about changing the list of idioms, see *note Optimizer Idiom Language::.  File: ick.info, Node: Other Options, Next: Options to Generated Programs, Prev: Optimizer Options, Up: Invoking ick 2.5 Other Options ================= Some options just can't be classified. '-@' If this option is given, the compiler doesn't run at all, but instead prints a set of instructions for using it, explaining which options are available on the system you're on and which options conflict with which other options.  File: ick.info, Node: Options to Generated Programs, Next: Environment Variables, Prev: Other Options, Up: Invoking ick 2.6 Options to Generated Programs ================================= 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. '+help' '-help' Whether '+' or '-' is given at the start of this option, it will cause the program to print out what options are available and what state they are in. It will then cause the program to exit via an internal error. '+wimpmode' '-wimpmode' If the '+' version of this is given (rather than the default '-'), then the program will print a message explaining that you are a wimp (the mode itself is known as wimpmode), and for the rest of execution will input in Arabic numerals ('123' rather than 'ONE TWO THREE') and likewise will output in Arabic numerals rather than Roman numerals (such as 'CXXIII'). True INTERCAL programmers should rarely have to use this mode. '+traditional' '-traditional' This option does not actually appear to do anything. '+instapipe' '-instapipe' This option causes standard output to be flushed whenever any characters are output when the '+' version is used, rather than on each newline (the default '-' version). It is most useful for more responsive pipes when outputting binary data, and also useful for debugging very slow programs. '+printflow' '-printflow' The usual debugging methods don't work with multithreaded or backtracking programs. This option exists to give at least a slim chance of working out what is going on with them. It causes the program to print the line number of the command it thinks it may be executing next (i.e. the line number that would be printed if that line had an error) immediately after executing each command, and also an internal identifier for the thread that that command was in. It also prints a trace of what parts of the multithreader are being activated; so for instance, it will tell you when a thread is being forked into multiple threads or when a choicepoint has been deleted. Note that the '-w' option (*note -w::) must be given to gain full support for flow printing in non-multithreaded non-backtracking programs, because otherwise the required code to print this information will not be generated. '+mystery' '-mystery' This option is occasionally capable of doing something, but is deliberately undocumented. Normally changing it will have no effect, but changing it is not recommended.  File: ick.info, Node: Environment Variables, Prev: Options to Generated Programs, Up: Invoking ick 2.7 Environment Variables ========================= Various environment variables can be set to affect the operation of 'ick'. Variable Meaning -------------------------------------------------------------------------- ICKINCLUDEDIR These four environment variables suggest ICKLIBDIR locations in which 'ick' should look to find ICKSYSDIR various files that it needs: the skeleton file, ICKCSKELDIR 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). CC The name of a C compiler to use (defaults to 'gcc'; C-INTERCAL has recently been tested only with 'gcc' and 'clang'). This option has no effect on DJGPP, where 'gcc' is always used. ICKTEMP On DJGPP, 'ick' creates temporary files to pass TMPDIR options to gcc as a method of getting around the TEMP limit on the length of a command line that can TMP 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.  File: ick.info, Node: Errors and Warnings, Next: The yuk debugger, Prev: Invoking ick, Up: Top 3 Errors and Warnings ********************* 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 INTERCAL. Errors and warnings appear as an error code starting with 'ICL', followed by a three digit number, followed by 'I' for an error or 'W' for a warning. However, they will be notated here as 'E000', etc., to save space and because consistency was never a strong point of INTERCAL. 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 'COME FROM's or computed 'COME FROM'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 (*note E633::). 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.) * Menu: * Errors:: Error messages that might be produced * Warnings:: Warnings produced by the '-l' option  File: ick.info, Node: Errors, Next: Warnings, Up: Errors and Warnings 3.1 Errors ========== This is a list of the error messages that might be produced during the compilation or execution of an INTERCAL program. E000 This is an unusual error; it's what's printed when a syntax error is encounted at runtime, in a situation in which it would be executed. (An 'ABSTAIN'ed syntax error, for instance, would not be executed; this is one of the mechanisms available for writing comments.) The text of the error message is simply the statement that couldn't be decoded. E017 DO YOU EXPECT ME TO FIGURE THIS OUT? This error occurs when there is an attempt to use a constant with a value outside the onespot range; it's a compile-time error. E079 PROGRAMMER IS INSUFFICIENTLY POLITE The balance between various statement identifiers is important. If less than approximately one fifth of the statement identifiers used are the polite versions containing 'PLEASE', that causes this error at compile time. E099 PROGRAMMER IS OVERLY POLITE Of course, the same problem can happen in the other direction; this error is caused at compile time if more than about one third of the statement identifiers are the polite form. E111 COMMUNIST PLOT DETECTED, COMPILER IS SUICIDING This error happens when you give the '-t' option (*note -t::) but you use a language construct that wasn't available in INTERCAL-72. If this happens, then either there's a mistake in the program that prevents it being INTERCAL-72 or you shouldn't be compiling it as INTERCAL-72 in the first place. E123 PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON There is a hard limit of 80 'NEXT's at a time; this is to discourage excessive use of 'NEXTING' for things like recursion. (Recursive programs are entirely legal; you simply have to figure out how to do it with computed 'COME FROM' instead. (For the record, it is possible. (Using lots of nested brackets when talking about recursion is great (yay!).))) Another problem with writing the source code that can cause this error is a failure to properly 'FORGET' the entry on the 'NEXT' stack created when trying to simulate a goto. E127 SAYING 'ABRACADABRA' WITHOUT A MAGIC WAND WON'T DO YOU ANY GOOD Your program asked to include a system library (by specifying a line number in a magic range without including a line with that number), but due to installation problems the compiler couldn't find the system library to include. You could try using the '-u' (*note -u::) option to see where the compiler's looking; that may give you an idea of where you need to copy the system library so that the compilation will work. This error happens at compile time and doesn't give a next command line number. E129 PROGRAM HAS GOTTEN LOST This error happens at compile time when the compiler can't figure out where a 'NEXT' command is actually aiming (normally due to a typo in either the line label given or the line label on the line aimed for). The logic behind this error means that the next line to be executed is unknown (after all, that's the whole point of the error) and is therefore not given. The '-e' command-line option (*note -e::) makes this error into a run-time error, because it allows 'NEXT' commands to dynamically change targets at runtime, as well as line labels to dynamically change values, and thus the error is impossible to detect at compile time. E139 I WASN'T PLANNING TO GO THERE ANYWAY This error happens at compile time when an 'ABSTAIN' or 'REINSTATE' references a non-existent target line. This generally happens for much the same reasons as E129 (*note E129::). E182 YOU MUST LIKE THIS LABEL A LOT! At present, it's impossible to have more than one line with the same line number. That would make 'NEXT' act too much like 'COME FROM' in reverse to be interesting. This error happens at compile time. (For inconsistency, it is possible to have multiple lines with the same number as long as at most one of them is in an INTERCAL program (the others have to be in programs in other languages included via the external calls system). The resulting behaviour is entirely inconsistent with the rest of the language, though, for what I hope are obvious reasons.) E197 SO! 65535 LABELS AREN'T ENOUGH FOR YOU? Legal values for line labels are 1 to 65535 (certain subranges are reserved for system and expansion libraries). This error comes up if you use nonpositive or twospot values for a line label. E200 NOTHING VENTURED, NOTHING GAINED You used a variable that isn't actually in your program. Failing that (which, contrary to previous versions of this manual, is indeed possible in the present version of C-INTERCAL, although I'm not telling how; a hint: what mechanism in C-INTERCAL allows for a computed variable number?), you specified an illegal number for a variable (legal numbers are positive and onespot). This error happens at compile time, at least for illegal variable numbers. E222 BUMMER, DUDE! In INTERCAL, you're allowed to 'STASH' as much as you like; this makes the language Turing-complete and allows for unlimited recursion when combined with computed 'COME FROM' in the right way. Unfortunately, real computers aren't so idealised; if you manage to write a program so memory-intensive that the computer runs out of memory to store stashes, it causes this error at runtime. To fix this error, you either have to simplify the program or upgrade your computer's memory, and even then that will only help to some extent. E240 ERROR HANDLER PRINTED SNIDE REMARK Arrays have to be large enough to hold at least one element; you tried to dimension an array which isn't large enough to hold any data. This error happens at run time. E241 VARIABLES MAY NOT BE STORED IN WEST HYPERSPACE This error happens at run time when the subscripts given to an array are inconsistent with the way the array was dimensioned, either because there were the wrong number of subscripts or because a subscript was too large to fit in the array. It can also happen when a multidimensional array is given to a command, such as 'WRITE IN', that expects it to be monodimensional. E252 I'VE FORGOTTEN WHAT I WAS ABOUT TO SAY This run-time error message is caused by the compiler running out of memory whilst trying to do I/O; at present, it can only happen during CLC-INTERCAL-style I/O. E256 THAT'S TOO HARD FOR MY TINY BRAIN Some commands simply aren't available in PIC-INTERCAL. I mean, PICs generally have less than a kilobyte of memory; you're not going to be able to use some of the more confusing language features with that sort of resource limitation. The solution is to replace the affected command, or to not give the '-P' option (*note -P: -P+.) if you didn't mean to compile as PIC-INTERCAL in the first place. E275 DON'T BYTE OFF MORE THAN YOU CAN CHEW This error happens when there is an attempt to store a twospot value in a onespot variable. The actual size of the value is what matters when counting its spots; so you can store the output of a mingle in a onespot variable if it happens to be less than or equal to 65535, for instance. (This is not necessarily the case in versions of INTERCAL other than C-INTERCAL, though, so you have to be careful with portability when doing this.) E277 YOU CAN ONLY DISTORT THE LAWS OF MATHEMATICS SO FAR Reverse assignments are not always mathematically possible. Also, sometimes they require changing the value of a constant; this is only legal if you specifically specified that it was legal by using the '-v' option. In the case of an impossible reverse assignment (including a situation in which operand overloading causes a reverse assignment to happen), this error happens at runtime. This error can also come up when a scalar variable is overloaded to an array (which doesn't make sense, but could happen if someone exploited bugs in the CREATE statement (*note CREATE::)), and an attempt is made to read or assign to that variable. (Subscripting a scalar variable is a syntax error, so there is no use for doing such an overload anyway.) E281 THAT MUCH QUOTATION AMOUNTS TO PLAGIARISM There is a limit of 3200 on the number of nested spark/ears groups allowed. If you somehow manage to exceed that limit, that will cause this error. Try breaking the expression up into smaller expressions. (The limit is trivial to increase by changing 'SENESTMAX' in 'ick.h'; if you ever actually come across a program that hits the limit but wasn't designed to, just email the maintainer to request a higher limit.) E333 YOU CAN'T HAVE EVERYTHING, WHERE WOULD YOU PUT IT? Your program references so many variables that the compiler couldn't cope. This error is unlikely to ever happen; if it does, try reducing the number of variables you use by combining some into arrays. This is a compile-time error. E345 THAT'S TOO COMPLEX FOR ME TO GRASP This is another compile-time error that's unlikely to ever happen; this one signifies the compiler itself running out of memory trying to compile your program. The only solutions to this are to simplify your program, or to make more memory available to the compiler. E404 I'M ALL OUT OF CHOICES! Your program asked that a choicepoint be backtracked to or removed, but there aren't any choicepoints at the moment. This runtime error usually indicates a logic mistake in your program. In backtracking programs translated from other backtracking languages, this indicates that the program has failed. E405 PROGRAM REJECTED FOR MENTAL HEALTH REASONS Your program used a construct that only makes sense when multithreading or backtracking ('WHILE', 'MAYBE', 'GO BACK', or 'GO AHEAD'), but you didn't specify the '-m' option (*note -m::). If you meant to write a multithreaded or backtracking program, just give that option; if you didn't, be careful what words you use in comments! This error happens at compile-time. E436 THROW STICK BEFORE RETRIEVING! In order to 'RETRIEVE' a variable, it has to be 'STASH'ed first; if it isn't, then this error happens at runtime. E444 IT CAME FROM BEYOND SPACE A 'COME FROM' aiming at a line label -- as opposed to a computed 'COME FROM', which is allowed to be pointing at a nonexistent line -- must point to a valid line label. The same applies to 'NEXT FROM'. This error happens at compile time if a nonexistent line label is found in one of these contexts. E533 YOU WANT MAYBE WE SHOULD IMPLEMENT 64-BIT VARIABLES? This error is like E275 (*note E275::), but applies when an attempt is made at runtime to store a threespot value (or even a fourspot or morespot value) in a twospot variable, or a threespot or greater value is produced as an intermediate during a calculation (for instance by a mingle operation). No values above twospot are allowed at any point during an INTERCAL program; if you want to process higher numbers, you have to figure out a different way of storing them. E553 BETTER LATE THAN NEVER Oops! The compiler just noticed that it had a buffer overflow. (Normally programs catch buffer overflows before they happen; C-INTERCAL catches them just afterwards instead.) This only happens on systems which don't have a modern C standard library. Try using shorter or fewer filenames on the command line, to reduce the risk of such an overflow. E555 FLOW DIAGRAM IS EXCESSIVELY CONNECTED Aiming two 'COME FROM's at the same line only makes sense in a multithreaded program. In a non-multithread program, doing that will cause this error at compile time (if neither 'COME FROM' is computed) or at run time (if the command that has just finished running is simultaneously the target of two or more 'COME FROM's). This either indicates an error in your program or that you've forgotten to use the '-m' option (*note -m::) if you are actually trying to split the program into two threads. E562 I DO NOT COMPUTE The program asked for input, but for some reason it wasn't available. (This is a runtime error, obviously.) The error may happen because the input is being piped in from a command or file which has reached end-of-file, or because the user typed '-' (UNIX/Linux) or '-' (DOS/Windows) while the program was trying to 'WRITE IN' some data. E579 WHAT BASE AND/OR LANGUAGE INCLUDES STRING? When reading spelt-out-digit input, the input didn't seem to be a valid digit in English, Sanskrit, Basque, Tagalog, Classical Nahuatl, Georgian, Kwakiutl, Volapük, or Latin. This seems to have languages covered pretty well; what on earth were you using, or did you just make a spelling mistake? E621 ERROR TYPE 621 ENCOUNTERED The compiler encountered error E621 (*note E621::). This happens at runtime when the program requests that no entries are removed from the 'NEXT' stack (which is possible), but that the last entry removed should be jumped to (which given the circumstances isn't, because no entries were removed). E632 THE NEXT STACK RUPTURES. ALL DIE. OH, THE EMBARRASSMENT! When an attempt is made to 'RESUME' past the end of the 'NEXT' stack, the program ends; however, this cause the program to end in a manner other than via 'GIVE UP' or 'DON'T TRY AGAIN', so an error message must be printed, and this is that error message. E633 PROGRAM FELL OFF THE EDGE You can't just let execution run off the end of the program. At least, that is, if it doesn't end with 'TRY AGAIN'. An attempt to do that causes this error at runtime. Note that if your program references the system library, then it counts as being appended to your program and so the program will run into the first line of the system library rather than cause this error. As it happens, the first line of the system library is a syntax error, so doing this will cause E000 (*note E000::) with the error text 'PLEASE KNOCK BEFORE ENTERING'. There isn't a next statement to be executed with E633, so the next statement won't be given in the error message. E652 HOW DARE YOU INSULT ME! The 'PIN' command doesn't make much sense for anything bigger than a PIC; using it in a non-PIC program causes this error at compile-time. Try using the normal input and output mechanisms instead. This error may also be a clue that you are trying to compile a PIC-INTERCAL program without giving the '-P' option (*note -P: -P+.). E666 COMPILER HAS INDIGESTION There isn't a limit on the length of an input program other than your computer's memory; if your computer does run out of memory during compilation, it causes this error. This error can also be caused if too many input files are specified on the command line; if you suspect this is the problem, split the compilation into separate compilations if you can, or otherwise you may be able to concatenate together your input files into larger but fewer files. Yet another potential cause of this error is if a line in an input program is too long; sensible line-wrapping techniques are encouraged. E774 RANDOM COMPILER BUG No compiler is perfect; sometimes errors just happen at random. In this case, the random error is E774. If you don't like the idea that your program may be shot down by a random compiler bug, or you are doing something important, you can use the '-b' option (*note -b::) to prevent this bug happening. (You may wonder why this bug is in there at all if it's so easily prevented. The answer is that such a bug was present in the original INTERCAL-72 compiler, which also had an option to turn the bug off. It's also a reward for people who actually read the manual.) E777 A SOURCE IS A SOURCE, OF COURSE, OF COURSE You specified a file to compile on the command line, but the compiler couldn't find or couldn't open it. This is almost certainly because you made a typo specifying the file. E778 UNEXPLAINED COMPILER BUG This should never come up, either at compile time or at run time. It could come up at either when an internal check by the compiler or the runtime libraries realises that something has gone badly wrong; mistakes happen, and in such cases the mistake will have been detected. (If this happens at compile time you can use the '-U' option (*note -U: -U+.) to cause the compiler to send an abort signal - which normally causes a core dump - when the error happens, to help debug what's causing it.) More often, this error comes up when the operating system has noticed something impossible, like an attempt to free allocated memory twice or to write to a null pointer, and tells the compiler an error has occured, in which case the same response of putting up this error happens. The point is that in all cases this error 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 it and send a bug report (*note Reporting Bugs::). E810 ARE ONE-CHARACTER COMMANDS TOO SHORT FOR YOU? This is a debug-time error caused when you give too much input to the debugger when all it wanted was to know what you wanted to do next. E811 PROGRAM IS TOO BADLY BROKEN TO RUN 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 a debug-time error. E888 I HAVE NO FILE AND I MUST SCREAM The output file couldn't be written, maybe because the disk is full or because there's already a read-only file with the same name. This is a compile-time error. E899 HELLO? CAN ANYONE GIVE ME A HAND HERE? This error occurs at compile-time if a file type was requested for which the required libraries are unavailable. (Support for Funge does not ship with the compiler; instead, you need to generate the library yourself from the cfunge sources. For more information, see *note Creating the Funge-98 Library::.) E990 FLAG ETIQUETTE FAILURE BAD SCOUT NO BISCUIT This error occurs at runtime if an INTERCAL program was passed an unknown option flag. E991 YOU HAVE TOO MUCH ROPE TO HANG YOURSELF There is no limit on the number of threads or choicepoints that you can have in a multithreaded or backtracking program (in a program that isn't multithreaded or backtracking, these are obviously limited to 1 and 0 respectively). However, your computer may not be able to cope; if it runs out of memory in the multithreader, it will cause this error at runtime. E993 I GAVE UP LONG AGO 'TRY AGAIN' has to be the last command in a program, if it's there at all; you can't even follow it by comments, not even if you know in advance that they won't be 'REINSTATE'd. This error happens at compile time if a command is found after a 'TRY AGAIN'. E994 NOCTURNAL EMISSION, PLEASE LAUNDER SHEETS IMMEDIATELY This error should never happen, and if it does indicates a compiler bug. It means the emitter function in the code degenerator has encountered an unknown opcode. Please send a copy of the program that triggered it to the INTERCAL maintainers. E995 DO YOU REALLY EXPECT ME TO HAVE IMPLEMENTED THAT? Some parts of the code haven't been written yet. There ought to be no way to cause those to actually run; however, if you do somehow find a way to cause them to run, they will cause this error at compile time. E997 ILLEGAL POSSESSION OF A CONTROLLED UNARY OPERATOR Some operators (such as whirlpool ('@') and sharkfin ('^')) only make sense in TriINTERCAL programs, and some have a minimum base in which they make sense. This error happens at compile-time if you try to use an operator that conflicts with the base you're in (such as using TriINTERCAL operators in an INTERCAL program in the default base 2). E998 EXCUSE ME, YOU MUST HAVE ME CONFUSED WITH SOME OTHER COMPILER This error occurs just before compile-time if a file is encountered on the command line that C-INTERCAL doesn't recognise. (If this error occurs due to a '.a', '.b98', '.c', '.c99', or '.c11' file, then you forgot to enable the external calls system using '-e' (*note -e::).) E999 NO SKELETON IN MY CLOSET, WOE IS ME! The skeleton file 'ick-wrap.c' or 'pickwrap.c' is needed to be able to compile INTERCAL to C. If the compiler can't find it, it will give this error message. This indicates a problem with the way the compiler has been installed; try using the '-u' option (*note -u::) to find out where it's looking (you may be able to place a copy of the skeleton file in one of those places).  File: ick.info, Node: Warnings, Prev: Errors, Up: Errors and Warnings 3.2 Warnings ============ This is a list of the warnings stored in the warning database. Warnings only come up when the '-l' option (*note -l::) is given; even then, some of the warnings are not currently implemented and therefore will never come up. W016 DON'T TYPE THAT SO HASTILY The positional precedence rules for unary operators are somewhat complicated, and it's easy to make a mistake. This warning is meant to detect such mistakes, but is not currently implemented. W018 THAT WAS MEANT TO BE A JOKE If an INTERCAL expression has been translated from another language such as C, the optimiser is generally capable of translating it back into something similar to the original, at least in base 2. When after optimisation there are still INTERCAL operators left in an expression, then this warning is produced. (Therefore, it's likely to come up quite a lot if optimisation isn't used!) The system library produces some of these warnings (you can tell if a warning has come up in the system library because you'll get a line number after the end of your program). W112 THAT RELIES ON THE NEW WORLD ORDER This warning comes up whenever the compiler recognises that you've added some code that didn't exist in INTERCAL-72. This allows you to check whether your code is valid INTERCAL-72 (although '-t' (*note -t::) is more useful for that); it also warns you that code might not be portable (because INTERCAL-72 is implemented by most INTERCAL compilers, but more recent language features may not be). W128 SYSLIB IS OPTIMIZED FOR OBUSCATION There is an idiom used in the system library that does a right-shift by selecting alternate bits from a twospot number and then mingling them the other way round. A rightshift can much more easily be done with a single rightshift, so this is a silly way to do it, and this warning warns that this idiom was used. However, the present optimizer is incapable of recognising whether this problem exists or not, so the warning is not currently implemented. W276 YOU CAN'T EXPECT ME TO CHECK BACK THAT FAR It's an error to assign a twospot value (a value over 65535) to a onespot variable, or to use it as an argument to a mingle. If the optimizer can't guarantee at compile time that there won't be an overflow, it issues this warning. (Note that this doesn't necessarily mean there's a problem -- for instance, the system library generates some of these warnings -- only that the optimiser couldn't work out for sure that there wasn't a problem.) W239 WARNING HANDLER PRINTED SNIDE REMARK Your code looks like it's trying to assign 0 to an array, giving it no dimension; this is an error. This warning is produced at compile time if it looks like a line in your code will cause this error, but it isn't necessarily an error because that line of code might never be executed. W278 FROM A CONTRADICTION, ANYTHING FOLLOWS It's sometimes impossible to reverse an assignment (a reverse assignment can happen if the '-v' option (*note -v::) is used and an expression is placed on the left of an assignment, or in operand overloading); if the compiler detects that a reversal failure is inevitable, it will cause this warning. Note that this doesn't always cause an error, because the relevant code might never be executed. W450 THE DOCUMENTOR IS NOT ALWAYS RIGHT There is no way to get this warning to come up; it isn't even written anywhere in C-INTERCAL's source code, is not implemented by anything, and there are no circumstances in which it is even meant to come up. It is therefore not at all obvious why it is documented. W534 KEEP LOOKING AT THE TOP BIT C-INTERCAL uses a slightly different typing mechanism to some other INTERCAL 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 a case has come up or not, but if the compiler or optimizer thinks that such a case might have come up, it will issue this warning. W622 WARNING TYPE 622 ENCOUNTERED Your code looks like it's trying to resume by 0; this is an error. This warning is produced at compile time if it looks like a line in your code will cause this error, but it isn't necessarily an error because that line of code might never be executed.  File: ick.info, Node: The yuk debugger, Next: Syntax, Prev: Errors and Warnings, Up: Top 4 The yuk debugger ****************** The C-INTERCAL 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 '-y' (*note -y::) to the command line of 'ick' 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.) yuk can also be used as a profiler using the '-p' option (*note -p::); this produces a file 'yuk.out' containing information on how much time was spent running each command in your program, and does not prompt for debugger commands. Note that some command line arguments are incompatible with the debugger, such as '-m' and '-f'. In particular, this means that multithreaded programs and programs that use backtracking cannot be debugged using this method; the '+printflow' option (*note +printflow::) to a compiled program may or may not be useful for debugging multithreaded programs. 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, 'yuk007 ', to let you know you can input a command. 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 '.', ',', ':' or ';' followed by a number in decimal; note that some commands only allow onespot and twospot variables as arguments). Command Description -------------------------------------------------------------------------- aLINE All non-abstained commands on line LINE become abstained from once. bLINE A breakpoint is set on line LINE. The breakpoint causes execution with 'c' to stop when it is reached. c The program is run until it ends (which also ends the debugger) or a breakpoint is reached. dLINE Any breakpoint that may be on line LINE is removed. eLINE An explanation of the main expression in each command on line LINE is printed to the screen. The explanation is in the same format as the format produced by '-h' (*note -h::) and shows what the optimiser optimised the expression to (or the original expression if the optimiser wasn't used). fLINE Removes the effect of the 'm' command on line LINE. gLINE Causes the current command to be the first command on LINE (if not on that line already) or the next command on LINE, as if that line was 'NEXT'ed to and then that 'NEXT' stack item was forgotten. h 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. iVAR Causes variable VAR to become 'IGNORE'd, making it read-only. jVAR Causes variable VAR to become 'REMEMBER'ed, making it no longer read-only. k Continues executing commands until the 'NEXT' stack is the same size or smaller than it was before. In other words, if the current command is not a 'NEXT' and doesn't have a 'NEXT FROM' aiming at it, one command is executed; but if a 'NEXT' does happen, execution will continue until that 'NEXT' returns or is forgotten. A breakpoint or the end of the program also end this. lLINE Lists 10 lines of source code either side of line LINE, the same way as with 'h', but using a line stated in the command rather than the current line. mLINE Produces a message onscreen every time a command on line LINE is executed, but without interrupting the program. n Show the 'NEXT' stack on the screen. o Continue executing commands until the 'NEXT' stack is smaller than it was before. If you are using 'NEXT'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. p Displays the value of all onespot and twospot variables. q Aborts the current program and exits the debugger. rLINE Reinstates once all abstained commands on line LINE. s Executes one command. t Continues execution until the end of the program or a breakpoint: each command that executes is displayed while this command is running. uLINE Continues execution of the program until just before a command on line LINE is run (or a breakpoint or the end of the program). vVAR Adds a 'view' on variable VAR (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 'm' or 't' commands). w Displays the current line and current command onscreen. xVAR Removes any view and any action that may be associated with it on variable VAR (which must be onespot or twospot). yVAR Adds a view on variable VAR; also causes a break, as if a breakpoint was reached, whenever the value of that variable changes. zVAR Adds a view on variable VAR; also causes a break, as if a breakpoint was reached, whenever that variable's value becomes 0. VAR A onespot or twospot variable written by itself prints out the value of that variable. -' (on UNIX/Linux) or '-' (on Windows/DOS); this will cause the current command to finish running and the debugger prompt to come back up.  File: ick.info, Node: Syntax, Next: Expressions, Prev: The yuk debugger, Up: Top 5 Syntax ******** INTERCAL 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. Whitespace is generally insignificant in INTERCAL 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. An INTERCAL statement consists of an optional line label, a statement identifier, an optional execution chance, the statement itself (*note Statements::), and optionally 'ONCE' or 'AGAIN'. * Menu: * Princeton and Atari Syntax:: There are two syntaxes for INTERCAL * Line Labels:: Allowing lines to be referred to * Statement Identifiers:: Marking the start of a statement * Execution Chance:: Statements that might not execute * ONCE and AGAIN:: Self-abstaining and self-reinstating statements  File: ick.info, Node: Princeton and Atari Syntax, Next: Line Labels, Up: Syntax 5.1 Princeton and Atari Syntax ============================== The history of INTERCAL 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). Princeton syntax ---------------- INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ some versions version 0.18+ all versions no The original INTERCAL-72 compiler was the Princeton compiler, which introduced what has become known as the Princeton syntax for INTERCAL; this is the syntax used in the original manual, for instance, and can be considered to be the 'original' or 'official' INTERCAL 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 'V', backspace, '-', 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 CLC-INTERCAL compiler, which is the de facto standard for expanding the Princeton syntax to modern INTERCAL features that are not found in INTERCAL-72; 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, CLC-INTERCAL uses the Latin-1 yen symbol for this, which just to make things confusing, refers to a mingle in modern Atari syntax). Atari syntax ------------ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ some versions yes version 0.05+ yes The other main syntax is the Atari syntax, so called because it was originally described in notes about an "Atari implementation" added to the paper INTERCAL-72 manual when it was softcopied in 1982. These notes describe a never-completed compiler implementation for 6502 by Mike Albaugh and Karlina Ott; it was meant to use the Atari 800 cartrtidge and screen editor, but that portion was never written. The syntax was designed to work better on ASCII-based systems, by avoiding the change character (although it can still be written as 'c', backspace, '/', which the Atari compiler documentation claims that the Princeton compiler supported) in favour of a 'big money' character ('$'), and using the 'what' ('?') as an alternative character for exclusive-or. This is the syntax that C-INTERCAL and J-INTERCAL have always used, and is the one most commonly used for communicating INTERCAL 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 INTERCAL-72 is normally taken to be that used by the C-INTERCAL compiler, because it is the only Atari-syntax-based compiler that contains non-INTERCAL-72 constructs that actually need their own notation.  File: ick.info, Node: Line Labels, Next: Statement Identifiers, Prev: Princeton and Atari Syntax, Up: Syntax 5.2 Line Labels =============== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions The first part of an INTERCAL statement is a line label that specifies what its line number is. This is optional; it's legal 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. A line label is a integer expressed in decimal within a wax/wane pair ('(' and ')'). For instance, this is a valid line label: (1000) 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. It has become reasonably customary for people writing INTERCAL 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 INTERCAL library, it may be a good idea to look at the existing libraries (in the 'pit/lib' directory in the C-INTERCAL 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.  File: ick.info, Node: Statement Identifiers, Next: Execution Chance, Prev: Line Labels, Up: Syntax 5.3 Statement Identifiers ========================= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions 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. The main statement identifier is 'DO'. It also has two synonyms, 'PLEASE' and 'PLEASE DO'; 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. Adding 'NOT' or 'N'T' to the end of any of these identifiers, to create a statement identifier such as 'DO NOT' or 'PLEASE DON'T', 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: PLEASE NOTE: This is a comment. The statement identifier ('PLEASE NOT') is the only part of this statement that is valid INTERCAL; however, because the statement identifier is in the negated form that contains 'NOT', the syntax error won't be executed, and therefore this is a valid statement. (In INTERCAL, syntax errors happen at runtime, so a program containing a statement like 'DOUBT THIS WILL WORK' will still compile, and will not end due to the syntax error unless that statement is actually executed. *Note E000::.) The 'ABSTAIN' and 'REINSTATE' statements can override the 'NOT' or otherwise on a statement identifier; see *note ABSTAIN::. In backtracking programs, 'MAYBE' is also a valid statement identifier; see *note MAYBE::. It comes before the other keywords in the statement identifier, and an implicit 'DO' is added if there wasn't one already in the statement identifier (so 'MAYBE', 'MAYBE DO', 'MAYBE DON'T', 'MAYBE PLEASE', and so on are all valid statement identifiers).  File: ick.info, Node: Execution Chance, Next: ONCE and AGAIN, Prev: Statement Identifiers, Up: Syntax 5.4 Execution Chance ==================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions version 0.02+ all versions 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 INTERCAL, although it is the only way to introduce randomness into a program. (The C-INTERCAL 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 ('%') 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 'DO %40 WRITE OUT #1' has a 40% chance of writing out 'I', but the statement 'DON'T %40 WRITE OUT #1' has no chance of writing out 'I' or anything else, because the 'N'T' prevents it running and the double-oh-seven cannot override that.  File: ick.info, Node: ONCE and AGAIN, Prev: Execution Chance, Up: Syntax 5.5 ONCE and AGAIN ================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.25+ no no The last part of a statement is an optional 'ONCE' or 'AGAIN'. 'ONCE' specifies that the statement is self-abstaining or self-reinstating (this will be explained below); 'AGAIN' 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 'ONCE' on an initially reinstated statement or 'AGAIN' on an initially abstained statement indicates a self-abstention, and a 'ONCE' on an initially abstained statement or 'AGAIN' on an initially reinstated statement indicates a self-reinstatement. 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 a 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 'ONCE' effectively changes to an 'AGAIN'; the 'ONCE' only happens once, as might be expected. 'REINSTATING' a currently abstained self-abstaining statement or 'ABSTAINING' (that is, with the 'ABSTAIN' or 'REINSTATE' commands) a currently reinstated self-reinstating statement causes the 'AGAIN' on the statement to change back into a 'ONCE', so the statement will again self-abstain or self-reinstate. Likewise, 'REINSTATING' a currently abstained self-reinstating statement or 'ABSTAINING' a currently reinstated self-abstaining statement causes its 'ONCE' to turn into an 'AGAIN'. Historical note: 'ONCE' was devised by Malcom Ryan as a method of allowing synchronisation between threads in a multithreaded program ('ONCE' is atomic with the statement it modifies, that is, there is no chance that threads will change between the statement and the 'ONCE'). 'AGAIN' 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 'ONCE's to happen multiple times, which is needed to implement some multithreaded algorithms).  File: ick.info, Node: Expressions, Next: Statements, Prev: Syntax, Up: Top 6 Expressions ************* Many INTERCAL statements take expressions as arguments. Expressions are made up out of operands and operators between them. Note that there is no operator precedence in INTERCAL; different compilers resolve ambiguities different ways, and some versions of some compilers (including the original INTERCAL-72 compiler) will cause error messages on compiling or executing an ambiguous expression, so it's safest to fully group each expression. * Menu: * Constants and Variables:: The basic operands that make up expressions * Grouping Rules:: How to specify grouping in expressions * Operators:: Joining operands into more complex expressions  File: ick.info, Node: Constants and Variables, Next: Grouping Rules, Up: Expressions 6.1 Constants and Variables =========================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions The basic operands in INTERCAL 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 INTERCAL, but by default C-INTERCAL turns this off because it carries an efficiency penalty and can be confusing; this can be turned on with the '-v' option (*note -v::).) 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 *note Mingle::.) A constant is written as a mesh ('#') 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, '#100' has 100 as its value, and it's strongly advised not to change the value of a constant during the execution of a program. 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 ('.', ':', ',', and ';') 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 C-INTERCAL before version 0.7.) 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, '.1' and '.001' are the same variable, onespot number 1. Array variables need to be dimensioned before they are used, by assigning dimensions to them; see *note Calculate::.  File: ick.info, Node: Grouping Rules, Next: Operators, Prev: Constants and Variables, Up: Expressions 6.2 Grouping Rules ================== Because there are no operator precedences in INTERCAL, there are various solutions to specifying what precedences actually are. The portable solution All known versions of INTERCAL accept the INTERCAL-72 grouping rules. These state that it's possible to specify that an operator takes precedence by grouping it inside sparks (''') or rabbit-ears ('"'), the same way as wax/wane pairs (parentheses) are used in other programming languages. INTERCAL-72 and earlier C-INTERCAL versions demanded that expressions were grouped fully like this, and this practice is still recommended because it leads to portable programs and is easier to understand. Whether sparks or rabbit-ears (often called just 'ears' for short) are used normally doesn't matter, and programmers can use one or the other for clarity or for aesthetic appeal. (One common technique is to use just sparks at the outermost level of grouping, just ears at the next level, just sparks at the next level, and so on; but expressions like '''#1~#2'~"#3~#4"'~#5' are completely unambiguous, at least to the compiler.) There are, however, some complicated situations involving array subscripting where it is necessary to use sparks and ears at alternate levels, if you want to write a portable program. This limitation is in C-INTERCAL to simplify the parsing process; INTERCAL-72 has the same limitation, probably for the same reason. Compare these two statements: DO .1 <- ,3SUB",2SUB.1".2 DO .1 <- ,3SUB",2SUB.1".2~.3"".4 The problem is that in the first statement, the ears close a group, and in the second statement, the ears open a group, and it's impossible to tell the difference without unlimited lookahead in the expression. Therefore, in similar situations (to be precise, in situations where a group is opened inside an array subscript), it's necessary to use the other grouping character to the one that opened the current group if you want a portable program. One final comment about sparks and rabbit-ears; if the next character in the program is a spot, as often happens because onespot variables are common choices for operands, a spark and the following spot can be combined into a wow ('!'). Unfortunately, the rabbit-ear/spot combination has no one-character equivalent in any of the character sets that C-INTERCAL accepts as input (UTF-8, Latin-1, and ASCII-7) as none of these contain the rabbit character, although the Hollerith input format that CLC-INTERCAL can use does. Positional precedences: CLC-INTERCAL rules The precedence rules used by CLC-INTERCAL for grouping when full grouping isn't used are simple to explain: the largest part of the input that looks like an expression is taken to be that expression. The main practical upshot of this is that binary operators right-associate; that is, '.1~.2~.3' is equivalent to '.1~'.2~.3''. C-INTERCAL versions 0.26 and later also right-associate binary operators so as to produce the same results as CLC-INTERCAL rules in this situation, but as nobody has yet tried to work out what the other implications of CLC-INTERCAL rules are they are not emulated in C-INTERCAL, except possibly by chance. Prefix and infix unary operators In INTERCAL-72 and versions of C-INTERCAL before 0.26, unary operators were always in the 'infix' position. (If you're confused about how you can have an infix unary operator: they go one character inside a group that they apply to, or one character after the start of a constant or variable representation; so for instance, to portably apply the unary operator '&' to the variable ':1', write ':&1', and to portably apply it to the expression ''.1~.2'', write ''&.1~.2''.) CLC-INTERCAL, and versions of C-INTERCAL from 0.26 onwards, allow the 'prefix' position of a unary operator, which is just before whatever it applies to (as in '&:1'). This leads to ambiguities as to whether an operator is prefix or infix. The portable solution is, of course, to use only infix operators and fully group everything, but when writing for recent versions of C-INTERCAL, it's possible to rely on its grouping rule, which is: unary operators are interpreted as infix where possible, but at most one infix operator is allowed to apply to each variable, constant, or group, and infix operators can't apply to anything else. So for instance, the C-INTERCAL ''&&&.1~.2'' is equivalent to the portable ''&"&.&1"~.2'' (or the more readable version of this, '"&'"&.&1"~.2'"', which is also portable). If these rules are counter-intuitive to you, remember that this is INTERCAL we're talking about; note also that this rule is unique to C-INTERCAL, at least at the time of writing, and in particular CLC-INTERCAL is likely to interpret this expression differently.  File: ick.info, Node: Operators, Prev: Grouping Rules, Up: Expressions 6.3 Operators ============= 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 *note Prefix and infix unary operators:: 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 INTERCAL-72 operators; many INTERCAL extensions add their own operators. * Menu: * Mingle:: Interleaving bits in two operands * Select:: Selecting from one operand according to another * Unary Binary Logic:: Binary logic on adjacent bits of an operand * Array Subscript:: Selecting elements of arrays  File: ick.info, Node: Mingle, Next: Select, Up: Operators 6.3.1 Mingle ------------ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions Mingle, or interleave, is one of the two binary operators in INTERCAL-72. However, different INTERCAL 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. The original INTERCAL-72 compiler (the Princeton compiler) used the 'change' (cent) character for a mingle, represented as 'c', backspace, '/'. (By the way, this is still the most portable way to write a mingle; both C-INTERCAL and CLC-INTERCAL accept it, at least if a lowercase 'c' is used, the Atari compiler was to accept it, and its documentation claimed that the Princeton compiler also accepted it; CLC-INTERCAL also accepts a capital 'C' before the backspace and '/', and allows '|' rather than '/'.) The uncompleted Atari compiler intended to use a 'big money' character ('$') as the mingle character; this character is also the only one accepted for mingle by the J-INTERCAL compiler. C-INTERCAL originally also used the '$' character for mingle, and this character is the one most commonly seen in existing C-INTERCAL programs, and most often used when giving examples of INTERCAL on Usenet, because it exists in the ASCII-7 character set, and because it doesn't contain control characters. From version 0.18 of C-INTERCAL 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. CLC-INTERCAL 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 '$', but it's important to bear in mind that this character is not the most portable choice. 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; C-INTERCAL 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; C-INTERCAL 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 a mingle.) 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. One of the most common uses of interleaving is to create a constant with a value greater than 65535; for instance, 65536 is '#0$#256'. 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.  File: ick.info, Node: Select, Next: Unary Binary Logic, Prev: Mingle, Up: Operators 6.3.2 Select ------------ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions The select operator is one of the two binary operators in INTERCAL-72; unlike mingle, every known implementation of INTERCAL ever has used the sqiggle character ('~') as the representation of the select operator, meaning that writing it portably is easy. The select operator takes two arguments, which can be of either datatype (that is, 16- or 32-bit). It returns a value made by selecting certain bits of its first operand indicated by the second operand, and right-justifying them. What it does is 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 INTERCAL-72 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 '#21~:1' produces a 32-bit result because 17 bits were selected, even though many of the leading bits were zeros; in C-INTERCAL the data type of the result is the same as of the right operand of the select, so that it can be determined at compile 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, '#21~:1' produces 21 as its result if :1 has the value 131061, 10 as its result if :1 has the value 30 (1E in hex; the least significant bit of 21 is removed because it corresponds to a 0 in :1), and 7 as its result if :1 has the value 21 (because three bits in 21 are set, and those three bits from 21 are therefore selected by 21). Select is used for right-shifts, to select every second bit from a number (either to produce what will eventually become an argument to 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.  File: ick.info, Node: Unary Binary Logic, Next: Array Subscript, Prev: Select, Up: Operators 6.3.3 Unary Binary Logic ------------------------ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions There are three unary operators in INTERCAL-72, 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 ('&') and book ('V') 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 'V', backspace, '-', in the Princeton INTERCAL-72 implementation, and this is still the most portable way to write it (C-INTERCAL and CLC-INTERCAL accept it). The Atari implementation of INTERCAL-72 wrote it with a what ('?'), and this is the representation originally used by C-INTERCAL (and still accepted), the only representation accepted by J-INTERCAL, 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). CLC-INTERCAL approximates a bookworm with the yen character, which being a currency character is one of the possible representations for mingle in C-INTERCAL; C-INTERCAL 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 CLC-INTERCAL doesn't support UTF-8.) In the same way, CLC-INTERCAL has a C-INTERCAL compatibility option to allow the use of '?' for exclusive-or. 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, '#&26' is 16 (26 is 1A in hexadecimal or 11010 in binary); '#V26' is 31 (11111 in binary), and '#?26' is 23 (10111 in binary). 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 INTERCAL, 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 INTERCAL-72 system library: 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 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): ((_1~:2)~((?32(:2~:2))^#2147483648))->(_1>(:2^_1)) (Here, the ^ refers to a bitwise exclusive or, an operation found in OIL but not in INTERCAL, which is why the INTERCAL version is so much longer.) The INTERCAL version also has some extra code to check for equality and to produce 1 or 2 as the output rather than 0 or 1.  File: ick.info, Node: Array Subscript, Prev: Unary Binary Logic, Up: Operators 6.3.4 Array Subscript --------------------- INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes version 0.7+ all versions all versions 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 'SUB'. Note that an array element is not a variable, so it is not accepted as an acceptable argument to statements like 'IGNORE'; however, it can be assigned to. The syntax for an array element is the array, followed by the keyword 'SUB', 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 'SUB' 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. For instance, this is a legal (but not particularly useful) INTERCAL program with no syntax errors that shows some of the syntaxes possible with array subscripting: 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 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 *note Grouping Rules::.  File: ick.info, Node: Statements, Next: System Libraries, Prev: Expressions, Up: Top 7 Statements ************ There is a wide range of statements available to INTERCAL programs; some identifiably belong to a particular variant or dialect (such as Backtracking INTERCAL), but others can be considered to be part of the 'core language'. The statements listed here are those that the C-INTERCAL 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 INTERCAL; known incompatibilities are listed here, but it's important to check your program on multiple compilers when attempting to write a portable program. * Menu: * Syntax Error:: Why use a deliberate syntax error? * Calculate:: Assigning to variables and arrays * NEXT FORGET and RESUME:: INTERCAL-72-style flow control * STASH and RETRIEVE:: Value stacks and scoping * IGNORE and REMEMBER:: Creating read-only variables * ABSTAIN and REINSTATE:: Dynamic DOs and DON'Ts * READ OUT and WRITE IN:: INTERCAL input and output * GIVE UP:: How to end a program * TRY AGAIN:: Control flow without loops * COME FROM and NEXT FROM:: Time-reversed GOTO  File: ick.info, Node: Syntax Error, Next: Calculate, Up: Statements 7.1 Syntax Error ================ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes version 0.15+ all versions all versions One of the more commonly-used commands in INTERCAL is the syntax error. A properly-written syntax error looks nothing like any known INTERCAL command; a syntax error that looks vaguely like a command but isn't may confuse C-INTERCAL before version 0.28, 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. 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: DOUBLE OR SINGLE PRECISION ARITHMETIC OVERFLOW This is a valid INTERCAL command, that produces an error when run (note the 'DO' at the start). An even more common use is to produce an initially abstained syntax error by using an appropriate statement identifier, for instance PLEASE NOTE THAT THIS IS A COMMENT 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 'PLEASE NOT'; the extra 'E' causes the command to be a syntax error, and this particular construction is idiomatic.) 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 CLC-INTERCAL (version 1.-94.-3 and later, with 'COMMENT', 'COMMENTS', or 'COMMENTING'), and C-INTERCAL ('COMMENT' in version 0.26 and later, and also 'COMMENTS' and 'COMMENTING' 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.  File: ick.info, Node: Calculate, Next: NEXT FORGET and RESUME, Prev: Syntax Error, Up: Statements 7.2 Calculate ============= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions At present, the only INTERCAL command that contains no keywords (apart from the statement identifier and possibly 'ONCE' or 'AGAIN') 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: DO .1 <- ':2~:3'~#55 That is, the command is written as a variable or array element, then the '<-' 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 'BY' to cause the array to become multidimensional; so for a 3 by 4 by 5 array, it would be possible to write DO ,1 <- #3 BY #4 BY #5 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. The gerund to refer to calculations is 'CALCULATING'; however, if you are planning to use this, note that a bug in older versions of C-INTERCAL means that assignments to arrays are not affected by this gerund before version 0.27. CLC-INTERCAL from 1.-94.-4 onwards, and C-INTERCAL from 0.26 onwards, allow arbitrary expressions on the left hand side of an assignment (C-INTERCAL only if the '-v' option is used); for more information on how such 'reverse assignments' work, see *note Operand Overloading::.  File: ick.info, Node: NEXT FORGET and RESUME, Next: STASH and RETRIEVE, Prev: Calculate, Up: Statements 7.3 NEXT, FORGET and RESUME =========================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions see text all versions The only flow-control commands in INTERCAL-72 were 'NEXT', 'RESUME', and 'FORGET'; together these manipulate a stack of locations in the program known as the 'NEXT stack'. Although all INTERCAL compilers have implemented these, from CLC-INTERCAL version 0.05 onwards CLC-INTERCAL 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 INTERCAL-72 implements nothing else.) Note that there is a strict limit of 80 locations on the NEXT stack, enforced by all known INTERCAL compilers; this helps to enforce good programming style, by discouraging NEXT-stack leaks (which are otherwise quite easy to write). Here are examples to show the syntax of these three statements: DO (1000) NEXT DO FORGET '.1~.1'~#1 DO RESUME .5 The 'NEXT' command takes a line label as its argument (unlike most other INTERCAL commands, it comes after its argument rather than before); both 'FORGET' and 'RESUME' take expressions. (CLC-INTERCAL from version 0.05 onwards also allows an expression in 'NEXT', rather than a label, to give a computed 'NEXT', but this behaviour was not implemented in other compilers, and is deprecated in CLC-INTERCAL along with noncomputed 'NEXT'; if computed 'NEXT' is ever implemented in C-INTERCAL, it will likely likewise be deprecated upon introduction). (Update: it was implemented in C-INTERCAL version 0.28, but only as part of the external calls system, so it cannot be used in ordinary programs; a sample expansion library gives in-program access to a limited form of computed 'NEXT', but should probably not be used.) Running a 'NEXT' 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 'NEXT' command on the top of the NEXT stack. In order to remove items from the 'NEXT' stack, to prevent it filling up (which is what happens with a naive attempt to use the 'NEXT' command as an equivalent to what some other languages call GOTO), it is possible to use the 'FORGET' or 'RESUME' commands. They each remove a number of items from the NEXT stack equal to their argument; 'RESUME' also transfers control flow to the last location removed from the 'NEXT' stack this way. Trying to remove no items, or more items than there are in the stack, does not cause an error when 'FORGET' is used (no items or all the items are removed respectively); however, both of these cases are errors in a 'RESUME' statement. Traditionally, boolean values in INTERCAL 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 INTERCAL-72 is by 'NEXTING', then 'NEXTING' again, then 'RESUMING' either by 1 or 2 according to an expression, and then if the expression evaluated to 1 'FORGETTING' the remaining NEXT stack entry. By the way, the previous sentence also explained what the appropriate gerunds are for 'NEXT', 'RESUME', and 'FORGET'.  File: ick.info, Node: STASH and RETRIEVE, Next: IGNORE and REMEMBER, Prev: NEXT FORGET and RESUME, Up: Statements 7.4 STASH and RETRIEVE ====================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions The NEXT stack is not the only stack available in an INTERCAL program; each variable used in the program also has its own stack, which holds values of the same type as the variable. The 'STASH' command pushes a variable's value onto that variable's stack; 'RETRIEVE' 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 INTERCAL commands, with the word 'STASH' or 'RETRIEVE' followed by the variable or variables to stash or retrieve: DO STASH .1 + ;2 DO RETRIEVE ,3 Note that it is possible to stash or retrieve multiple variables at once, by listing their names separated by intersections ('+'); it's even possible to stash or retrieve a variable twice in the same statement. It is not entirely clear how 'RETRIEVE' interacts with 'IGNORE' in historical INTERCAL-72 compilers; the three modern INTERCAL compilers all use different rules for the interaction (and the C-INTERCAL maintainers recommend that if anyone decides to write their own compiler, they choose yet another different rule so that looking at the interaction (the so-called 'ignorret test') can be used as a method of determining which compiler is running): * C-INTERCAL treats a retrieval just like an assignment. That is, a read-only variable will not be changed by a retrieval, and will remain read-only, but the side-effect of popping that variable's stash will still happen. * J-INTERCAL ignores the read-only status of a variable when retrieving it from a stash; the value of the variable changes despite being read-only. The variable remains read-only; the 'RETRIEVE' simply allows a change to its value despite the read-only status. * CLC-INTERCAL is the most complicated; it stores read-only status or otherwise in the stash, along with the variable's value. This means that if a variable was stashed when read-only, retrieving it will retrieve its value and set it to read-only regardless of its previous read-only status; likewise, if a variable was stashed when read-write, retrieving it will retrieve its value and set it to read-write even if it was previously read-only. The appropriate gerunds for 'STASH' and 'RETRIEVE' are 'STASHING' and 'RETRIEVING' respectively.  File: ick.info, Node: IGNORE and REMEMBER, Next: ABSTAIN and REINSTATE, Prev: STASH and RETRIEVE, Up: Statements 7.5 IGNORE and REMEMBER ======================= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions Variables in INTERCAL can be either read-write or read-only. At the start of a program, all variables are read-write, but this status can be changed dynamically during execution of a program using the 'IGNORE' and 'REMEMBER' statements (whose gerunds are 'IGNORING' and 'REMEMBERING' respectively). The syntax is the same as for 'STASH' and 'RETRIEVE': the command's name followed by an intersection-separated list of variables. For instance: DO IGNORE .4 DO REMEMBER ,4 + ;5 Using the 'IGNORE' statement sets a variable to be read-only (or does nothing if it's read-only already); 'REMEMBER' 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. The interaction between 'IGNORE' and 'RETRIEVE' was never defined very clearly, and is in fact different in C-INTERCAL, CLC-INTERCAL and J-INTERCAL; for more details, see *note RETRIEVE::.  File: ick.info, Node: ABSTAIN and REINSTATE, Next: READ OUT and WRITE IN, Prev: IGNORE and REMEMBER, Up: Statements 7.6 ABSTAIN and REINSTATE ========================= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions 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 'ABSTAIN' and 'REINSTATE'. 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 CLC-INTERCAL versions), and one which takes an intersection-delimited list of gerunds. They look like this: DO ABSTAIN FROM ABSTAINING + REINSTATING DO ABSTAIN FROM (10) DO REINSTATE CALCULATING DO REINSTATE (22) (This also illustrates the gerunds used for these commands; note that 'ABSTAINING' from 'REINSTATING' 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 'ABSTAIN' and/or 'REINSTATE' won't abstain from a command that's already abstained, or reinstate a command that's already reinstated. There is a strange set of restrictions on 'ABSTAIN' and 'REINSTATE' that has existed since INTERCAL-72; historically such restrictions have not always been implemented, or have not been implemented properly. They together define an unusual interaction of 'ABSTAIN' and 'GIVE UP' (note, for instance, that there isn't a gerund for 'GIVE UP'). The wording used in the INTERCAL-72 manual is: [...] 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. This restriction was not implemented at all in the only CLC-INTERCAL version before 0.02 (i.e. version 0.01), or in C-INTERCAL versions before 1.26. The restriction was implemented in C-INTERCAL version 1.26 and CLC-INTERCAL versions 0.02 and later as "'GIVE UP' cannot be 'REINSTATED' or 'ABSTAINED FROM'"; however, this is not strictly the same as the definition used by INTERCAL-72 (C-INTERCAL still uses this definition in CLC-INTERCAL compatibility mode). The J-INTERCAL implementation of this restriction is to make 'REINSTATING' or 'ABSTAINING' from a line label that refers to a 'GIVE UP' statement a compile-time error, but this does not fit the INTERCAL-72 definition either. The definition adopted with version 0.27 and later of C-INTERCAL, which is hopefully correct, is to allow abstaining from a 'GIVE UP' 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). As well as CLC-INTERCAL's extension to abstain/reinstate by computed line number, there is also (since version 0.25) a C-INTERCAL-specific extension to 'ABSTAIN', also known as 'computed abstain', but with a different syntax and different semantics. It's written like an ordinary 'ABSTAIN', but with an expression between the words 'ABSTAIN' and 'FROM', for instance: DO ABSTAIN #1 FROM (1000) DO ABSTAIN .2 FROM WRITING IN Unlike non-computed 'ABSTAIN', this form 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. There are many uses for 'ABSTAIN' (both the computed and non-computed versions) and 'REINSTATE', especially when interacting with 'ONCE' and 'AGAIN' (*note ONCE and AGAIN::); 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.  File: ick.info, Node: READ OUT and WRITE IN, Next: GIVE UP, Prev: ABSTAIN and REINSTATE, Up: Statements 7.7 READ OUT and WRITE IN ========================= The 'READ OUT' and 'WRITE IN' commands are the output and input commands in INTERCAL; they allow communication between the program and its user. There was a numeric I/O mechanism implemented in INTERCAL-72, 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 C-INTERCAL and CLC-INTERCAL. The syntax of 'READ OUT' and 'WRITE IN' 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 be different for different elements in the list. * Menu: * INTERCAL-72 I/O:: Spelt-out numbers and Roman numerals * C-INTERCAL I/O:: The Turing Tape I/O system * CLC-INTERCAL I/O:: Baudot and mingled binary  File: ick.info, Node: INTERCAL-72 I/O, Next: C-INTERCAL I/O, Up: READ OUT and WRITE IN 7.7.1 INTERCAL-72 I/O --------------------- INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions see text all versions INTERCAL-72 had its own versions of I/O commands; these commands are available in all modern INTERCAL compilers as well (but CLC-INTERCAL implements output slightly differently). To distinguish INTERCAL-72 input and output from the other more modern types of I/O, the 'READ OUT' and 'WRITE IN' 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 'READ OUT') a constant, meaning that these are some examples of the possible forms: READ OUT .1 READ OUT ;2 SUB .3:4 READ OUT #3 WRITE IN :4 WRITE IN ,5 SUB #6 The statements do what you would expect; 'READ OUT' outputs its argument to the user, and 'WRITE IN' 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 'WRITE IN' 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. 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 'ONE TWO THREE FOUR FIVE' as input (if they were using English, the most portable choice of language). In INTERCAL-72 only English is accepted as a language, but other compilers accept other languages in addition. C-INTERCAL 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. J-INTERCAL accepts the same languages, except with Esperanto instead of Latin; from version 0.05 of CLC-INTERCAL onwards, the same list of languages as C-INTERCAL is supported (apart from Latin, which was added in version 1.-94.-8), plus Scottish Gaelic. The format that output can be read in is a modified form of Roman numerals, known as 'butchered' Roman numerals. INTERCAL-72, C-INTERCAL and J-INTERCAL do this the same way; CLC-INTERCAL is somewhat different. The characters 'I', 'V', 'X', 'L', 'C', 'D', and 'M' 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 'XI' is 11 and 'IX' is 9, for instance. In INTERCAL-72, C-INTERCAL, and J-INTERCAL, a bar over a numeral multiplies its value by 1000, and writing a letter in lowercase multiplies its value by 1000000; however, CLC-INTERCAL uses lowercase to represent multiplication by 1000 and for multiplication by 1000000 writes a backslash before the relevant numeral.  File: ick.info, Node: C-INTERCAL I/O, Next: CLC-INTERCAL I/O, Prev: INTERCAL-72 I/O, Up: READ OUT and WRITE IN 7.7.2 C-INTERCAL I/O -------------------- INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.07+ version 0.05+ no C-INTERCAL'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 C-INTERCAL-style I/O is being used, an array must be used as the argument to 'READ OUT' or 'WRITE IN'; as the syntax is the same as for CLC-INTERCAL's I/O, command-line arguments and the capabilities of the version of the compiler being used serve to distinguish the two mechanisms. 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 'WRITE IN' to the next. 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 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 'src/cesspool.c') or at some example C-INTERCAL programs that do text-based I/O.)  File: ick.info, Node: CLC-INTERCAL I/O, Prev: C-INTERCAL I/O, Up: READ OUT and WRITE IN 7.7.3 CLC-INTERCAL I/O ---------------------- INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no see text all versions no There are also two CLC-INTERCAL-specific I/O mechanisms. These are Baudot-based text I/O (which is also implemented from C-INTERCAL version 0.27 onwards), and CLC-INTERCAL generalised binary I/O (not implemented in C-INTERCAL). Baudot text-based I/O is specified by using a tail array as an argument to 'WRITE IN' or 'READ OUT'. (A tail array can also be used to specify C-INTERCAL-style Turing Tape I/O. In order to determine which is used: both C-INTERCAL and CLC-INTERCAL use their own sort of I/O unless a command-line argument instructs them to use the other.) In the case of 'WRITE IN', one line of input is requested from the user (C-INTERCAL requires this to be input in Latin-1, and will then automatically convert it; CLC-INTERCAL 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; CLC-INTERCAL pads with zeros, C-INTERCAL pads with random bits. Trying to input at end-of-file will act as if the input were a blank line. 'READ OUT' is the reverse; it interprets the array as extended Baudot and converts it to an appropriate character set (Latin-1 for C-INTERCAL, or whatever was specified on the command line for CLC-INTERCAL), 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, *note Character Sets::. Generalised binary I/O is specified using a hybrid array as an argument to 'WRITE IN' or 'READ OUT'. 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.  File: ick.info, Node: GIVE UP, Next: TRY AGAIN, Prev: READ OUT and WRITE IN, Up: Statements 7.8 GIVE UP =========== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions all versions all versions The 'GIVE UP' command causes the program to end (or, in a multithreaded program, causes the current thread to end). It is written simply as 'GIVE UP'. 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 'TRY AGAIN', and that it has an unusual interaction with 'ABSTAIN'; for details of this, see *note ABSTAIN::. (Going past the last command in the program is an error.) There is no gerund for 'GIVE UP'; in particular, 'GIVING UP' is a syntax error.  File: ick.info, Node: TRY AGAIN, Next: COME FROM and NEXT FROM, Prev: GIVE UP, Up: Statements 7.9 TRY AGAIN ============= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.25+ no no The 'TRY AGAIN' 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 'TRY AGAIN' 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. The gerund for 'TRY AGAIN' is 'TRYING AGAIN'.  File: ick.info, Node: COME FROM and NEXT FROM, Prev: TRY AGAIN, Up: Statements 7.10 COME FROM and NEXT FROM ============================ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no see text see text see text The 'COME FROM' statement (incidentally also invented in 1972, but not in connection with INTERCAL) is the main control-flow command in CLC-INTERCAL (which deprecates 'NEXT'), and one of two main control flow structures in other modern INTERCAL compilers. It takes either a label or an expression as its argument; these forms are noncomputed 'COME FROM' and computed 'COME FROM'. Noncomputed 'COME FROM' was implemented in version 0.5 of C-INTERCAL, but did not conform to modern-day semantics until version 0.7; it is available in every version of CLC-INTERCAL and J-INTERCAL. Computed 'COME FROM' support is available in every version of CLC-INTERCAL and in C-INTERCAL from version 0.25 onwards, but not in J-INTERCAL; the variant 'NEXT FROM' of 'COME FROM' is available from CLC-INTERCAL version 1.-94.-8 and C-INTERCAL version 0.26 (both computed and noncomputed). C-INTERCAL and CLC-INTERCAL also have a from-gerund form of 'COME FROM' and 'NEXT FROM', which was also implemented from CLC-INTERCAL version 1.-94.-8 and C-INTERCAL version 0.26. The basic rule of 'COME FROM' is that if a 'COME FROM' statement references another statement, whenever that statement is reached, control flow will be transferred to the 'COME FROM' after that statement finishes executing. ('NEXT FROM' is identical except that in addition to the 'COME FROM' 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 itself a 'NEXT'.) Here are examples of noncomputed, computed, and from-gerund 'COME FROM': DO COME FROM (10) DO COME FROM #2$'.1~#1' DO COME FROM COMING FROM (The last example is an infinite loop. If it said 'DO NEXT FROM NEXTING FROM', it would not be an infinite loop because the NEXT stack would overflow and cause an error. This also establishes the gerunds used for 'COME FROM' and 'NEXT FROM'.) There are some things to be careful with involving 'COME FROM' and 'NEXT FROM'. First, if the statement come from or nexted from happens to be a 'NEXT', the 'NEXT' doesn't count as 'finishing executing' until the NEXT stack entry created by the 'NEXT' is 'RESUME'd to. In particular, this means that if 'FORGET' is used to remove the entry, or a 'RESUME' with a large argument resumes a lower entry, the 'COME FROM' doesn't steal execution at all. Second, you may be wondering what happens if two 'COME FROM's or 'NEXT FROM'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 'COME FROM's or 'NEXT FROM'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 'COME FROM's or 'NEXT FROM's are noncomputed, however, a compiler can (but does not have to) give a compile time error if two 'COME FROM's or 'NEXT FROM's share a label, and so that situation should be avoided in portable code. (If it is wanted, one solution that works for C-INTERCAL and CLC-INTERCAL is to use computed 'COME FROM's or 'NEXT FROM's with a constant expression.)  File: ick.info, Node: System Libraries, Next: TriINTERCAL, Prev: Statements, Up: Top 8 System Libraries ****************** Some programming support libraries may be included automatically at the end of your program by the C-INTERCAL compiler. While such a convenience feature might be judged not in the spirit of INTERCAL, the required level of perversity is arguably restored by the way inclusion is triggered: whenever your program refers to a line from specified magic ranges without defining any line in those ranges in the program. (CLC-INTERCAL does not have this feature, but it is trivial to concatenate a copy of any desire library onto the end of the program.) The following table maps magic line ranges to systen libraries. Descriptions of the libraries follow it. * Menu: * syslib:: Base system library * floatlib:: Floating-point library From To Versions Description --------------------------------------------------------------------- (1000) (1999) All Basic System Library (5000) (5999) >=0.29 Floatring Point Library  File: ick.info, Node: syslib, Next: floatlib, Up: System Libraries 8.1 syslib ========== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions no all versions INTERCAL has a system library, called 'syslib' (versions for bases other than 2 will have a numeric suffix on the name). The intention of the system library is to provide a range of useful capabilities, like multiplication, that can otherwise be hard to write in INTERCAL. System library routines are used by 'NEXTING' to their line number (*note NEXT::), where they will make changes to certain variables depending on certain other variables (depending on which routine is called), and 'RESUME' back to the original program. As the system library is itself written in INTERCAL, there are some restrictions that need to be obeyed for calls to it to be guaranteed to work; none of the variables it uses ('.1' to '.6' and ':1' to ':5') 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 'DO ABSTAIN FROM (1500)' or more subtle problems like gerund-abstention) or have 'COME FROM's or 'NEXT FROM's aiming at them. The system library is currently available in all bases from 2 to 7 (*note TriINTERCAL::), but not every command is available in every base, and C-INTERCAL is the only one of the three compilers listed above that has the system library to ship with a version in bases other than 2. (This table was originally based on the INTERCAL-72 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. Line Description Bases ----------------------------------------------------------------------- (1000) .3 <- .1 plus .2, error exit on overflow 2, 3, 4, 5, 6, 7 (1009) .3 <- .1 plus .2, overflow checked 2, 3, 4, 5, 6, 7 (1010) .3 <- .1 minus .2, no action on overflow 2, 3, 4, 5, 6, 7 (1020) .1 <- .1 plus #1, no action on overflow 2, 3, 4, 5, 6, 7 (1030) .3 <- .1 times .2, error exit on overflow 2, 3, 4, 5, 6, 7 (1039) .3 <- .1 times .2, overflow checked 2, 3, 4, 5, 6, 7 (1040) .3 <- .1 divided by .2 2, 3, 4, 5, 6, 7 (1050) .2 <- :1 divided by .1, error exit on overflow 2, 3, 4, 5, 6, 7 (1200) .2 <- .1 times #2, overflow captured in .3 4, 6 (1210) .2 <- .1 divided by #2, one digit after the 4, 6 quartic or sextic point stored in .3 (1500) :3 <- :1 plus :2, error exit on overflow 2, 3, 4, 5, 6, 7 (1509) :3 <- :1 plus :2, overflow checked 2, 3, 4, 5, 6, 7 (1510) :3 <- :1 minus :2, no action on overflow 2, 3, 4, 5, 6, 7 (1520) :1 <- .1 concatenated with .2 2, 3, 4, 5, 6, 7 (1530) :1 <- .1 times .2 2, 3, 4, 5, 6, 7 (1540) :3 <- :1 times :2, error exit on overflow 2, 3, 4, 5, 6, 7 (1549) :3 <- :1 times :2, overflow checked 2, 3, 4, 5, 6, 7 (1550) :3 <- :1 divided by :2 2, 3, 4, 5, 6, 7 (1700) :2 <- :1 times #2, overflow captured in .1 4, 6 (1710) :2 <- :1 divided by #2, one digit after the 4, 6 quartic or sextic point stored in .1 (1720) :2 <- :1 times the least significant digit of 5, 7 .1, overflow captured in .2 (1900) .1 <- uniform random number from #0 to #65535 2, 3, 4, 5, 6, 7 (1910) .2 <- normal random number from #0 to .1, with 2, 3, 4, standard deviation .1 divided by #12 5, 6, 7 If you happen to be using base 2, and are either using the external call system (*note External Calls::) or are willing to use it, it is possible to use a version of the system library written in C for speed, rather than the default version (which is written in INTERCAL). To do this, use the command line options '-eE' (before the INTERCAL file), and 'syslibc' (at the end of the command line).  File: ick.info, Node: floatlib, Prev: syslib, Up: System Libraries 8.2 floatlib ============ INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ yes all versions no all versions INTERCAL also has a floating-point library, called 'floatlib', presently available only in base 2. It is used by several of the demonstration programs shipped with the distribution. In versions after 0.28 it is included automatically at the end of your program by the compiler whenever your program refers to a line from (5000) to (5999) without defining any line in that range in the program. Here is a summary of routines in floatlib.i: Line Description ------------------------------------------------------------------- (5000) :3 <- :1 plus :2 (5010) :3 <- :1 minus :2 (5020) :2 <- the integer part of :1, :3 <- the fractional part of :1 (5030) :3 <- :1 times :2 (5040) :3 <- :1 divided by :2 (5050) :3 <- :1 modulo :2 (5060) :2 <- :1 cast from a two's-complement integer into a floating-point number (5070) :2 <- :1 cast from a floating-point number into the nearest two's-complement ineger (5080) :2 <- :1 cast from a floating-point number into a decimal representation in scientific notation (5090) :2 <- :1 cast from a decimal representation in scientific notation into a floating-point number (5100) :2 <- the square root of :1 (5110) :2 <- the natural logarithm of :1 (5120) :2 <- e to the power of :1 (the exponential function) (5130) :3 <- :1 to the power of :2 (5200) :2 <- sin :1 (5210) :2 <- cos :1 (5220) :2 <- tan :1 (5400) :1 <- uniform random number between zero and one exclusive (5410) :2 <- :1 times phi (5419) :2 <- :1 divided by phi Note: All of the above routines except (5020), (5060), (5080), (5200), (5210), and (5400) also modify .5 as follows: .5 will contain #3 if the result overflowed or if the arguments were out of domain, #2 if the result underflowed, #1 otherwise. (See below.) The INTERCAL floating-point library uses the IEEE format for 32-bit floating-point numbers, which uses bit 31 as a sign bit (1 being negative), bits 30 through 23 hold the exponent with a bias of 127, and bits 22 through 0 contain the fractional part of the mantissa with an implied leading 1. In mathematical notation: 'N = (1.0 + fraction) * 2^(exponent - 127) * -1^sign' Thus the range of floating-point magnitudes is, roughly, from 5.877472*10^-39 up to 6.805647*10^38, positive and negative. Zero is specially defined as all bits 0. (Actually, to be precise, zero is defined as bits 30 through 0 as being 0. Bit 31 can be 1 to represent negative zero, which the library generally treats as equivalent to zero, though don't hold me to that.) Note that, contrary to the IEEE standard, exponents 0 and 255 are not given special treatment (besides the representation for zero). Thus there is no representation for infinity or not-a-numbers, and there is no gradual underflow capability. Conformance with widely-accepted standards was not considered to be a priority for an INTERCAL library. (The fact that the general format conforms to IEEE at all is due to sheer pragmatism.)  File: ick.info, Node: TriINTERCAL, Next: Multithreading and Backtracking, Prev: System Libraries, Up: Top 9 TriINTERCAL ************* INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.7+ version no 1.-94.-8+ One extension to INTERCAL that is implemented by both C-INTERCAL and CLC-INTERCAL is known as TriINTERCAL, and extends INTERCAL to bases other than binary. Unlike ordinary INTERCAL programs, which have the extension '.i', TriINTERCAL programs in bases from 3 to 7 (the only allowed bases) have extensions from '.3i' to '.7i' respectively. 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: * Exclusive-or becomes two operators, known either as subtract-without-borrow and add-without-carry due to their mathematical interpretations, or what and sharkfin after their Atari syntax representations ('?' and '^'). (In Princeton syntax, these are the bookworm or yen sign, and a spike ('|').) The two operators do the same thing in binary, but differ in higher bases. (Nevertheless, it is an error to use a sharkfin in binary, because it is a so-called 'controlled unary operator', as are the rest of the new operators defined in this section, which has a lower limit on which base it is allowed in.) Instead of doing the exclusive-or operation, the bits being combined are either subtracted or added; if the result is out of range for the base being used, the base is added or subtracted from the result until it is in range. (For the subtraction, the bit that was less significant is subtracted from the bit that was more significant in any given pair of bits, except for the subtraction between the most and least significant bits, where the most significant bit is subtracted from the least.) * The AND and OR operators are generalised into an entire sequence of operators; the number of operators available is the same as the base that is being used. In base 3, the third operator is known as BUT; in other bases, there are no commonly accepted names for the extra operators, 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 0 if either argument is a 0, and otherwise a 1, and likewise, an OR gives the result 1 if either argument is a 1, and otherwise a 0; they could be said to favour 0 over 1 and 1 over 0 respectively. In base 3, AND favours 0 over 2 over 1, OR favours 2 over 1 over 0, and BUT favours 1 over 0 over 2. (The symbol for BUT is '@' (a 'whirlpool', which is another name for the BUT operation) in Atari syntax, and '?' in Princeton syntax.) The pattern continues: in base 4, AND favours 0 over 3 over 2 over 1, BUT favours 1 over 0 over 3 over 2, 2BUT (written '2@' or '2?') favours 2 over 1 over 0 over 3, and OR favours 3 over 2 over 1 over 0. (This can be extended to higher bases following the same pattern, introducing operators '3@' or '3?', etc., to favour 3, etc., when neither AND (which always favours 0) nor OR (which favours the highest digit in the base) are available.) All the whirlpool operators are controlled unary operators, which are only legal when both the base contains the favoured digit, and they aren't redundant to AND nor OR. * Select has its semantics modified to deal with more than one nonzero digit in the base. It starts off by doing an AND (in whatever base is being used) between the two numbers being selected; then the bits of the result are sorted by the bits of the right-hand argument to the select, with bits corresponding to 0s in the right-hand argument ending up more significant than bits corresponding to high digits in the right-hand argument. In base 2, this has the same effect as a traditional-style select. 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.)  File: ick.info, Node: Multithreading and Backtracking, Next: Operand Overloading, Prev: TriINTERCAL, Up: Top 10 Multithreading and Backtracking ********************************** The multithreading and backtracking extensions to INTERCAL were originally invented by Malcom Ryan, who implemented 'COME FROM'-based multithreading as a modified version of C-INTERCAL, known as Threaded INTERCAL, but did not implement backtracking. (The same functionality is implemented in C-INTERCAL today, but with different code. Most likely, this means that the original code was better.) He also invented the original version of Backtracking INTERCAL, but did not implement it; the only known implementation is the C-INTERCAL one. A different version of multithreading, using 'WHILE', was implemented as part of CLC-INTERCAL (like all extensions first available in CLC-INTERCAL, it is most likely due to Claudio Calvelli) and then added to C-INTERCAL, although its implications were not noticed for some time afterwards. So nowadays, three freely-mixable threading-like extensions to INTERCAL exist, all of which are implemented in C-INTERCAL. (A fourth, Quantum INTERCAL, is implemented in CLC-INTERCAL but not C-INTERCAL, 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 C-INTERCAL, because the INTERCAL 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 INTERCAL as a whole, for that matter.) * Menu: * Multithreading using COME FROM:: Creating separate threads. * Multithreading using WHILE:: Creating connected threads. * Backtracking:: Multithreading in series, not parallel.  File: ick.info, Node: Multithreading using COME FROM, Next: Multithreading using WHILE, Up: Multithreading and Backtracking 10.1 Multithreading using COME FROM =================================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.25+ version 0.05+ no 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 'COME FROM's or 'NEXT FROM's (or a mixture of these) 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. 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 'COME FROM' and a 'NEXT FROM' aim at the same line, for instance, the 'NEXT FROM' thread will end up with a NEXT stack entry that isn't in the 'COME FROM' thread, created by the 'NEXT FROM' 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 INTERCAL.) In C-INTERCAL, 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, 'COME FROM's and 'NEXT FROM'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 'COME FROM' or 'NEXT FROM' 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 C-INTERCAL from 0.27 onwards, there is a third guarantee; that if a 'COME FROM' 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 'COME FROM' could block all threads if it aimed for itself due to the speed restrictions and the fact that 'COME FROM's need not count towards the total command count.) Also, all commands, including any 'ONCE' or 'AGAIN' 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 INTERCAL status quo, these guarantees are somewhat _better_ than in most other languages that implement threading, amusingly continuing to leave INTERCAL with the status of being unlike any other mainstream language.) 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 'ABSTAIN' and 'ONCE' is one way to communicate atomically, due to the atomic nature of 'ONCE'.) If there are at least two threads, the 'GIVE UP' command ends the current thread, rather than the current program.  File: ick.info, Node: Multithreading using WHILE, Next: Backtracking, Prev: Multithreading using COME FROM, Up: Multithreading and Backtracking 10.2 Multithreading using WHILE =============================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.27+ version 0.05+ no The 'WHILE' 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 CLC-INTERCAL, there are at least two other meanings for 'WHILE', but only the one implemented in C-INTERCAL is discussed here.) The syntax is somewhat unusual, and consists of two commands separated by the 'WHILE' keyword, but sharing the statement identifier, execution chance, and any 'ONCE'/'AGAIN' keyword that may be present. For instance: (1) DO COME FROM ".2~.2"~#1 WHILE :1 <- "'?.1$.2'~'"':1/.1$.2'~#0"$#65535'"$ "'"'&.1$.2'~'#0$#65535'"$#0'~#32767$#1" (OK, maybe that's an unnecessarily complicated example, and maybe it shouldn't have included the '/' operator which is part of another INTERCAL extension (*note Operand Overloading::). Still, I thought that maybe you'd want to see how addition can be implemented in INTERCAL.) A 'WHILE' 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 'WHILE' 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. 'NEXTING FROM', 'ABSTAINING FROM' or similar behaviour with respect to the 'WHILE' 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 'WHILE' 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 'NEXTING', 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 'NEXT'), that thread loops and reruns that command as long as the left command has not finished; 'COMING FROM' that command, or a 'NEXT'/'NEXT FROM' from/aiming at that command, doesn't count as finishing that command until it is 'RESUME'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 'GIVE's 'UP' or the loop ends due to the command ending later in another thread). A 'WHILE' 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 of the same 'WHILE' 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 'WHILE' ends, they together only cause one right-hand command to end. (What, did you expect the logical and orthogonal behaviour?) The two threads produced by a 'WHILE' (the original thread and a new copy of it) have more in common than ordinary INTERCAL threads created by 'COME FROM'; ordinary threads share only 'ABSTAIN'/'REINSTATE' information, whereas the 'WHILE'-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. Ordinary multithreading cannot create woven threads. When threads are created by multiple 'COME FROM'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 (*note Backtracking::) 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 'MAYBE', 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 'WHILE' inside one of the threads that is already woven, which causes all the new threads to be woven together (the weaving relationship is transitive).  File: ick.info, Node: Backtracking, Prev: Multithreading using WHILE, Up: Multithreading and Backtracking 10.3 Backtracking ================= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.25+ no no 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 'MAYBE' 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 'GO AHEAD' and get rid of the dormant thread, or decide that it didn't like the consquences of the command and 'GO BACK' 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.) To create a choicepoint, the statement identifier 'MAYBE' is used, rather than the more usual 'DO' or 'PLEASE'. (Combination statement identifiers are still allowed, but must be in the order 'MAYBE PLEASE DO NOT' with optionally some parts omitted, or different versions of 'NOT' used, or both.) Here's an example: MAYBE DON'T GIVE UP When a command whose statement identifer contains 'MAYBE' 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 'ABSTAIN' and 'REINSTATE', 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 'NEXT' stack are. 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 'GO BACK' command (which has no arguments, and is just the statement identifier, optional execution chance, 'GO BACK', and optional 'ONCE' or 'AGAIN'). 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 'MAYBE' is temporarily reversed for determining whether it runs or not (this reversal only lasts immediately after the 'GO BACK', and does not affect uses of the command in other threads or later in the same thread), so unless it has been 'ABSTAIN'ed or 'REINSTATE'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 'GO BACK' to a stale choicepoint instead causes the stale choicepoint to be deleted and the program to continue executing. (This is what gives INTERCAL's backtracking greater flexibility in some ways than some other languages; to get backtracking without the stale choicepoints having an effect, simply run 'COME FROM' the 'GO BACK' as the previous statement.) 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 'GO BACK' 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 'GO BACK' 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 INTERCAL's backtracking is more flexible than that of some other languages. If, on the other hand, a program decides that it likes where it is and doesn't need to 'GO BACK', or it wants to 'GO BACK' to a choicepoint lower down the stack while skipping some of the ones nearer the top of the stack, it can run the 'GO AHEAD' command, which removes the top choicepoint on the stack, whether it's a genuine choicepoint or just a stale one. Both 'GO AHEAD' and 'GO BACK' cause errors if an attempt is made to use them when the choicepoint stack is empty.  File: ick.info, Node: Operand Overloading, Next: PIC-INTERCAL, Prev: Multithreading and Backtracking, Up: Top 11 Operand Overloading ********************** INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.26+ version 0.05+ no (Operand overloading in C-INTERCAL is nowhere near as advanced as it is in CLC-INTERCAL. This chapter only explains the partial implementation used by C-INTERCAL; for a full implementation, see CLC-INTERCAL and its documentation.) 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. At the beginning of the program, all variables stand for themselves; so '.1' really does mean '.1', for instance. The meaning of a variable can be overloaded using the slat operator ('/'), which is the same in both Princeton and Atari syntax: it is a binary operator whose left argument must be a onespot or twospot 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: DO .1 <- .2/'.3~.4' The example causes '.2''s true value to be assigned to '.1' (unless of course '.1' is read-only), but also causes '.2' from then on to actually mean ''.3~.4'', except when it's the left operand of a slat operator. So for instance, 'DO .1 <- .2' would actually assign ''.3~.4'' to '.1'. Somewhat confusingly, this also works in the other direction; 'DO .2 <- .1' would assign '.1' to ''.3~.4'', which would have the effect of changing the values of '.3' and '.4' so that ''.3~.4'' 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 'DO .1 <- .1/#1' is entirely capable of changing the value of '#1', although to protect new INTERCAL users C-INTERCAL will refuse to carry out operations that change the value of constants unless a command-line switch (*note -v::) is used to give it permission. In C-INTERCAL, changing the value of a constant only changes meshes with that value, but in CLC-INTERCAL it can also change non-mesh uses of that constant, so doing so is not portable anyway.) When multiple overloading rules are in effect, they are all applied; overloading '.1' to ''.2~.3'' and '.2' to ''.3$.4'' will cause '.1' to refer to '''.3$.4'~.3''. 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 '.1/.2' and '.2/.1' together cause '.1' to expand to '.2', which expands to '.1', which cannot expand any further). In C-INTERCAL, the expression on the right hand side of a slat is not evaluated and not expanded by operand overloading. 'STASHING' a variable causes its overloading information to be stashed too; 'RETRIEVING' 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). 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. 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 'DO .1 <- .2/'.3$.3' DO .2 <- #6' are liable to succeed assigning garbage to '.3' 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.  File: ick.info, Node: PIC-INTERCAL, Next: CREATE, Prev: Operand Overloading, Up: Top 12 PIC-INTERCAL *************** INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.26+ no no PIC-INTERCAL is a simplified version of INTERCAL designed especially for embedded systems, designed to minimise code and data usage by INTERCAL 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.) C-INTERCAL only compiles 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, 'src/pick1.h' and 'src/pick2.h', don't have any effect 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.) There are several restrictions on PIC-INTERCAL programs: * It's impossible to store more than one item in the STASH for any given variable. * Many errors are not checked at runtime; it is the programmer's job to ensure that runtime errors are avoided. (The few errors that are detected will send the program into an infinite loop, as there is no sensible way to exit from a PIC program.) * Double-oh-sevens are not randomised, but instead depend merely on whether the probability given is greater than 50% or not. * The NEXT stack is limited to 16 entries rather than the usual 80. * 'ABSTAIN' and 'REINSTATE' still work, but cannot be computed 'ABSTAIN's, and will not necessarily work when used to affect the system library or calls to it. * 'READ OUT' and 'WRITE IN' don't work. (See below for a replacement.) * 'COME FROM' and 'NEXT FROM' must aim at a label, not an expression or gerund. * Multithreading and TriINTERCAL cannot be used on PICs. (Operand overloading can be used, but only if your PIC cross-compiler supports function pointers; some don't.) In order to provide I/O capabilities, a new command 'PIN' 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 'PORTA' and 'PORTB'; for other microcontrollers, adapting the code in 'src/pick1.h' 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. The 'PIN' command takes one twospot variable as its argument, like this: DO PIN :2 The twospot variable is conceptually divided into 4 blocks of 8 bits. The highest two blocks control the directions of the pins in 'PORTB' (most significant block) and 'PORTA' (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 'PORTB' and the least significant block controls 'PORTA', 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 'PIN' 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.  File: ick.info, Node: CREATE, Next: External Calls, Prev: PIC-INTERCAL, Up: Top 13 CREATE ********* INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.28+ see text no The 'CREATE' command allows the creation of new syntax at runtime. CLC-INTERCAL has had such a command since 1.-94.-8, but its syntax is completely different and incompatible with the C-INTERCAL version, and so is not documented here (see the CLC-INTERCAL documentation for more details). The C-INTERCAL version is only defined if the '-a' option is used on the command line (and a runtime error E000 otherwise), because it forces the operand overloading code to be introduced and so slows down every variable access in the program. The syntax of the 'CREATE' command is to write 'CREATE', then a line label, then anything. OK, well not quite anything; you're restricted to syntax that is supported by the 'just-in-case' compiler that runs on comments at compile time just in case they gain a meaning later (see below). The anything provides an example statement to 'CREATE'; statements which look the same (but may differ in details) are created. Typical syntax for a 'CREATE' statement would therefore look something like this: DO CREATE (5) SWITCH .1 WITH .2 There is also computed 'CREATE', working identically to ordinary 'CREATE' except that the line number is taken from an expression and the created command must start with a letter (to avoid an ambiguity if the expression giving the line label happens to be an array reference), with a syntax like this: DO CREATE .5 SWITCH .1 WITH .2 Here, a new 'SWITCH WITH' statement (there is no such statement in INTERCAL normally) is being created. This command makes it possible to do this: DO SWITCH .3 WITH .4 Normally that line would be an error (E000) due to being unrecognised, but having been 'CREATE'd, it's now a real statement. (The gerund to affect created statements is 'COMMENT', just like before they were created; the gerund to affect 'CREATE' itself is 'CREATION' ('CREATING' is also allowed, but not as elegant).) When the created statement is encountered, it 'NEXT's to line (5), the line number specified in the 'CREATE' statement. In order for the code there to be able to affect the variables mentioned in the statement, the variables ':1601' (for the first variable or expression mentioned), ':1602' (for the second variable or expression mentioned), and so on, are 'STASH'ed and then overloaded to the respective expressions or variables mentioned in the created command; so ':1601' has been overloaded to mean '.3' and ':1602' has been overloaded to mean '.4' at this point. Then, the code at (5) runs; if it returns via a 'RESUME #1', ':1601' and ':1602' will be 'RETRIEVE'd automatically and the program will continue from after the created statement. (If you do not resume to that point, say if you're creating a flow control statement, you'll have to deal with the stashes for the 1600-range variables yourself.) So what syntax is available in created statements? All the capital letters except 'V' (which is an operator in INTERCAL) are available and can be used freely and as many times as desired; they match themselves literally. However, they are not allowed to spell an INTERCAL keyword at any point (so watch out for 'DO' and 'FROM', for instance). Whitespace is allowed, but is ignored (both in the 'CREATE' template statement, and in the code being created; so 'DO SW ITCH :8 WITH :50' will also have been created). Then, there are three groups of matchable data: scalar variables (onespot or twospot variables, as used in the examples above) match other scalar variables, array elements (like ',4 SUB '.5~.6'') match other array elements, and other expressions match other other expressions. Two matchable data may not appear consecutively in a created command, but must be separated by at least one capital letter (to prevent array-subscript-related ambiguities; remember that the just-in-case compiler has to compile these statements at compile time without knowing what they are). The actual expressions used in the 'CREATE' statement don't matter; they're just examples for the runtime to match against. It is also possible (from C-INTERCAL version 0.29 onwards) to create new operators. Such operators are always binary operators (that is, they take two arguments and parse like mingle or select), and always return 32-bit results. There are three types of legal names for such operators, all of which are treated equivalently: lowercase letters, punctuation marks otherwise unused in INTERCAL, and overstrikes consisting of a character, a backspace, and another character (apart from overstrikes already used for built-in INTERCAL operators). The syntax for creating an operator looks like one of these: DO CREATE (5) x DO CREATE .5 = The arguments to the operator will be overloaded onto :1601 and :1602 (which are, like with 'CREATE'd statements, stashed before the overloading happens), and the return value is read from :1603 (which is stashed, then overloaded to itself). All these three variables are retrieved again after the operator finishes evaluating. Note that it is a very unwise idea to use a 'CREATE'd operator in the expression for a computed 'COME FROM' or 'NEXT FROM', because this always leads to an infinite regress; whenever any line label is reached (including the line label that the 'CREATE' statement pointed at), the expression needs to be evaluated in order to determine whether to 'COME FROM' that point, which in turn involves evaluating lines which have labels. Some other points: a newer 'CREATE' statement supercedes an older 'CREATE' statement if they give equivalent templates, multiple 'CREATE' statements may aim at the same line (this is the recommended technique for creating a statement that can handle expressions even if they're array elements or variables; you do this by specifying multiple templates in multiple 'CREATE' statements), and strange things happen if a twospot variable in the 1600-range is used as an argument to a created statement itself (because of the stash/retrieve, such a variable can usually be read, but may not always be able to be written without the data being lost).  File: ick.info, Node: External Calls, Next: Differences to Other Compilers, Prev: CREATE, Up: Top 14 External Calls ***************** INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.28+ no no C-INTERCAL has a feature allowing INTERCAL and non-INTERCAL code to be mixed. This is achieved by causing the non-INTERCAL programs to participate in the INTERCAL line-numbering model. The same feature allows expansion libraries to be linked into the code. To create a combined program containing INTERCAL and non-INTERCAL code, use 'ick' as the compiler as normal, but specify both the INTERCAL and non-INTERCAL source files on the command line, and use the '-e' command-line option. 'ick' will invoke other compilers as necessary, after modifying the source files accordingly. At present, external calls are only supported to and from C and Funge-98. In each case, it will be the INTERCAL program that is invoked first. (This means that it is impossible to link together more than one INTERCAL program, but you probably don't want to, because concatenating the programs is likely to have a similar effect.) You can get the INTERCAL program to 'NEXT' to the non-INTERCAL program immediately, or the non-INTERCAL program to 'COME FROM' or 'NEXT FROM' the INTERCAL program immediately, to obtain the effect of running the non-INTERCAL program first. Note that external calls are incompatible with PIC-INTERCAL and with multithreading; note also that you must use 'gcc' as your compiler, and GNU cpp and ld, for them to work in the current version of C-INTERCAL. * Menu: * External Calls to C:: How to put INTERCAL calls in C. * External Calls to Funge-98:: Linking Befunge-98 and INTERCAL. * Miscellaneous External Calls:: Other things you can link in. * Using External Calls:: What happens when you use -e. * Expansion Libraries:: Expanding the compiler's capabilities.  File: ick.info, Node: External Calls to C, Next: External Calls to Funge-98, Up: External Calls 14.1 External Calls to C ======================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.28+ no no Linking C and INTERCAL programs is achieved by placing various constructs into the C programs that are equivalent to various INTERCAL constructs. It is possible to simulate a line with a label and a dummy command (which serves as a 'COME FROM' suckpoint and 'NEXT' target), a command with a line label, 'NEXT', 'RESUME', and 'FORGET', and 'COME FROM' and 'NEXT FROM'. Onespot and twospot variables are accessible from inside the C program, where they can be read and written; however, the INTERCAL program cannot access any variables inside the C program that weren't part of the INTERCAL program originally. To prevent various logical impossibilities, there are restrictions on where these can be used and what preparation is needed before they are used. Also, the semantics are not always exactly what you might expect for technical reasons. It should be observed that the INTERCAL link intrudes on the user namespace. To prevent possible namespace clashes, no identifiers starting with 'ick_' or 'ICK_' should be used anywhere in the linked C program for any reason, except where specified in this manual. * Menu: * External C Call Infrastructure:: Enabling a C program for external calls * ick_startup:: Doing things at startup * ick_linelabel:: Labelling lines... * ick_labeledblock:: ...and labelling blocks * ick_comefrom and ick_nextfrom:: Stealing control from elsewhere * ick_next:: The INTERCAL answer to subroutine calls * ick_resume:: Going back to before a NEXT * ick_forget:: Discarding NEXT stack entries * ick_get/setone/twospot:: Accessing INTERCAL variables from C * ick_create:: CREATE statements via external calls * External Calls and auto:: Considerations for auto variables  File: ick.info, Node: External C Call Infrastructure, Next: ick_startup, Up: External Calls to C 14.1.1 External C Call Infrastructure ------------------------------------- For a C program to be connected to an INTERCAL program, it needs to be marked with the correct header file, and needs to have functions marked for communication with the INTERCAL program. '#include ' The header file 'ick_ec.h' must be included using the preprocessor in any file which uses any of the INTERCAL external call functions, variables, or macros. (Note that this file may not necessarily exist, or exist in the usual place; 'ick' will deal with making sure the correct header file is included.) This will include 'stdint.h' (a standard C header file, which must exist on your system), so that you can access INTERCAL variables (the INTERCAL types onespot, twospot, tail, hybrid correspond to the C types uint16_t, uint32_t, uint16_t*, uint32_t* respectively); also, it will provide the prototypes for all the functions and definitions for all the macros needed to use the external calls system with C. 'ICK_EC_FUNC_START' 'ICK_EC_FUNC_END' Many of the INTERCAL interface macros ('ick_linelabel', 'ick_comefrom', and 'ick_nextfrom') make it possible to jump from an INTERCAL program to a C program. Because C doesn't allow jumping into the middle of a function, there has to be some way to create a block of code which _can_ be jumped into. This is what these two macros achieve. This declaration and definition: ICK_EC_FUNC_START(identifier) { /* code goes here */ } ICK_EC_FUNC_END is equivalent to this: void identifier(void) { /* code goes here */ } except that it is possible to jump from an INTERCAL program into the declared and defined program. (If you need to write a prototype for the function early, 'void identifier(void);' is perfectly acceptable, but an early prototype is not required unless you call the function from earlier within the C code.) Of course, you can substitute any identifier that's legal as a function name for 'identifier' (as long as it doesn't start with 'ick_' or 'ICK_'). The resulting function is a function (for instance, you can take its address or call it in the usual ways); the only differences are that it can be jumped into from INTERCAL code and that it is constrained to take no arguments and return no data. (It can still access global and INTERCAL variables.) If the function is jumped into from INTERCAL code, but then control flow reaches the end of the function, or the function 'return;'s but was not called from C, the resulting behaviour is undefined; C-INTERCAL will attempt to continue by some means at that point, but may fail. If a function is unsure whether it gained control from C or from INTERCAL code, it may use 'ick_return_or_resume' (described below). Because you are not allowed to declare two C functions with the same name (even in different modules), all functions declared with 'ICK_EC_FUNC_START' must have unique names across the entire compilation.  File: ick.info, Node: ick_startup, Next: ick_linelabel, Prev: External C Call Infrastructure, Up: External Calls to C 14.1.2 ick_startup ------------------ It is sometimes necessary for a C program to do its own initialisation before the INTERCAL program starts running. To do so, it can use the 'ick_startup' macro inside a function declared with 'ICK_EC_FUNC_START'; the syntax is 'ick_startup(block)', where the argument is an expression, statement, or compound statement to run. The argument itself must not contain any ick_-prefixed macros or functions except possibly ick_create, may have side effects, and must fit the C preprocessor's idea of what a macro argument should look like (it's more used to parsing expressions than blocks; the general rule is to avoid commas except when they're directly or indirectly inside parentheses or strings).  File: ick.info, Node: ick_linelabel, Next: ick_labeledblock, Prev: ick_startup, Up: External Calls to C 14.1.3 ick_linelabel -------------------- A line label is something that can be 'NEXT'ed to and 'COME FROM'. Unlike an INTERCAL line label, it does not label a statement, and therefore attempts to 'ABSTAIN' or 'REINSTATE' it may be errors, or may be ignored (it's unspecified which, which means that either may happen for any or no reason, but exactly one will happen in any given case, although the choice might not be consistent). The macro 'ick_linelabel(expression);' may appear anywhere a compound statement would normally be able to appear. (That is, it looks like a function call being used as a standalone expression, but in fact the places where it can appear are more limited.) In contrast to ordinary line labels, an expression can be used rather than just a constant; however, the behaviour is undefined if the expression has side-effects. Upon encountering the line label, any 'COME FROM's or 'NEXT FROM's aiming at the line label (including 'ick_comefrom's and 'ick_nextfrom's) will steal control from the program; 'RESUMING' after a 'NEXT FROM' will work, but suffers from the same caveats as setjmp/longjmp do (any auto variables that change their value between the 'NEXT FROM' and 'RESUME' will have their value clobbered (i.e. their value is no longer reliable and should not be accessed)). Note that the INTERCAL variables are immune to this problem. You can also avoid the problem by marking variables as 'volatile' in the C program. It is possible to 'NEXT' or 'ick_next' to a 'ick_linelabel', which has the same effect as saving the 'NEXT' stack, calling the function containing the 'ick_linelabel' and then immediately doing a C 'goto' to an imaginary label preceding it. Due to this possibility, an 'ick_linelabel' is only allowed within a function defined with 'ICK_EC_FUNC_START'.  File: ick.info, Node: ick_labeledblock, Next: ick_comefrom and ick_nextfrom, Prev: ick_linelabel, Up: External Calls to C 14.1.4 ick_labeledblock ----------------------- In INTERCAL programs, labels don't stand on their own, but instead label a statement. The difference between a standalone line label and a line label that labels a statement is that 'COME FROM's will come from the _label itself_ (which is before the next statement) when aiming at a standalone line label, but the _end of the statement_ when aiming at a labeled statement. To achieve the same effect in C, the macro 'ick_labeledblock' is available; it can be used as 'ick_labeledblock(expression,expression)' or 'ick_labeledblock(expression,statement)'; the first argument is the label, and the second argument is an expression or statement to label (if an expression is labeled, it will be converted to a statement that evaluates it for its side effects and discards the result). It is even permitted to label a block statement in this way. Note, however, that you have to contend with the C preprocessor's ideas of where macro arguments begin and end when doing this. Other than the position of the 'COME FROM' target created by the label, this behaves the same way as 'ick_linelabel' (so for instance, computed line labels are allowed, but the expression that computes them must not have side effects, and it is only allowed within a function defined with 'ICK_EC_FUNC_START').  File: ick.info, Node: ick_comefrom and ick_nextfrom, Next: ick_next, Prev: ick_labeledblock, Up: External Calls to C 14.1.5 ick_comefrom and ick_nextfrom ------------------------------------ The 'ick_comefrom' and 'ick_nextfrom' macros are, like the other INTERCAL flow control macros (as opposed to functions), only allowed within a function defined with 'ICK_EC_FUNC_START'. They act almost exactly like the INTERCAL statements of the same name (although note that C statements cannot be 'ABSTAIN'ed 'FROM' even if they act the same way as INTERCAL statements); they are written as 'ick_comefrom(expression);' and 'ick_nextfrom(expression);' respectively (note that they must be called as statements, and cannot be used as part of an expression). Whenever a standalone line label is encountered whose expression evaluates to the same number as the expression inside the 'ick_comefrom' or 'ick_nextfrom', and that number is at most 65535, then control will be transferred to the 'ick_comefrom' or 'ick_nextfrom', leaving a 'NEXT' stack entry behind in the case of 'ick_nextfrom'; likewise, if the end of a labeled statement, expression or block is reached and the label has the right number. Some caveats: the expression need not be constant, but must not have side effects, must not be negative, and must fit into the range of an 'unsigned long' in the C program (and the statement will do nothing if the expression evaluates to a value larger than 65535). In keeping with the best C traditions, these caveats are not checked, but instead result in undefined behaviour if breached. There are also versions 'ick_comefromif' and 'ick_nextfromif', which take a second parameter, which is a condition that specifies whether control is actually stolen from the target. The condition may have side effects, and is only run when the line numbers match; it should return 0 or NULL to leave control flow alone, or nonzero to steal control, and should be either an integral type or a pointer type. Although side effects are allowed, the condition must not look at or alter 'auto' or 'register' variables in the enclosing function, not even if they are also marked 'volatile'. (Global and 'static' variables are fine, though.)  File: ick.info, Node: ick_next, Next: ick_resume, Prev: ick_comefrom and ick_nextfrom, Up: External Calls to C 14.1.6 ick_next --------------- 'ick_next' is a macro that acts like the INTERCAL statement 'NEXT'. Contrary to the other INTERCAL-like macros, it can be used in any function regardless of whether it was defined with 'ICK_EC_FUNC_START'; however, it must still be used as a statement by itself, and a call to it looks like 'ick_next(expression);'. The expression is the label to 'NEXT' to, and works under the same rules as the expressions for 'ick_comefrom'; it need not be constant (unlike in C-INTERCAL!), but must not have side effects, must not be negative, must fit into the range of an unsigned long, and is ignored if it is over 65535. If there happen to be multiple labels with the correct value at the time, the compiler will 'NEXT' to one of them. Bear in mind that there is a limit of 80 entries to the 'NEXT' stack, and that this limit is enforced. If the resulting 'NEXT' stack entry is 'RESUME'd to, the program will continue after the 'ick_next' as if via 'setjmp', with all the usual restrictions that that entails; if the resulting 'NEXT' stack entry is forgotten, then the 'ick_next' call will never return. (Note that the 'as if via setjmp' condition allows you to preserve the vales of 'auto' and 'alloca'-allocated storage as long as its value has not changed since the 'ick_next' was called, which is a significantly more lenient condition than that normally imposed on such variables (*note External Calls and auto::).)  File: ick.info, Node: ick_resume, Next: ick_forget, Prev: ick_next, Up: External Calls to C 14.1.7 ick_resume ----------------- 'ick_resume' is a macro, but there are few restrictions on its use; it is permitted to use it inside an expression (but it returns void, making this not particularly useful), and acts like a function which takes an unsigned short argument, returns void, and has a prototype (but you cannot take its address; if you need to be able to do that, write a wrapper function for it). It can be used within any function regardless of how it was declared, and never returns; instead, it pops the specified number of 'NEXT' stack entries and resumes execution at the last one popped, just as the INTERCAL statement does. This causes the same errors as the INTERCAL statement if the number of entries popped is zero or larger than the 'NEXT' stack. There is also a macro 'ick_return_or_resume();'; it can only be used inside a function defined with 'ICK_EC_FUNC_START', and is equivalent to 'return;' if the function was called from C, or 'ick_resume(1);' if the function was called from INTERCAL. It's therefore a safe way to return from such a C function if you don't know how control reached it in the first place.  File: ick.info, Node: ick_forget, Next: ick_get/setone/twospot, Prev: ick_resume, Up: External Calls to C 14.1.8 ick_forget ----------------- The 'ick_forget' macro removes 'NEXT' stack entries, and the corresponding C stack entries. It must be called as a statement by itself, and its invocation looks like this: 'ick_forget(expr);', where the expression is the number of 'NEXT' stack entries to forget (all of them will be forgotten if the number is higher than the number of entries). The expression will be casted to an 'unsigned short'. 'ick_forget' can only be used inside a function declared with 'ICK_EC_FUNC_START'. As it is removing stack entries both in INTERCAL and in C, it will clobber the value of all 'auto' variables created since the highest remaining 'NEXT' stack entry came into being (or since the start of the program, if the 'NEXT' stack is emptied by the command) and also deallocate all 'alloca' storage allocated since then. It also causes the return address of the current function to become undefined, so that function must not return; control may leave it via 'RESUME', or via 'COME FROM', or via 'NEXT' or 'NEXT FROM' followed by the relevant 'NEXT' stack entry being forgotten (the function is still 'running' but suspended while the 'NEXT' stack entry still exists). (Note that these restrictions are stronger than those on 'RESUME'; this is because 'RESUME' preserves most of the stack, but 'FORGET' destroys parts of the stack and therefore cannot avoid destroying the data stored there. It could be much worse; a previous (never released) version of the code didn't remove those parts of the stack in many circumstances, leading to a stack leak that caused programs to segfault after a while.)  File: ick.info, Node: ick_get/setone/twospot, Next: ick_create, Prev: ick_forget, Up: External Calls to C 14.1.9 ick_get/setone/twospot ----------------------------- This class of four functions make it possible to get and set INTERCAL scalar variables from C code. Their prototypes are as follows: uint16_t ick_getonespot(unsigned short varnumber); void ick_setonespot(unsigned short varnumber, uint16_t newvalue); uint32_t ick_gettwospot(unsigned short varnumber); void ick_settwospot(unsigned short varnumber, uint32_t newvalue); The program will error out with a fatal error (*note E200::) if the variable you request is mentioned nowhere in the INTERCAL program; if you attempt to set an 'IGNORE'd variable, the attempt will silently fail (just as if you assigned to it in an INTERCAL program). The get functions are safe to use in a computed line label, so you can use them to produce computed line labels that depend on INTERCAL variables. ('uint16_t' and 'uint32_t' are standard C data types; if your system doesn't provide them, get better system header files.) If you care about speed, note that .1 is the fastest variable of all to access, and otherwise variables first mentioned near the top of the INTERCAL program will be faster to access than variables mentioned lower down.  File: ick.info, Node: ick_create, Next: External Calls and auto, Prev: ick_get/setone/twospot, Up: External Calls to C 14.1.10 ick_create ------------------ The 'ick_create' function (prototype: 'void ick_create(char*, unsigned long)') allows the external calls system to be used to create new INTERCAL syntax; to do this, you give a 'signature' representing the syntax you want to define and a line number to the function (which are its two arguments, respectively). The signature defines the syntax that you are defining; whenever that syntax is encountered within the INTERCAL program, it will 'NEXT' to the line number you specify, which can do various clever things and then 'RESUME' back to the INTERCAL program (or if you're defining a flow-control operation, you might want to leave the 'NEXT' stack entry there and do other things). However, note that the overloading of ':1601', etc., will still take place as in the INTERCAL version of 'CREATE' if the '-a' option is used (*note -a::), so care is needed when writing flow control statements that they work both with and without the option and don't cause 'STASH' leaks (which means no 'FORGET'ting the relevant 'NEXT' stack entry, and no looking at 1600-range variables). This allows the external calls system to define whole new INTERCAL commands, with the same power as any other programming language. There are various restrictions on what syntax you can 'CREATE' with this method, which are best explained by an explanation of the relevant C-INTERCAL compiler internals. When an INTERCAL program is compiled by C-INTERCAL, any unrecognised statements it comes across are compiled by a 'just-in-case' compiler that attempts to compile them anyway with no knowledge of their syntax, just in case the syntax becomes defined later. (E000 (*note E000::) will be thrown when such statements are encountered at runtime, unless the syntax has been 'CREATE'd since to give a statement a meaning.) For the just-in-case compiler to run, the resulting statement must be completely unrecognised; this means that it may contain no keywords (not even a sequence of letters that forms a keyword, such as 'FROM' or 'DO'), it must consist only of variable names, expressions, and capital letters other than 'V' (because 'V' is a unary operator, so otherwise there would be ambiguity), and in which any two variable names or expressions are separated by at least one capital letter. The compiler will produce a 'signature' for the unknown command that can be defined. A signature consists of a sequence of characters (and is represented as a null-terminated string; the runtime makes a shallow copy of the string and keeps it until the end of the program, so arrangements must be made to ensure that the storage in which the string is allocated stays around that long, but this opens up interesting possibilities in which the signature that was actually 'CREATE'd can be modified retroactively); whitespace is not allowed in a signature. Capital letters can be used (apart from 'V'), and match the same capital letters literally in the INTERCAL syntax being created; also available are the special characters '.,;~', which match respectively a scalar variable (a onespot or twospot variable such as ':1'), an array variable (such as ';2'), an array element (such as ',3 SUB #4 #5'), and an expression that isn't a variable name and isn't an array element (such as '.4$.5'). If you want to be able to match other things (say, to be able to match all expressions), you will need to submit multiple signatures using multiple calls to 'ick_create'; maybe you could write a library to do that automatically. 'CREATE'd operators also have signatures, but of quite a different form. The signature for a single-character operator is a lowercase u, followed by its character code in hexadecimal (no leading zeros, and in lowercase); the signature for an overstrike is a lowercase o, followed by the lower relevant character code in hexadecimal, followed by a lowercase x, followed by the higher relevant character code in hexadecimal. The routine that is 'NEXT'ed to will presumably want to be able to see what in the INTERCAL program was matched by the signature, so a range of function-like macros is provided to access that. They must be run from within the invocation of the function which was 'NEXT'ed into by the created syntax (*note External Calls and auto:: for when a function invocation ends, which could be sooner than you think when the C-INTERCAL external calls system is used), and are undefined behaviour when that invocation did not gain control from a 'CREATE'd statement. Here are their effective prototypes: int ick_c_width(int); int ick_c_isarray(int); unsigned short ick_c_varnumber(int); uint32_t ick_c_value(int); /* These require -a to work */ uint32_t ick_c_getvalue(int); void ick_c_setvalue(int, uint32_t); The first argument to all these macros is the position of the match in the signature (0 for the first non-capital-letter match in the signature, 1 for the second, and so on until no more items are left in the signature to match); specifying a position that isn't in the signature is undefined behaviour. 'ick_c_width' returns the data type, as a width in bits, of the expression (or the width in bits of an element of the passed in array), and 'ick_c_isarray' returns 1 if the argument was an array variable or 0 if it was an expression (array elements and scalar variables are expressions). 'ick_c_varnumber' returns the variable's number (for instance 123 for '.123'), or 0 if the corresponding argument was not a variable; in the cases where the argument was a variable, these three functions together provide enough information to figure out which variable (which is useful if you're writing an extension which takes a variable name as an argument). 'ick_c_value' returns the value of the corresponding expression at the time the 'CREATE'd command was called; 'ick_c_getvalue' is almost equivalent, but only works if the '-a' option (*note -a::) was used during compilation, and returns the value of the corresponding expression now. (The uint32_t return type is large enough to hold either a onespot or twospot value, and will be zero-extended if the corresponding expression had onespot type.) 'ick_c_setvalue' also depends on '-a', and will assign to the corresponding expression (be careful not to provide a value that is too large for it!). In the case that the corresponding expression is not a variable, this will attempt to perform a reverse assignment to the expression, and can produce ordinary INTERCAL errors if it fails. It is not possible to redimension an array this way, as this is assignment, not a calculate operation.  File: ick.info, Node: External Calls and auto, Prev: ick_create, Up: External Calls to C 14.1.11 External Calls and auto ------------------------------- Because the external calls system merges the INTERCAL 'NEXT' stack with the C return value and data storage stack (note for pedants: the C standards nowhere mandate the existence of such a stack, or even mention one, but the restrictions stated in them imply that implementations have to act as if such a stack existed, because of the way the scoping rules and recursion work), the external calls system therefore has severe effects on data that happens to be stored there. (In INTERCAL terms, imagine what would happen if data could be stored on the 'NEXT' stack; if C used the more sensible system of having a 'STASH' for each variable, these problems would never occur in the first place, instead causing an entirely different set of problems.) Similar considerations apply to the common nonstandard C extension 'alloca', which dynamically alters the size of the stack; also, in what goes below, 'register' variables should be considered to be 'auto', because the compiler may choose to allocate them on the stack. Theoretical considerations would lead one to conclude that variable-length arrays should obey most of the same restrictions; in practice, though, it's unwise to attempt to mix those with INTERCAL code at all, except by separating them into separate functions which aren't flagged with 'ICK_EC_FUNC_START' and use no 'ick_'-prefixed identifiers, even indirectly. (They may cause a compile to fail completely because they don't mix well with 'goto'.) In the description below, INTERCAL commands should be taken to include the equivalent C macros. 'NEXT'/'NEXT FROM' paired with 'RESUME' have the least effect, and the most obvious effect, on 'auto' variables in the function that was 'NEXT'ed from, which is the same effect that the standard C function 'longjmp' has. That is, 'alloca' storage stays intact, and 'auto' variables have their values 'clobbered' (that is, their value is no longer reliable and should not be used) if they changed since the corresponding 'NEXT' and are not marked as 'volatile'. (This is a very easy restriction to get around, because changing the values of such variables is quite difficult without using statically-allocated pointers to point to them (a dubious practice in any case), and 'volatile' is trivial to add to the declaration.) 'COME FROM' has more restrictions; it deallocates all 'alloca' storage in the function that was 'COME FROM', and functions that called it or that called functions that called it, etc., using C calls (as opposed to 'NEXT'), and those invocations of the functions will cease to exist (thus destroying any 'auto' variables in them), even in the case of 'COMING FROM' a function into the same function. 'auto' variables in the function that is come into will start uninitialised, even if initialisers are given in their declaration, and it will be a 'new' invocation of that function. (It is quite possible that the uninitialised values in the 'auto' variables will happen by chance to have the values they had in some previous invocation of the function, though, because they are likely to be stored in much the same region of memory; but it is highly unwise to rely on this.) Note that 'volatile' will not help here. Observant or source-code-reading readers may note that there is a mention of an 'ick_goto' in the source code to C-INTERCAL; this is undocumented and this manual does not officially claim that such a macro exists (after all, if it did, what in INTERCAL could it possibly correspond to?), but if such a macro does exist it obeys the same restrictions as 'COME FROM'. 'FORGET' is the worst of all in terms of preserving data on the stack; it deallocates 'alloca' data and clobbers or deletes 'auto' variables in all function invocations that have come into existence since the 'NEXT' that created the topmost remaining 'NEXT' stack entry was called, or since the start of the program if the 'NEXT' stack is emptied, and the current function will continue in a new invocation. 'volatile' is useless in preventing this, because the relevant parts of the stack where the data were stored are deleted by the command (that's what 'FORGET' does, remove stack). If any of these data are required, they have to be backed up into static storage (variables declared with 'static' or global variables), or into heap storage (as in with 'malloc'), or other types of storage (such as temporary files) which are not on the stack. (Incidentally, suddenly deleting parts of the stack is excellent at confusing C debuggers; but even 'RESUME' and 'COME FROM' tend to be sufficient to confuse such debuggers. More worrying is probably the fact that the C standard provides a portable method for deleting the stack like that, and in fact the external calls runtime library is written in standard freestanding-legal C89 (with the exception of '+printflow' debug output which requires a hosted implementation), meaning that in theory it would be possible to split it out to create an implementation of a C-plus-COME-FROM-and-NEXT language, and doing so would not be particularly difficult.) Note that INTERCAL variables are not stored on the C stack, nor are any of the metadata surrounding them, and so are not affected unduly by control flow operations.  File: ick.info, Node: External Calls to Funge-98, Next: Miscellaneous External Calls, Prev: External Calls to C, Up: External Calls 14.2 External Calls to Funge-98 =============================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.29+ no no C-INTERCAL supports linking INTERCAL programs with Funge-98 programs (to be precise, only Befunge-98 programs are currently supported). However, it does not ship with a Funge-98 interpreter, and such an interpreter needs to be linked to the resulting program in order to run the Befunge program. Therefore, you need to convert a third-party Funge-98 interpreter to a library usable by C-INTERCAL before you can use this part of the external calls system (*note Creating the Funge-98 Library::); however, this only has to be done once. Once the library has been created, you can link an INTERCAL program with a Befunge-98 program by invoking 'ick' like this: ick -e intercalprogram.i befungeprogram.b98 You can link no more than one Befunge-98 program at once (just like you can link no more than one INTERCAL program at once). Also, the INTERCAL program must come first on the command line. It is legal to link INTERCAL, C, and Befunge-98 simultaneously; however, the identifiers used in the third-party Funge-98 interpreter have not been mangled to avoid collisions, and therefore problems may be caused if the C program uses the same identifiers as the Funge-98 interpreter. * Menu: * Creating the Funge-98 Library:: How to create the Funge-98 library. * The IFFI Fingerprint:: External calls from Funge's view.  File: ick.info, Node: Creating the Funge-98 Library, Next: The IFFI Fingerprint, Up: External Calls to Funge-98 14.2.1 Creating the Funge-98 Library ------------------------------------ Before external calls to Funge-98 can be used, the relevant library must be compiled. (After the library has been compiled, then you will need to reinstall C-INTERCAL; however, you will not need to recompile C-INTERCAL.) At present, only the cfunge Funge-98 interpreter () can be converted into a library suitable for use by C-INTERCAL; also, doing this is only supported on POSIX systems (although if someone gets it to work on DOS/Windows, the author of this manual would be interested to hear about it). Also, a source-code distribution (rather than a binary distribution) is needed. One way to obtain the latest cfunge sources is via the bzr version-control system, using the following command (correct as of the time of writing, but as always, links can become dead): bzr branch lp:cfunge (As a licensing note, note that cfunge is licensed under the GNU General Public licence version 3, whereas C-INTERCAL is licensed under version 2 and all later versions of that licence; although these terms are obviously compatible with each other, you must ensure yourself that your program has appropriate licensing terms to allow a GPLv3 library to be linked to it.) Once you have downloaded the cfunge sources, you need to compile them into a library suitable for use with C-INTERCAL (note that this is a somewhat different process to compiling them into a standalone Funge-98 interpreter). There is a script provided in the C-INTERCAL distribution to do this, 'etc/cftoec.sh'. It must be run in the 'etc' subdirectory of the C-INTERCAL distribution (i.e. the directory the script itself is in), and must be given the path to the root directory of the cfunge source distribution (that is, the directory that contains the 'src', 'lib' and 'tools' subdirectories of that distribution) as its only argument. Note that it may give some compiler warnings on compilation; my experience is that warnings about C99 inlining can be safely ignored (they reflect a deficiency in 'gcc' itself that luckily seems to be irrelevant in this case), but other warnings may indicate problems in the exact versions of the sources that you downloaded (and errors definitely indicate such problems). Once the library has been created, it will appear as the new file 'lib/libick_ecto_b98.a' in the C-INTERCAL distribution (the cfunge distribution will be left unchanged); reinstalling C-INTERCAL will install this file to its proper location. (It is also in a valid location to be able to be run if you aren't installing C-INTERCAL but instead just running it from the distribution's directory.)  File: ick.info, Node: The IFFI Fingerprint, Prev: Creating the Funge-98 Library, Up: External Calls to Funge-98 14.2.2 The IFFI Fingerprint --------------------------- This section will not make much sense to a non-Funge programmer; therefore, if you are not used to Funge, you probably want to skip it. To a Funge program, the external calls interface is accessed via a Funge-98 'fingerprint' defined by the interpreter. The name of the fingerprint is 0x49464649, or as text, 'IFFI'. When a program formed by linking INTERCAL and Befunge-98 is run, the first thing that happens is some internal INTERCAL initialisation which is not visible to either program, and then initialisation routines specified in the Befunge-98 program run (if an initialisation routine is also specified in a linked C program using ick_startup, it is unspecified whether the C or Befunge-98 initialisation happens first.) In the Befunge program, the initialisation routine consists of everything that happens until the 'Y' command in the 'IFFI' fingerprint is run; the author of the Funge-98 must load the 'IFFI' fingerprint themselves during this initialisation to access that command. (This is so that the Befunge program ends up complying with the Funge-98 standard; commands not defined in that standard cannot be used until a fingerprint is loaded.) During initialisation, no commands from the 'IFFI' fingerprint may be used except 'Y' and 'A'. (If a different command is used, 'C', 'M', and 'X' remove the arguments they would use from the stack (if any) but otherwise do nothing, and the other commands in the 'IFFI' fingerprint reflect.) After the 'Y' command is called, the INTERCAL program starts running; in order for the Befunge program to regain control, it has to be 'NEXT'ed to from the INTERCAL program, or 'COME' or 'NEXT FROM' the INTERCAL program, or contain the line label to which syntax in the INTERCAL program was 'CREATE'd. (In other words, the normal INTERCAL ways of transferring information between parts of a program.) In order to do this, therefore, line labels and INTERCAL control flow statements must be placed into the Befunge program. Code like 'COME FROM (100)' is a single statement in INTERCAL, but several statements in Funge-98; therefore, some method of telling the interpreter where to start executing to look for 'COME FROM's, 'NEXT FROM's, and line labels is needed. The method used by C-INTERCAL is that of the 'marker'; a marker is represented by character 0xB7 (a mid-dot in Latin-1) in the input Funge-98 program, but is transformed to a capital 'M' by 'ick'. (The reason for using a special character for a marker and transforming it rather than just using 'M' is to prevent occurences of 'M' in comments and string literals, etc., having an effect on the control flow of the program.) Whenever a 'NEXT' or line label is encountered (in the INTERCAL program, the Funge program or elsewhere), the Funge program is executed starting from each marker in each cardinal direction to look for line labels or 'COME'/'NEXT FROM's respectively. Therefore, 'COME FROM (100)' is written in Funge-98 as 'Maa*C' (where the M is a marker in the source code), and likewise the line label '(100)' would be written as 'Maa*L'. (This code can be written in any cardinal direction, that is left to right, top to bottom, right to left, or bottom to top, but not diagonally or flying.) There are likely to be unused directions from markers, which will be evaluated too; you can (and must) close these off by reflecting code execution back into that marker, another marker, or a non-marker 'M'. Note also that a marker remains in Funge-space even if the 'M' on the same square is deleted (the marker itself is not visible to the 'g' command, though). Here are the commands in the 'IFFI' fingerprint: 'A' This command pops a line number and then an 0"gnirts"-format string from the stack; they are used as the line number and signature to 'CREATE' syntax in the INTERCAL program; for details of the format of the signature, see *note ick_create::. Although using this command during speculative execution works, doing so is not recommended; if the target line number for 'CREATE'd syntax is changed during speculative execution to find the line that that syntax corresponds to, its effect is delayed until after the original line is found and execution continues from that point. (Side effects during speculative execution are never recommended, because they might or might not be optimised away.) 'C' During speculative execution to find 'COME FROM's and 'NEXT FROM's, pops a line label off the top of the stack and does a 'COME FROM' that location. During speculative excution to find line labels, pops the top of the stack and ends that particular speculative execution as a failure. When not doing speculative execution, pops and discards the top element of the stack. 'D' This command must only be used when the Funge program is executing a 'CREATE'd command, and allows access to the arguments that command has. It pops an integer off the top of the stack, and treats it as an argument position (0-based, so 0 refers to the first argument, 1 refers to the second, and so on). Note that providing an invalid argument number, or running this command when not implementing a 'CREATE'd command, leads to undefined behaviour (possibly a reflection, possibly a segfault, possibly worse). The command pushes information about the argument chosen onto the stack; the following information is pushed from bottom to top: * The data type of the argument, in bits (16 if the argument was a onespot variable or expression of onespot type, and 32 if the argument was a twospot variable or expression of twospot type). Note that this is under the C-INTERCAL typing rules, rather than the INTERCAL-72 typing rules (that is, select's type is always that of its right argument no matter how many bits are actually selected). * 1 if the argument is an array variable, 0 if it is a scalar value. * 0 if the argument is not a variable, or the variable's number if it is (e.g. '.123' would push 123 here, but '.1~.2' would push 0). * The argument's value at the time that the 'CREATE'd instruction was called. * The argument's value now, or alternatively a repeat of the previous stack element if '-a' (*note -a::) was not used. (Without '-a', the information needed to re-evaluate the expression is not available.) 'F' During speculative execution, this command reflects; otherwise, this command pops an integer from the top of stack, and 'FORGET's that many 'NEXT' stack entries (or all of them if the argument given is negative). 'G' This command pops an integer from the top of stack. If it is positive, the value of the onespot variable whose name is the popped integer is pushed onto the stack; if it is negative, the value of the twospot variable whose name is minus the popped integer is pushed onto the stack; and if it is zero, the command reflects. If the referenced variable is not in the INTERCAL program at all, this causes an INTERCAL error due to referencing a nonexistent variable. 'L' During speculative execution to find 'COME FROM's and 'NEXT FROM's, this command pops and discards the top stack element, then ends that speculative execution. During speculative execution to find a line label, this command pops an integer from the top of stack and succeeds with that integer as the line label (that is, it is possible to 'NEXT' to an 'L' in the Funge program if a marker, followed by code to push the correct line number onto the stack, precedes that 'L'). When not doing speculative execution, the integer on the top of the stack is used as a line label (assuming it is in the range 1-65535, otherwise it is popped and discarded), and a search is made for 'COME FROM's and 'NEXT FROM's aiming for that line label (including in the INTERCAL program and the Befunge program itself, as well as programs in any other language which may be linked in). Note that just as in INTERCAL, it is possible to 'NEXT' to a line label which has a 'COME FROM' aiming for it, in which case the 'COME FROM' will come from that line label as soon as the 'NEXT' transfers control to it. 'M' Does nothing if not in speculative execution, or ends the current speculative execution with failure. (This is so that code like v >M5C ^ does exactly the same thing as 'COME FROM (5)', even when, for instance, it is entered from the left in the Funge program, rather than gaining control from the line label '(5)'.) 'N' During speculative execution, reflects. Otherwise, pops the top stack element, interprets it as a line label, and 'NEXT's to that line label (this may start speculative execution to look for line labels, but might not if it isn't needed, for instance if the line label in question is in the INTERCAL program or in a C program linked to the Befunge program). 'R' During speculative execution, reflects. Otherwise, pops the top stack element, removes that many items from the 'NEXT' stack, and 'RESUME's at the last item removed. (If the top stack element was zero, negative, or too large, this will cause a fatal error in the INTERCAL program.) 'S' Pops a variable number (interpreted as onespot if positive, or minus the number of a twospot variable if negative) and an integer from the stack, and sets the referenced variable to the integer. This reflects if an attempt is made to set the nonexistent variable 0, causes a fatal error in the INTERCAL program if an attempt is made to set a variable that doesn't exist there, and does not set read-only variables (but pops the stack anyway). If the integer is too high for the variable it is being stored in, only the least significant 16 or 32 bits from it will be used; and likewise, if it is negative, it will be treated as the two's complement of the number given. 'V' Pops a 'CREATE'd argument index and an integer from the top of stack. (This is undefined behaviour if not in the implementation of a 'CREATE'd statement, or if the referenced argument does not exist; as with the 'D' instruction, 0 refers to the first argument, 1 to the second, and so on.) If the '-a' option is not used, this command does nothing; otherwise, the value of the argument will be set to the integer. (This involves doing a reverse assignment if the argument is a non-variable expression, as usual, and causes a fatal error in the INTERCAL program if the reverse assignment is impossible or an attempt is made to assign a scalar to an array.) 'X' This is identical to 'C', except that it does a 'NEXT FROM' rather than a 'COME FROM'. As with external calls to C, terminating any program involved (whether the INTERCAL program with 'GIVE UP', the Befunge program with '@' or 'q', or a C program with 'exit()') causes all programs involved to terminate, and likewise a fatal error will end all programs with an error. One final point which is probably worth mentioning is that flow control instructions only record the IP's position and direction, nothing else; so for instance, if the stack is modified in one part of the code, those modifications will remain even after a 'RESUME', for instance.  File: ick.info, Node: Miscellaneous External Calls, Next: Using External Calls, Prev: External Calls to Funge-98, Up: External Calls 14.3 Miscellaneous External Calls ================================= INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.29+ no no It is possible to specify other information to the external calls system by using the filename list after all the options are given. To be precise, certain filename patterns are recognised and used to change the options that are used to compile the externally-called files. The '.c99' extension is treated identically to '.c', except that it causes the file with that extension to be preprocessed as C99 (the more modern version of the C standard, the older C89 is more common), and that all C files involved will be compiled and linked as C99. (This corresponds to '-std=c99' in 'gcc'.) Likewise, the '.c11' extension can be used to indicate C11. The '.a' extension indicates that an object-code library should be linked in to the final program. This is most commonly used to link in the maths library 'libm.a' and other such system libraries. If the filename is of the form 'lib*.a', then the file will be searched for in the standard directories for libraries on your system, and also where the C-INTERCAL libraries are stored (which may be the same place); otherwise, the current directory will be searched. (Specifying 'libm.a' on the command line corresponds to passing '-lm' to 'gcc'.)  File: ick.info, Node: Using External Calls, Next: Expansion Libraries, Prev: Miscellaneous External Calls, Up: External Calls 14.4 Using External Calls ========================= Whatever language your source files are written in, when '-e' is used (*note -e::), the compiler will go through much the same steps. First, the INTERCAL program specified is compiled into a C program that uses the INTERCAL external call conventions for its control flow operations. The resulting '.c' file will be left behind in the same directory (even if '-g' isn't used); if you look at it, you'll see the '#include ' line, and the other hallmarks of an external call program (for instance, INTERCAL 'NEXT's will translate into slightly modified 'ick_next's; the modification is simply to allow the correct line number to be displayed in case of error). After that, the resulting files are preprocessed twice. First, the C preprocessor is run on the files; then, a special C-INTERCAL 'preprocessor' is run on the files. ('Preprocessor' is a bit of a misnomer here, as it's near the end of the compilation process; 'postprocessor' would likely be more accurate, or maybe 'interprocessor'.) Its job is to fix line labels between the gotos that are used to implement jumping into the middle of a C function, to assign unique numbers to things that need them, and to keep track of which functions need to be checked for line labels and for 'COME FROM's and 'NEXT FROM's. The resulting file will have the extension '.cio'; it is almost human-readable, especially if you run it through a C code indenter, and consists of C code (which might be a thin wrapper around some other language) and instructions to 'gcc'. The '.cio' file will be left behind for you to look at, if you like. Once the '.cio' files have been produced, 'gcc' is used to compile all the '.cio' files and link them together into an executable; the executable will have the same name as the INTERCAL source, minus any extension (and on DJGPP, assuming that its version of 'gcc' could handle the resulting command line (not necessarily guaranteed), a '.exe' extension is added), and will consist of all the C files linked together with the INTERCAL. Any functions named 'main' in the C files will be deleted; likewise, if there is a name clash between any two functions, the one in the file named earlier on the command line will be used. There is presumably some use for this feature, although I haven't figured out what it is yet. Extending this to other compiled languages is mostly a problem of determining how they fit into the INTERCAL control structure, which is not a trivial task, and of figuring out how to link them to C code, which in some cases is trivial (especially if the language is one that 'gcc' can compile!) and in other cases is very difficult. If anyone has any ideas of new languages that could be added to the external calls system, feel free to contact the current C-INTERCAL maintainer with suggestions or patches.  File: ick.info, Node: Expansion Libraries, Prev: Using External Calls, Up: External Calls 14.5 Expansion Libraries ======================== INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL ------------------------------------------------------------------------ no version 0.28+ no no The C-INTERCAL distribution comes with libraries that can be used to extend its capabilities; they are implemented using the external call mechanism, and are in effect standard files to include using that mechanism. To use an expansion library, give the '-e' option to 'ick' (note that this means you cannot use them with the debugger or profiler, nor with multithreaded or backtracking programs), and specify the expansion library's name at the end of the command line (or to be precise, anywhere after the initial INTERCAL file). The libraries themselves are written in C and have a '.c' extension, and are human-readable; C-INTERCAL will look for them in the same places as it looks for the system library (including in the current directory, so you can test your own expansion libraries without having to install them). Expansion libraries use C identifiers which start with the string 'ick_my_' (this is not used by the compiler, and is explicitly not affected by the prohibition on identifiers starting 'ick_' when writing an expansion library), and use line labels in the range (1600) to (1699). (Most programs will be avoiding this range anyway, because it's inside the (1000) to (1999) range reserved for the system library, but the system library doesn't use it, in much the same way that the identifiers used are inside the range reserved for the compiler, but the compiler doesn't use them.) Expansion libraries are available from C-INTERCAL version 0.28; CLC-INTERCAL has a similar concept (that of 'preloads'), but implemented a completely different way. syslibc ------- 'syslibc' is an implementation of the base-2 INTERCAL system library in C (*note System Libraries::); using it in programs running in other bases is accepted by the compiler, but likely to produce unpredictable results. When using this expansion library, you also need to give the '-E' option (*note -E: -E+.) so that the main system library is not included, or it will be used in preference to the expansion library. All documented features of the INTERCAL base-2 system library are implemented, but most undocumented features are not, so INTERCAL programs which relied on them (dubious behaviour in any case) will not work with 'syslibc'. The main reason to use this library is to increase the speed of an INTERCAL program; however, note that the speed gains in arithmetic will be accompanied by the performance penalty of using the external calls infrastructure, unless you were already using it. compunex -------- As an example of using 'ick_create', a very simple expansion library is provided to enable a computed NEXT capability, by defining a new command 'COMPUNEX'. It is used as 'DO .1 COMPUNEX' (allowing any expression in place of the .1), and is similar to an ordinary 'NEXT', but has two limitations: it takes up two 'NEXT' stack entries, and the top one should not be 'RESUMEd' past or forgotten (thus it isn't a particularly useful command, except maybe to produce the equivalent of something like function pointers). By the way, note that C-INTERCAL avoids computed 'NEXT' mainstream for much the same way that CLC-INTERCAL avoids 'NEXT' altogether; it makes things too easy. This example is provided mostly just to demonstrate the syntax, and the care that needs to be taken with implementing flow control operators. 'compunex' is double-deprecated; an alternative is the following sequence of commands involving computed 'CREATE': DO CREATE .1 ABC DO ABC This sequence emulates all features of 'NEXT' (although it has different gerunds and is two statements, not one), making it much more useful for simulating computed 'NEXT' than 'COMPUNEX' is. (There's no need to avoid forgetting the return value; although this skips the 'CREATE' cleanup, none is required because the created statement 'ABC' (any other statement would do just as well) takes no arguments.)  File: ick.info, Node: Differences to Other Compilers, Next: Character Sets, Prev: External Calls, Up: Top 15 Differences to Other Compilers ********************************* The C-INTERCAL compiler exists in a world of several other compilers. Differences to the Princeton compiler ------------------------------------- The Princeton compiler was the first INTERCAL compiler available, and compiled INTERCAL-72. Using 'convickt' (*note convickt::) to translate its programs from the original EBCDIC to Latin-1 or Atari-syntax ASCII is required to run them under the C-INTERCAL compiler, but apart from that there should be no problems; everything that that compiler can do can be reproduced by C-INTERCAL, even including some of its bugs. The only potential problems may be where constructs were nonportable or dubious to begin with (such as the 'IGNORE'/'RETRIEVE' interaction), or where commands intended to be syntax errors were used in the program but have a meaning in C-INTERCAL. For extra portability, it's possible to use the '-t' compiler option to 'ick' (*note -t::) to tell it to interpret the program as INTERCAL-72, but as C-INTERCAL's dialect of INTERCAL is basically backward-compatible anyway this mostly serves to check newer programs for compatibility with older compilers. Differences to the Atari compiler --------------------------------- The Atari compiler was an uncompleted implementation of INTERCAL-72, optimistically pre-described in some 1982 additions to the original INTERCAL-72 manual. Despite the implementation's never actually existing, the documentation of the syntax provided a model for C-INTERCAL. If any Atari 800 INTERCAL source code actually existed, there would be no need to use 'convickt' on it. Differences to J-INTERCAL ------------------------- The J-INTERCAL compiler is an implementation of INTERCAL written in Java that compiles INTERCAL into Java (and so has a similar relationship with Java to that of the C-INTERCAL compiler (which is written in C and compiles into C) with C). J-INTERCAL has much the same feature set as older versions of C-INTERCAL, with a few changes (such as the addition of Esperanto and error messages coming up in different situations). J-INTERCAL programs should run fine on C-INTERCAL without trouble (as it is also an Atari syntax compiler), except in nonportable cases such as 'IGNORE'/'RETRIEVE' interaction. Differences to CLC-INTERCAL --------------------------- The CLC-INTERCAL compiler is the most modern INTERCAL compiler apart from C-INTERCAL (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 C-INTERCAL, and is responsible for the origin of many of the features added in more recent versions of C-INTERCAL. Generally speaking, a CLC-INTERCAL program that uses its advanced features is unlikely to run on C-INTERCAL, or vice versa, whatever you do (apart from completely rewriting the more advanced parts of the program). 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 CLC-INTERCAL to C-INTERCAL) or Atari syntax (if translating from C-INTERCAL to CLC-INTERCAL), maybe using 'convickt', 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; C-INTERCAL uses the options '-xX', and on CLC-INTERCAL this is done by selecting the appropriate preloads, or by changing the program's file extension to '.ci'. In each case other options may be needed to turn on various extensions (maybe '-m' or '-v' if translating to C-INTERCAL, maybe the preload for gerund-based 'COME FROM' if translating to CLC-INTERCAL), and if translating to CLC-INTERCAL you need to append the system library to your program yourself because CLC-INTERCAL doesn't load it automatically. 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 'convickt'. 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 'IGNORE'/'RETRIEVE' interaction is one way to do this, as it differs between C-INTERCAL, J-INTERCAL, and CLC-INTERCAL. The other things to watch out for when doing this are that CLC-INTERCAL needs an explicit option to enable the use of 'NEXT', that CLC-INTERCAL doesn't load the system library itself (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 CLC-INTERCAL.  File: ick.info, Node: Character Sets, Next: convickt, Prev: Differences to Other Compilers, Up: Top Appendix A Character Sets ************************* The following table explains the equivalences between the various character sets used for INTERCAL: 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 CLC-INTERCAL versions, which are used by INTERCAL 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 'convickt' command-line tool to translate INTERCAL programs from one format to another (*note convickt::). 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. Atari Baudot EBCDIC Latin-1 ------------------------------------ 09 N/A 09 09 0a * 02 0a 0a 0d * 08 0d 0d 20 * 04 40 20 21 3 0d 4f 21 22 3 11 7f 22 23 4 06 7b 23 24 4 01 4a a2 25 4 1c 6c 25 26 3 1a 50 26 27 3 0b 7d 27 28 3 0f 4d 28 29 3 12 5d 29 2a 4 09 5c 2a 2b 4 03 4e 2b 2c 3 0c 6b 2c 2d 3 03 60 2d 2e 3 1c 4b 2e 2f 3 1d 61 2f 30 3 16 f0 30 31 3 17 f1 31 32 3 13 f2 32 33 3 01 f3 33 34 3 0a f4 34 35 3 10 f5 35 36 3 15 f6 36 37 3 07 f7 37 38 3 06 f8 38 39 3 18 f9 39 3a 3 0e 7a 3a 3b 3 1e 5e 3b 3c 4 0f 4c 3c 3d 4 07 7e 3d 3e 4 12 6e 3e 3f 4 0c 65 a5 40 3 19 6f 3f 41 1 03 c1 41 42 1 19 c2 42 43 1 0e c3 43 44 1 09 c4 44 45 1 01 c5 45 46 1 0d c6 46 47 1 1a c7 47 48 1 14 c8 48 49 1 06 c9 49 4a 1 0b d1 4a 4b 1 0f d2 4b 4c 1 13 d3 4c 4d 1 1c d4 4d 4e 1 0c d5 4e 4f 1 18 d6 4f 50 1 16 d7 50 51 1 17 d8 51 52 1 0a d9 52 53 1 05 e2 53 54 1 10 e3 54 55 1 07 e4 55 56 1 1e e5 56 57 1 12 e6 57 58 1 1d e7 58 59 1 15 e8 59 5a 1 11 e9 5a 5b 4 10 9e 5b 5c 4 05 N/A 5c 5d 4 13 5a 5d 5e 4 0d 6a 7c 5f 4 15 7c 40 60 N/A N/A 60 61 2 03 81 61 62 2 19 82 62 63 2 0e 83 63 64 2 09 84 64 65 2 01 85 65 66 2 0d 86 66 67 2 1a 87 67 68 2 14 88 68 69 2 06 89 69 6a 2 0b 91 6a 6b 2 0f 92 6b 6c 2 13 93 6c 6d 2 1c 94 6d 6e 2 0c 95 6e 6f 2 18 96 6f 70 2 16 97 70 71 2 17 98 71 72 2 0a 99 72 73 2 05 a2 73 74 2 10 a3 74 75 2 07 a4 75 76 2 1e a5 76 77 2 12 a6 77 78 2 1d a7 78 79 2 15 a8 79 7a 2 11 a9 7a 7b 4 0a 9c 7b 7c 4 1e fe N/A 7d 4 11 dc 7d 7e 4 0b a1 7e  File: ick.info, Node: convickt, Next: Optimizer Idiom Language, Prev: Character Sets, Up: Top Appendix B convickt ******************* A variety of character sets have historically been used to represent INTERCAL programs. Atari syntax was designed specifically for use with ASCII-7, and all Atari-syntax-based INTERCAL compilers accept that character set as possible input. (C-INTERCAL 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 CLC-INTERCAL compiler accepts Latin-1, a custom dialect of EBCDIC, Baudot, and a punched-card format as input; C-INTERCAL 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. 'convickt' is an INTERCAL character set conversion program designed with these needs in mind. The syntax for using 'convickt' is convickt INPUTSET OUTPUTSET [PADDING] (that is, the input and output character sets are compulsory, but the parameter specifying what sort of padding to use is optional). The following values for INPUTSET and OUTPUTSET are permissible: 'latin1' Latin-1, or to give it its official name ISO-8859-1, is the character set most commonly used for transmitting CLC-INTERCAL programs, and therefore nowadays the most popular character set for Princeton syntax programs. Because it is identical to ASCII-7 in all codepoints that don't have the high bit set, most of the characters in it can be read by most modern editors and terminals. It is also far more likely to be supported by modern editors than EBCDIC, Baudot, or punched cards, all of which have fallen into relative disuse since 1972. It is also the only input character set that C-INTERCAL supports for Princeton syntax programs. It uses 8 bit characters. 'ebcdic' EBCDIC is an 8-bit character set that was an alternative to ASCII in 1972, and is the character set used by the original Princeton compiler. Unfortunately, there is no single standard version; the version of EBCDIC used by 'convickt' is the one that CLC-INTERCAL uses. It is the default input character set that CLC-INTERCAL uses (although more recent versions of CLC-INTERCAL instead try to guess the input character set based on the input program.) 'baudot' Baudot is a 5-bit character set with shift codes; therefore when storing it in a file on an 8-bit computer, padding is needed to fill in the remaining three bits. The standard Baudot character set does not contain all the characters needed by INTERCAL; therefore, CLC-INTERCAL uses repeated shift codes to add two more sets of characters. 'convickt' uses the CLC-INTERCAL version of Baudot, so as to be able to translate programs designed for that compiler; however, standard Baudot is also accepted in input if it contains no redundant shift codes, and if the input contains no characters not in standard Baudot, the output will be written so that it is both correct standard Baudot and correct CLC-INTERCAL Baudot for those characters. 'atari' This option causes 'convickt' to attempt a limited conversion to or from Atari syntax; this uses ASCII-7 as the character set, but also tries to translate between Atari and Princeton syntax at the character level, which is sometimes but not always effective. For instance, '?' is translated from Atari to Princeton as a yen sign, and from Princeton to Atari as a whirlpool ('@'); this sort of behaviour is often capable of translating expressions automatically, but will fail when characters outside ASCII-7 (Atari) or Latin-1 (Princeton) are used, and will not, for instance, translate a Princeton 'V', backspace, '-' into Atari '?', but instead leave it untouched. ASCII-7 is a 7-bit character set, so on an 8 bit computer, there is one bit of padding that needs to be generated; note, however, that it is usual nowadays to clear the top bit when transmitting ASCII-7, which the 'printable' and 'zero' padding styles will do, but the 'random' style may not do. 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: Option Meaning ----------------------------------------------------------------- printable Keep the output in the range 32-126 where possible zero Zero the high bits in the output random Pad with random bits (avoiding all-zero bytes) 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 INTERCAL (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 INTERCAL source code into Baudot.)  File: ick.info, Node: Optimizer Idiom Language, Next: Copying, Prev: convickt, Up: Top Appendix C Optimizer Idiom Language *********************************** One file in the C-INTERCAL distribution ('src/idiotism.oil') is written in Optimizer Idiom Language, a programming language designed especially for expressing optimizer idioms for INTERCAL 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 INTERCAL compiler). * Menu: * Basics: OIL Basics. The basics of how an OIL program works. * Syntax: OIL Syntax. How to write comments, idioms, and groups. * Expressions: OIL Expressions. Expressions are the basis of idioms. * Patterns: OIL Patterns. Filling in the left hand side of an idiom. * Replacements: OIL Replacements. Syntax for the right hand side. * Loops: OIL Loops. Simplifying and shortening programs. * Tips: OIL Tips. Some tips about using OIL. * Example: OIL Example. An example of how OIL can work.  File: ick.info, Node: OIL Basics, Next: OIL Syntax, Up: Optimizer Idiom Language C.1 OIL Basics ============== The structure of an OIL file consists of a sequence of idioms. An optimizer idiom looks for a certain pattern in an expression (which could be an INTERCAL expression, or an expression that has already been partly optimized and therefore contains some non-INTERCAL operators), and replaces it with a replacement that's 'simpler' in some sense (in the case of C-INTERCAL, 'simpler' is interpreted to mean 'compiles into a faster or smaller executable when run through a C compiler'). When an OIL program acts on an input INTERCAL 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. At present, the only place that OIL is used in the C-INTERCAL compiler is when the '-O' option (*note -O: -O+.) is used in base 2. (Syntax is planned to extend OIL 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 'src/idiotism.oil' during the compilation of the C-INTERCAL from sources; you can change the idioms, but you will then have to recompile the distribution (and if you are using the 'config.sh' method, also reinstall, but that will be pretty fast.)  File: ick.info, Node: OIL Syntax, Next: OIL Expressions, Prev: OIL Basics, Up: Optimizer Idiom Language C.2 OIL Syntax ============== An OIL file is encoded as an ASCII 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. Comments can be given anywhere in the file by writing lines starting with semicolons (known as hybrids to INTERCAL 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 '/*' and '*/' (in such cases, the comments will be copied verbatim to the C temporary files used when building the C-INTERCAL 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 '.:#_}', 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. 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: [nullshift] (_1 >> #0)->(_1) (_1 << #0)->(_1) 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. As the example above shows, the syntax of an idiom itself is (pattern)->(replacement) 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 OIL expressions, although they both have their own special syntax elements as well.  File: ick.info, Node: OIL Expressions, Next: OIL Patterns, Prev: OIL Syntax, Up: Optimizer Idiom Language C.3 OIL Expressions =================== An OIL expression is built around subexpressions connected by infix binary operators and/or preceded by prefix unary operators, the same way as in C or INTERCAL (although unary operators must be entirely before their argument; the one character later position is not allowed.) As in INTERCAL, 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). The following unary and binary operators are allowed in OIL expressions: '$' INTERCAL mingle '~' INTERCAL select '&16' INTERCAL unary AND (16-bit) 'V16' INTERCAL unary OR (16-bit) '?16' INTERCAL unary XOR (16-bit) '^16' INTERCAL unary sharkfin (16-bit) '@16' INTERCAL unary whirlpool (16-bit) '@216..@516' INTERCAL unary generalised whirlpool (16-bit) '&32' INTERCAL unary AND (32-bit) 'V32' INTERCAL unary OR (32-bit) '?32' INTERCAL unary XOR (32-bit) '^32' INTERCAL unary sharkfin (32-bit) '@32' INTERCAL unary whirlpool (32-bit) '@232..@532' INTERCAL unary generalised whirlpool (32-bit) '&' C binary bitwise AND '|' C binary bitwise OR '^' C binary bitwise XOR '+' C addition '-' C subtraction '*' C multiplication '/' C integer division '%' C modulus '>' C greater than '<' C less than '~' C unary bitwise complement '!=' C not equals operator '==' C equals operator '&&' C logical AND '||' C logical OR '>>' C bitwise rightshift '<<' C bitwise leftshift '!' C unary logical NOT (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 INTERCAL unary logic operators, OIL unary logic operators must have a bitwidth stated.) 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.  File: ick.info, Node: OIL Patterns, Next: OIL Replacements, Prev: OIL Expressions, Up: Optimizer Idiom Language C.4 OIL Patterns ================ Patterns are simply OIL expressions; the expressions match either original INTERCAL 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. One special simple form of match is possible: '#NUMBER', where NUMBER is in decimal, matches a constant with that value. (Unlike in INTERCAL, 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 OIL.) Otherwise, an operand consists of the following parts, written in order: 1. A character to specify the data type of what's being matched. Usually, this will be '_' to specify that any data type can be matched. In a few cases, you may want to use '.' or ':' to specify that you only want to match a onespot or twospot value respectively (that is, 16- or 32-bit). You can also use '#'; this specifies a value that can be any width, but must be known to be a constant with a known value at optimize time (either because it was hardcoded as a constant originally or because a constant was produced there by the optimizer, for instance via a constant folding optimization). 2. Optionally, an expression in braces ('{' and '}'). This expression is written in C, not OIL (as are all expressions in braces), and puts an extra condition on whether the pattern matches. The exact meaning of this will be explained later. 3. A reference number, which must be one decimal digit long. A reference number of 0 causes the operand to be discarded immediately after matching; normally, you will want to specify a positive reference number. Two operands with the same reference number must be exactly the same for the pattern to match (for instance, both references to the same variable, or identical subexpressions). The reference number also allows the operand to be referenced by C expressions on other operands and by replacements. Reference numbers must be unique within the idiom (unless two or more reference numbers are deliberately the same so that the operands they reference have to be identical to produce a match), and they are scoped only as far as the containing idiom; they don't carry from one idiom to another. Note that syntax like '#2' 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 '#{1}2', using a no-op braced expression to tell them apart. This particular no-op is recommended because it's detected and optimized by the 'OIL' compiler. 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: 'c' 'cNUMBER' This accesses a calculation made automatically by the compiled OIL program to identify which bits of the operand can possibly be set, and which ones cannot be. 'c' by itself refers to the operand to which the braced expression is attached; if a number is given, it refers to another node (the number is interpreted as a reference number). The actual value of 'c' is a 32-bit unsigned integer, each bit of which is true, or 1, if there is any chance that the corresponding bit of the operand might be 1, and false, or 0, if it's known for certain that the corresponding bit of the operand is 0. For instance: _{!(c&4294901760LU)}1 The constant given here is FFFF0000 when expressed in hexadecimal; the point is that the expression matches any operand that is known to have a value no greater than 65535. Unless the operand is the argument to a unary AND, this check generally makes more sense than explicitly specifying '.' rather than '_', because it will identify both 16- and 32-bit values as long as they're small enough to fit into a onespot variable. This code could, for instance, be used to check that an argument to a mingle must be small enough before optimising it (this is important because an optimisation shouldn't optimise an error - in this case, an overflowing mingle - into a non-error). 'x' 'xNUMBER' 'x' is like 'c', and refers to operands in the same way, except that it can only refer to an operand marked with '#'. It holds the value of that constant (a 32-bit unsigned integer), which will be known to the optimizer at optimize time. One common use of this is to detect whether a constant happens to be a power of 2, although there are many other possibilities that may be useful. 'r' When inside a loop, 'r' is the value of the loop counter. (It's almost certainly a mistake if you have a loop but don't reference the loop counter at least once, and usually at least twice, within the loop.) *Note OIL Loops::. 'and16' 'and32' 'or16' 'or32' 'xor16' 'xor32' 'iselect' 'mingle' These are all functions with one argument (apart from iselect and mingle, which each take two arguments); they exist so that INTERCAL operators can be used by C expressions. They all take unsigned longs as input and output, even if they are onespot operators. Note that it's entirely possible for these to cause a compile-time error if used on invalid arguments (such as mingling with an operand over 65535), or to silently truncate an invalid argument down to the right number of bits; both of these should be avoided if possible, so the optimiser should check first to make sure that it doesn't use any of these functions on invalid arguments. 'xselx' This function returns its argument selected with itself; so 'xselx(c)' is shorthand for 'iselect(c,c)'. When the argument is very complicated, this can save a lot of space in the original OIL program. 'setbitcount' This function simply returns the number of bits with value 1 in its argument. This is sometimes useful with respect to various select-related optimisations, and can be a useful alternative to having to take logarithms in various situations. 'smudgeright' 'smudgeleft' The 'smudgeright' function returns its argument but with all the bits less significant than the most significant bit with value 1 set to 1; likewise, 'smudgeleft' returns its argument with all the bits more significant than the least significant bit with value 1 set to 1. Note that all OIL calculation 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 'LU' 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 OIL compiler itself will not complain. Here's a more complicated example of an optimizer operand: #{!(x&2863311530LU)&&iselect(x,1431655765LU)== xselx(iselect(x,1431655765LU))}3 It helps to understand this if you know that 2863311530 in hexadecimal is AAAAAAAA and 1431655765 in hexadecimal is 55555555. (It's worth putting a comment with some frequently-used decimal constants in an OIL 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.  File: ick.info, Node: OIL Replacements, Next: OIL Loops, Prev: OIL Patterns, Up: Optimizer Idiom Language C.5 OIL Replacements ==================== 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. INTERCAL 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 INTERCAL's rules, this information needs to be inserted somehow in a replacement. In C-INTERCAL, it usually doesn't matter what the bitwidth is, and in cases where it doesn't matter the normal operators ('$', '~', and so on) can be used. (The bitwidth of the entire replacement may be different from the bitwidth of the original, thus leading to, say, a 32-bit unary logical operation applied to a "16-bit" argument; but this is not a problem, as it just means that there's an implied typecast in there somewhere.) In cases where it does matter (due to C-INTERCAL's lenient interpretation of bitwidth on mingle inputs, the only place it matters is in the input to INTERCAL unary logical operators), both the bitwidth 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, '!=32' 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 '&32' already have a bitwidth specified, so specifying '&3232' (or worse, '&3216') is not allowed. Replacement operands are simpler than pattern operands, because there are only a few forms they can take. '_NUMBER' '.NUMBER' ':NUMBER' This tells the optimiser to copy the operand or expression with reference number NUMBER to this point in the replacement used for the expression matched by the pattern. The three forms are identical; the last two are provided for aesthetic reasons (it can look better and be clearer to match '.1' in the pattern with '.1' in the replacement, for instance). You cannot use '#NUMBER' here to copy in a constant from the left-hand side, though, nor '#{1}NUMBER', because the first means something else and the second is undefined behaviour (that is, no behaviour for the second case has been specifically implemented in the compiler and therefore its behaviour is unpredictable and subject to change in future versions); use '_NUMBER' to copy over a constant with an unknown at optimizer compile time (but known at optimize time) value from the left hand side, as you can do with any other operand being copied. '#NUMBER' Insert a constant with the literal value NUMBER here. '#{EXPRESSION}0' Calculate the value of EXPRESSION (a C expression, which can reference the same variables and functions as a C expression in a pattern can; see *note C functions in OIL::) and insert a constant with the calculated value here. (That is, a value is calculated at optimise-time and the resulting value is therefore constant at runtime.) 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, whilst the shifts can all be combined into one large shift.) ((_1 << #{1}2) & #{1}3)->((_1 & #{x3>>x2}0) << _2)  File: ick.info, Node: OIL Loops, Next: OIL Tips, Prev: OIL Replacements, Up: Optimizer Idiom Language C.6 OIL Loops ============= 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: (_1~#{xselx(x)<<1==x&&x}2)->((_1&_2)>>#1) (_1~#{xselx(x)<<2==x&&x}2)->((_1&_2)>>#2) Adding a loop to automatically generate the idioms, and placing a name for the group of idioms at the start, produces the following code: [rshift] <#1-#31 (_1~#{xselx(x)<((_1&_2)>>#{r}0) > That's 31 different idioms, generated with a loop. As the above example shows, a loop starts with '<#NUMBER-#NUMBER' and ends with '>'; a different idiom is generated for each possible value of the loop counter 'r' 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 '#{r}0' to generate a constant whose value is equal to the value of the loop counter.  File: ick.info, Node: OIL Tips, Next: OIL Example, Prev: OIL Loops, Up: Optimizer Idiom Language C.7 OIL Tips ============ Here are some tips for the best use of OIL: * The OIL compiler has a few deficiencies, such as error messages that don't give you much of an idea of what you did wrong (to compensate for this, it does give a reasonably accurate line and character number where the error happened), limits on things like how deep expressions can be nested and how many idioms are allowed (if you hit the first, you should really break it up into smaller idioms if possible, and if you hit the second, increase 'MAXTOFREE' in oil.y; this isn't a limit on the number of idioms but on the number of strings that are allocated internally to process the idioms), and lack of error checking (invalid OIL may produce errors in the OIL compiler, or cause the output C code to contain errors or warnings, or may even appear to work). * When you have symmetrical operators in an idiom (like C binary logical operators), you need to write the idiom both ways round (in the same group of idioms, preferably), or write another idiom to standardise the format first; the first method can get very tedious when there are many symmetrical operators in an idiom, and the second is prone to optimizer loops and subtle errors (both methods have been used in the provided 'idiotism.oil' file). * Idioms should preferably be as general as possible, broken down into many separate idioms rather than all as one big idiom, and match the smallest part of the expression being optimized that is necessary for the idiom to be correct in all circumstances; all of these help to improve the performance of the optimizer in terms of what it can optimize. * If a program's optimizing incorrectly, or you just want to see how the optimizer deals with a particular program, it's possible to debug the optimizer by giving the '-h', '-H', or '-hH' (*note -h::) switch to the C-INTERCAL compiler, which will cause debug information to be output on stderr. '-h' will show the initial and final expressions for each expression that was given as input to the optimizer, as well as a list of all optimizations used, in a language that's a sort of mix of C, INTERCAL, and OIL; '-H' will do the same, and also show the intermediate stages in the optimization. '-hH' is like '-H', 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 INTERCAL. '-H' can be a useful learning resource for people who want to understand how a particular INTERCAL expression works. * Make sure that the optimizer doesn't change a statement from a run-time error into something that silently succeeds! Checking which bits can and can't be 1 is one good way to avoid this, especially with mingles. Likewise, don't optimise a run-time error into a compile-time error (although creating a compile-time warning in this situation is fine). * You can help! If you find an idiom that the optimizer isn't optimizing correctly, feel free to add it, or multiple idioms that come to the same thing, to 'idiotism.oil'. In such a case, it would help other users if you would submit your new optimizer idiom to the project (*note Reporting Bugs::); this will help other users and future releases of INTERCAL, and also has a chance of allowing other users to check your new idioms to see if they cause problems or could be written better. intercal-0.30/doc/PaxHeaders.27456/READ.ME0000644000000000000000000000013212507155722014512 xustar0030 mtime=1427954642.774849006 30 atime=1427954642.862848705 30 ctime=1427992235.630945573 intercal-0.30/doc/READ.ME0000664000175000017500000000436412507155722014423 0ustar00esresr00000000000000This directory contains the documentation (such as it is) for INTERCAL. READ.ME: This file. Makefile: Machine-readable rules for building the documentation. intercal.mm: Masters for the INTERCAL manual (needs pic to render illos) This has been carefully proofread against the original paper version. ick.txi: Master for the Revamped reference manual, a newer manual independent of the old one. THEORY.txt: Implementation notes on the C-INTERCAL implementation. build-process.txt: Notes on how the C-INTERCAL build process works. chipspec.txt: Christian Brunschen's spec sheet for the INTERCAL chip. RFC-DRAFT.roff: A draft of an INTERCAL-related RFC by Eric S. Raymond. ick.1: convickt.1: Man pages for ick and convickt. fdl-1-2.txi: License for the Revamped Manual. fixtoc.pl, fix83.pl, ickstyle.css, tidy.cfg: Helper files used to build the HTML version of the Revamped Manual. Note 1: The TeX version we formerly distributed has been dropped. The combination of groff and pic does an effective job of rendering the illustrations and is easier to maintain. Note 2: The supplemental reference manual, ick.txt, has been merged into the intercal manual. (It is still possible to generate the original; see the Makefile.) Note 3: The flat-ASCII directly transcribed from the paper original is also gone. You can regenerate something very close to it with `make original.txt'. The differences will be (a) page breaks may fall in different places, (b) the circuit diagrams present in the paper version but absent in the ASCII transcription are instead poorly approximated with ASCII boxology, (c) every "butchered Roman numeral" is preceded and followed by a line break, (d) the hanging-indent list of Princeton compiler options has all marks above each description, rather than to its left. The aim of these changes was to reduce to one the number of manual masters that need to be maintained for the original manual, which can both produce the original INTERCAL-72 manual and the revised version that existed up to about version 0.18. However, the revised version proved to be unportable and impractical; it's still worth a read, but for up-to-date information available in a range of formats it's worth reading the Revamped manual instead. intercal-0.30/doc/PaxHeaders.27456/fix83.pl0000644000000000000000000000007411437550756015066 xustar0030 atime=1427954558.347140885 30 ctime=1427992235.622945595 intercal-0.30/doc/fix83.pl0000755000175000017500000000433211437550756014766 0ustar00esresr00000000000000#!/bin/perl # Change .html to .htm and change all URLs appropriately in the file # being edited; also fix a bug in makeinfo that sometimes causes # incorrect anchors to be used in the META REFRESH commands. # # This script assumes the output from makeinfo is reasonably correct, so it # needs to be run on a system that supports filenames longer than 8.3; it # converts these long filenames into 8.3 form. my @base32str=qw{0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v}; # Hash a string into 8 5-bit segments, base32 encoded # The algorithm isn't designed to be secure or anything like that, but simply # to avoid collisions in what filenames are mapped to. I don't know how well # it succeeds at this. Note that this can't map to "index" unless the input # is "index", in which case it always does; this is a special case. The # hashing is case-insensitive to reduce errors on DOS. sub hash8x5($) { my $low32sf=0; my $high32sf=0; my $str=shift; $str=lc $str; defined($str) or die; return "index" if $str eq "index"; while($str ne '') { $low32sf ^= !!($low32sf & (1<<19)); $low32sf &= (1<<19)-1; $low32sf <<= 1; $low32sf ^= ord $str; $low32sf *= 41; $high32sf ^= !!($high32sf & (511<<11)); $high32sf &= (1<<11)-1; $high32sf <<= 9; $high32sf ^= ord $str; $high32sf *= 43; $str = substr $str, 1; } $str = $base32str[$low32sf & 31]; $low32sf >>= 5; $str .= $base32str[$low32sf & 31]; $low32sf >>= 5; $str .= $base32str[$low32sf & 31]; $low32sf >>= 5; $str .= $base32str[$low32sf & 31]; $str .= $base32str[$high32sf & 31]; $high32sf >>= 5; $str .= $base32str[$high32sf & 31]; $high32sf >>= 5; $str .= $base32str[$high32sf & 31]; $high32sf >>= 5; $str .= $base32str[$high32sf & 31]; return $str; } $/=undef; #read the whole file at a time open CSSFILE, "; close CSSFILE; while(<>) { /^]*?).html([\"\#])/$1 . hash8x5($2) . ".htm" . $3/ge; }; s/(\-\-><\/style>)/$css$1/; s/(href=\")([^\">]*?).html([\"\#])/$1 . hash8x5($2) . ".htm" . $3/ge; s=^(.*?)\.html$="mv html/".$1.".html html/".hash8x5($1).".htm"=gemi; print; } intercal-0.30/doc/PaxHeaders.27456/intercal.mm0000644000000000000000000000007411474650025015713 xustar0030 atime=1427954558.347140885 30 ctime=1427992235.630945573 intercal-0.30/doc/intercal.mm0000644000175000017500000036044311474650025015620 0ustar00esresr00000000000000.\" Note: This is both a current manual and an archeological exhibit. .\" All revisions must be properly conditioned on the c string so that .\" it's still possible to format the INTERCAL-72 manual. Only outright .\" errors should be corrected -- each of these is marked with CORRECTION .\" and an explanatory comment. .\" .\" This document is free; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This document is distributed in the hope that it will be amusing, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this document; if not, write to the Free Software .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .ND .ds vb V\v'-0.2'\h'-0.6'\-\v'0.2' .if n .ds es \o"O|" .if t .ds es \(es .if n .ds ct \o"c/" .if t .ds ct \(ct .if n .ds no \o"-'" .if t .ds no \(no .if n .ds ov - .if t .ds ov \(rn .INITR intercal.refs .TL THE INTERCAL PROGRAMMING LANGUAGE .br .if '\*c'y' REVISED REFERENCE MANUAL .if '!\*c'n' REFERENCE MANUAL .AU "Donald R. Woods" .AF "" .AU "and" .AF "" .AU "James M. Lyon" .AF "" .if '\*c'y' \{\ .AU "" .AU "C-INTERCAL revisions:" .AU "Louis Howell" .AF "" .AU "and" .AF "" .AU "Eric S. Raymond" \} .AF "" .AST "" .AS 2 .ce 2 \fICopyright (C) 1973 by Donald R. Woods and James M. Lyon\fR .if '\*c'y' \{\ .ce 2 \fICopyright (C) 1996, 1997 by Eric S. Raymond Redistribution encouraged under GPL\} .sp .ce 1 (This version distributed with C-INTERCAL 0.18) .AE .MT 4 .nr % 0 .nr Hs 5 .nr Ej 1 .bp .H 1 "INTRODUCTION" .if '\*c'y' \{\ .DS I F "But I don't want to go among mad people," Alice remarked. .P "Oh, you ca'n't help that," said the Cat: "We're all mad here. I'm mad. You're mad." .P "How do you know I'm mad?" said Alice. .P "You must be," said the Cat, "or you wouldn't have come here." .DE \} .P The names you are about to ignore are true. However, the story has been changed significantly. Any resemblance of the programming language portrayed here to other programming languages, living or dead, is purely coincidental. .H 2 "Origin and Purpose" .P The INTERCAL programming language was designed the morning of May 26, 1972 by Donald R. Woods and James M. Lyon, at Princeton University. Exactly when in the morning will become apparent in the course of this manual. .ie '\*c'y' \{\ .P Eighteen years later (give or take a few months) Eric S. Raymond perpetrated a UNIX-hosted INTERCAL compiler as a weekend hack. The C-INTERCAL implementation has since been maintained and extended by an international community of technomasochists, including Louis Howell, Steve Swales, Michael Ernst, and Brian Raiter. .P (There was evidently an Atari implementation sometime between these two; notes on it got appended to the INTERCAL-72 manual. The culprits have sensibly declined to identify themselves.) .P INTERCAL \} .el It was inspired by one ambition: to have a compiler language which has nothing at all in common with any other major language. By 'major' was meant anything with which the authors were at all familiar, e.g., FORTRAN, BASIC, COBOL, ALGOL, SNOBOL, SPITBOL, FOCAL, SOLVE, TEACH, APL, LISP, and PL/I. For the most part, INTERCAL has remained true to this goal, sharing only the basic elements such as variables, arrays, and the ability to do I/O, and eschewing all conventional operations other than the assignment statement (FORTRAN "="). .H 2 "Acronym" .P The full name of the compiler is "Compiler Language With No Pronounceable Acronym", which is, for obvious reasons, abbreviated "INTERCAL". .H 2 "Acknowledgments" .P The authors are deeply indebted to Eric M. Van and Daniel J. Warmenhoven, without whose unwitting assistance this manual would still have been possible. .H 1 "FUNDAMENTAL CONCEPTS" .if '\*c'y' \{\ .DS I F "There's nothing like eating hay when you're faint," the White King remarked to Alice, as he munched away. .P "I should think throwing cold water over you would be better," Alice suggested: "-- or some sal-volatile." .P "I didn't say there was nothing \fIbetter\fR," the King replied. "I said there was nothing \fIlike\fR it." Which Alice did not venture to deny. .DE \} .P In this section an attempt is made to describe how and why INTERCAL may be used; i.e., what it is like and what it is good for. .H 2 "Sample Program" .SETR example1 .P Shown below is a relatively simple INTERCAL program which will read in 32-bit unsigned integers, treat them as signed, 2's-complement numbers, and print out their absolute values. The program exits if the absolute value is zero. Note in particular the inversion routine (statements 6 through 14), which could be greatly simplified if the subroutine library (see section .GETHN sublib ) were used. .P A more detailed analysis of a program is made in section .GETHN proghints of this manual. .\" Note: there was an error in line 15 in the original manual; .\" the operands of the third \(ct were swapped. .DS L .cs R 24 DO (5) NEXT (5) DO FORGET #1 PLEASE WRITE IN :1 DO .1 <- '\*(vb":1~'#32768\*(ct#0'"\*(ct#1'~#3 DO (1) NEXT DO :1 <- "'\*(vb":1~'#65535\*(ct#0'"\*(ct#65535' ~'#0\*(ct#65535'"\*(ct"'\*(vb":1~'#0\*(ct#65535'" \*(ct#65535'~'#0\*(ct#65535'" DO :2 <- #1 PLEASE DO (4) NEXT (4) DO FORGET #1 DO .1 <- "\*(vb':1~:2'\*(ct#1"~#3 DO :1 <- "'\*(vb":1~'#65535\*(ct#0'"\*(ct":2~'#65535 \*(ct#0'"'~'#0\*(ct#65535'"\*(ct"'\*(vb":1~'#0 \*(ct#65535'"\*(ct":2~'#0\*(ct#65535'"'~'#0\*(ct#65535'" DO (1) NEXT DO :2 <- ":2~'#0\*(ct#65535'" \*(ct"'":2~'#65535\*(ct#0'"\*(ct#0'~'#32767\*(ct#1'" DO (4) NEXT (2) DO RESUME .1 (1) PLEASE DO (2) NEXT PLEASE FORGET #1 DO READ OUT :1 PLEASE DO .1 <- '\*(vb"':1~:1'~#1"\*(ct#1'~#3 DO (3) NEXT PLEASE DO (5) NEXT (3) DO (2) NEXT PLEASE GIVE UP .cs R .DE .H 2 "Uses for INTERCAL" .P INTERCAL's main advantage over other programming languages is its strict simplicity. It has few capabilities, and thus there are few restrictions to be kept in mind. Since it is an exceedingly easy language to learn, one might expect it would be a good language for initiating novice programmers. Perhaps surprising, then, is the fact that it would be more likely to initiate a novice into a search for another line of work. As it turns out, INTERCAL is more useful (which isn't saying much) as a challenge to professional programmers. Those who doubt this need only refer back to the sample program in section .GETHN example1 .\" CORRECTION: .\" The original manual counted 22 statements, incorrectly. \&. This 23-statement program took somewhere from 15 to 30 minutes to write, whereas the same objectives can be achieved by single-statement programs in either SNOBOL; .DS L PLEASE INPUT POS(0) ('-' ! '') + (SPAN('0123456789') $ OUTPUT) + *NE(OUTPUT) :S(PLEASE)F(END) .DE or APL; .DS L [1] \(->0\(!=\(sq\(<-\(or\(sq .DE Admittedly, neither of these is likely to appear more intelligible to anyone unfamiliar with the languages involved, but they took roughly 60 seconds and 15 seconds, respectively, to write. Such is the overwhelming power of INTERCAL! .P The other major importance of INTERCAL lies in its seemingly inexhaustible capacity for amazing one's fellow programmers, confounding programming shop managers, winning friends, and influencing people. It is a well-known and oft-demonstrated fact that a person whose work is incomprehensible is held in high esteem. For example, if one were to state that the simplest way to store a value of 65536 in a 32-bit INTERCAL variable is: .DS L DO :1 <- #0\*(ct#256 .DE any sensible programmer would say that that was absurd. Since this is indeed the simplest method, the programmer would be made to look foolish in front of his boss, who would of course happened to turn up, as bosses are wont to do. The effect would be no less devastating for the programmer having been correct. .H 1 "DESCRIPTION" .if '\*c'y' \{\ .DS I F "I quite agree with you," said the Duchess; "and the moral of that is -- 'Be what you would seem to be' -- or, if you'd like it put more simply -- 'Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise." .P "I think I should understand that better," Alice said very politely, "if I had it written down: but I ca'n't quite follow it as you say it." .P "That's nothing to what I could say if I chose," the Duchess replied, in a pleased tone. .DE \} .P The examples of INTERCAL programming which have appeared in the preceding sections of this manual have probably seemed highly esoteric to the reader unfamiliar with the language. With the aim of making them more so, we present here a description of INTERCAL. .H 2 "Variables" .P INTERCAL allows only 2 different types of variables, the .B "16-bit integer" and the .B "32-bit integer." These are represented by a spot (.) or two-spot (:), respectively, followed by any number between 1 and 65535, inclusive. These variables may contain only non-negative numbers; thus they have the respective ranges of values: 0 to 65535 and 0 to 4294967295. Note: .123 and :123 are two distinct variables. On the other hand, .1 and .0001 are identical. Furthermore, the latter may \fInot\fR be written as 1E-3. .H 2 "Constants" .P .B Constants are 16-bit values only and may range from 0 to 65535. They are prefixed by a mesh (#). Caution! Under no circumstances confuse the mesh with the interleave operator, except under confusing circumstances! .H 2 "Arrays" .P .B Arrays are represented by a tail (,) for 16-bit values, or a hybrid (;) for 32-bit values, followed by a number between 1 and 65535, inclusive. The number is suffixed by the word SUB, followed by the subscripts, separated optionally by spaces. Subscripts may be any expressions, including those involving subscripted variables. This occasionally leads to ambiguous constructions, which are resolved as discussed in section .GETHN precedence \&. Definition of array dimensions will be discussed later in greater detail, since discussing it in less detail would be difficult. As before, ,123 and ;123 are distinct. In summary, .123, :123, #123, ,123, and ;123 are all distinct. .H 2 "Operators" .P INTERCAL recognizes 5 operators -- 2 binary and 3 unary \*F. Please be kind to our operators: they may not be very intelligent, but they're all we've got. In a sense, all 5 operators are binary, as they are all bit-oriented, but it is not our purpose here to quibble about bits of trivia. .if '\*c'y' \{\ .FS Other operators are also available with C-INTERCAL's non-standard dialects; see section .GETHN tri_intercal \&. .FE \} .H 3 "Binary Operators" .P The binary operators are \fBinterleave\fR (also called \fBmingle\fR) and \fBselect\fR, which are represented by a change (\*(ct) and a sqiggle [sic] (~), respectively. .if '\*c'y' \{\ (In C-INTERCAL's ASCII environment, EBCDIC \*(ct is replaced by a big money ($), but \*(ct can be used if encoded in Latin-1 as \e0xA2 or UTF-8 as 0xC2A2.) \} .P The interleave operator takes two 16-bit values and produces a 32-bit result by alternating the bits of the operands. Thus, #65535\*(ct#0 has the 32-bit binary form 101010....10 or 2863311530 decimal, while #0\*(ct#65535 = 0101....01 binary = 1431655765 decimal, and #255\*(ct#255 is equivalent to #65535. .P The select operator takes from the first operand whichever bits correspond to 1's in the second operand, and packs these bits to the right in the result. Both operands are automatically padded on the left with zeros to 32 bits before the selection takes place, so the variable types are unrestricted. If more than 16 bits are selected, the result is a 32-bit value, otherwise it is a 16-bit value. For example, #179~#201 (binary value 10110011~11001001) selects from the first argument the 8th, 7th, 4th, and 1st from last bits, namely, 1001, which = 9. But #201~#179 selects from binary 11001001 the 8th, 6th, 5th, 2nd, and 1st from last bits, giving 10001 = 17. #179~#179 has the value 31, while #201~#201 has the value 15. .P Perhaps a simpler way of understanding the operation of the select operator .\" CORRECTION: .\" "in Figure 1" was originally "on the following page (Figure 1)" .\" We can't rely on the page boundaries any more. would be to examine the logic diagram in Figure 1, which performs the select operation upon two 8-bit values, A and B. The gates used are Warmenhovian logic gates, which means the outputs have four possible values: low, high, undefined (value of an uninitialized flip-flop), and oscillating (output of a NOR gate with one input low and the other input connected to the output). These values are represented symbolically by '0', '1', '?', and '\*(es'. Note in particular that, while NOT-0 is 1 and NOT-1 is 0 as in two-valued logic, NOT-? is ? and NOT-\*(es is \*(es. The functions of the various gates are listed in Table 1. .if n \{\ .P [Warning: The following picture will be garbled or missing. Get a better output device.] .sp 1 \} .PS # The CIRCUITOUS DIAGRAM, Figure 1 of the INTERCAL manual. # # Transcribed to PIC by Eric S. Raymond from the paper original. # The transcription is topologically correct but not geometrically perfect. # # I discovered late in the process that the gate spacing to gate width # ratio should be 6/5, not 5/5. The only place the difference shows is # in the zigzag part of the adventitious lead below gate 37, which is # a bit narrower in this version than in the paper original. # # Minor liberties have been taken with the sizes of some features at the # left and right sides to fit the diagram on a letter-sized page. The # A/B input leads should really be a whole boxwidth wide, and the bus line # rectangle was slightly wider and further right in the paper original. # Also, there are only 15 "New York" terminals rather than 16, and in the # original the bus terminal label texts were rotated 90 degrees clockwise. # # The whole diagram can be scaled horizontally or vertically by changing # the boxwid and boxht variables. At default scale the values boxwid = # 0.60 boxht = 0.525 reproduce the paper version most exactly; they get # the gate grid and leads nearly perfect. # scale=6/5 # This is how we scale the whole thing to fit on 8.5x11 boxwid = 0.60 boxht = 0.525 linewid = boxwid lineht = boxht movewid = boxwid moveht = boxht # Offset of top and bottom pins from gate midline define pinoffset {(2/3)} define warmengate { # Draw a Warmenhovian gate box [ box invis; line from last box .sw \ to last box .nw \ to 1/2 \ to 1/2 \ to 1/2 \ to 1/2 \ to last box .sw; IN: last box .w; UP: pinoffset DN: pinoffset OUT: last box .e; "$1" at last box .center; ] } [ # Beginning of diagram object # Draw the gate array copy thru % move to (($1-1) * movewid * 2, ($2-1) * moveht * 2); warmengate($3) % until "END" 0 1 6 0 2 6 0 3 1 0 4 1 0 5 1 0 6 1 0 7 1 0 8 1 0 9 1 0 10 1 END copy thru % move to ((boxwid + movewid * 7 / 5) + ($1-2) * movewid * 2, ($2-1) * moveht * 2); warmengate($3) % until "END" 1 1 1 1 2 2 1 3 2 1 4 2 1 5 2 1 6 2 1 7 2 1 8 2 1 9 2 1 10 2 2 1 1 2 2 7 2 3 4 2 4 3 2 5 3 2 6 3 2 7 7 2 8 3 2 9 7 2 10 3 3 1 1 3 2 3 3 3 3 3 4 4 3 5 4 3 6 3 3 7 3 3 8 3 3 9 3 3 10 3 4 1 1 4 2 4 4 3 5 4 4 5 4 5 4 4 6 5 4 7 4 4 8 3 4 9 2 4 10 1 END # Draw bus line: BUSLINE: box with .sw at 41st [].se + (boxwid/2, 0) \ wid (boxwid / 2) \ ht (50th [].n.y - 41st [] .s.y) copy thru % move to $1 / 40 ; "$2" % until "END" 9 B 11 U 13 S 17 L 19 I 21 N 23 E 30 8 END define newyork { line right boxwid/3 box invis "" "TO" "NEW" "YORK" "" } define philly { line right boxwid/3 box invis "" "TO" "PHILA-" "DELPHIA" "" } for i = 0 to 14 do { move to (i+1)/18 newyork } move to (i+1)/18 philly define dot {circle rad 0.03 filled 1} # Place a junction dot wherever we are define junction % {dot at Here}; % # Draw inputs define inwidth {boxwid*3/4} define drawinputs { line left inwidth from $1.UP; "A" at last line .end - (0.1, 0) rjust; "$2" at last line .end - (0.05, 0.1) rjust; move to last line .center; A$2: junction line left inwidth from $1.DN; "B" at last line .end - (0.1, 0) rjust; "$2" at last line .end - (0.05, 0.1) rjust; move to last line .center; B$2: junction } drawinputs(3rd [],8) drawinputs(4th [],7) drawinputs(5th [],6) drawinputs(6th [],5) drawinputs(7th [],4) drawinputs(8th [],3) drawinputs(9rd [],2) # Gate 10 inputs have to be done by hand define go {move to $1;} # Define `gate' to *refer* to nth gate define gate {`$1'th []} # Go to specified pin of given gate define pin {gate($1).$2} # We exploit the quantization of lead placements here # Draw from left edge of box $1 quanta of inter-box horizontal distance define left_mv {line left boxwid * $1 / 5;} # Draw from right edge of box $1 quanta of inter-box horizontal distance define right_mv {line right boxwid * $1 / 5;} # Draw from top pin of box $1 quanta of inter-box vertical distance up define up_mv {line up (boxht * (2 - pinoffset)) * $1 / 4;} # Draw from bottom pin of box $1 quanta of inter-box vertical distance down define dn_mv {line down (boxht * (2 - pinoffset)) * $1 / 4;} # Draw from here to given object, with directional constraint define vert {line up ($1.y - Here.y);} define horz {line right ($1.x - Here.x);} define zig {vert($1) horz($1)} define to_bus {line to (BUSLINE.w, Here)} define ground { dn_mv(1) [ boxwid = boxwid * (3/4) boxht = boxht / 3 box invis line from last box .ne to last box .nw line from 1/3 to 1/3 line from 2/3 to 2/3 ] } # Now all those connections # Gate 1: go(pin(1,OUT)) right_mv(3) CORNER:Here; zig(pin(12,DN)) go(CORNER) vert(pin(1,UP)) \ {junction horz(pin(11,UP))} \ up_mv(2) junction horz(gate(32).e) right_mv(3) junction {zig(pin(43,IN))} horz(gate(42).e) right_mv(1) junction {to_bus} vert(pin(43,UP)) up_mv(2) to_bus # Gate 2 go(pin(2,OUT)) right_mv(2) zig(pin(12,UP)) # Gate 3 go(A8) up_mv(1) horz(gate(13).e) right_mv(3) zig(pin(23,IN)) go(B8) dn_mv(1) horz(gate(13)) right_mv(1) dn_mv(1) horz(gate(23).e) right_mv(2) dn_mv(2) horz(pin(32,UP)) go(pin(3,OUT)) right_mv(2) vert(gate(3).UP) up_mv(3) horz(gate(13).e) right_mv(2) vert(gate(15,UP)) up_mv(4) #??? don't know why 4 is necessary horz(gate(16).w) left_mv(1) vert(gate(6).w) up_mv(4) left_mv(2) zig(pin(7,OUT)) # Gate 4 go(A7) up_mv(1) horz(gate(14).e) right_mv(1) zig(pin(24,UP)) go(B7) dn_mv(1) horz(gate(4)) right_mv(1) dn_mv(1) horz(gate(14).e) right_mv(3) vert(pin(26,UP)) up_mv(1) horz(gate(25)) up_mv(2) horz(gate(25).e) right_mv(4) vert(pin(38,UP)) up_mv(1) horz(gate(48).e) right_mv(1) vert(pin(47,DN)) dn_mv(1) horz(gate(47).w) left_mv(3) vert(gate(46).DN) dn_mv(2) right_mv(2) vert(gate(45).DN) dn_mv(2) left_mv(3) vert(gate(44).DN) right_mv(3) dn_mv(2) horz(gate(33).w) left_mv(1) vert(gate(33).DN) dn_mv(3) horz(gate(32).e) up_mv(2) horz(gate(42).e) dn_mv(2) line down boxwid/5 to_bus go(pin(4,OUT)) right_mv(3) junction {zig(pin(13,UP))} vert(pin(4,UP)) up_mv(3) junction {right_mv(3) zig(pin(15,IN))} left_mv(2) vert(pin(7,UP)) up_mv(3) right_mv(3) zig(pin(19,DN)) # Gate 5 go(A6) up_mv(1) horz(gate(15).e) right_mv(1) vert(pin(15,UP)) junction {horz(pin(25,UP))} vert(pin(15,DN)) dn_mv(1) horz(gate(25).e) right_mv(1) zig(pin(34,UP)) go(B6) dn_mv(2) horz(gate(25).e) dn_mv(1) right_mv(4) vert(pin(24,DN)) dn_mv(1) horz(gate(34).e) right_mv(1) vert(pin(32,DN)) dn_mv(1) right_mv(3) zig(pin(42,IN)) go(pin(5,OUT)) right_mv(5) junction {vert(pin(14,IN)) junction {horz(pin(14,IN))} zig(pin(13,IN)) } vert(pin(17,DN)) junction {horz(pin(17,DN))} zig(pin(18,DN)) # Gate 6 go(A5) up_mv(1) horz(gate(16).e) right_mv(1) zig(pin(26,UP)) go(B5) dn_mv(2) horz(gate(26).e) right_mv(3) zig(pin(34,IN)) go(pin(6,OUT)) right_mv(4) junction {horz(pin(16,IN))} vert(pin(15,DN)) junction {horz(pin(15,DN))} vert(pin(14,DN)) junction {horz(pin(14,DN))} zig(pin(13,DN)) # Gate 7 go(A4) up_mv(1) horz(gate(27).e) right_mv(3) vert(pin(37,IN)) junction {horz(pin(37,IN))} vert(pin(37,DN)) dn_mv(2) right_mv(1) junction {zig(pin(36,IN))} horz(gate(37).e) right_mv(3) zig(pin(45,IN)) go(B4) dn_mv(2) horz(gate(17).e) right_mv(4) vert(pin(26,DN)) dn_mv(1) horz(gate(26).e) dn_mv(2) right_mv(4) vert(pin(35,DN)) dn_mv(1) horz(gate(35).e) right_mv(2) junction {zig(pin(45,UP))} {zig(pin(44,UP))} # Gate 8 go(A3) up_mv(1) horz(gate(28).e) right_mv(1) zig(pin(38,UP)) go(B3) dn_mv(2) horz(gate(28).e) right_mv(2) zig(pin(37,UP)) go(pin(8,OUT)) right_mv(6) junction {zig(pin(17,IN))} up_mv(4) left_mv(1) vert(pin(19,UP)) junction {horz(pin(19,UP))} zig(pin(20,UP)) # Gate 9 go(A2) up_mv(1) horz(gate(19).e) right_mv(1) zig(pin(28,UP)) go(B2) dn_mv(2) horz(gate(39).e) right_mv(1) vert(pin(38,DN)) dn_mv(2) right_mv(2) zig(pin(47,IN)) go(pin(9,OUT)) right_mv(3) junction {zig(pin(20,DN))} {horz(pin(19,IN))} vert(pin(16,DN)) junction {horz(pin(16,DN))} zig(pin(15,UP)) # Gate 10 line left inwidth from 10th[].UP; "A" at last line .end - (0.1, 0) rjust; "1" at last line .end - (0.05, 0.1) rjust; move to last line .center; A1: junction line left inwidth from 10th [].DN; "B" at last line .end - (0.1, 0) rjust; "1" at last line .end - (0.05, 0.1) rjust; move to 1/2 ; B1: junction go(A1) vert(pin(10,DN)) dn_mv(1) horz(gate(20).e) right_mv(2) zig(pin(30,UP)) go(B1) dn_mv(2) horz(gate(30).e) right_mv(1) junction {zig(pin(39,UP))} right_mv(3) zig(pin(40,DN)) go(pin(10,OUT)) right_mv(2) junction {horz(pin(20,IN))} vert(pin(18,UP)) junction {horz(pin(18,UP))} vert(pin(16,UP)) junction {horz(pin(16,UP))} zig(pin(14,UP)) # Gate 11 go(pin(11, DN)) left_mv(3) vert(pin(11,UP)) up_mv(1) \ horz(gate(31).e) right_mv(1) zig(pin(41,DN)) go(pin(11,OUT)) right_mv(2) zig(pin(21,DN)) # Gate 12 go(pin(12,OUT)) right_mv(3) junction {horz(pin(22,IN))} vert(pin(12,UP)) up_mv(1) horz(gate(12).w) left_mv(3) zig(pin(12,IN)) # Gate 13 go(pin(13,OUT)) right_mv(1) zig(pin(23,UP)) # Gate 14 go(pin(14,OUT)) horz(pin(24,IN)) # Gate 15 go(pin(15,OUT)) horz(pin(25,IN)) # Gate 16 go(pin(16,OUT)) right_mv(2) junction {horz(pin(26,IN))} vert(pin(27,UP)) junction {horz(pin(27,UP))} zig(pin(29,DN)) # Gate 17 go(pin(17,OUT)) horz(pin(27,IN)) # Gate 18 go(pin(18,OUT)) right_mv(3) junction {horz(pin(28,IN))} zig(pin(27,DN)) # Gate 19 go(pin(19,OUT)) horz(pin(29,IN)) # Gate 20 go(pin(20,OUT)) right_mv(3) junction {horz(pin(30,IN))} zig(pin(29,UP)) # Gate 21 go(pin(21,UP)) left_mv(2) vert(pin(21,DN)) ground go(pin(21,OUT)) right_mv(2) junction {zig(pin(31,DN))} up_mv(2) junction # Gate 22 go(pin(22,UP)) left_mv(3) up_mv(2) junction go(pin(22,DN)) left_mv(4) vert(pin(22,UP)) up_mv(3) right_mv(3) vert(pin(23,UP)) up_mv(3) horz(gate(23).e) right_mv(2) vert(pin(25,UP)) left_mv(1) vert(pin(28,DN)) right_mv(1) zig(pin(40,IN)) go(pin(22,OUT)) right_mv(3) junction {horz(pin(32,IN))} {zig(pin(33,IN))} zig(pin(31,UP)) # Gate 23 go(pin(23,OUT)) right_mv(1) vert(gate(23).DN) dn_mv(1) horz(gate(33)) right_mv(1) dn_mv(1) to_bus # Gate 24 go(pin(24,OUT)) right_mv(1) zig(pin(33,UP)) # Gate 25 go(pin(25,OUT)) horz(pin(35,IN)) # Gate 26 go(pin(26,OUT)) right_mv(2) vert(pin(26,DN)) dn_mv(1) junction {to_bus} zig(pin(35,UP)) # Gate 27 go(pin(27,OUT)) right_mv(2) zig(pin(36,UP)) # Gate 28 go(pin(28,OUT)) right_mv(3) junction {horz(pin(38,IN))} vert(pin(38, DN)) dn_mv(1) to_bus # Gate 29 go(pin(29,OUT)) right_mv(3) junction {horz(pin(39,IN))} {vert(pin(39, DN)) dn_mv(1) to_bus} zig(pin(40,UP)) # Gate 30 go(pin(30,OUT)) right_mv(1) vert(pin(30,DN)) dn_mv(1) horz(gate(40).e) right_mv(2) zig(pin(50,UP)) # Gate 31 go(pin(31,OUT)) right_mv(2) zig(pin(41,UP)) # Gate 32 go(pin(32,OUT)) right_mv(2) vert(pin(32,UP)) junction {horz(pin(42,UP))} up_mv(1) to_bus # Gate 33 go(pin(33,OUT)) right_mv(2) zig(pin(43,UP)) # Gate 34 go(pin(34,OUT)) right_mv(3) junction {horz(pin(44,IN))} vert(pin(44, DN)) dn_mv(1) to_bus # Gate 35 go(pin(35,OUT)) right_mv(1) dn_mv(1) right_mv(2) dn_mv(1) to_bus # Gate 36 go(pin(36,OUT)) horz(pin(46,IN)) # Gate 37 go(pin(37,OUT)) right_mv(2) vert(pin(48,UP)) junction {horz(pin(48,UP))} zig(pin(49,DN)) # Gate 38 go(pin(38,OUT)) right_mv(3) junction {horz(pin(48,IN))} vert(pin(48,DN)) right_mv(1) dn_mv(3) left_mv(3) vert(pin(47,UP)) junction {horz(pin(47,UP))} zig(pin(46,UP)) # Gate 39 go(pin(39,OUT)) right_mv(3) junction {horz(pin(49,IN))} {vert(pin(49, DN)) dn_mv(2) to_bus} zig(pin(50,IN)) # Gate 40 go(pin(40,OUT)) right_mv(1) vert(pin(40,DN)) dn_mv(2) junction {horz(gate(40).w); dn_mv(1); horz(gate(40).e); right_mv(1)} dn_mv(1) junction zig(pin(49,UP)) # Gate 41 # (should be right_mv(2) but we've squeezed the bus line a bit left) go(pin(41,OUT)) right_mv(1) vert(pin(41,DN)) ground # Gate 42 go(pin(42,OUT)) to_bus # Gate 43 go(pin(43,OUT)) to_bus # Gate 44 go(pin(44,OUT)) to_bus # Gate 45 go(pin(45,OUT)) to_bus # Gate 46 go(pin(46,OUT)) to_bus # Gate 47 go(pin(47,OUT)) to_bus # Gate 48 go(pin(48,OUT)) to_bus # Gate 49 go(pin(49,OUT)) to_bus # Gate 50 go(pin(50,OUT)) to_bus # The adventitious lead go(pin(17,OUT)) right_mv(1) {vert(pin(17,UP)) up_mv(3) horz(gate(17))} vert(pin(17,DN)) dn_mv(1) horz(gate(27).w) dn_mv(1) horz(gate(27).e) dn_mv(1) horz(gate(36).w) up_mv(2) right_mv(1) dn_mv(2) right_mv(1) up_mv(2) right_mv(1) dn_mv(2) right_mv(1) up_mv(2) right_mv(1) vert(pin(37,DN)) right_mv(4) dn_mv(2) right_mv(3) dn_mv(1) left_mv(3) vert(pin(46,DN)) left_mv(3) dn_mv(3) horz(gate(36).w) up_mv(1) horz(gate(36)) right_mv(1) ] # End of diagram object .PE .ce 1 FIGURE 1. CIRCUITOUS DIAGRAM .bp .sp 10 .ps 8 .vs 10 .nf .cs R 24 .ec % .ds EO %(ci%v'-0.08'%h'-0.67'+%v'0.08' .%" This is dodgy, but it's the last place es is used .if n .ds es %o"O|" .if t .ds es %(es __________________________________________________________ |\ \ | \ 1. Logic gate. Inputs A, B. Output O = AB. \ | \ \ | \ \ 2. Logic gate. Inputs A, B, C. Output O = A+BC. \ | |\ \ \ | | \ \ 3. Logic gate. Inputs A, B. Output O = A+AB. \ | | \ \ \ | | |\ \ 4. Logic gate. Inputs A, B. Output O = AB %*(EO -(A+-B) \ | | | \ \ \ | | | \ \ 5. Logic gate. Inputs A, B. Output O = A%*(EOA + AA \ | | | \ \ \ | | | \ \ 6. Uninitialized flip-flop. Inputs none. Output O = ? \ | | | \ \ \ | | | \ \ 7. Flip-flop-flap. Inputs A, B, C. Output O = 1 if \ | | | \ \ A=0 or B+C=0 and A=1. O = 0 if AC=1, B=0. O = %*(es if \ | | | \ \ AB=1, C=0. O = ? if ABC=1. O as yet undetermined \ | | | \ \ for other Warmenhovian inputs. See Figure 2. \ | | | \ \ \ | | | \ \ 8. Bus line. \ | | | \ \_________________________________________________________\ | | | \ | | | | | | | _____________________________________________________ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \|__| | | | \|__| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \|__| \|__| .ec \ .cs R .fi .ps 10 .vs 12 .sp .ce 1 Table 1. Logical (and other) functions. .bp .if n \{\ .P [Warning: The following picture will be garbled or missing. Get a better output device.] \} .sp 10 .PS # The FLIP FLAP FLOP, Figure 2 of the INTERCAL manual down; A: warmengate(); move; move; B: warmengate(); move; move; C: warmengate(); move; move; D: warmengate(); dot at 1st []; dot at 2nd []; dot at 3rd []; circle rad 0.06 at last []; line from last circle.w to last circle.e; line from last circle.n to last circle.s; line left 3 from A.UP; "A" rjust line left 3 from B.IN; "B" rjust line left 3 from C.UP; "C" rjust line left 2 from C.IN then down 2 then left; "1" rjust right; circle rad 0.06 with .w at A.OUT; line right 0.5; junction {line right 1.5; "D" ljust} line down 0.25; X1: Here line left 0.5 from A.IN; line down 0.25; X2: Here line left 0.5 from B.UP; line up 0.25; line to X1; line right 1.0 from D.OUT; vert(B.UP) line up 0.25; line to X2; right; circle rad 0.06 with .w at B.OUT; line right 0.5; vert(C.DN) line down 0.25; X3: Here; line left 0.25 from D.UP then up 0.25 then to X3; right; circle rad 0.06 with .w at C.OUT; line right 0.3; vert(C.DN) line down 0.25; X4: Here line left 0.5 from D.IN; vert(D.UP) line up 0.25 then to X4; .PE .sp 10 .ce 1 FIGURE 2. FLIP FLAP FLOP .bp .if n \{\ .P [Warning: The following picture will be garbled or missing. Get a better output device.] \} .PS [ NYC: box ht 4 wid 0.5 "9"; for i = 0 to 16 do { move to (i+1)/18 line left 0.5 } for i = 0 to 8 do { move to (i+1)/10 line right 0.5 } ] move right from last [].w; box invis wid 6 \ "GATE TYPE 9. BLACK BOX" ljust \ "INPUTS A1-8, B1-8. " ljust \ "OUTPUT O1-8 = A1-8~B1-8" ljust .PE .sp 10 .ce 1 FIGURE 1 (CONTINUED). NEW YORK .bp .if '\*c'y' \{\ .H 4 "Return type of SELECT" .P INTERCAL-72 defined the return type of a select operation to depend on the number of bits selected. The C-INTERCAL compiler takes the easier route of defining the return type to be that of the right operand, independent of its actual value. This form has the advantage that all types can be determined at compile time. Putting in run-time type-checking would add significant overhead and complication, to effect a very minor change in language semantics. .P The only time this distinction makes any difference is when a unary operator is applied to the select result. This happens extremely rarely in practice, the only known instance being the 32-bit greater-than test in the standard library, where an XOR operator is applied to the result of selecting a number against itself. The INTERCAL-72 authors first select the result against #65535\*(ct#65535 to insure that XOR sees a 32-bit value. With the current compiler this extra step is unnecessary, but harmless. .P The cautious programmer should write code that does not depend on the compiler version being used. We therefore suggest the following guideline for determining the select return type: .P A select operation with a 16-bit right operand returns a 16-bit value. The return type of a select operation with a 32-bit right operand is undefined, but is guaranteed to be an acceptable input to a mingle operation so long as 16 or fewer bits are actually selected. Correct code should not depend on whether the return type is 16 or 32 bits.\} .H 3 "Unary Operators" .P The unary operators are & (logical \fBAND\fR), V (logical \fBOR\fR), and \*(vb (logical \fBXOR\fR). This last character is obtained by overpunching a worm (\-) on a V (V). .if '\*c'y' \{\ (In C-INTERCAL, \*(vb is replaced by what (?). The compiler recognizes V- as a valid equivalent, in case you are concerned about compatibility with the Princeton compiler. In version 0.20 and later, the Unicode character U+2200 FOR ALL, which looks exactly like V- or an upside-down `A' is also accepted in UTF-8 form.) \} The operator is inserted between the spot, two-spot, mesh, or what-have-you, and the integer, thus: .&123, #\*(vb123. Multiple unary operators may not be concatenated, thus the form #\*(vb&123 is invalid. This will be covered later when precedence is discussed. These operators perform their respective logical operations on all pairs of adjacent bits, the result from the first and last bits going into the first bit of the result. The effect is that of rotating the operand one place to the right and ANDing, ORing, or XORing with its initial value. Thus, #&77 (binary = 1001101) is binary 0000000000000100 = 4, #V77 is binary 1000000001101111 = 32879, and #\*(vb77 is binary 1000000001101011 = 32875. .H 3 "Precedence" .SETR precedence .P Precedence of operators is as follows: .sp 10 (The remainder of this page intentionally left blank)\*F .FS Keep in mind that the aim in designing INTERCAL was to have no precedents. .FE .bp .P This precedence (or lack thereof) may be overruled by grouping expressions between pairs of sparks (') or rabbit-ears ("). Thus '#165\*(ct#203'~#358 (binary value '10100101\*(ct11001011'~101100110) has the value 15, but #165\*(ct'#203~#358' has the value 34915, and #165\*(ct#203~#358 is invalid syntax and is completely valueless (except perhaps as an educational tool to the programmer). A unary operator is applied to a sparked or rabbit-eared expression by inserting the operator immediately following the opening spark or ears. Thus, the invalid expression #\*(vb&123, which was described earlier, could be coded as '\*(vb#&123' or '\*(vb"{"'. Note: In the interests of simplifying the sometimes overly-complex form of expressions, INTERCAL allows a spark-spot combination ('.) to be replaced with a wow (!). Thus '.1~.2' is equivalent to !1~.2', and 'V.1\*(ct.2' is equivalent to "V!1\*(ct.2'". .P Combining a rabbit-ears with a spot to form a rabbit (\o'".') is not permitted, although the programmer is free to use it should he find an EBCDIC reader which will properly translate a 12-3-7-8 punch. .P Sparks and/or rabbit-ears must also be used to distinguish among such otherwise ambiguous subscripted and multiply-subscripted expressions as: .DS L ,1 SUB #1 ~ #2 ,1 SUB ,2 SUB #1 #2 #3 ,1 SUB " ,2 SUB " ,3 SUB #1 " #2 " " #3 " .DE The third case may be isolated into either of its possible interpretations by simply changing some pairs of rabbit-ears to sparks, instead of adding more ears (which would only confuse the issue further). Ambiguous cases are defined as those for which the compiler being used finds a legitimate interpretation which is different from that which the user had in mind. See also section .GETHN princeton \&. .H 1 "STATEMENTS" .if '\*c'y' \{\ .DS I F "There's glory for you!" .P "I don't know what you mean by 'glory,'" Alice said. .P Humpty Dumpty smiled contemptuously. "Of course you don't -- till I tell you. I meant 'there's a nice knock-down argument for you!'" .P "But 'glory' doesn't mean 'a nice knock-down argument.'" Alice objected. .P "When \fII\fR use a word," Humpty Dumpty said, in a rather scornful tone, "it means just what I choose it to mean -- neither more nor less." .DE \} .P In this section is described the format of INTERCAL statements. .H 2 "General Format" .P Statements may be entered in 'free format'. That is, more than one statement may occur on a single card, and a statement may begin on one card and end on a later one. Note that if this is done, all intervening cards and portions thereof must be part of the same statement. That this restriction is necessary is immediately apparent from the following example of what might occur if statements could be interlaced. .DS L DO .1 <- ".1\*(ct'&:51~"#\*(vb1c!12~;&75SUB"\*(vb'V.1~ DO .2 <- '"!1\*(ct"&';\*(vb79SUB",&7SUB:173"'~!\*(vb9\*(ct .2'\*(ct,&1SUB:5~#33578"'"'"~'#65535\*(ct"\*(vb'V#&85'"' #8196'"'~.1"\*(ct.2'~'#&5\*(ct"'#1279\*(ct#4351'~#65535"' .DE The above statements are obviously meaningless. (For that matter, so are the statements .DS L DO .1 <- ".1\*(ct"&:51~"#\*(vb1\*(ct!12~;&75SUB"\*(vb'V.1~ .2'\*(ct,&1SUB:5~#333578"'"'"~#65535\*(ct"\*(vb'V#&85'"' DO .2 <- '"!1\*(ct"&';\*(vb79SUB",&7SUB:173"'~!\*(vb9\*(ct #8196'"'~.1"\*(ct.2'~'#&5\*(ct"'#1279\*(ct#4351'~#65535"' .DE but this is not of interest here.) .P Spaces may be used freely to enhance program legibility (or at least reduce program illegibility), with the restriction that no word of a statement identifier (see section .GETHN identifiers ) may contain any spaces. .H 2 "Labels" .P A statement may begin with a .B "logical line label" enclosed in wax-wane pairs (()). A statement may not have more than one label, although it is possible to omit the label entirely. A line label is any integer from 1 to 65535, which must be unique within each program. The user is cautioned, however, that many line labels between 1000 and 1999 are used in the INTERCAL System Library functions. .H 2 "Identifiers and Qualifiers" .SETR identifiers .P After the line label (if any), must follow one of the following statement identifiers: DO, PLEASE, or PLEASE DO. These may be used interchangeably to improve the aesthetics of the program. The identifier is then followed by either, neither, or both of the following optional parameters (qualifiers): (1) either of the character strings NOT or N'T, which causes the statement to be automatically abstained from (see section .GETHN abstain ) when execution begins, and (2) a number between 0 and 100, preceded by a double-oh-seven (%), which causes the statement to have only the specified percent chance of being executed each time it is encountered in the course of execution. .H 2 "Statements" .P Following the qualifiers (or, if none are used, the identifier) must occur one of the .ie '\*c'y' \{\ 14 \} .el \{\ 13 \} valid operations. (Exception: see section .GETHN comments \&.) These are described individually in sections .GETHN calculate through .GETHN last_statement \&. .H 3 "Calculate" .SETR calculate .P The INTERCAL equivalent of the half-mesh (=) in FORTRAN, BASIC, PL/I, and others, is represented by an angle (<) followed by a worm (-). This combination is read 'gets'. 32-bit variables may be assigned 16-bit values, which are padded on the left with 16 zero bits. 16-bit variables may be assigned 32-bit values only if the value is less than 65535. Thus, to invert the least significant bit of the first element of 16-bit 2-dimensional array number 1, one could write: .DS ,1SUB#1#1 <- '\*(vb",1SUB#1#1"\*(ct#1'~'#0\*(ct#65535' .DE Similarly to SNOBOL and SPITBOL, INTERCAL uses the angle-worm to define the dimensions of arrays. An example will probably best describe the format. To define 32-bit array number 7 as 3-dimensional, the first dimension being seven, the second being the current value of 16-bit variable number seven, and the third being the current value of the seventh element of 16-bit array number seven (which is one-dimensional) mingled with the last three bits of 32-bit variable number seven, one would write (just before they came to take him away): .DS ;7 <- #7 BY .7 BY ",7SUB#7"\*(ct':7~#7' .DE This is, of course, different from the statement: .DS ;7 <- #7 BY .7 BY ,7SUB"#7\*(ct':7~#7'" .DE INTERCAL also permits the redefining of array dimensioning, which is done the same way as is the initial dimensioning. All values of items in an array are lost upon redimensioning, unless they have been STASHed (see section .GETHN stash ), in which case restoring them also restores the old dimensions. .H 3 "NEXT" .SETR next .P The NEXT statement is used both for subroutine calls and for unconditional transfers. This statement takes the form: .DS DO (label) NEXT .DE (or, of course, .DS PLEASE DO (label) NEXT .DE etc.), where (label) represents any logical line label which appears in the program. The effect of such a statement is to transfer control to the statement specified, and to store in a push down list (which is initially empty) the location from which the transfer takes place. Items may be removed from this list and may be discarded or used to return to the statement immediately following the NEXT statement. These operations are described in sections .GETHN forget and .GETHN resume respectively. The programmer is generally advised to discard any stack entries which he does not intend to utilize, since the stack has a maximum depth of 79 entries. A program's attempting to initiate an 80th level of NEXTing will result in the fatal error message, "PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON." .H 3 "FORGET" .SETR forget .P The statement PLEASE FORGET exp, where exp represents any expression (except colloquial and facial expressions), causes the expression to be evaluated, and the specified number of entries to be removed from the NEXTing stack and discarded. An attempt to FORGET more levels of NEXTing than are currently stacked will cause the stack to be emptied, and no error condition is indicated. This is because the condition is not considered to be an error. As described in section .GETHN next \&, it is good programming practice to execute a DO FORGET #1 after using a NEXT statement as an unconditional transfer, so that the stack does not get cluttered up with unused entries: .DS L .cs R 24 DO (123) NEXT . . (123) DO FORGET #1 .cs R .DE .H 3 "RESUME" .SETR resume .P The statement PLEASE RESUME exp has the same effect as FORGET, except that program control is returned to the statement immediately following the NEXT statement which stored in the stack the last entry to be removed. Note that a rough equivalent of the FORTRAN computed GO TO and BASIC ON exp GO TO is performed by a sequence of the form: .DS L .cs R 24 DO (1) NEXT . . (1) DO (2) NEXT PLEASE FORGET #1 . . (2) DO RESUME .1 .cs R .DE Unlike the FORGET statement, an attempt to RESUME more levels of NEXTing than has been stacked will cause program termination. See also section .GETHN give_up \&. .H 3 "STASH" .SETR stash .P Since subroutines are not explicitly implemented in INTERCAL, the NEXT and RESUME statements must be used to execute common routines. However, as these routines might use the same variables as the main program, it is necessary for them to save the values of any variables whose values they alter, and later restore them. This process is simplified by the STASH statement, which has the form DO STASH list, where list represents a string of one or more variable or array names, separated by intersections (+). Thus .DS PLEASE STASH .123+:123+,123 .DE stashes the values of two variables and one entire array. The values are left intact, and copies thereof are saved for later retrieval by (what else?) the RETRIEVE statement (see section .GETHN retrieve ). It is not possible to STASH single array items. .H 3 "RETRIEVE" .SETR retrieve .P PLEASE RETRIEVE list restores the previously STASHed values of the variables and arrays named in the list. If a value has been stashed more than once, the most recently STASHed values are RETRIEVEd, and a second RETRIEVE will restore the second most recent values STASHed. Attempting to RETRIEVE a value which has not been STASHed will result in the error message, "THROW STICK BEFORE RETRIEVING." .H 3 "IGNORE" .SETR ignore .P The statement DO IGNORE list causes all subsequent statements to have no effect upon variables and/or arrays named in the list. Thus, for example, after the sequence .DS L DO .1 <- #1 PLEASE IGNORE .1 DO .1 <- #0 .DE 16-bit variable number 1 would have the value 1, not 0. Inputting (see section .GETHN input ) into an IGNOREd variable also has no effect. The condition is annulled via the REMEMBER statement (see section .GETHN remember ). Note that, when a variable is being IGNOREd, its value, though immutable, is still available for use in expressions and the like. .if '\*c'y' \{\ .P Though the INTERCAL-72 manual laid down that the value of an IGNOREd variable cannot change, it was unclear about whether or not a statement which appears to change an IGNOREd variable is executed or not. This may appear to be a "If a tree falls in the forest ..." type of question, but if the statement in question has other side effects it is not. .P Since another mechanism already exists for ABSTAINing from a statement, C-INTERCAL's IGNORE only prevents the changing of the specific variable in question, not the execution of the entire statement. In the present version of the language this only makes a difference for the WRITE IN (see .GETHN input ) and RETRIEVE (see .GETHN retrieve ) statements. Attempting to WRITE IN to an IGNOREd variable will cause a number to be read from the input, which will be discarded since it cannot be stored in the variable. Using RETRIEVE on an IGNOREd variable will pop the variable's stash stack without actually changing its value. \} .H 3 "REMEMBER" .SETR remember .P PLEASE REMEMBER list terminates the effect of the IGNORE statement for all variables and/or arrays named in the list. It does not matter if a variable has been IGNOREd more than once, nor is it an error if the variable has not been IGNOREd at all. .H 3 "ABSTAIN" .SETR abstain .P INTERCAL contains no simple equivalent to an IF statement or computed GO TO, making it difficult to combine similar sections of code into a single routine which occasionally skips around certain statements. The IGNORE statement (see section .GETHN ignore ) is helpful in some cases, but a more viable method is often required. In keeping with the goal of INTERCAL having nothing in common with any other language, this is made possible via the ABSTAIN statement. .P This statement takes on one of two forms. It may not take on both at any one time. DO ABSTAIN FROM (label) causes the statement whose logical line label is (label) to be abstained from. PLEASE ABSTAIN FROM gerund list causes all statements of the specified type(s) to be abstained from, as in .DS L .ta .3i .6i T .6i PLEASE ABSTAIN FROM STASHING PLEASE ABSTAIN FROM IGNORING + FORGETTING PLEASE ABSTAIN FROM NEXTING or PLEASE ABSTAIN FROM CALCULATING .DE Statements may also be automatically abstained from at the start of execution via the NOT or N'T parameter (see section .GETHN identifiers ). .P If, in the course of execution, a statement is encountered which is being abstained from, it is ignored and control passes to the next statement in the program (unless it, too, is being abstained from). .P The statement DO ABSTAIN FROM ABSTAINING is perfectly valid, as is DO ABSTAIN FROM REINSTATING (although this latter is not usually recommended). However, the statement DO ABSTAIN FROM GIVING UP is not accepted, even though DON'T GIVE UP is. .H 3 "REINSTATE" .SETR reinstate .P The REINSTATE statement, like the ABSTAIN, takes as an argument either a line label or a gerund list. No other form of argument is permitted. For example, the following is an invalid argument: .DS L Given: x\(!=0, y\(!=0, Prove: x+y=0 Since x\(!=0, then x+1\(!=1, x+a\(!=a, x+y\(!=y. But what is y? y is anything but 0. Thus x+y \(!= anything but 0. Since x+y cannot equal anything but 0, x+y=0. Q.E.D. .DE REINSTATEment nullifies the effects of an abstention. Either form of REINSTATEment can be used to "free" a statement, regardless of whether the statement was abstained from by gerund list, line label, or NOT. Thus, PLEASE REINSTATE REINSTATING is not necessarily an irrelevant statement, since it might free a DON'T REINSTATE command or a REINSTATE the line label of which was abstained from. However, DO REINSTATE GIVING UP is invalid, and attempting to REINSTATE a GIVE UP statement by line label will have no effect. Note that this insures that DON'T GIVE UP will always be a "do-nothing" statement. .H 3 "GIVE UP" .SETR give_up .P PLEASE GIVE UP is used to exit from a program. It has the effect of a PLEASE RESUME #80. DON'T GIVE UP, as noted in section .GETHN reinstate \&, is effectively a null statement. .H 3 "Input" .SETR input .P Input is accomplished with the statement DO WRITE IN list, where list represents a string of variables and/or elements of arrays, separated by intersections. Numbers are represented on cards, each number on a separate card, by spelling out each digit (in English) and separating the digits with one or more spaces. A zero (0) may be spelled as either ZERO or OH. Thus the range of (32-bit) input values permissible extends from ZERO (or OH) through FOUR TWO NINE FOUR NINE SIX SEVEN TWO NINE FIVE. .if '\*c'y' \{\ (For the convenience of aviators, C-INTERCAL accepts the spelling NINER for NINE. In the service of internationalization, C-INTERCAL also accepts input digits in Sanskrit, Basque, Tagalog, Classical Nahuatl, Georgian, Kwakiutl, and Volapuk.) \} .P Attempting to write in a value greater than or equal to SIX FIVE FIVE THREE SIX for a 16-bit variable will result in the error message, "DON'T BYTE OFF MORE THAN YOU CAN CHEW." .if '\*c'y' \{\ .P (See also section .GETHN communication for a description of C-INTERCAL's character I/O.) \} .H 3 "Output" .P Values may be output to the printer, one value per line, via the statement DO READ OUT list, where the list contains variables, array elements, and/or constants. Output is in the form of "extended" Roman numerals (also called "butchered" Roman numerals), with an overline .if t (\(rn) indicating the value below is "times 1000", and lower-case letters indicating "times 1000000". Zero is indicated by an overline with no character underneath. Thus, the range of (32-bit) output values possible is from .if t \(rn .if n \{\ .nf _ .fi \} through .ie t \o"i\(rn"\o"v\(rn"ccxciv\o"C\(rn"\o"M\(rn"\o"L\(rn"\o"X\(rn"\o"V\(rn"\o"I\(rn"\o"I\(rn"CCXCV. .el \{\ .br .nf __ ____________ ivccxcivCMLXVIICCXCV. .fi \} Note: For values whose residues modulo 1000000 are less than 4000, M is used to represent 1000; for values whose residues are 4000 or greater, .if t \o"I\(rn" .if n \{\ .nf _ I .fi \} .\" This is the one place we corrected the original manual. is used. Thus #3999 would read out as MMMCMXCIX \*F while #4000 would .FS The original INTERCAL-72 manual claimed that #3999 should render as MMMIM, but the C-INTERCAL developers have been unable to find an algorithm that does this and is consistent with the rest of the rules. .FE readout as .if t \o"I\(rn"\o"V\(rn". .if n \{\ .nf __ IV .fi \} Similar rules apply to the use of .if t \o"M\(rn" .if n \{\ .nf _ M .fi \} and i for 1000000, and to that of m and .if t \o"i\(rn" .if n \{\ .nf _ i .fi \} for 1000000000. .if '\*c'y' \{\ .P (See also section .GETHN communication for a description of C-INTERCAL's character I/O.) \} .if '\*c'y' \{\ .H 3 "COME FROM" .P In which we try to precisely define a statement that should never have been born, but is nevertheless one of the more useful statements in INTERCAL. .H 4 "Background" .P The earliest known description of the COME FROM statement in the computing literature is in [R. L. Clark, "A linguistic contribution to GOTO-less programming," Commun. ACM 27 (1984), pp. 349-350], part of the famous April Fools issue of CACM. The subsequent rush by language designers to include the statement in their languages was underwhelming, one might even say nonexistent. It was therefore decided that COME FROM would be an appropriate addition to C-INTERCAL. .H 4 "Description" .P There are two useful ways to visualize the action of the COME FROM statement. The simpler is to see that it acts like a GOTO when the program is traced backwards in time. More precisely, the statements .DS L (1) DO . . . (2) DO COME FROM (1) .DE should be thought of as being equivalent to .DS L (1) DO (2) DO GOTO (3) . . . (3) DO NOTHING .DE if INTERCAL actually had a GOTO statement at all, which of course it doesn't. .P What this boils down to is that the statement DO COME FROM (label), anywhere in the program, places a kind of invisible trap door immediately after statement (label). Execution or abstention of that statement is immediately followed by an unconditional jump to the COME FROM, unless the (label)ed statement is an executed NEXT, in which case the jump occurs if the program attempts to RESUME back to that NEXT statement. It is an error for more than one COME FROM to refer to the same (label). .P Modification of the target statement by ABSTAIN or by the % qualifier affects only that statement, not the subsequent jump. Such modifications to the COME FROM itself, however, do affect the jump. Encountering the COME FROM statement itself, rather than its target, has no effect. \} .SETR last_statement .H 2 "Comments" .SETR comments .P Unrecognizable statements, as noted in section .GETHN error_messages \&, are flagged with a splat (*) during compilation, and are not considered fatal errors unless they are encountered during execution, at which time the statement (as input at compilation time) is printed and execution is terminated. This allows for an interesting (and, by necessity, unique) means of including comments in an INTERCAL listing. For example, the statement: .sp 1 * PLEASE NOTE THAT THIS LINE HAS NO EFFECT .P will be ignored during execution due to the inclusion of the NOT qualifier. User-supplied error messages are also easy to implement: .sp 1 * DO SOMETHING ABOUT OVERFLOW IN ;3 .P as are certain simple conditional errors: .DS L .cs R 24 * (123) DON'T YOU REALIZE THIS STATEMENT SHOULD ONLY BE ENCOUNTERED ONCE? PLEASE REINSTATE (123) .cs R .DE This pair of statements will cause an error exit the second time they are encountered. Caution!! The appearance of a statement identifier in an intended comment will be taken as the beginning of a new .\" CORRECTION: .\" "comment example above" was originally "example on the preceding page" .\" We can't rely on page boundaries any more. statement. Thus, the first comment example above could not have been: .sp 1 * PLEASE NOTE THAT THIS LINE DOES NOTHING .P The third example, however, is valid, despite the appearance of two cases of D-space-O, since INTERCAL does not ignore extraneous spaces in statement identifiers. .if '\*c'y' \{\ .H 1 "OUTSIDE COMMUNICATION" .if '\*c'y' \{\ .DS I F She puzzled over this for some time, but at last a bright thought struck her. "Why, it's a Looking-glass book, of course! And, if I hold it up to a glass, the words will all go the right way again." .DE \} .SETR communication .P In which we try to remedy the fact that, due to I/O limitations, INTERCAL can not even in principle perform the same tasks as other languages. It is hoped that this addition will permit INTERCAL users to waste vast quantities of computer time well into the 21st century. .H 2 "Motivation" .P One of the goals of INTERCAL was to provide a language which, though different from all other languages, is nevertheless theoretically capable of all the same tasks. INTERCAL-72 failed to accomplish this because its I/O functions could not handle arbitrary streams of bits, or even arbitrary sequences of characters. A language which can't even send its input directly to its output can hardly be considered as capable as other languages. .H 2 "Turing Text Model" .P To remedy this problem, character I/O is now provided in a form based on the "Turing Text" model, originally proposed by Jon Blow. The C-INTERCAL programmer can access this capability by placing a one-dimensional array in the list of items given to a WRITE IN or READ OUT statement. On execution of the statement, the elements of the array will, from first to last, be either loaded from the input or sent to the output, as appropriate, in the manner described below. There is currently no support for I/O involving higher-dimensional arrays, but some form of graphics might be a possible 2-D interpretation. .P The heart of the Turing Text model is the idea of a continuous loop of tape containing, in order, all the characters in the machine's character set. When a character is received by the input routine, the tape is advanced the appropriate number of spaces to bring that character under the tape head, and the number of spaces the tape was moved is the number that is actually seen by the INTERCAL program. Another way to say this is that the number placed in an INTERCAL array is the difference between the character just received and the previous character, modulo the number of characters in the machine character set. .P Output works in just the opposite fashion, except that the characters being output come from the other side of the tape. From this position the characters on the tape appear to be in reverse order, and are individually backwards as well. (We would show you what it looks like, but we don't have a font with backwards letters available. Use your imagination.) The effect is that a number is taken out of an INTERCAL array, subtracted from the last character output -- i.e., the result of the last subtraction -- and then sent on down the output channel. The only catch is that the character as seen by the INTERCAL program is the mirror-image of the character as seen by the machine and the user. The bits of the character are therefore taken in reverse order as it is sent to the output. Note that this bit reversal affects only the character seen by the outside world; it does not affect the character stored internally by the program, from which the next output number will be subtracted. All subtractions are done modulo the number of characters in the character set. .P Two different tapes are used for input and output to allow for future expansion of the language to include multiple input and output channels. Both tapes start at character 0 when a program begins execution. On input, when an end-of-file marker is reached the number placed in the array is one greater than the highest-numbered character on the tape. .H 2 "Example Program" .P If all this seems terribly complicated, it should be made perfectly clear by the following example program, which simply maps its input to its output (like a simplified UNIX "cat"). It assumes that characters are 8 bits long, but that's fine since the current version of C-INTERCAL does too. It uses the standard library routines for addition and subtraction. .DS L .cs R 24 DO ,1 <- #1 DO .4 <- #0 DO .5 <- #0 DO COME FROM (30) DO WRITE IN ,1 DO .1 <- ,1SUB#1 DO (10) NEXT PLEASE GIVE UP (20) PLEASE RESUME '?.1$#256'~'#256$#256' (10) DO (20) NEXT DO FORGET #1 DO .2 <- .4 DO (1000) NEXT DO .4 <- .3~#255 DO .3 <- !3~#15'$!3~#240' DO .3 <- !3~#15'$!3~#240' DO .2 <- !3~#15'$!3~#240' DO .1 <- .5 DO (1010) NEXT DO .5 <- .2 DO ,1SUB#1 <- .3 (30) PLEASE READ OUT ,1 .cs R .DE For each number received in the input array, the program first tests the #256 bit to see if the end of file has been reached. If not, the previous input character is subtracted off to obtain the current input character. Then the order of the bits is reversed to find out what character should be sent to the output, and the result is subtracted from the last character sent. Finally, the difference is placed in an array and given to a READ OUT statement. See? We told you it was simple! \} .if '\*c'y' \{\ .H 1 "TriINTERCAL" .if '\*c'y' \{\ .DS I F "-- oh dear, how puzzling it all is! I'll try if I know all the things I used to know. Let me see: four times five is twelve, and four times six is thirteen, and four times seven is -- oh dear! I shall never get to twenty at that rate!" .DE \} .SETR tri_intercal .P In which it is revealed that bitwise operations are too ordinary for hard-core INTERCAL programmers, and extensions to other bases are discussed. These are not, strictly speaking, extensions to INTERCAL itself, but rather new dialects sharing most of the features of the parent language. .H 2 "Motivation" .P INTERCAL is really a pretty sissy language. It tries hard to be different, but when you get right down to its roots, what do you find? You find bits, that's what. Plain old ones and zeroes, in groups of 16 and 32, just like every other language you've ever heard of. And what operations can you perform on these bits? The INTERCAL operators may arrange and permute them in weird and wonderful ways, but at the bit level the operators are the same AND, OR and XOR you've seen countless times before. .P Once the prospective INTERCAL programmer masters the unusual syntax, she finds herself working with the familiar Boolean operators on perfectly ordinary unsigned integer words. Even the constants she uses are familiar. After all, who would not immediately recognize #65535 and #32768? It may take a just a moment more to figure out #65280, and #21845 and #43690 could be puzzles until she notices that they sum to #65535, but basically she's still on her home turf. The 16-bit limit on constants actually works in the programmer's favor by insuring that very long anonymous constants cannot appear in INTERCAL programs. And this is in a language that is supposed to be different from any other! .H 2 "Abandon All Hope..." .P Standard INTERCAL is based on variables consisting of ordinary bits and familiar Boolean operations on those bits. In pursuit of uniqueness, it seems appropriate to provide a new dialect, otherwise identical to INTERCAL, which instead uses variables consisting of trits, i.e. ternary digits, and operators based on tritwise logical operations. This is intended to be a separate dialect, rather than an extension to INTERCAL itself, for a number of reasons. Doing it this way avoids word-length conflicts, does not spoil the elegance of the Spartan INTERCAL operator set, and dodges the objections of those who might feel it too great an alteration to the original language. Primarily, though, giving INTERCAL programmers the ability to switch numeric base at will amounts to excessive functionality. So much better that a programmer choose a base at the outset and then be forced to stick with it for the remainder of the program. .H 2 "Compiler Operation" .P The same compiler, ick, supports both INTERCAL and TriINTERCAL. This has the advantage that future bug fixes and additions to the language not related to arithmetic immediately apply to both versions. The compiler recognizes INTERCAL source files by the extension '.i', and TriINTERCAL source files by the extension '.3i'. It's as simple as that. There is no way to mix INTERCAL and TriINTERCAL source in the same program, and it is not always possible to determine which dialect a program is written in just by looking at the source code. .H 2 "Data Types" .P The two TriINTERCAL data types are 10-trit unsigned integers and 20-trit unsigned integers. All INTERCAL syntax for distinguishing data types is ported to these new types in the obvious way. Small words may contain numbers from #0 to #59048; large words may contain numbers from #0$#0 to #59048$#59048. Errors are signaled for constants greater than #59048 and for attempts to WRITE IN numbers too large for a given variable or array element to hold. .P Note that though TriINTERCAL considers all numbers to be unsigned, nothing prevents the programmer from implementing arithmetic operations that treat their operands as signed. Three's complement is one obvious choice, but balanced ternary notation is also a possibility. This latter is a very pretty and symmetrical system in which all 2 trits are treated as if they had the value -1. .H 2 "Operators" .P The TriINTERCAL operators are designed to inherit the relevant properties of the standard INTERCAL operators, so that both can be considered as merely different aspects of the same Platonic ideal. (Not that the word "ideal" is ever particularly relevant when used in connection with INTERCAL.) .H 3 "Binary Operators I" .P The binary operators carry over from the original language with only minor changes. The mingle operator ($) creates a 20-trit word by alternating trits from its two 10-trit operands. The select operator (~) is a little more complicated, since the ternary tritmask may contain 0, 1, and 2 trits. If we observe that the select operation on binary operands amounts to a bitwise AND and some rearrangement of bits, it seems appropriate to base the select for ternary operands on a tritwise AND in the analogous fashion. We therefore postpone the definition of select until we know what a tritwise AND looks like. .H 3 "Unary Operators" .P The unary operators in INTERCAL are all derived from the familiar Boolean operations on single bits. To extend these operations to trits, we first ask ourselves what the important properties of these operations are that we wish to be preserved, then design the tritwise operators so that they behave in a similar fashion. .H 4 "Unary Logical Operators" .P Let's start with AND and OR. To begin with, these can be considered "choice" or "preference" operators, as they always return one of their operands. AND can be described as wanting to return 0, but returning 1 if it is given no other choice, i.e., if both operands are 1. Similarly, OR wants to return 1 but returns 0 if that is its only choice. From this it is immediately apparent that each operator has an identity element that "always loses", and a dominator element that "always wins". .P AND and OR are commutative and associative, and each distributes over the other. They are also symmetric with each other, in the sense that AND looks like OR and OR looks like AND when the roles of 0 and 1 are interchanged (De Morgan's Laws). This symmetry property seems to be a key element to the idea that these are logical, rather than arithmetic, operators. In a three-valued logic we would similarly expect a three-way symmetry among the three values 0, 1 and 2 and the three operators AND, OR and (of course) BUT. .P The following tritwise operations have all the desired properties: OR returns the greater of its two operands. That is, it returns 2 if it can get it, else it tries to return 1, and it returns 0 only if both operands are 0. AND wants to return 0, will return 2 if it can't get 0, and returns 1 only if forced. BUT wants 1, will take 0, and tries to avoid 2. The equivalents to De Morgan's Laws apply to rotations of the three elements, e.g., 0 -> 1, 1 -> 2, 2 -> 0. Each operator distributes over exactly one other operator, so the property "X distributes over Y" is not transitive. The question of which way this distributivity ring goes around is left as an exercise for the student. .P In TriINTERCAL programs the whirlpool (@) denotes the unary tritwise BUT operation. You can think of the whirlpool as drawing values preferentially towards the central value 1. Alternatively, you can think of it as drawing your soul and your sanity inexorably down ... .P On the other hand, maybe it's best you \fInot\fR think of it that way. .P A few comments about how these operators can be used. OR acts like a tritwise maximum operation. AND can be used with tritmasks. 0's in a mask wipe out the corresponding elements in the other operand, while 1's let the corresponding elements pass through unchanged. 2's in a mask consolidate the values of nonzero elements, as both 1's and 2's in the other operand yield 2's in the output. BUT can be used to create "partial tritmasks". 0's in a mask let BUT eliminate 2's from the other operand while leaving other values unchanged. Of course, the symmetry property guarantees that the operators don't really behave differently from each other in any fundamental way; the apparent differences come from the intuitive view that a 0 trit is "not set" while a 1 or 2 trit is "set". .H 4 "Binary Operators II" .P At this point we can define select, since we now know what the tritwise AND looks like. Select takes the binary tritwise AND of its two operands. It shifts all the trits of the result corresponding to 2's in the right operand over to the right (low) end of the result, then follows them with all the output trits corresponding to 1's in the right operand. Trits corresponding to 0's in the right operand, which are all 0 anyway, occupy the remaining space at the left end of the output word. Both 10-trit and 20-trit operands are accepted, and are padded with zeroes on the left if necessary. The output type is determined the same way as in standard C-INTERCAL. .H 4 "Unary Arithmetic Operators" .P Now that we've got all that settled, what about XOR? This is easily the most-useful of the three unary INTERCAL operators, because it combines in one package the operations ADD WITHOUT CARRY, SUBTRACT WITHOUT BORROW, BITWISE NOT-EQUAL, and BITWISE NOT. In TriINTERCAL we can't have all of these in the same operator, since addition and subtraction are no longer the same thing. The solution is to split the XOR concept into two operators. The ADD WITHOUT CARRY operation is represented by the new sharkfin (^), while the old what (?) represents SUBTRACT WITHOUT BORROW. The reason for this choice is so that what (?) will also represent the TRITWISE NOT-EQUAL operation. .P Note that what (?), unlike the other four unary operators, is not symmetrical. It should be thought of as rotating its operand one trit to the right (with wraparound) and then subtracting off the trits of the original number. These subtractions are done without borrowing, i.e., trit-by-trit modulo 3. .H 3 "Examples" .P The TriINTERCAL operators really aren't all that bad once you get used to them. Let's look at a few examples to show how they can be used in practice. In all of these examples the input value is contained in the 10-trit variable .3. .P In INTERCAL, single-bit values often have to be converted from {0,1} to {1,2} for use in RESUME statements. Examples of how to do this appear in the original manual. In TriINTERCAL the expression "^.3$#1"~#1 sends 0 -> 1 and 1 -> 2. If the 1-trit input value can take on any of its three possible states, however, we will also have to deal with the 2 case. The expression "V.3$#1"~#1 sends {0,1} -> 1 and 2 -> 2. To test if a trit is set, we can use "V'"&.3$#2"~#1'$#1"~#1, sending 0 -> 1 and {1,2} -> 2. To reverse the test we use "?'"&.3$#2"~#1'$#1"~#1, sending 0 -> 2 and {1,2} -> 1. Note that we have not been taking full advantage of the new select operator. These last two expressions can be simplified into "V!3~#2'$#1"~#1 and "?!3~#2'$#1"~#1, which perform exactly the same mappings. Finally, if we need a 3-way test, we can use "@'"^.3$#7"~#4'$#2"~#10, which obviously sends 0 -> 1, 1 -> 2, and 2 -> 3. .P For an unrelated example, the expression "^.3$.3"~"#0$#29524" converts all of the 1-trits of .3 into 2's and all of the 2-trits into 1's. In balanced ternary, where 2-trits represent -1 values, this is the negation operation. .H 2 "Beyond Ternary..." .P While we're at it, we might as well extend this multiple bases business a little farther. The ick compiler actually recognizes filename suffixes of the form '.Ni', where N is any number from 2 to 7. 2 of course gives standard INTERCAL, while 3 gives TriINTERCAL. We cut off before 8 because octal notation is the smallest base used to facilitate human-to-machine communication, and this seems quite contrary to the basic principles behind INTERCAL. The small data types hold 16 bits, 10 trits, 8 quarts, 6 quints, 6 sexts, or 5 septs, and the large types are always twice this size. .P As for operators, ? is always SUBTRACT WITHOUT BORROW, and ^ is always ADD WITHOUT CARRY. V is the OR operation and always returns the max of its inputs. & is the AND operation, which chooses 0 if possible but otherwise returns the max of the inputs. @ is BUT, which prefers 1, then 0, then the max of the remaining possibilities. Rather than add more special symbols forever, a numeric modifier may be placed directly before the @ to indicate the operation that prefers one of the digits not already represented. Thus in files ending in '.5i', the permitted unary operators are ?, ^, &, @, 2@, 3@, and V. Use of such barbarisms as 0@ to represent & are not permitted, nor is the use of @ or ^ in files with either of the extensions '.i' or '.2i'. Why not? You just can't, that's why. Don't ask so many questions. .P As a closing example, we note that in balanced quinary notation, where 3 means -2 and 4 means -1, the negation operation can be written as either .DS L DO .1 <- "^'"^.3$.3"~"#0$#3906"'$'"^.3$.3"~"#0$#3906"'"~"#0$#3906" .DE or as .DS L DO .1 <- "^.3$.3"~"#0$#3906" DO .1 <- "^.1$.1"~"#0$#3906" .DE These work because multiplication by -1 is the same as multiplication by 4, modulo 5. .P Now go beat your head against the wall for a while.\} .H 1 "SUBROUTINE LIBRARY" .if '\*c'y' \{\ .DS I F "You don't know what you're talking about!" cried Humpty Dumpty. "How many days are there in a year?" .P "Three hundred and sixty-five," said Alice. .P "And how many birthdays have you?" .P "One." .P "And if you take one from three hundred and sixty-five, what remains?" .P "Three hundred and sixty-four, of course." .P Humpty Dumpty looked doubtful. "I'd rather see that done on paper," he said. .DE \} .SETR sublib .P INTERCAL provides several built-in subroutines to which control can be transferred to perform various operations. These operations include many useful functions which are not easily representable in INTERCAL, such as addition, subtraction, etc. .H 2 "Usage" .P In general, the operands are .1, .2, etc., or :1, :2, etc., and the result(s) are stored in what would have been the next operand(s). For instance, one routine adds .1 to .2 and stores the sum in .3, with .4 being used to indicate overflow. All variables not used for results are left unchanged. .H 2 "Available Functions" .SETR functions .P At the time of this writing, only the most fundamental operations are offered in the library, as a more complete selection would require prohibitive time and core to implement. These functions, along with their corresponding entry points (entered via DO (entry) NEXT) are listed below. .DS L .cs R 24 (1000) .3 <- .1 plus .2, error exit on overflow (1009) .3 <- .1 plus .2 .4 <- #1 if no overflow, else .4 <- #2 (1010) .3 <- .1 minus .2, no action on overflow (1020) .1 <- .1 plus #1, no action on overflow (1030) .3 <- .1 times .2, error exit on overflow (1039) .3 <- .1 times .2 .4 <- #1 if no overflow, else .4 <- #2 (1040) .3 <- .1 divided by .2 .3 <- #0 if .2 is #0 (1050) .2 <- :1 divided by .1, error exit on overflow .2 <- #0 if .1 is #0 (1500) :3 <- :1 plus :2, error exit on overflow (1509) :3 <- :1 plus :2 :4 <- #1 if no overflow, else :4 <- #2 (1510) :3 <- :1 minus :2, no action on overflow (1520) :1 <- .1 concatenated with .2 (1525) This subroutine is intended solely for internal use within the subroutine library and is therefore not described here. Its effect is to shift .3 logically 8 bits to the left. (1530) :1 <- .1 times .2 (1540) :3 <- :1 times :2, error exit on overflow (1549) :3 <- :1 times :2 :4 <- #1 if no overflow, else :4 <- #2 (1550) :3 <- :1 divided by :2 :3 <- #0 if :2 is #0 (1900) .1 <- uniform random no. from #0 to #65535 (1910) .2 <- normal random no. from #0 to .1, with standard deviation .1 divided by #12 .cs R .DE .if '\*c'y' \{\ .H 2 "Automagical Inclusion Of The Subroutine Library" .P The C-INTERCAL compiler will automatically include the system library if a DO (1xxx) NEXT statement is used, and if no (1xxx) labels are defined anywhere, where (1xxx) is a label in the 1000-1999 range, inclusive. This was not an INTERCAL-72 feature. \} .H 1 "PROGRAMMING HINTS" .if '\*c'y' \{\ .DS I F "If any one of them can explain it," said Alice, "I'll give him sixpence. \fII\fR don't believe there's an atom of meaning in it." The jury all wrote down, on their slates, "\fIShe\fR doesn't believe there's an atom of meaning in it," but none of them attempted to explain the paper. .P "If there's no meaning in it," said the King, "that saves a world of trouble, you know, as we needn't try to find any. And yet, I don't know," he went on, spreading out the verses on one knee, and looking at them with one eye: "I seem to see some meaning in them, after all...." .DE \} .SETR proghints .P For the user looking to become more familiar with the INTERCAL language, we present in this section an analysis of a complex program, as well as some suggested projects for the ambitious programmer. .P Considering the effort involved in writing an INTERCAL program, it was decided in putting together this manual to use an already existing program for instructive analysis. Since there was only one such program available, we have proceeded to use it. It is known as the "INTERCAL System Library." .H 2 "Description" .P .\" CORRECTION: .\" "is in section {section}" was "on the second page following" .\" We can't rely on the page breaks any more. The program listing is in section .GETHN syslib \&. It is in the same format as would be produced by the Princeton INTERCAL compiler in FORMAT mode with WIDTH=62 (see section .GETHN princeton ). For a description of the functions performed by the Library, see section .GETHN functions \&. .H 2 "Analysis" .P We shall not attempt to discuss here the algorithms used, but rather we shall point out some of the general techniques applicable to a wide range of problems. .P Statements 10, 14, 15, and 26 make up a virtual "computed GO TO". When statement 10 is executed, control passes eventually to statement 16 or 11, depending on whether .5 contains #1 or #2, respectively. The value of .5 is determined in statement 9, which demonstrates another handy technique. To turn an expression, exp, with value #0 or #1, into #1 or #2 (for use in a "GO TO"), use "\*(vb'exp'\*(ct#1"~#3. To reverse the condition (i.e., convert #0 to #2 and leave #1 alone) use "\*(vb'exp'\*(ct#2"~#3. .P Certain conditions are easily checked. For example, to test for zero, select the value from itself and select the bottom bit (see statement 54). To test for all bits being 1's, select the value from itself and select the top bit. .\" CORRECTION: .\" "statements 219 and 220" were "statement 192 and 193", but there .\" is no such test there. .\" Also, last sentence had parenthetical "(see statement 261)". Not .\" only does 261 contain no such test, the library as a whole doesn't .\" seem to either. The test for greater than, performed in statements 219 and 220 on 32-bit values, employs binary logical operations, which are performed as follows: .DS \&'\*(vb.1\*(ct.2'~'#0\*(ct#65535' .DE for 16-bit values or, for 32-bit values: .DS L "'\*(vb":1~'#65535\*(ct30'"\*(ct":2~'#65535\*(ct#0'"'~'#0 \*(ct#65535'"\*(ct"'\*(vb":1~'#0\*(ct#65535'"\*(ct":2~'#0 \*(ct#65535'"'~'#0\*(ct#65535'" .DE (The proofs are left as an exercise to the reader.) .P Testing for greater-than with 16-bit values is somewhat simpler and is done with the pair of statements: .DS L DO .C <- '\*(vb.A\*(ct.B'~'#0\*(ct#65535' DO .C <- '&"'.A~.C'~'"\*(vb'\*(vb.C~.C'\*(ct#32768" ~"#0\*(ct#65535"'"\*(ct".C~.C"'~#1 .DE This sets .C (a dummy variable) to #1 if .A > .B, and #0 otherwise. The expression may be expanded as described above to instead set .C to #1 or #2. .P Note also in statement 220 the occurrence of ~"#65535\*(ct#65535". Although these operations select the entire value, they are not extraneous, as they ensure that the forthcoming \*(vbs will be operating on 32-bit values. .P In several virtual computed GO TOs the DO FORGET #1 (statement 15 in the earlier example) has been omitted, since the next transfer of control would be a DO RESUME #1. By making this a DO RESUME #2 instead, the FORGET may be forgotten. .P In statement 64, note that .2 is STASHed twice by a single statement. This is perfectly legal. .P Lastly, note in statements 243 and 214 respectively, expressions for shifting 16- and 32-bit variables logically one place to the left. Statement 231 demonstrates right-shifting for 32-bit variables. .bp .H 2 "Program Listing" .SETR syslib .DS L .cs R 24 .\" CORRECTION: .\" This is the corrected system library, not the rather buggy original. .\" Can be semi-mechanically generated from the syslib.i file with .\" sed syslib.i -e 1d -e '/\$/s//\\*(ct/g' -e '/?/s//\\*(vb/g' | nl | expand \" but you have to .\" (a) restore the splat on line 13 DOUBLE OR SINGLE PRECISION OVERFLOW .\" (b) restore the splat on line 254 PLEASE NOTE .... .\" (c) appropriately conditionalize lines 289-294 .\" (d) manually break lines where they wrap 1 (1000) PLEASE IGNORE .4 2 PLEASE ABSTAIN FROM (1005) 3 (1009) DO STASH .1 + .2 + .5 + .6 4 DO .4 <- #1 5 DO (1004) NEXT 6 (1004) PLEASE FORGET #1 7 DO .3 <- '\*(vb.1\*(ct.2'~'#0\*(ct#65535' 8 DO .6 <- '&.1\*(ct.2'~'#0\*(ct#65535' 9 PLEASE DO .5 <- "\*(vb!6~#32768'\*(ct#1"~#3 10 DO (1002) NEXT 11 DO .4 <- #2 12 (1005) DO (1006) NEXT * 13 (1999) DOUBLE OR SINGLE PRECISION OVERFLOW 14 (1002) DO (1001) NEXT 15 (1006) PLEASE FORGET #1 16 DO .5 <- '\*(vb"!6~.6'~#1"\*(ct#1'~#3 17 DO (1003) NEXT 18 DO .1 <- .3 19 DO .2 <- !6\*(ct#0'~'#32767\*(ct#1' 20 DO (1004) NEXT 21 (1003) DO (1001) NEXT 22 DO REINSTATE (1005) 23 (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6 24 DO REMEMBER .4 25 PLEASE RESUME #2 26 (1001) DO RESUME .5 27 (1010) DO STASH .1 + .2 + .4 28 DO .4 <- .1 29 DO .1 <- '\*(vb.2\*(ct#65535'~'#0\*(ct#65535' 30 DO (1020) NEXT 31 PLEASE DO .2 <- .4 32 PLEASE DO (1009) NEXT 33 DO RETRIEVE .1 + .2 + .4 34 PLEASE RESUME #1 35 (1020) DO STASH .2 + .3 36 DO .2 <- #1 37 PLEASE DO (1021) NEXT 38 (1021) DO FORGET #1 39 DO .3 <- "\*(vb!1~.2'\*(ct#1"~#3 40 PLEASE DO .1 <- '\*(vb.1\*(ct.2'~'#0\*(ct#65535' 41 DO (1022) NEXT 42 DO .2 <- !2\*(ct#0'~'#32767\*(ct#1' 43 DO (1021) NEXT 44 (1023) PLEASE RESUME .3 45 (1022) DO (1023) NEXT 46 PLEASE RETRIEVE .2 + .3 47 PLEASE RESUME #2 48 (1030) DO ABSTAIN FROM (1033) 49 PLEASE ABSTAIN FROM (1032) 50 (1039) DO STASH :1 + .5 51 DO (1530) NEXT 52 DO .3 <- :1~#65535 53 PLEASE DO .5 <- :1~'#65280\*(ct#65280' 54 DO .5 <- '\*(vb"!5~.5'~#1"\*(ct#1'~#3 55 DO (1031) NEXT 56 (1032) DO (1033) NEXT 57 DO (1999) NEXT 58 (1031) DO (1001) NEXT 59 (1033) DO .4 <- .5 60 DO REINSTATE (1032) 61 PLEASE REINSTATE (1033) 62 DO RETRIEVE :1 + .5 63 PLEASE RESUME #2 64 (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3 65 DO .2 <- #0 66 DO (1520) NEXT 67 DO STASH :1 68 PLEASE RETRIEVE .2 69 DO .1 <- .2 70 DO .2 <- #0 71 PLEASE DO (1520) NEXT 72 DO :2 <- :1 73 DO RETRIEVE .1 + .2 + :1 74 DO (1550) NEXT 75 PLEASE DO .3 <- :3 76 DO RETRIEVE :1 + :2 + :3 77 DO RESUME #1 78 (1050) PLEASE STASH :2 + :3 + .5 79 DO :2 <- .1 80 PLEASE DO (1550) NEXT 81 DO .5 <- :3~'#65280\*(ct#65280' 82 DO .5 <- '\*(vb"!5~.5'~#1"\*(ct#1'~#3 83 DO (1051) NEXT 84 DO (1999) NEXT 85 (1051) DO (1001) NEXT 86 DO .2 <- :3 87 PLEASE RETRIEVE :2 + :3 + .5 88 DO RESUME #2 89 (1500) PLEASE ABSTAIN FROM (1502) 90 PLEASE ABSTAIN FROM (1506) 91 (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6 92 DO .1 <- :1~#65535 93 PLEASE DO .2 <- :2~#65535 94 DO (1009) NEXT 95 DO .5 <- .3 96 PLEASE DO .6 <- .4 97 DO .1 <- :1~'#65280\*(ct#65280' 98 DO .2 <- :2~'#65280\*(ct#65280' 99 DO (1009) NEXT 100 DO .1 <- .3 101 PLEASE DO (1503) NEXT 102 DO .6 <- .4 103 DO .2 <- #1 104 DO (1009) NEXT 105 DO .1 <- .3 106 DO (1501) NEXT 107 (1504) PLEASE RESUME .6 108 (1503) DO (1504) NEXT 109 (1501) DO .2 <- .5 110 DO .5 <- '\*(vb"'&.6\*(ct.4'~#1"\*(ct#2'~#3 111 DO (1505) NEXT 112 (1506) DO (1502) NEXT 113 PLEASE DO (1999) NEXT 114 (1505) DO (1001) NEXT 115 (1502) DO :4 <- .5 116 DO (1520) NEXT 117 DO :3 <- :1 118 PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6 119 DO REINSTATE (1502) 120 DO REINSTATE (1506) 121 PLEASE RESUME #3 122 (1510) DO STASH :1 + :2 + :4 123 DO :1 <- "'\*(vb":2~'#65535\*(ct#0'"\*(ct#65535' ~'#0\*(ct#65535'"\*(ct"'\*(vb":2~'#0\*(ct#65535' "\*(ct#65535'~'#0\*(ct#65535'" 124 DO :2 <- #1 125 DO (1509) NEXT 126 PLEASE RETRIEVE :1 127 DO :2 <- :3 128 PLEASE DO (1509) NEXT 129 DO RETRIEVE :2 + :4 130 PLEASE RESUME #1 131 (1520) PLEASE STASH .3 + .4 132 DO .3 <- .1~#43690 133 DO (1525) NEXT 134 PLEASE DO .4 <- 'V.3\*(ct".2~#43690"'~'#0\*(ct#65535' 135 DO .3 <- .1~#21845 136 PLEASE DO (1525) NEXT 137 DO :1 <- .4\*(ct"'V.3\*(ct".2~#21845"'~'#0\*(ct#65535'" 138 PLEASE RETRIEVE .3 + .4 139 DO RESUME #1 140 (1525) DO .3 <- '"'"'"!3\*(ct#0'~'#32767\*(ct#1'"\*(ct#0' ~'#32767\*(ct#1'"\*(ct#0'~'#16383\*(ct#3'"\*(ct#0' ~'#4095\*(ct#15' 141 PLEASE RESUME #1 142 (1530) DO STASH :2 + :3 + .3 + .5 143 DO :1 <- #0 144 DO :2 <- .2 145 DO .3 <- #1 146 DO (1535) NEXT 147 (1535) PLEASE FORGET #1 148 DO .5 <- "\*(vb!1~.3'\*(ct#1"~#3 149 DO (1531) NEXT 150 DO (1500) NEXT 151 DO :1 <- :3 152 PLEASE DO (1533) NEXT 153 (1531) PLEASE DO (1001) NEXT 154 (1533) DO FORGET #1 155 DO .3 <- !3\*(ct#0'~'#32767\*(ct#1' 156 DO :2 <- ":2~'#0\*(ct#65535'"\*(ct"'":2~'#32767 \*(ct#0'"\*(ct#0'~'#32767\*(ct#1'" 157 PLEASE DO .5 <- "\*(vb!3~.3'\*(ct#1"~#3 158 DO (1532) NEXT 159 DO (1535) NEXT 160 (1532) DO (1001) NEXT 161 PLEASE RETRIEVE :2 + :3 + .3 + .5 162 DO RESUME #2 163 (1540) PLEASE ABSTAIN FROM (1541) 164 DO ABSTAIN FROM (1542) 165 (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5 166 DO .1 <- :1~#65535 167 PLEASE DO .2 <- :2~'#65280\*(ct#65280' 168 DO .5 <- :1~'#65280\*(ct#65280' 169 DO (1530) NEXT 170 DO :3 <- :1 171 DO .2 <- :2~#65535 172 PLEASE DO (1530) NEXT 173 DO :5 <- :1 174 DO .1 <- .5 175 DO (1530) NEXT 176 DO :4 <- :1 177 PLEASE DO :1 <- ":3~'#65280\*(ct#65280'" \*(ct":4~'#65280\*(ct#65280'" 178 DO .5 <- ':1~:1'~#1 179 DO .2 <- :2~'#65280\*(ct#65280' 180 DO (1530) NEXT 181 PLEASE DO .5 <- '"':1~:1'~#1"\*(ct.5'~#3 182 DO .1 <- :3~#65535 183 DO .2 <- #0 184 DO (1520) NEXT 185 PLEASE DO :2 <- :1 186 PLEASE DO .1 <- :4~#65535 187 DO (1520) NEXT 188 DO (1509) NEXT 189 DO .5 <- !5\*(ct":4~#3"'~#15 190 DO :1 <- :3 191 DO :2 <- :5 192 DO (1509) NEXT 193 PLEASE DO .5 <- !5\*(ct":4~#3"'~#172 194 DO .5 <- '\*(vb"!5~.5'~#1"\*(ct#1'~#3 195 PLEASE RETRIEVE :4 196 (1541) DO :4 <- .5 197 DO (1543) NEXT 198 (1542) DO (1544) NEXT 199 PLEASE DO (1999) NEXT 200 (1543) DO (1001) NEXT 201 (1544) DO REINSTATE (1541) 202 PLEASE REINSTATE (1542) 203 PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5 204 DO RESUME #2 205 (1550) DO STASH :1 + :4 + :5 + .5 206 DO :3 <- #0 207 DO .5 <- '\*(vb"':2~:2'~#1"\*(ct#1'~#3 208 PLEASE DO (1551) NEXT 209 DO :4 <- #1 210 PLEASE DO (1553) NEXT 211 (1553) DO FORGET #1 212 DO .5 <- '\*(vb":2~'#32768\*(ct#0'"\*(ct#2'~#3 213 DO (1552) NEXT 214 DO :2 <- ":2~'#0\*(ct#65535'"\*(ct"'":2~'#32767 \*(ct#0'"\*(ct#0'~'#32767\*(ct#1'" 215 PLEASE DO :4 <- ":4~'#0\*(ct#65535'"\*(ct"'":4 ~'#32767\*(ct#0'"\*(ct#0'~'#32767\*(ct#1'" 216 DO (1553) NEXT 217 (1552) DO (1001) NEXT 218 (1556) PLEASE FORGET #1 219 DO :5 <- "'\*(vb":1~'#65535\*(ct#0'"\*(ct":2 ~'#65535\*(ct#0'"'~'#0\*(ct#65535'"\*(ct"' \*(vb":1~'#0\*(ct#65535'"\*(ct":2~'#0\*(ct #65535'"'~'#0\*(ct#65535'" 220 DO .5 <- '\*(vb"'&"':2~:5'~'"'\*(vb"'\*(vb":5~:5 "~"#65535\*(ct#65535"'~'#65535\*(ct#0'"\*(ct #32768'~'#0\*(ct#65535'"\*(ct"'\*(vb":5~:5" ~"#65535\*(ct#65535"'~'#0\*(ct#65535'"'"\*(ct"' :5~:5'~#1"'~#1"\*(ct#2'~#3 221 DO (1554) NEXT 222 DO :5 <- :3 223 DO (1510) NEXT 224 PLEASE DO :1 <- :3 225 DO :3 <- "'V":4~'#65535\*(ct#0'"\*(ct":5~'#65535 \*(ct#0'"'~'#0\*(ct#65535'"\*(ct"'V":4~'#0 \*(ct#65535'"\*(ct":5~'#0\*(ct#65535'"'~'#0 \*(ct#65535'" 226 DO (1555) NEXT 227 (1554) PLEASE DO (1001) NEXT 228 (1555) DO FORGET #1 229 DO .5 <- "\*(vb':4~#1'\*(ct#2"~#3 230 DO (1551) NEXT 231 DO :2 <- ":2~'#0\*(ct#65534'"\*(ct":2~'#65535\*(ct#0'" 232 DO :4 <- ":4~'#0\*(ct#65534'"\*(ct":4~'#65535\*(ct#0'" 233 PLEASE DO (1556) NEXT 234 (1551) DO (1001) NEXT 235 PLEASE RETRIEVE :1 + :4 + :5 + .5 236 PLEASE RESUME #2 237 (1900) DO STASH .2 + .3 + .5 238 DO .1 <- #0 239 DO .2 <- #1 240 PLEASE DO (1901) NEXT 241 (1901) DO FORGET #1 242 DO %50 .1 <- 'V.1\*(ct.2'~'#0\*(ct#65535' 243 DO .2 <- !2\*(ct#0'~'#32767\*(ct#1' 244 PLEASE DO .5 <- "\*(vb!2~.2'\*(ct#1"~#3 245 DO (1902) NEXT 246 DO (1901) NEXT 247 (1902) DO (1001) NEXT 248 DO RETRIEVE .2 + .3 + .5 249 PLEASE RESUME #2 250 (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3 251 DO .3 <- #65524 252 DO :1 <- #6 253 DO (1911) NEXT * 254 PLEASE NOTE THAT YOU CAN'T GET THERE FROM HERE 255 (1912) DO (1001) NEXT 256 (1911) DO FORGET #1 257 PLEASE DO (1900) NEXT 258 DO :2 <- .1 259 DO (1500) NEXT 260 PLEASE DO :1 <- :3 261 DO .1 <- .3 262 DO (1020) NEXT 263 PLEASE DO .3 <- .1 264 DO .5 <- '\*(vb"!3~.3'~#1"\*(ct#2'~#3 265 DO (1912) NEXT 266 DO .1 <- #12 267 PLEASE DO (1050) NEXT 268 DO RETRIEVE .1 269 DO (1530) NEXT 270 DO :2 <- #32768 271 DO (1500) NEXT 272 PLEASE DO .2 <- :3~'#65280\*(ct#65280' 273 PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3 274 DO RESUME #1 .cs R .DE .bp .H 2 "Programming Suggestions" .P For the novice INTERCAL programmer, we provide here a list of suggested INTERCAL programming projects: .P Write an integer exponentiation subroutine. :1 <- .1 raised to the .2 power. .P Write a double-precision sorting subroutine. Given 32-bit array ;1 of size :1, sort the contents into numerically increasing order, leaving the results in ;1. .P Generate a table of prime numbers. .P Put together a floating-point library, using 32-bit variables to represent floating-point numbers (let the upper half be the mantissa and the lower half be the characteristic). The library should be capable of performing floating-point addition, subtraction, multiplication, and division, as well as the natural logarithm function. .P Program a Fast Fourier Transform (FFT). This project would probably entail the writing of the floating-point library as well as sine and cosine functions. .P Calculate, to :1 places, the value of pi. .if '\*c'y' \{\ .P (Working programs for each of these projects are included in the C-INTERCAL distribution's pit directory of sample code.) \} .bp .H 1 "ERROR MESSAGES" .if '\*c'y' \{\ .DS I F Alice felt dreadfully puzzled. The Hatter's remark seemed to her to have no sort of meaning in it, and yet it was certainly English. "I don't quite understand you," she said, as politely as she could. .DE \} .SETR error_messages .P Due to INTERCAL's implementation of comment lines (see section 4.5), most error messages are produced during execution instead of during compilation. All errors except those not causing immediate termination of program execution are treated as fatal. .H 2 "Format" .P All error messages appear in the following form: .DS L ICLnnnI (error message) ON THE WAY TO STATEMENT nnnn CORRECT SOURCE AND RESUBMIT .DE The message varies depending upon the error involved. For undecodable statements the message is the statement itself. The second line tells which statement would have been executed next had the error not occurred. Note that if the error is due to 80 attempted levels of NEXTing, the statement which would have been executed next need not be anywhere near the statement causing the error. .H 2 "Messages" .P Brief descriptions of the different error types are listed below according to message number. .BL .LI 000 An undecodable statement has been encountered in the course of execution. Note that keypunching errors can be slightly disastrous, since if 'FORGET' were misspelled F-O-R-G-E-R, the results would probably not be those desired. Extreme misspellings may have even more surprising consequences. For example, misspelling 'FORGET' R-E-S-U-M-E could have drastic results. .LI 017 An expression contains a syntax error. .LI 079 Improper use has been made of statement identifiers. .LI 099 Improper use has been made of statement identifiers. .LI 123 Program has attempted 80 levels of NEXTing. .LI 129 Program has attempted to transfer to a non-existent line label. .LI 139 An ABSTAIN or REINSTATE statement references a non-existent line label. .LI 182 A line label has been multiply defined. .LI 197 An invalid line label has been encountered. .LI 200 An expression involves an unidentified variable. .LI 240 An attempt has been made to give an array a dimension of zero. .LI 241 Invalid dimensioning information was supplied in defining or using an array. .LI 275 A 32-bit value has been assigned to a 16-bit variable. .LI 436 A retrieval has been attempted for an unSTASHed value. .LI 533 A WRITE IN statement or interleave (\*(ct) operation has produced a value requiring over 32 bits to represent. .LI 562 Insufficient data. .LI 579 Input data is invalid. .LI 621 The expression of a RESUME statement evaluated to #0. .LI 632 Program execution was terminated via a RESUME statement instead of GIVE UP. .LI 633 Execution has passed beyond the last statement of the program. .LI 774 A compiler error has occurred (see section .GETHN princeton ). .LI 778 .ie '\*c'n' \{\ An unexplainable compiler error has occurred (see J. Lyon or D. Woods)\}. .el An unexplainable compiler error has occurred. .LE .if '\*c'y' \{\ .P The following error codes are new in C-INTERCAL: .BL .LI 111 You tried to use a C-INTERCAL extension with the `traditional' flag on. .LI 127 Can't find syslib.i file when it's needed for magical inclusion. .LI 222 Out of stash space, or attempt to stash an undeclared array. .LI 333 Too many variables. .LI 444 A COME FROM statement references a non-existent line label. .LI 555 More than one COME FROM references the same label. .LI 666 Too many source lines. .LI 777 No such source file. .LI 888 Can't open C output file. .LI 999 Can't open C skeleton file. .LI 998 Source file name with invalid extension (use .i or .[2-7]i). .LI 997 Illegal possession of a controlled unary operator. .LE \} .if '\*c'y' \{\ .H 1 "The C-INTERCAL Compiler" .if '\*c'y' \{\ .DS I F "And yet it was a very clever pudding to invent." .P "What did you mean it to be made of?" Alice asked, hoping to cheer him up, for the poor Knight seemed quite low-spirited about it. .P "It began with blotting-paper," the Knight answered with a groan. .P "That wouldn't be very nice, I'm afraid --" .P "Not very nice \fIalone\fR," he interrupted, quite eagerly, "but you've no idea what a difference it makes, mixing it with other things -- such as gunpowder and sealing-wax." .DE \} .P This section describes the use of ick, the C-INTERCAL compiler. Information specific to the other known INTERCAL compilers appears in the following sections. These sections are less useful, since the other compilers are no longer available, but they are retained to provide a sense of history, and because any information regarding INTERCAL is really too scarce to discard. .H 2 "Character Set" .P The C-INTERCAL compiler uses ASCII rather than EBCDIC. We follow the Atari implementation (see section .GETHN atari ) by (a) replacing the change sign (\*(ct) with big money ($) as the mingle operator, and (b) replacing the bookworm (\*(vb) symbol with what (?) as the XOR operator. .P Version 0.18 and later versions accept the Latin-1 (ISO 8859-1) character set, which is a superset of ASCII. As a result, 0xA2 (\*(ct), 0xA3 (quid), and 0xA4 (zlotnik) are accepted as mingle operators. .P Version 0.20 and later versions also accept UTF-8 as an alternative to Latin-1. The above three currency operators will be accepted in either Latin-1 or UTF-8 format. UTF-8 format is required if you wish to use any of EURO-CURRENCY SIGN, COLON SIGN (that's Costa Rican dinero, not the Intercal two-spot), CRUZEIRO SIGN, FRENCH FRANC SIGN, LIRA SIGN, MILL SIGN, NAIRA SIGN, PESETA SIGN, RUPEE SIGN, WON SIGN, NEW SHEQEL SIGN, DONG SIGN, EURO SIGN, BENGALI RUPEE MARK, BENGALI RUPEE SIGN, or THAI CURRENCY SYMBOL BAHT. (Isn't internationalization wonderful?) Furthermore, you can use the Intercal character FOR ALL to represent the what operator. .H 2 "Usage and Compilation Options" .P To compile an INTERCAL program `foo.i' to executable code, just do ick foo.i There's a -c option that leaves the generated C code in place for inspection (suppressing compilation to machine code), a -d option that enables verbose parse reporting from the yacc/bison parser, a -t option that requires strict INTERCAL-72 compliance (rejecting COME FROM and the extensions for bases other than two), a -b option that disables the INTERCAL-72 random-bug feature (error 774), and an -O option that enables the (hah!) optimizer. Invoking ick -? prints a usage message. .P Another compilation switch affects C-INTERCAL's runtime behavior. The `-C' option forces output in "clockface" mode, for superstitious users who believe writing "IV" upside-down offends IVPITER and would rather see IIII. .H 2 "Runtime Options" .P Every C-INTERCAL runtime also accepts certain options at runtime. These include [+/-]help, [+/-]traditional, and [+/-]wimpmode. The help option (with either + or -) triggers a 'usage' message. The +traditional option is presently a no-op. .P Steve explains: "The wimpmode option is the most interesting. I found myself always running my test programs with filters on both ends to work around the \&'nifty' INTERCAL number representations. This was so painful that I decided it would be \fIless\fR painful (and a lot less code) if I added a 'wimp' option. With the +wimpmode option, the user is subjected to a humiliating message about what a wimp he or she is to use this mode, but after that is allowed to use conventional numerical notation. While such a mode doubtless violates to some extent the INTERCAL philosophy, the fact that an 'unbutcher' command has been posted clearly indicates the need for it. Anyway ... if you don't like it, don't use it ... the default is -wimpmode (i.e. \fInot\fR wimp mode)." .H 2 "PLEASE Politesse Checking" .P A feature of INTERCAL-72 not documented in the original manual was that it required a certain level of politesse from the programmer. If fewer than 1/5th of the program statements included the PLEASE qualifier, the program would be rejected as insufficiently polite. If more than 1/3rd of them included PLEASE, the program would be rejected as excessively polite. .P This check has been implemented in C-INTERCAL. To assist programmers in coping with it, the intercal.el mode included with the distribution randomly expands "do " in entered source to "PLEASE DO" 1/4th of the time. .H 2 "Localization: Ancient Roman" Version 0.18 and later versions of C-Intercal have been localized for Ancient Roman as well as English-speaking locales. This means that Latin-language keywords are accepted as equivalents for the English-based ones traditionally used. See src/lexer.l for details, as we do not propose to break Priscian's head (publicly expose our ignorance of Latin) here. \} .if '\*c'y' \{\ .\" The final paragraph is the same text as the ATARI NOTES at the end .\" of the manual. .H 1 "The Atari Implementation" .if '\*c'y' \{\ .DS I F "Perhaps it doesn't understand English," thought Alice. "I daresay it's a French mouse, come over with William the Conqueror." (For, with all her knowledge of history, Alice had no very clear notion how long ago anything had happened.) .DE \} .SETR atari .P The Atari 800 implementation, actually a generic 6502 implementation that was begun in 1982 by Mike Albaugh and Karlina Ott, was never completed sufficiently to target the Atari cartridge format. These notes were added by Mike Albaugh when he typed in the original INTERCAL-72 manual, which up to that point had existed only in paper copies. .P The Atari implementation of INTERCAL differs from the original Princeton version primarily in the use of ASCII rather than EBCDIC. Since there is no "change" sign (\*(ct) in ASCII, we have substituted the "big money" ($) as the mingle operator. We feel that this correctly represents the increasing cost of software in relation to hardware. (Consider that in 1970 one could get RUNOFF for free, to run on a $20K machine, whereas today a not quite as powerful formatter costs $99 and runs on a $75 machine.) We also feel that there should be no defensible contention that INTERCAL has any sense. Also, since overpunches are difficult to read on the average VDT, the exclusive-or operator may be written ?. This correctly expresses the average person's reaction on first encountering exclusive-or, especially on a PDP-11. Note that in both of these cases, the over-punched symbol may also be used if one is masochistic, or concerned with portability to the Princeton compiler. The correct over-punch for "change" is "c/" and the correct over-punch for \*(vb is "V-". These codes will be properly printed if you have a proper printer, and the corresponding EBCDIC code will be produced by the /IBM option on the LIST command. \} .if '\*c'n' \{\ .H 1 "JCL" .SETR princeton .P The information contained in the following section applies only to the Princeton compiler, run under OS/360. .H 2 "The Princeton Compiler" \} .if '\*c'y' \{\ .H 1 "The Princeton Compiler" .DS I F "My name is Alice, so please your Majesty," said Alice very politely; but she added, to herself, "Why, they're only a pack of cards, after all. I needn't be afraid of them!" .DE \} .SETR princeton .P The Princeton compiler, written in SPITBOL (a variant of SNOBOL), performs the compilation in two stages. First the INTERCAL source is converted into SPITBOL source, then the latter is compiled and executed. .P It should be noted that the Princeton compiler fails to properly interpret certain multiply-subscripted expressions, such as: .DS ",1SUB",2SUB#1"#2" .DE .P This is not a "bug". Being documented, it is merely a "restriction". Such cases may be resolved by alternating sparks and ears in various levels of expression nesting: .DS ",1SUB',2SUB#1'#2" .DE which is advisable in any case, since INTERCAL expressions are unreadable enough as is. .P Since there is currently no catalogued procedure for invoking the compiler, the user must include the in-line .\" CORRECTION: .\" "in Figure 3" was "on the following page" procedure shown in Figure 3 in his job before the compilation step. Copies of this in-line procedure may be obtained at any keypunch if the proper keys are struck. .P The compiler is then executed in the usual manner: .DS L // EXEC INTERCAL[,PARM='parameters'] //COMPILE.SYSIN DD * {INTERCAL source deck} /* //EXECUTE.SYSWRITE DD * {input data} /* .DE The various parameters are described following the in-line procedure. At most one parameter from each set may apply to a given compilation; if more than one are specified, the results are undefined, and may vary depending upon the particular set of options. The default parameters are .if n \{\ underlined.\} .if t \{\ italicized.\} .\" CORRECTION: .\" In the original, the footnote was on the wrong line (one above). .DS L //INTERCAL PROC //COMPILE EXEC PGM=INTERCAL //STEPLIB DD DSN=U.INTERCAL.LIBRARY,DISP=SHR // DD DSN=SYS1.FORTLIB,DISP=SHR //SYSPRINT DD SYSOUT=A,DCB=(BLKSIZE=992,LRECL=137,RECFM=VBA) //SYSPUNCH DD DUMMY //SCRATCH DD DSN=&COMPSET,UNIT=SYSDA,SPACE=(CYL,(3,1)),DISP=(,PASS) //EXECUTE EXEC PGM=EXECUTE,COND=(4,LT) //SOURCES DD DSN=U.INTERCAL.SOURCES,DISP=SHR \*F //STEPLIB DD DSN=U.INTERCAL.LIBRARY,DISP=SHR // DD DSN=SYS5.SPITLIB,DISP=SHR // DD DSN=SYS1.FORTLIB,DISP=SHR //SYSIN DD DSN=&COMPSET,DISP=(OLD,DELETE) //SYSOBJ DD SYSOUT=B,DCB=(BLKSIZE=80,LRECL=80,RECFM=F) //SYSPRINT DD SYSOUT=A,DCB=(BLKSIZE=992,LRECL=137,RECFM=VBA) //SYSPUNCH DD DUMMY // PEND .DE .FS Pending acquisition of SPITBOL release 3.0, the SOURCES DD card must be replaced by the five cards: .DS L //NOOPTPFX DD DSN=U.INTERCAL.SOURCES(NOOPTPFX),DISP=SHR //NOOPTSUB DD DSN=U.INTERCAL.SOURCES(NOOPTSUB),DISP=SHR //OPTPFX DD DSN=U.INTERCAL.SOURCES(OPTPFX),DISP=SHR //OPTSUB DD DSN=U.INTERCAL.SOURCES(OPTSUB),DISP=SHR //PRELIM DD DSN=U.INTERCAL.SOURCES(PRELIM),DISP=SHR .DE .FE .ce 1 Figure 3. Inline procedure for using INTERCAL. .P .LB 5 0 " " 0 * 0 0 .LI "\fIOPT\fR" .LI "NOOPT" .LI " " In the default mode, the compiler will print a list of all options in effect, including the defaults for unspecified parameter groups and the effective option for those sets where one was specified. If NOOPT is requested, it causes the default mode to be assumed. .LI "\fIOPTSUB\fR" .LI "NOOPTSUB" .LI "NOSUB" .LI " " Unless 'NOOPTSUB' is requested, the System Library is optimized, resulting in much more rapid processing of function calls. Specifying NOOPTSUB causes the non-optimized INTERCAL code shown in section .GETHN syslib to be used, whereas NOSUB requests that the System Library be omitted altogether. .LI IAMBIC .LI "\fIPROSE\fR" .LI " " The IAMBIC parameter permits the programmer to use poetic license and thus write in verse. If the reader does not believe it possible to write verse in INTERCAL, he should send the authors a stamped, self-addressed envelope, along with any INTERCAL program, and they will provide one which is verse. .LI "\fIFORMAT\fR" .LI NOFORMAT .LI " " In FORMAT mode, each statement printed is put on a separate line (or lines). In NOFORMAT mode, the free-format source is printed exactly as input. In this latter case, statement numbers are provided only for the first statement on a card, and they may be only approximate. Also, unrecognizable statements are not flagged. .LI SEQ .LI "\fINOSEQ\fR" .LI " " If the source deck has sequence numbers in columns 73 through 80, specifying 'SEQ' will cause them to be ignored. .LI "SOURCE" .LI "\fINOSOURCE\fR" .LI " " If NOSOURCE is selected, all source listing is suppressed. .LI LIST .LI "\fINOLIST\fR" .LI " " If LIST is specified, the compiler will provide a list of statement numbers catalogued according to type of statement. The compiler uses this table to perform abstentions by gerund. .LI "WIDTH=nn" .LI " " This sets the width (in number of characters) of the output line for FORMAT mode output. The default is .B 132. .LI "CODE" .LI "\fINOCODE\fR" .LI " " Include 'CODE' in the parameter list to obtain a listing of the SPITBOL code produced for each INTERCAL statement. .LI "LINES=nn" .LI " " This determines the number of lines per page, during both compilation and execution. The default is .B 60. .LI DECK .LI "\fINODECK\fR" .LI " " Selecting 'DECK' will cause the compiler to punch out a SPITBOL object deck which may then be run without reinvoking the INTERCAL (or SPITBOL) compiler. .LI "\fIKIDDING\fR" .LI NOKIDDING .LI " " Select NOKIDDING to eliminate the snide remarks which ordinarily accompany INTERCAL error messages. .LI "\fIGO\fR" .LI NOGO .LI " " Specifying 'NOGO' will cause the program to be compiled but not executed. EXECUTE/NOEXECUTE may be substituted for GO/NOGO, but this will result in an error, and GO will be assumed. .LI "\fIBUG\fR" .LI NOBUG .LI " " Under the default, there is a fixed probability of a fatal compiler bug being worked at random into the program being compiled. Encountering this bug during execution results in error message 774 (see section .GETHN error_messages ). This probability is reduced to zero under 'NOBUG'. This does not affect the probability (presumably negligible) of error message 778. .LE .H 2 "Other INTERCAL Compilers" .P There are no other INTERCAL compilers. \*F .FS This assertion in the INTERCAL-72 manual was blatantly contradicted by some notes on an Atari implementation included at the end of the manual. So, you expect compiler manuals to be consistent? .FE .ds App TONSIL .APP "A\*F" "" .if '\*c'y' \{\ .DS I F "Of course they answer to their names?" the Gnat remarked carelessly. .P "I never knew them to do it." .P "What's the use of their having names," the Gnat said, "if they wo'n't answer to them?" .P "No use to \fIthem\fR," said Alice; "but it's useful to the people that name them, I suppose. If not, why do things have names at all?" .P "I ca'n't say," the Gnat replied. "Further on, in the wood down there, they've got no names -- however, go on with your list...." .DE \} .P The Official INTERCAL Character Set .FS Since all other reference manuals have Appendices, it was decided that the INTERCAL manual should contain some other type of removable organ. .FE .\" I don't remember what this font change did in 1990, .\" but in 2010 it gave groff terrible fits and had to be removed. .\" Ditto for the second instance of @ps a few lines down and .\" the third just before Tonsil B. .\".ps \n[@ps] .\".nr * \n*+1 .P .\" CORRECTION: .\" The original manual said "Tabulated on page " and gave a page number, .\" rather than saying "Tabulated next". But we can't count on the .\" page breaks to be in the same places. Tabulated next are all the characters used in INTERCAL, excepting letters and digits, along with their names and interpretations. Also included are several characters not used in INTERCAL, which are presented for completeness and to allow for future expansion. .\" All we're doing here is evaluating \*F and throwing it away .fi \*F .FS This footnote intentionally unreferenced. .FE .ds CH - % - .bp .\".nr * \n*-1 .\".ps \n[@ps] .\" .\" Note: In the original manual, the headers on the character-set table .\" were more or less centered. This should be achievable with a "c c c" .\" format line, but for some reason the attempt desperately confuses .\" groff in 2010. .\" .ie '\*c'n' \{\ .\" CORRECTION: "exclusive or" was typoed as "exlusive or" .TS box; l l l. Character Name Use (if any) = \&. spot identify 16-bit variable : two-spot identify 32-bit variable , tail identify 16-bit array ; hybrid identify 32-bit array # mesh identify constant \&= half-mesh \' spark grouper ` backspark ! wow equivalent to spark-spot ? what \fIunary exclusive OR (ASCII)\fR " rabbit-ears grouper \o'".' rabbit equivalent to ears-spot | spike % double-oh-seven percentage qualifier \- worm used with angles < angle used with worms > right angle ( wax precedes line label ) wane follows line label [ U turn ] U turn back { embrace } bracelet * splat flags invalid statements & ampersand \*F unary logical AND V V (or book) unary logical OR \*(vb bookworm (or universal qualifier) unary exclusive OR $ big money \fIbinary mingle (ASCII)\fR \*(ct change binary mingle ~ sqiggle binary select \&_ flat worm \*(ov overline indicates "times 1000" + intersection separates list items / slat \e backslat @ whirlpool \(no hookworm ^ shark (or simply sharkfin) \o"#*\(sq" blotch .TE \} .el \{\ .TS box; l l l. Character Name Use (if any) = \&. spot identify 16-bit variable : two-spot identify 32-bit variable , tail identify 16-bit array ; hybrid identify 32-bit array # mesh identify constant \&= half-mesh \' spark grouper ` backspark ! wow equivalent to spark-spot ? what unary logical XOR " rabbit-ears grouper \o'".' rabbit equivalent to ears-spot | spike % double-oh-seven percentage qualifier \- worm used with angles < angle used with worms > right angle ( wax precedes line label ) wane follows line label [ U turn ] U turn back { embrace } bracelet * splat flags invalid statements & ampersand \*F unary logical AND V V (or book) unary logical OR \*(vb bookworm (universal qualifier) unary logical XOR (INTERCAL-72) $ big money binary mingle \*(ct change binary mingle (INTERCAL-72) ~ sqiggle binary select \&_ flat worm \*(ov overline indicates "times 1000" + intersection separates list items / slat \e backslat @ whirlpool unary logical BUT (TriINTERCAL) \(no hookworm ^ shark (or simply sharkfin) unary logical XOR (TriINTERCAL) \o"#*\(sq" blotch \(de bunghole \(rg name grabber \(mu andrew cross \(di norwegian minus \(co text grabber \(sc swash \(*m microscope \(+- interworm \*(no half turn \(Po quid binary mingle \(Cs zlotnik binary mingle .TE \} .ce 1 Table 2 (top view). INTERCAL character set. .FS Got any better ideas? .FE \".ps \n[@ps] .if '\*c'n' \{\ .APP "B" "NOTES ON THE ATARI IMPLEMENTATION" .P The Atari implementation of INTERCAL differs from the original Princeton .ds CH INTERCAL version primarily in the use of ASCII rather than EBCDIC. Since there is no "change" sign (\*(ct) in ASCII, we have substituted the "big money" ($) as the mingle operator. We feel that this correctly represents the increasing cost of software in relation to hardware. (Consider that in 1970 one could get RUNOFF for free, to run on a $20K machine, whereas today a not quite as powerful formatter costs $99 and runs on a $75 machine.) We also feel that there should be no defensible contention that INTERCAL has any sense. Also, since overpunches are difficult to read on the average VDT, the exclusive-or operator may be written ?. This correctly expresses the average person's reaction on first encountering exclusive-or, especially on a PDP-11. Note that in both of these cases, the over-punched symbol may also be used if one is masochistic, or concerned with portability to the Princeton compiler. The correct over-punch for "change" is "c/" and the correct over-punch for \*(vb is "V-". These codes will be properly printed if you have a proper printer, and the corresponding EBCDIC code will be produced by the /IBM option on the LIST command. \} intercal-0.30/doc/PaxHeaders.27456/ickstyle.css0000644000000000000000000000007411474462532016124 xustar0030 atime=1427954558.347140885 30 ctime=1427992235.626945589 intercal-0.30/doc/ickstyle.css0000644000175000017500000000245311474462532016023 0ustar00esresr00000000000000 /* Custom styles for the C-INTERCAL manual. These are partly for a small amount of beautification, but mostly to work around the ugliness of the default stylesheet on at least one compiler. This stylesheet is public domain from this comment onwards. */ body {text-align:justify; font-family:serif; background-color:#FFFFFF; color:#000000;} pre {margin:0.5em 3em 0.5em 3em; background-color:#F8F8F8; border:1px solid #CCCCCC;} pre.smallexample {font-size:75%;} p {margin:0.5em 0em 0.5em 0em;} li {margin:0.5em 0em 0.5em 0em;} ul.menu li {margin:0em 0em 0em 0em;} ul.index-cp li {margin:0em 0em 0em 0em;} div.contents ul li {margin:0em 0em 0em 0em;} blockquote {margin:0.5em 3em 0.5em 3em;} dt {margin:0em 0em 0em 0em; font-weight:bold;} dd {margin:0.5em 0em 1em 3em;} code {background-color:#F8F8F8;} tt {background-color:#F8F8F8;} samp {background-color:#F8F8F8;} table {border:1px solid #666666; background-color:#CCCCCC;} td {border:1px solid #666666; background-color:#FFFFFF;} intercal-0.30/doc/PaxHeaders.27456/ick.10000644000000000000000000000007411474462532014413 xustar0030 atime=1427954558.347140885 30 ctime=1427992235.498945939 intercal-0.30/doc/ick.10000644000175000017500000001154311474462532014312 0ustar00esresr00000000000000.TH ICK 1 .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection .\" other parms are allowed: see man(7), man(1) .\" .\" Modified by Alex Smith under the terms of the GPL. .SH NAME ick \- INTERCAL compiler .SH SYNOPSIS .B ick .I "[options] file..." .PP .B ick .I "-e [options] intercal-file [non-intercal-file...] [library...]" .SH "DESCRIPTION" This manual page documents briefly the .BR ick command. This manual page was originally written for the Debian GNU/Linux distribution (but may be used by others), because the original program did not have a manual page, and was then added back to the main distribution. Fuller documentation is available via the command .B info ick (for the .B ick command itself; even fuller documentation is available via .B info C-INTERCAL (which contains the documentation for both the compiler and the INTERCAL language)). .\"Comment this back in on Debian: .\"There is also other documentation in .\".B /usr/share/doc/intercal .\"and .\".B /usr/share/doc/intercal/examples .\"as one would expect on a Debian system. .PP .B ick takes INTERCAL programs and generates code from them (by running gcc). .PP Note that the base in which a program is written is deduced from its extension; INTERCAL programs in base 2 must have the extension .i, INTERCAL programs in bases from 3 to 7 must have an extension from .3i to .7i respectively. .PP No options take arguments; multiple options can be given separately or combined in the usual way (even -e). The order in which options is given is irrelevant unless they conflict, in which case the options that are given last on the command line take precedence. .SH OPTIONS .TP .B \-c Compile INTERCAL to C, but don't compile the resulting C. .TP .B \-d Print yacc debugging information (implies -c). .TP .B \-t Requires strict INTERCAL-72 compliance (rejecting COME FROM, the extensions for bases other than two, and other features not found in INTERCAL-72). .TP .B \-b Disables the INTERCAL-72 random-bug feature. .TP .B \-O Attempt to optimize expressions in the generated code. .TP .B \-C Clockface output (using IIII rather than IV in Roman numerals). .TP .B \-f Optimize control flow in generated code (prevents -yp). .TP .B \-F Optimize everything in generated code for speed, regardless of how slow the compiler becomes or how large the object file becomes. Implies -fO, prevents -cdeghpyH. .TP .B \-h Print optimizer debugging information (implies -cO). .TP .B \-H Print verbose optimizer debugging information (implies -cO). .TP .B \-hH Print optimizer debugging information in a different form (implies -cO). .TP .B \-w Enable the +printflow option in output programs even if they are not multithreaded. .TP .B \-y Run the yuk debugger on the code (prevents -fme). .TP .B \-p Run the yuk profiler on the code (prevents -fme). .TP .B \-m Allow multithreading and backtracking (prevents -ype, implies -w). .TP .B \-e Link one INTERCAL file to non-INTERCAL files or to expansion libraries. Doing this changes the syntax of the command line; the first file given must be the INTERCAL source file, then this can be followed by any number of files in other languages to link via the external calls system (currently only C and maybe Befunge-98 programs are allowed), and then any number of expansion libraries. The non-INTERCAL files will be processed to link them to the INTERCAL files, and then compiled with gcc and linked to the main INTERCAL program. .TP .B \-E Do not link any system libraries, even if the code suggests that one or more is needed (prevents -P). .TP .B \-a Allow the use of the CREATE statement (prevents -P). .TP .B \-v Allow anything on the left of an assignment, and turn off the protection that constants otherwise have against being assigned to (prevents -fFOP). .TP .B \-P Compile PIC-INTERCAL rather than INTERCAL (prevents -amFvxeE, implies -cfO). .TP .B \-o Output to stdout rather than .c (implies -c). .TP .B \-X Interpret ambiguous syntax such as ? and @ with Princeton meanings (as used by CLC-INTERCAL), rather than with the default Atari meanings. .TP .B \-x Use CLC-INTERCAL rules for text I/O and for abstaining from a GIVE UP by label (prevents -P). .TP .B \-u Print a message whenever the compiler tries to open a file. .TP .B \-U Dump core on E778 as well as printing an error. .TP .B \-Y Display the command lines for programs invoked by ick. .TP .B \-g Leave the generated C in place, and make the output executable debuggable. .TP .B \-l Attempt to report likely bugs and nonportabilities (implies -O). .SH "SEE ALSO" The newsgroup .B alt.lang.intercal is where INTERCAL compilers are announced, and INTERCAL itself is discussed; the website .B http://catb.org/~esr/intercal is where the most recent versions of C-INTERCAL are currently hosted. .SH AUTHOR .B ick was originally written by Eric S. Raymond. This manual page was originally written by Mark W. Eichin , for the Debian GNU/Linux system. intercal-0.30/PaxHeaders.27456/configure.ac0000644000000000000000000000013212507267141015274 xustar0030 mtime=1427992161.787150875 30 atime=1427992161.795150859 30 ctime=1427992235.486945978 intercal-0.30/configure.ac0000664000175000017500000001413612507267141015203 0ustar00esresr00000000000000dnl -*- autoconf -*- dnl Process this file with autoconf to produce a configure script. dnl Yes, that is a valid email address. If your mailer doesn't support nested dnl comments, then get a better mailer. (Sadly, the escape syntax to place dnl escaped parens into an email address no longer works with autoconf; the dnl problem is that it's passed to the shell in a variety of quoting styles, dnl and the shell gets confused by the backlashes.) AC_INIT([C-INTERCAL],[0.30],[[ais523(with a (comment))@nethack4.org]],[intercal]) AC_CONFIG_SRCDIR([src/perpet.c]) AC_CONFIG_HEADERS([config.h:buildaux/configh.in]) AC_CONFIG_AUX_DIR([buildaux]) AM_INIT_AUTOMAKE([foreign dist-bzip2 dist-xz tar-pax check-news subdir-objects no-texinfo.tex -Wall -Wno-override]) dnl Information about this version of INTERCAL. PACKAGE_VERSION=0.29 dnl Checks for programs. AC_PROG_YACC dnl Don't assume yacc exists just because bison doesn't (wtf autoconf...) if test "x$YACC" == "xyacc"; then YACC= AC_CHECK_PROG([YACC],[yacc]) fi AC_PROG_CC AM_PROG_AR AM_PROG_LEX AC_PROG_RANLIB AC_PROG_LN_S AC_CHECK_TOOL([AR],[ar]) AC_SUBST(AR) dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_HEADER_STDBOOL if test "x$ac_cv_header_stdbool_h" == "xyes" then HAVE_STDBOOL_H=1 fi AC_CHECK_HEADERS([sys/time.h unistd.h stdarg.h]) AC_CHECK_HEADERS([stdint.h],[HAVE_STDINT_H=1]) AC_SUBST(HAVE_STDINT_H) AC_SUBST(HAVE_STDBOOL_H) dnl Checks for typedefs, structures, and compiler characteristics. dnl This Autoconf input is compatible with pre-C99 Autoconf, so to dnl check for long long AC_CHECK_SIZEOF is used to test for a nonzero dnl result. AC_C_CONST AC_C_VOLATILE AC_CHECK_SIZEOF([long long int],[0]) AC_CHECK_SIZEOF([sig_atomic_t],[0],[[#include ]]) AC_HEADER_TIME AC_SYS_INTERPRETER AC_TYPE_SIZE_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T # Some compilers (correctly according to the standard, but dubiously for # actual use in code) dislike mixing _Bool and varargs. if test "x$ac_cv_type__Bool" == "xyes" then HAVE__BOOL=1 AC_MSG_CHECKING([[whether booleans can be passed via varargs]]) AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #ifdef HAVE_STDARG_H #include void test(int x, ...) #else #include void test(va_alist) va_dcl #endif { int y,z; _Bool b; va_list ap; #ifdef HAVE_STDARG_H va_start(ap, x); y = x; #else va_start(ap); y = va_arg(ap, int); #endif b = va_arg(ap, _Bool); z = va_arg(ap, int); if(b && x != z) exit(2); if(!b && x == z) exit(3); } ]],[[ _Bool match = (_Bool)1; _Bool nomatch = (_Bool) 0; test(12345,match,12345); test(23456,nomatch,1234); exit(0); ]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) AC_DEFINE([BOOL_VARARGS_BROKEN],[1],dnl [Define to 1 if _Bool works but cannot be passed via varargs.]) ],[AC_MSG_RESULT([[unknown in a cross-compile, assuming no]]) AC_DEFINE([BOOL_VARARGS_BROKEN],[1],dnl [Define to 1 if _Bool works but cannot be passed via varargs.]) ]) fi AC_SUBST(HAVE__BOOL) AC_MSG_CHECKING([[whether yyrestart() is needed]]) # Write a lex program that will cause an error if yyrestart exists. echo '%% %% float yyrestart(int, ...);' | $LEX AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "${LEX_OUTPUT_ROOT}.c" ]], [[exit(0);]])],[AC_MSG_RESULT(no)],[AC_DEFINE([NEED_YYRESTART],dnl [1],[Define to 1 if yyrestart() is necessary to yyparse a new file.]) AC_MSG_RESULT(yes)]) rm -f ${LEX_OUTPUT_ROOT}.c if test "$interpval" != "no"; then AC_DEFINE([HAVE_SYS_INTERPRETER], [1], [Define to 1 if #! works on your system.]) fi AC_DEFINE_UNQUOTED([EXEEXT],"$EXEEXT",[Extension to use on executable files.]) dnl Checks for library functions. AC_CHECK_FUNCS(gettimeofday gethrtime strdup strtol strtoul snprintf vsnprintf isatty) ICK_SAVECFLAGS=$CFLAGS CFLAGS="$CFLAGS -lrt" AC_CHECK_FUNCS(clock_gettime) CFLAGS=$ICK_SAVECFLAGS dnl Substitutions. INCLUDE_HIDDEN_FROM_AUTOMAKE="include" AC_SUBST(PACKAGE_VERSION) AC_SUBST(INCLUDE_HIDDEN_FROM_AUTOMAKE) AC_CONFIG_FILES([Makefile:buildaux/Makefile.in coopt.sh:src/cooptsh.in host.mak:buildaux/hostmak.in abcess.h:src/abcessh.in]) AC_OUTPUT # After the output, chmod coopt.sh to be executable. chmod a+x coopt.sh # Use prebuilt files if necessary, after config.h is generated. # Automake is capable of handling the files in question, but they need to # be in the directory configure was run in. if test ! -n "$LEX" || echo "$LEX" | grep missing > /dev/null 2>&1; then cp $srcdir/prebuilt/lexer.c $ac_pwd/src/lexer.c AC_MSG_WARN([No version of lex was found; using prebuilt lexer.]) AC_MSG_WARN([Changes to src/lexer.l will be ignored.]) fi if test ! -n "$YACC" || echo "$YACC" | grep missing > /dev/null 2>&1; then cp $srcdir/prebuilt/parser.c $ac_pwd/src/parser.c cp $srcdir/prebuilt/parser.h $ac_pwd/src/parser.h cp $srcdir/prebuilt/oil-oil.c $ac_pwd/src/oil-oil.c AC_MSG_WARN([No version of yacc was found; using prebuilt parser.]) AC_MSG_WARN([Changes to src/parser.y and src/oil.y will be ingored.]) fi # Configure again, for the build system, if necessary. # It's simpler the second time round as we don't care about things like # installation dirs, just about how to do things like run the compiler. if test "$cross_compiling" != yes; then cp config.h bconfig.h exit 0 fi cd $ac_pwd; # This trick for unsetting variables comes from the autoconf manual # "|| exit" suppresses any "Segmentation fault" message. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then unset=unset else unset=false fi AC_DEFUN([GEN_BUILD_CMD_LINE],[ BUILD_$1_ARG="FOO=BAR" if test ! "x$[]$1_FOR_BUILD" == x; then BUILD_$1_ARG="$1=$[]$1_FOR_BUILD"; fi $1=foo $unset $1 || $1='']) GEN_BUILD_CMD_LINE(CC) GEN_BUILD_CMD_LINE(CFLAGS) GEN_BUILD_CMD_LINE(LDFLAGS) GEN_BUILD_CMD_LINE(LIBS) GEN_BUILD_CMD_LINE(CPPFLAGS) GEN_BUILD_CMD_LINE(CPP) BUILD_MACHINE_ARG="FOO=BAR" if test ! "x$build_alias" == x; then BUILD_MACHINE_ARG="--build=$build_alias" fi # Run the new configure script. mv config.status config.status.save (env -i "PATH=$PATH" $srcdir/buildaux/buildconfig "$BUILD_MACHINE_ARG" "$BUILD_CC_ARG" "$BUILD_CFLAGS_ARG" "$BUILD_LDFLAGS_ARG" "$BUILD_LIBS_ARG" "$BUILD_CPPFLAGS_ARG" "$BUILD_CPP_ARG") mv config.status config.status.build mv config.status.save config.status intercal-0.30/PaxHeaders.27456/src0000644000000000000000000000013212507267253013524 xustar0030 mtime=1427992235.618945611 30 atime=1427992237.754939663 30 ctime=1427992235.618945611 intercal-0.30/src/0000775000175000017500000000000012507267253013503 5ustar00esresr00000000000000intercal-0.30/src/PaxHeaders.27456/convickt.c0000644000000000000000000000007411441514002015551 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.542945822 intercal-0.30/src/convickt.c0000644000175000017500000001101211441514002015437 0ustar00esresr00000000000000/***************************************************************************** NAME convickt.c -- translate between various INTERCAL formats LICENSE TERMS Copyright (C) 2007 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ***************************************************************************/ #include #include #include #include #include extern int ick_clc_cset_convert(const char* in, /*@partial@*/ char* out, const char* incset, const char* outcset, int padstyle, size_t outsize, /*@null@*/ FILE* errsto); /* For communication with clc_cset.c */ /*@observer@*/ char* ick_globalargv0; /*@-redef@*/ /* it's never the case that both definitions are used at once */ /*@observer@*/ /*@dependent@*/ const char* ick_datadir; /*@=redef@*/ /* We want to read the latest versions of the character sets from disk. */ /*@null@*/ const char* ick_clc_cset_atari=0; /*@null@*/ const char* ick_clc_cset_baudot=0; /*@null@*/ const char* ick_clc_cset_ebcdic=0; /*@null@*/ const char* ick_clc_cset_latin1=0; /* In case we don't have vsnprintf. */ void /*@noreturn@*/ ick_lose(const char *m, int n, /*@null@*/ const char *s) { (void) m; (void) n; (void) s; abort(); } /*@-redef@*/ /* because only one main is used at a time */ int main(int argc, char** argv) /*@=redef@*/ { size_t allocsize=100; char* in; char* out; size_t i=0; int ti; int c; int padding=-1; ick_globalargv0=argv[0]; srand((unsigned)time(NULL)); if(argc<3||argc>5) { fprintf(stderr,"Usage: convickt informat outformat [padding [arrayname]]\n"); fprintf(stderr,"Available formats are:\n"); fprintf(stderr,"\tPrinceton: latin1, baudot, ebcdic\n"); fprintf(stderr,"\tAtari: atari (7-bit ASCII)\n"); fprintf(stderr,"Possible values for padding are:\n"); fprintf(stderr,"\tprintable: try to leave the output in char range " "32-126\n"); fprintf(stderr,"\tzero: leave the output with 0s in the high bits\n"); fprintf(stderr,"\trandom: pad with random data\n"); fprintf(stderr,"Padding only has an effect on character sets with less\n"); fprintf(stderr,"than 8 bits used per bytes; default is 'printable'.\n"); fprintf(stderr,"If arrayname is given, which must be a legal name for\n"); fprintf(stderr,"a tail array, the output will instead be a portable\n"); fprintf(stderr,"INTERCAL program that stores the required byte pattern\n"); fprintf(stderr,"in that array.\n"); return 0; } if(argc>=4&&!strcmp(argv[3],"printable")) padding=1; if(argc>=4&&!strcmp(argv[3],"zero")) padding=0; if(argc>=4&&!strcmp(argv[3],"random")) padding=2; if(argc>=4&&padding==-1) { fprintf(stderr,"Error: padding value not recognized.\n"); return 1; } if(!(ick_datadir=getenv("ICKDATADIR"))) ick_datadir=ICKDATADIR; in=malloc(allocsize); if(!in) {perror("Error: Memory allocation failure"); return 0;} while((c=getchar())!=EOF) { in[i++]=(char)c; if(i+1>=allocsize) { char* temp=in; allocsize*=2; in=realloc(in,allocsize); if(!in) { perror("Error: Memory allocation failure"); /* Annotation, because in hasn't been freed here; that's what the error return from realloc means. */ /*@-usereleased@*/ if(temp) free(temp); /*@=usereleased@*/ return 0; } } } in[i]='\0'; out=malloc(allocsize*6+6); if(!out) { perror("Error: Memory allocation failure"); free(in); return 0; } ti=ick_clc_cset_convert(in,out,argv[1],argv[2],padding,allocsize*6+6,stderr); if(ti>=0&&argc<5) (void) fwrite(out,1,(size_t)ti,stdout); else if(ti>=0&&argc==5) { int pleasedelay=2; printf("\tDO %s <- #%d\n",argv[4],ti); while(ti--) { printf("\t"); if(!--pleasedelay) {printf("PLEASE "); pleasedelay=4;} printf("DO %s SUB #%d <- #%d\n",argv[4],ti+1,(int)(out[ti])); } } free(in); free(out); return ti<0; } intercal-0.30/src/PaxHeaders.27456/uncommon.c0000644000000000000000000000007411437551705015604 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.534945844 intercal-0.30/src/uncommon.c0000644000175000017500000001452411437551705015505 0ustar00esresr00000000000000/* * uncommon.c -- functions used by ick, convickt, yuk and compiled programs * LICENSE TERMS Copyright (C) 2007 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include "uncommon.h" /* Options that might affect this */ bool ick_printfopens=0; /*@dependent@*/ /*@null@*/ FILE* ick_debfopen(/*@observer@*/ const char* fname, /*@observer@*/ const char* mode) { FILE* t; if(ick_printfopens) fprintf(stderr,"Trying to open '%s'...\n",fname); t=fopen(fname,mode); if(ick_printfopens && t != NULL) fprintf(stderr,"Success!\n"); if(ick_printfopens && t == NULL) fprintf(stderr,"Failed!\n"); return t; } /* This function looks for the skeleton and syslib, searching first the path they should be in, then the current directory, then argv[0]'s directory (if one was given). This function avoids possible buffer overflows, instead truncating filenames (and if that manages to find them, I'll be incredibly surprised). It also tries argv[0]/../lib and argv[0]/../include (where they are when running without installing). */ /*@dependent@*/ /*@null@*/ FILE* ick_findandfopen(/*@observer@*/ const char* file, /*@observer@*/ const char* guessdir, /*@observer@*/ const char* mode, /*@observer@*/ const char* argv0) { static char buf2[BUFSIZ]; /*@observer@*/ static const char *fileiter; size_t i = 0, j; FILE* ret; while(guessdir && *guessdir != '\0' && i= size) ick_lose(IE553, 0, (const char*)NULL); #endif va_end(ap); return retval; } intercal-0.30/src/PaxHeaders.27456/ick.h0000644000000000000000000000007311437551705014523 xustar0030 atime=1427954558.375140793 29 ctime=1427992235.60694564 intercal-0.30/src/ick.h0000644000175000017500000001401211437551705014415 0ustar00esresr00000000000000/* ick.h -- compilation types for intercal parser */ #include "ick_bool.h" #ifdef ICKNOSEARCH #define ICKINCLUDEDIR "." #define ICKLIBDIR "." #define ICKBINDIR "." #define YYDEBUG 1 #endif /* AIS: This is now detected by autoconf and doesn't need to be set by the user. */ #ifdef NEED_YYRESTART # define USE_YYRESTART #endif #define YY_NO_UNPUT #define ALLOC_CHUNK 256 /* * We choose this value for maximum number of possible variables on * the theory that no human mind could grok a more complex INTERCAL * program than this and still retain any vestige of sanity. #define MAXVARS 100 */ /* * Maximum supported statement types; should be equal to (FROM - GETS + 1) * AIS: Changed this when I added new statements. */ #define MAXTYPES 32 /* AIS: Maximum supported spark/ears nesting, divided by 32. The value given allows for 3200 nested spark/ears groupings, which should be enough. */ #define SENESTMAX 100 enum onceagain {onceagain_NORMAL, onceagain_ONCE, onceagain_AGAIN}; /* AIS */ typedef struct node_t { int opcode; /* operator or type code */ unsigned long constant; /* constant data attached */ unsigned long optdata; /* AIS: Temp used by the optimizer */ int width; /* is this 32-bit data? */ struct node_t *lval, *rval; /* attached expression nodes */ struct node_t *nextslat; /* AIS: The next node with a slat */ } node; typedef struct tuple_t { unsigned int label; /* label # of this statement */ unsigned int ncomefrom; /* AIS: How many noncomputed COME FROMS have this line as a suck-point */ int exechance; /* chance of execution, initial abstain, (AIS) MAYBE details */ bool maybe; /* AIS: Where MAYBE details go when exechance has been parsed */ bool abstainable; /* AIS: Is it possible for this line to be abstained from? */ bool initabstain; /* AIS: Is this line initially abstained from? */ bool nextable; /* AIS: Can this line be a NEXT target? */ bool optversion; /* AIS: Use an optimized version? (Only set if the optimizer thinks that it's safe.) */ bool preproc; /* AIS: Is this line a nonexistent one that was added to implement a command in the parser? */ bool warn112:1; /* AIS: Should this line produce warning 112 during degeneration? */ bool warn128:1, warn534:1, warn018:1, warn016:1, warn276:1, warn239:1, warn622:1; /* AIS: As warn112. The warnings are a bitfield to save space. */ unsigned int type; /* statement type */ struct { /* AIS: Struct, not union needed because ABSTAIN expr FROM (line) has both */ unsigned int target; /* for NEXT statements */ node *node; /* attached expression node(s) */ } u; unsigned int nexttarget; /* AIS: The target tuple of a NEXT must also be recorded for optimizef */ int ick_lineno; /* source line for error messages */ bool sharedline; /* if NZ, two statements on a line */ enum onceagain onceagainflag; /* AIS: ONCE / AGAIN */ int ppnewtype; /* AIS: 'real' type of this line when the preprocessor is used; 0 on all statements but the 'real' statement */ signed setweave; /* AIS: +1 to turn weaving on, -1 to turn it off, before this command */ } tuple; /* this maps the `external' name of a variable to an internal ick_array index */ typedef struct { int type; unsigned long extindex; unsigned long intindex; int ignorable; /* AIS: Can this variable be IGNOREd? */ int memloc; /* AIS: Where does a PIC store this in memory? */ } atom; typedef struct { int value; /*@null@*/const char *name; } assoc; /*@null@*/ /*@owned@*/ /*@partial@*/ extern atom *oblist; /*@null@*/ /*@dependent@*/ /*@partial@*/ extern atom *obdex; extern int obcount, nonespots, ntwospots, ntails, nhybrids; extern int nmeshes; /* AIS */ /*@only@*/ extern tuple *tuples; extern int tuplecount; /*@dependent@*/ extern tuple *optuple; /* AIS: The tuple currently being optimized */ extern const char **enablers; /*@observer@*/ extern const char *enablersm1[MAXTYPES+1]; extern const assoc vartypes[]; /* the lexical analyzer keeps copies of the source logical lines */ /*@only@*/ extern char **textlines; extern int textlinecount; extern int iyylineno; /* AIS: These are needed to sort out a grammar near-ambiguity */ extern unsigned long sparkearsstack[SENESTMAX]; extern int sparkearslev; /* compilation options */ extern bool compile_only; /* just compile into C, don't run the linker */ extern bool nocompilerbug; /* set possibility of IE774 to zero */ extern bool ick_traditional; /* compile as INTERCAL-72 */ extern int yydebug; /* print debugging information while parsing */ extern int politesse; /* AIS: I added these */ extern bool yukdebug; /* debug the code with yuk */ extern bool yukprofile; /* profile the code with yuk */ extern int compucomecount; /* number of computed COME FROMs */ extern bool compucomesused; /* are computed COME FROMs used? */ extern bool nextfromsused; /* is NEXT FROM used? */ extern bool gerucomesused; /* is COME FROM gerund used? */ extern bool opoverused; /* is operand overloading used? */ extern bool useickec; /* are external calls used? */ extern bool createsused; /* are CREATEs used? */ /*@null@*/ extern node* firstslat; /* the ick_first node with a slat */ /*@null@*/ extern node* prevslat; /* the last node so far with a slat */ extern bool multithread; /* is the program multithreaded? */ extern bool variableconstants; /* is any assignment allowed? */ extern bool ick_coreonerr; /* dump core on IE778? */ extern int optdebug; /* debug the optimizer */ extern bool flowoptimize; /* optimize program flow */ extern bool ick_checkforbugs; /* check for bugs */ extern bool coopt; /* constant-output optimizer */ /* ick.h ends here */ intercal-0.30/src/PaxHeaders.27456/cooptsh.in0000644000000000000000000000007411440130757015606 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.518945889 intercal-0.30/src/cooptsh.in0000644000175000017500000000347411440130757015511 0ustar00esresr00000000000000#! /bin/sh ########################################################################### # # Name # coopt.sh -- an inefficient optimizer that can produce very efficient # code # # DESCRIPTION # This optimizer is only run on noninteractive code that takes no # output. (It's designed to run on executables produced by INTERCAL # code, but will run on other executables that support the +mystery # option). It optimizes the file by replacing it by one that simply # produces the required output! Therefore, it creates fast but # inefficient code. If the file to be optimized hits an error or # is terminated by +mystery, then no changes are made. # # LICENSE TERMS # Copyright (C) 2006 Alex Smith # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # ########################################################################### rm -f icktemp.out >/dev/null 2>/dev/null if `readlink -f $1@EXEEXT@` +mystery >icktemp.out 2>/dev/null ; then : ; else echo Execution of $1@EXEEXT@ failed. rm -f icktemp.out ; exit 0 ; fi rm $1@EXEEXT@ echo '#! /bin/sh tail -n+3 $0; exit 0' | cat - icktemp.out > $1@EXEEXT@ chmod +x $1@EXEEXT@ rm -f icktemp.out exit 0 intercal-0.30/src/PaxHeaders.27456/fiddle.c0000644000000000000000000000013112507155722015170 xustar0030 mtime=1427954642.778848997 30 atime=1427954642.862848705 29 ctime=1427992235.53094585 intercal-0.30/src/fiddle.c0000664000175000017500000002252412507155722015100 0ustar00esresr00000000000000/* * fiddle.c -- functions that implement the five INTERCAL operators * * We link these to the compiler, too, in order to do constant folding * LICENSE TERMS Copyright (C) 1996 Eric S. Raymond This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "fiddle.h" #include "sizes.h" #include "ick_lose.h" #include unsigned int ick_mingle(register unsigned int r, register unsigned int s) { if (ick_Base == 2) { if (r>0xffff || s>0xffff) ick_lose(IE533, ick_lineno, (const char *)NULL); r = ((r & 0x0000ff00) << 8) | (r & 0x000000ff); r = ((r & 0x00f000f0) << 4) | (r & 0x000f000f); r = ((r & 0x0c0c0c0c) << 2) | (r & 0x03030303); r = ((r & 0x22222222) << 1) | (r & 0x11111111); s = ((s & 0x0000ff00) << 8) | (s & 0x000000ff); s = ((s & 0x00f000f0) << 4) | (s & 0x000f000f); s = ((s & 0x0c0c0c0c) << 2) | (s & 0x03030303); s = ((s & 0x22222222) << 1) | (s & 0x11111111); return (r << 1) | s; } else { unsigned int result = 0, fac = 1; int i; for (i = 0 ; i < ick_Small_digits ; i++) { result += fac * (s % ick_Base); s /= ick_Base; fac *= ick_Base; result += fac * (r % ick_Base); r /= ick_Base; fac *= ick_Base; } return result; } } unsigned int ick_iselect(register unsigned int r, register unsigned int s) { if (ick_Base == 2) { register unsigned int i = 1, t = 0; while (s) { if (s & i) { t |= r & i; s ^= i; i <<= 1; } else { s >>= 1; r >>= 1; } } return(t); } else { unsigned int j, result = 0, fac, digit, ofac = 1; for (j = (unsigned)ick_Base - 1 ; j > 0 ; j--) { int i; fac = 1; for (i = 0; i < ick_Large_digits ; i++) { if ((s / fac) % ick_Base == j) { digit = (r / fac) % ick_Base; if (digit) result += ofac * (digit > j ? digit : j); ofac *= ick_Base; } fac *= ick_Base; } } return result; } } static unsigned int ick_whirl(unsigned int len, unsigned int p, unsigned int n) { unsigned int i, fac = 1, result = 0, d1, d2, dsave; d1 = n % ick_Base; dsave = d1; for (i = 1 ; i <= len ; i++) { d2 = d1; d1 = (i < len) ? (n /= ick_Base, n % ick_Base) : dsave; if (d1 <= p) result += fac * ((d2 < d1 || d2 > p) ? d1 : d2); else result += fac * ((d2 < d1 && d2 > p) ? d1 : d2); fac *= ick_Base; } return result; } unsigned int ick_and16(unsigned int n) { if (ick_Base == 2) { unsigned int m = (n >> 1); if (n & 1) m |= 0x8000; return(m & n); } else { return ick_whirl((unsigned)ick_Small_digits,0,n); } } unsigned int ick_or16(unsigned int n) { if (ick_Base == 2) { unsigned int m = (n >> 1); if (n & 1) m |= 0x8000; return(m | n); } else { return ick_whirl((unsigned)ick_Small_digits,(unsigned)ick_Base-1,n); } } unsigned int ick_whirl16(unsigned int p, unsigned int n) { return ick_whirl((unsigned)ick_Small_digits,p,n); } unsigned int ick_and32(unsigned int n) { if (ick_Base == 2) { unsigned int m = (n >> 1); if (n & 1) m |= 0x80000000; return(m & n); } else { return ick_whirl((unsigned)ick_Large_digits,0,n); } } unsigned int ick_or32(unsigned int n) { if (ick_Base == 2) { unsigned int m = (n >> 1); if (n & 1) m |= 0x80000000; return(m | n); } else { return ick_whirl((unsigned)ick_Large_digits,(unsigned)ick_Base-1,n); } } unsigned int ick_whirl32(unsigned int p, unsigned int n) { return ick_whirl((unsigned)ick_Large_digits,p,n); } static unsigned int ick_xor(unsigned int len, unsigned int n) { unsigned int i, fac = 1, result = 0, d1, d2, dsave; d1 = n % ick_Base; dsave = d1; for (i = 1 ; i <= len ; i++) { d2 = d1; d1 = (i < len) ? (n /= ick_Base, n % ick_Base) : dsave; result += fac * ((ick_Base + d1 - d2) % ick_Base); fac *= ick_Base; } return result; } unsigned int ick_xor16(unsigned int n) { if (ick_Base == 2) { unsigned int m = (n >> 1); if (n & 1) m |= 0x8000; return(m ^ n); } else { return ick_xor((unsigned)ick_Small_digits,n); } } unsigned int ick_xor32(unsigned int n) { if (ick_Base == 2) { unsigned int m = (n >> 1); if (n & 1) m |= 0x80000000; return(m ^ n); } else { return ick_xor((unsigned)ick_Large_digits,n); } } static unsigned int ick_fin(unsigned int len, unsigned int n) { unsigned int i, fac = 1, result = 0, d1, d2, dsave; d1 = n % ick_Base; dsave = d1; for (i = 1 ; i <= len ; i++) { d2 = d1; d1 = (i < len) ? (n /= ick_Base, n % ick_Base) : dsave; result += fac * ((d1 + d2) % ick_Base); fac *= ick_Base; } return result; } unsigned int ick_fin16(unsigned int n) { if (ick_Base == 2) { unsigned int m = (n >> 1); if (n & 1) m |= 0x8000; return(m ^ n); } else { return ick_fin((unsigned)ick_Small_digits,n); } } unsigned int ick_fin32(unsigned int n) { if (ick_Base == 2) { unsigned int m = (n >> 1); if (n & 1) m |= 0x80000000; return(m ^ n); } else { return ick_fin((unsigned)ick_Large_digits,n); } } /* AIS: Reversed operations, for operand overloading */ static unsigned int ick_rotleft16(unsigned int n) { return !!(n&0x8000)|((n&0x7FFF)<<1); } static unsigned int ick_rotleft32(unsigned int n) { return !!(n&0x80000000)|((n&0x7FFFFFFF)<<1); } /* For the time being, just work out the answer in binary, and test using the base-whatever operation. This means that there'll nearly always be a failure in reversing in bases other than 2. */ unsigned int ick_rev_or16(unsigned int n) { if(ick_or16(ick_rotleft16(ick_and16(n)))==n) return ick_rotleft16(ick_and16(n)); ick_lose(IE277, ick_lineno, (const char*) NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } unsigned int ick_rev_or32(unsigned int n) { if(ick_or32(ick_rotleft32(ick_and32(n)))==n) return ick_rotleft32(ick_and32(n)); ick_lose(IE277, ick_lineno, (const char*) NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } unsigned int ick_rev_and16(unsigned int n) { if(ick_and16(ick_rotleft16(ick_or16(n)))==n) return ick_rotleft16(ick_or16(n)); ick_lose(IE277, ick_lineno, (const char*) NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } unsigned int ick_rev_and32(unsigned int n) { if(ick_and32(ick_rotleft32(ick_or32(n)))==n) return ick_rotleft32(ick_or32(n)); ick_lose(IE277, ick_lineno, (const char*) NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } unsigned int ick_rev_xor16(unsigned int n) { unsigned int a=0, l=1, t=0; while(l<=0x4000) { if(n&l) t^=1; if(t) a+=l*2; l*=2; } if(ick_xor16(a)==n) return a; ick_lose(IE277, ick_lineno, (const char*) NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } unsigned int ick_rev_xor32(unsigned int n) { unsigned int a=0, l=1, t=0; while(l<=0x4000000) { if(n&l) t^=1; if(t) a+=l*2; l*=2; } if(ick_xor32(a)==n) return a; ick_lose(IE277, ick_lineno, (const char*) NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } unsigned int ick_rev_fin16(unsigned int n) { unsigned int a=0, l=1, t=0; while(l<=0x4000) { if(n&l) t^=1; if(t) a+=l*2; l*=2; } if(ick_fin16(a)==n) return a; ick_lose(IE277, ick_lineno, (const char*) NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } unsigned int ick_rev_fin32(unsigned int n) { unsigned int a=0, l=1, t=0; while(l<=0x4000000) { if(n&l) t^=1; if(t) a+=l*2; l*=2; } if(ick_fin32(a)==n) return a; ick_lose(IE277, ick_lineno, (const char*) NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } unsigned int ick_rev_whirl16(unsigned int p, unsigned int n) { /* Only reverse if all digits are the same. */ if(ick_whirl16(p,n)==n) return n; ick_lose(IE277, ick_lineno, (const char*) NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } unsigned int ick_rev_whirl32(unsigned int p, unsigned int n) { /* Only reverse if all digits are the same. */ if(ick_whirl32(p,n)==n) return n; ick_lose(IE277, ick_lineno, (const char*) NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } /* AIS: Some helper functions for the optimizer, only working in base 2 */ unsigned int ick_xselx(unsigned int x) { register unsigned int r=0; if(ick_Base != 2) ick_lose(IE778, ick_lineno, (const char*) NULL); while(x) {if(x&1) r=(r<<1)|1; x>>=1;} return r; } unsigned int ick_setbitcount(unsigned int x) { register unsigned int r=0; while(x) {if(x&1) r++; x>>=1;} return r; } unsigned int ick_smudgeright(unsigned int x) { x=x|(x>>1); x=x|(x>>2); x=x|(x>>4); x=x|(x>>8); x=x|(x>>16); return x; } unsigned int ick_smudgeleft(unsigned int x) { x=x|(x<<1); x=x|(x<<2); x=x|(x<<4); x=x|(x<<8); x=x|(x<<16); return x; } /* fiddle.c */ intercal-0.30/src/PaxHeaders.27456/feh.h0000644000000000000000000000007411437551705014520 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.602945656 intercal-0.30/src/feh.h0000644000175000017500000000335411437551705014420 0ustar00esresr00000000000000/* feh.h -- compilation functions used by perpetrate.c and ick.y */ /*@partial@*/ extern node *newnode(void); /*@partial@*/ extern node *cons(int type, /*@null@*/ /*@keep@*/ node *car, /*@null@*/ /*@keep@*/ node *cdr); extern unsigned long intern(int type, unsigned long index); extern void checklabel(int label); extern void treset(void); /*@out@*/ /*@dependent@*/ extern tuple *newtuple(void); extern void tupleswap(int,int); /* AIS */ extern void ppinit(int); /* AIS */ extern void typecast(node *np); extern void codecheck(void); extern void optimize(node *np); /*@observer@*/ /*@null@*/ extern const char *nameof(int value, const assoc table[]); extern void emit(tuple *tn, FILE *fp); extern void emittextlines(FILE *fp); extern void emitslatproto(FILE *fp); /* AIS: emit prototypes for /-functions */ extern void emitslat(FILE* fp); /* AIS: emit bodies of /-functions */ extern int comefromsearch(tuple *tn, unsigned int index); /* AIS */ extern void explexpr(node* np, FILE* fp); /* AIS */ extern void prexpr(node *np, FILE* fp, int freenode); /* AIS: destaticed */ extern void checknodeactbits(node *np); /* AIS */ extern void optimizef(void); /* AIS */ extern void nodefree(/*@keep@*/ /*@null@*/ node* np); /* AIS */ extern unsigned long varextern(unsigned long intern, int vartype); /* AIS */ extern node *nodecopy(const node*); /* AIS */ extern bool nodessame(/*@observer@*/ const node*, /*@observer@*/ const node*); /* AIS */ extern node *optdebugnode; /* AIS */ extern const char **enablers; /* AIS: so that there can be an element before the ick_first element of the ick_array (UNKNOWN is element -1, just to cause a bit more confusion) */ extern const assoc vartypes[]; extern bool useprintflow; /* AIS */ /* feh.h ends here */ intercal-0.30/src/PaxHeaders.27456/fiddle.h0000644000000000000000000000007411437550756015212 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.502945933 intercal-0.30/src/fiddle.h0000644000175000017500000000273111437550756015110 0ustar00esresr00000000000000/* fiddle.h -- functions implementing intercal's operators */ /*@-exportlocal@*/ /* these are used, just in generated code */ extern unsigned int ick_mingle(register unsigned int r, register unsigned int s); extern unsigned int ick_iselect(register unsigned int r, register unsigned int s); extern unsigned int ick_and16(unsigned int n), ick_or16(unsigned int n), ick_xor16(unsigned int n), ick_fin16(unsigned int n); extern unsigned int ick_whirl16(unsigned int p, unsigned int n); extern unsigned int ick_and32(unsigned int n), ick_or32(unsigned int n), ick_xor32(unsigned int n), ick_fin32(unsigned int n); extern unsigned int ick_whirl32(unsigned int p, unsigned int n); /* AIS: Reversed operators */ extern unsigned int ick_rev_and16(unsigned int n), ick_rev_or16(unsigned int n), ick_rev_xor16(unsigned int n), ick_rev_fin16(unsigned int n); extern unsigned int ick_rev_whirl16(unsigned int p, unsigned int n); extern unsigned int ick_rev_and32(unsigned int n), ick_rev_or32(unsigned int n), ick_rev_xor32(unsigned int n), ick_rev_fin32(unsigned int n); extern unsigned int ick_rev_whirl32(unsigned int p, unsigned int n); /* AIS: Optimizer helper operators */ extern unsigned int ick_xselx(unsigned int x); extern unsigned int ick_setbitcount(unsigned int x); extern unsigned int ick_smudgeleft(unsigned int x); extern unsigned int ick_smudgeright(unsigned int x); /*@=exportlocal@*/ /* fiddle.h ends here */ intercal-0.30/src/PaxHeaders.27456/bin2c.c0000644000000000000000000000007411437550756014753 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.542945822 intercal-0.30/src/bin2c.c0000644000175000017500000000301311437550756014643 0ustar00esresr00000000000000/***************************************************************************** NAME bin2c.c -- convert a binary data file to a C source file LICENSE TERMS Copyright (C) 2007 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ***************************************************************************/ #include int main(int argc, char** argv) { int c,colno; if(argc!=2) { fprintf(stderr,"Usage: bin2c varname < infile > outfile\n"); return 0; } (void) puts("/* This file is automatically generated; to modify it,"); (void) puts(" modify the source file, not this file. */"); (void) puts("#include \"config.h\""); printf("const char* %s=\"\\\n",argv[1]); colno=0; while((c=getchar())!=EOF) { printf("\\x%02x",(unsigned)c); colno+=4; if(colno>70) {(void) puts("\\"); colno=0;} } (void) puts("\";"); return 0; } intercal-0.30/src/PaxHeaders.27456/unravel.c0000644000000000000000000000007411437550756015432 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.538945827 intercal-0.30/src/unravel.c0000644000175000017500000010115711437550756015332 0ustar00esresr00000000000000/***************************************************************************** NAME unravel.c -- multithreading and backtracking support for C-INTERCAL LICENSE TERMS Copyright (C) 2006 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ***************************************************************************/ /* Notes about authorship. This entire file was written by Alex Smith (AIS), but with reference to an earlier implementation of Threaded INTERCAL written by Malcom Ryan. I have not reused any of his C code (two of his INTERCAL programs are in the pit), but it was a useful source of inspiration, even though I did it a completely different and less efficient way (I think we handled mutiple COME FROM recognition in much the same way). This file only contains functions necessary for multithreading; some of the code is stored in feh2.c (stored in strings), or in perpet.c (again stored in strings). The information about the required syntax is in parser.y and lexer.l. A small amount of the multithread code is in ick-wrap.c, although as that file is copied almost verbatim (although it's quite a big 'almost') into all ick output, it's guarded there by #if...#endif. The whole multithread idea started on alt.lang.intercal when it was noticed that multiple COME FROMs aiming at the same line were hard to interpret, but I would like to thank Malcom Ryan for drafting the Threaded Intercal standard and a reference compiler, and for turning the idea into a concrete set of rules. (The standard itself carries a note saying that a revision (use of AGAIN) was inspired by Kyle Dean, so I'd like to mention that here too, and I also revised it (so that ABSTAIN/REINSTATE were preserved through backtracking).) In terms of the quality of the code, Malcom Ryan's code was clearly better for multithread programs, but required rewriting most of the compiler. As clearly it would be unfair to subject the INTERCAL community at large to the risk of silent multithreading by default, I decided multithreading should be off by default (but ONCE/AGAIN should be legal). So this code is designed to interfere as little as possible with non-multithreaded output. There are two versions of libick compiled by the Makefile in this distribution: libick.a, the non-multithread version, and libickmt.a, the multithread version. The only difference between them is this file, unravel.c, which is multithread only, so it seemed a good place for this comment. To see what the multithreading looks like in the object code, see degenerated code or feh2.c. */ /* This file also implements Backtracking INTERCAL, which is turned on with the same command-line option (-m). This implementation differs from Malcom Ryan's standard in that abstention stati are not restored upon GOING BACK. As far as I know, this is the only Backtracking INTERCAL implementation currently available, although the code depends on the multithreading code (which is why -m is neccesary). */ /* Note about control structures: Crazy INTERCAL control structures call for crazy C control structures. setjmp/longjmp is probably C's weirdest control structure (it's sort of like a time-reversed computed COME FROM). I've used them to implement both multithreading and computed COME FROMming. Worried that this code might actually be copied by a casual C programmer, I have the following warning: setjmp/longjmp is worse than goto in terms of spaghettification of code. It is strictly to be used only when neccesary, or when writing INTERCAL compilers. They also lead to weird portability problems when you don't obey all the restrictions put on them by the C standard. For instance, if(setjmp(ick_cjb)!=0) puts("Jumped"); is portable, but if(setjmp(ick_cjb)) puts("Jumped"); is not, despite seeming to mean exactly the same thing. Also, the address of setjmp can't be taken. Semantically, setjmp/longjmp lets you do the same crazy things like goto, like jump into the middle of a loop, except in this case the loop can be in a different function, or even in a different file. unravel.c has no qualms about jumping straight into the middle of an if statement in a degenerated C program, even if said degenerated C program didn't exist when libickmt.a was compiled. */ /* LINTLIBRARY */ #include "config.h" #include #include #include #include #include #define MULTITHREAD 1 #include "sizes.h" #include "abcess.h" #include "ick_lose.h" int gonebackto; /* Is the choicepoint reached by GOING BACK? */ static int choicing = 0; /* Is a multithread function being used to do backtracking processing? */ jmp_buf btjb; /* The backtracking jmp_buf */ /* About the annotation 'dependent': topchoice is really 'owned', but the owner keeps on changing. So Splint gets less confused if we simply never tell it who the owner is. */ /*@null@*/ /*@dependent@*/ static ickthread* topchoice; /* Top of the choicepoint stack */ extern int ick_lineno; /* Keep track of error-message lines */ extern int ick_printflow; /* from arrgghh.c; a debug option */ int weaving=0; /* Weave newly created threads? */ /* Printflow debugging output */ static void fluputs(const char* s) { fprintf(stderr,"%s",s); (void) fflush(stderr); } /********************************************************************** * * This functions deal with choicepoints, which are implemented as * ickthread objects. choicepoint creates a choicepoint or marks a * choicepoint as stale; choiceahead eliminates a choicepoint; * choiceback eliminates a stale choicepoint or returns to a fresh * choicepoint. * *********************************************************************/ void choicepoint(void) { ickthread* oldprev, *oldtc; int oldweave; if(gonebackto) { /* Create a stale choicepoint */ if(ick_printflow) fluputs("(back)"); oldtc = topchoice; /* Suppress the onlytrans warning because we're allocating a member of a linked list, which confuses Splint no matter what the list is flagged as (because malloc returns 'only' data, but yet that data has to be pointed to by other 'only' data in the same list). */ /*@-onlytrans@*/ topchoice = (ickthread*) malloc(sizeof(ickthread)); /*@=onlytrans@*/ if(!topchoice) ick_lose(IE991, ick_lineno, (const char*) NULL); topchoice->choicepoint = oldtc; topchoice->stale = 1; topchoice->refcount = 1; /* At the moment, this is the only thread looking at this choicepoint */ topchoice->dsi=topchoice; topchoice->usesthis=0; /* topchoice needn't be completely defined if it's stale */ /*@-compdef@*/ return; /*@=compdef@*/ } else { /* Create a new choicepoint */ if(ick_printflow) fluputs("(maybe)"); oldprev = ickmt_prev; choicing = 1; oldweave = weaving; weaving = 0; (void) multicome1(ick_lineno,btjb); /* Duplicate data */ weaving = oldweave; choicing = 0; oldprev->ick_next = ickmt_cur; ickmt_prev->choicepoint = topchoice; topchoice = ickmt_prev; ickmt_prev = oldprev; topchoice->stale = 0; topchoice->refcount = 1; /* So in other words, we've duplicated the current execution environment, except for the choicepoint stack, changed the duplicate from a thread into a choicepoint, and pushed it on top of the choicepoint stack. Its pc is the point in the degenerated program where choicepoint was called. */ } } void choiceahead(void) { ickthread* tempthread; jmp_buf fakepc; if(!topchoice) ick_lose(IE404, ick_lineno, (const char*) NULL); /* That's what IE404's for */ /* GO AHEAD with multithreading requires care. The choicepoint should only be removed from this thread. topchoice = topchoice->ick_next almost works, but is a memory leak. So most of this is garbage-collection. */ /* If other threads are using the choicepoint, don't free it. */ if(topchoice->refcount > 1) { if(ick_printflow) fluputs("(refahead)"); topchoice->refcount--; topchoice = topchoice->choicepoint; return; } /* The top choicepoint is not being used by other threads; free it. */ /* Freeing a stale choicepoint (which contains no data) is easy. */ if(topchoice->stale) { if(ick_printflow) fluputs("(destale)"); tempthread = topchoice; topchoice = topchoice->choicepoint; /*@-dependenttrans@*/ /* because it's really owned, not dependent */ free(tempthread); /*@=dependenttrans@*/ return; } if(ick_printflow) fluputs("(ahead)"); /* This code works by converting topchoice back to a thread and placing it just before the current thread, and then killing it. First, the data from this thread, apart from the choicepoint stack, must be saved. */ choicing = 1; if(setjmp(fakepc) == 0) { memcpy((void*)ickmt_cur->pc,(const void*)fakepc,sizeof(jmp_buf)); nextthread(fakepc, -1, 5); } choicing = 0; /* That's saved the current thread's data. Now to convert topchoice to a thread. */ tempthread = topchoice->choicepoint; ickmt_prev->ick_next = topchoice; topchoice->ick_next = ickmt_cur; ickmt_cur = topchoice; topchoice = tempthread; /* Let's load the backtracking data... */ choicing = 1; if(setjmp(fakepc) == 0) { memcpy((void *)ickmt_cur->pc,(const void *)fakepc,sizeof(jmp_buf)); nextthread(fakepc, -1, 6); } /* only to destroy it! Mwahahahahah! */ if(setjmp(fakepc) == 0) { memcpy((void *)ickmt_cur->ick_next->pc,(const void *)fakepc,sizeof(jmp_buf)); killthread(); } choicing = 0; /* So we've reloaded the original current thread, the original previous thread is still correct, topchoice has become topchoice->choicepoint, and the original topchoice has disappeared. Mission accomplished. */ } void choiceback(void) { if(!topchoice) ick_lose(IE404, ick_lineno, (const char *) NULL); if(topchoice->stale) { if(ick_printflow) fluputs("(back=)"); choiceahead(); return; } /* That's two simple cases out of the way (at least once choiceahead's been implemented). What we need to do to backtrack is to change topchoice to a thread after the current thread (rather than before as in the previous two functions), and then kill the current thread. (It amuses me that destroying a choicepoint, as in choiceahead(), is more complicated than either visiting a choicepoint or creating a choicepoint. That's how much work it can take to avoid a memory leak.) In this case, choiceback won't return in the normal fashion. */ if(topchoice->refcount > 1) { /* The Threaded INTERCAL standard states that if other threads are using the choicepoint, a GO BACK should cause the thread it's in to be killed. (Of course, if it's stale, it should just have been removed.)*/ if(ick_printflow) fluputs("(desplit)"); killthread(); return; } topchoice->ick_next = ickmt_cur->ick_next; ickmt_cur->ick_next = topchoice; topchoice = topchoice->choicepoint; if(ickmt_cur==ickmt_prev) ickmt_prev = ickmt_cur->ick_next; choicing = 2; /* Tells killthread to set it back to 0 */ killthread(); } /********************************************************************** * * This function is called when two COME FROMs reference the same * line at runtime. multicome1 is used in a multithread * program; it forks the program. For ick_multicome0, see cesspool.c. * *********************************************************************/ int multicome1(int errlineno, jmp_buf pc) { /* Make a new thread just before the current one. Fake a PC in the current thread within this function, change to the new thread, then call nextthread. The upshot of all this is that all this thread's data is stored in the new thread's state. Then, we have to copy all this thread's current data to new locations. */ ickthread* newthread; jmp_buf fakepc; ick_stashbox *isb, *isb2, *isbprev; void* tvp; ick_array* a; int prod, i, j; newthread = malloc(sizeof(ickthread)); if(!newthread) ick_lose(IE991, errlineno, (const char *) NULL); ickmt_prev->ick_next = newthread; newthread->ick_next = ickmt_cur; ickmt_cur = newthread; newthread->dsi=newthread; newthread->usesthis=0; if(ick_printflow && !choicing) fluputs("(fork)"); if(setjmp(fakepc) == 0) { memcpy((void *)newthread->ick_next->pc,(const void *)fakepc,sizeof(jmp_buf)); nextthread(pc, -1, 1); } /* So on the previous line: Save the value of pc as the program counter of the new thread, and give a fake value for the program value of the current thread (so it returns here, not anywhere in the degenerated program). All that remains is to duplicate all the data stored through pointers in the 'old' thread (nextthread has changed ickmt_cur to point at the 'old' thread). The original memory pointed to by these pointers is in use storing the values in the 'new' thread, so the 'old' thread needs new copies that it can modify independently. */ if(!weaving) { /* duplicate variables, forget indicators */ i = onespotcount; tvp = ick_onespots; ick_onespots = malloc(i * sizeof *ick_onespots); if(!ick_onespots) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(ick_onespots, tvp, i * sizeof *ick_onespots); if(ick_oo_onespots) { tvp = ick_oo_onespots; ick_oo_onespots = malloc(i * sizeof *ick_oo_onespots); if(!ick_oo_onespots) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(ick_oo_onespots, tvp, i * sizeof *ick_oo_onespots); } i = twospotcount; tvp = ick_twospots; ick_twospots = malloc(i * sizeof *ick_twospots); if(!ick_twospots) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(ick_twospots, tvp, i * sizeof *ick_twospots); if(ick_oo_twospots) { tvp = ick_oo_twospots; ick_oo_twospots = malloc(i * sizeof *ick_oo_twospots); if(!ick_oo_twospots) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(ick_oo_twospots, tvp, i * sizeof *ick_oo_twospots); } i = tailcount; tvp = ick_tails; ick_tails = malloc(i * sizeof *ick_tails); if(!ick_tails) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(ick_tails, tvp, i * sizeof *ick_tails); i = hybridcount; tvp = ick_hybrids; ick_hybrids = malloc(i * sizeof *ick_hybrids); if(!ick_hybrids) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(ick_hybrids, tvp, i * sizeof *ick_hybrids); i = onespotcount; tvp = ick_oneforget; ick_oneforget = malloc(i * sizeof *ick_oneforget); if(!ick_oneforget) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(ick_oneforget, tvp, i * sizeof *ick_oneforget); i = twospotcount; tvp = ick_twoforget; ick_twoforget = malloc(i * sizeof *ick_twoforget); if(!ick_twoforget) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(ick_twoforget, tvp, i * sizeof *ick_twoforget); i = tailcount; tvp = ick_tailforget; ick_tailforget = malloc(i * sizeof *ick_tailforget); if(!ick_tailforget) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(ick_tailforget, tvp, i * sizeof *ick_tailforget); i = hybridcount; tvp = ick_hyforget; ick_hyforget = malloc(i * sizeof *ick_hyforget); if(!ick_hyforget) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(ick_hyforget, tvp, i * sizeof *ick_hyforget); /* duplicate data stored in arrays */ j = tailcount; tvp = NULL; while(j--) { a = ick_tails+j; /* &(ick_tails[j]) */ if(!a->rank||!a->dims) continue; /* don't duplicate a deallocated ick_array */ tvp = a->dims; /* Much of this code is paraphrased from the ick_stashbox-copying code below, which was in turn paraphrased from a section in cesspool.c I didn't write. So any errors in this code are probably mine, but the algorithm isn't. */ a->dims = malloc(a->rank * sizeof *(a->dims)); if(a->dims == NULL) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(a->dims, tvp, a->rank * sizeof *(a->dims)); prod = (int)!!a->rank; i = (int)a->rank; while(i--) prod *= a->dims[i]; /*@-mustfreeonly@*/ /* how on earth did a->dims become only? */ tvp = a->data.tail; /*@=mustfreeonly@*/ a->data.tail = malloc(prod * sizeof(ick_type16)); if(!a->data.tail) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(a->data.tail, tvp, prod * sizeof(ick_type16)); /*@-mustfreeonly@*/ /* likewise. This isn't only, honest! */ tvp = NULL; /*@=mustfreeonly@*/ } j = hybridcount; while(j--) { a = ick_hybrids+j; /* &(ick_hybrids[j]) */ if(!a->rank||!a->dims) continue; /* don't duplicate a deallocated ick_array */ tvp = a->dims; /* Much of this code is paraphrased from the ick_stashbox-copying code below, which was in turn paraphrased from a section in cesspool.c I didn't write. So any errors in this code are probably mine, but the algorithm isn't. */ a->dims = malloc(a->rank * sizeof(*(a->dims))); if(!a->dims) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(a->dims, tvp, a->rank * sizeof(*(a->dims))); prod = (int)!!a->rank; i = (int)a->rank; while(i--) prod *= a->dims[i]; /*@-mustfreeonly@*/ tvp = a->data.hybrid; /*@=mustfreeonly@*/ a->data.hybrid = malloc(prod * sizeof(ick_type32)); if(!a->data.hybrid) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(a->data.hybrid, tvp, prod * sizeof(ick_type32)); /*@-mustfreeonly@*/ tvp=NULL; /*@=mustfreeonly@*/ } /* duplicate ick_stashbox */ isb2 = ick_first; isbprev = (ick_stashbox*)NULL; while(isb2) { isb = (ick_stashbox*)malloc(sizeof(ick_stashbox)); if(!isb) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(isb,isb2,sizeof(ick_stashbox)); if(isbprev) isbprev->ick_next = isb; isbprev = isb; if(isb2==ick_first) ick_first = isb; /* change ick_first only the ick_first time round */ if(isb->type == ick_ONESPOT || isb->type == ick_TWOSPOT) { /* all copying already done */ isb2 = isb->ick_next; continue; } /* Copy the stashed ick_array. Much of this code is paraphrased from some code in cesspool.c. In fact, it's the same, with a few idioms added and variable names changed. So, although it's in this file, I can't take the credit for it. */ isb->save.a = (ick_array*)malloc(sizeof(ick_array)); if(!isb->save.a) ick_lose(IE991, errlineno, (const char *) NULL); assert(isb2 != NULL); /* we already said that in the while condition, so it's surprising that Splint needs this hint */ isb->save.a->rank = isb2->save.a->rank; isb->save.a->dims = malloc(isb2->save.a->rank * sizeof(*(isb2->save.a->dims))); if(!isb->save.a->dims) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(isb->save.a->dims, isb2->save.a->dims, isb2->save.a->rank * sizeof(*(isb2->save.a->dims))); prod = (int)!!isb2->save.a->rank; /* I use this idiom often enough in the code produced by my optimizer that I may as well use it here. */ i = (int)isb2->save.a->rank; while(i--) prod *= isb2->save.a->dims[i]; if(isb2->type == ick_TAIL) { isb->save.a->data.tail = (ick_type16*)malloc(prod * sizeof(ick_type16)); if(!isb->save.a->data.tail) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(isb->save.a->data.tail, isb2->save.a->data.tail, prod * sizeof(ick_type16)); } else { isb->save.a->data.hybrid = (ick_type32*)malloc(prod * sizeof(ick_type32)); if(!isb->save.a->data.hybrid) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(isb->save.a->data.hybrid, isb2->save.a->data.hybrid, prod * sizeof(ick_type32)); } isb2 = isb->ick_next; } } else /* we are weaving, reference the old current thread */ { ickthread* tempthread; if(ick_printflow) fluputs("(weave)"); /* Sanity check to make sure that the threads are arranged correctly */ if(newthread->ick_next!=ickmt_cur) ick_lose(IE778, errlineno, (const char *) NULL); tempthread=newthread->ick_next; /* the old current thread */ while(tempthread->usesthis) tempthread=tempthread->usesthis; newthread->dsi=tempthread->dsi; tempthread->usesthis=newthread; } /* duplicate NEXT stack */ tvp = ick_next; ick_next = malloc(ick_MAXNEXT * sizeof *ick_next); if(!ick_next) ick_lose(IE991, errlineno, (const char *) NULL); memcpy(ick_next, tvp, ick_MAXNEXT * sizeof *ick_next); /* allow for multithreading with choicepoints on the stack */ if(!choicing && topchoice != NULL) { ickthread* icktp = topchoice; while(icktp) { icktp->refcount++; icktp = icktp->choicepoint; /* ick_next choicepoint on the stack */ } /* The old thread's and new thread's choicepoint stack share memory. This is pretty much necessary to handle backtracking past a fork correctly. */ } /* The nullstate annotation is because Splint doesn't notice that all the mallocs are guarded by lines that error out permanently if they fail. The mustfreefresh annotation is because Splint doesn't realise that I've stored newthread in a pointer buried in the linked list of threads, and so Splint assumes that it's memory-leaking. */ /*@-nullstate@*/ /*@-mustfreefresh@*/ return 1; /* Tell the degenerated program to look for yet another COME FROM */ /*@=nullstate@*/ /*@=mustfreefresh@*/ } /********************************************************************** * * These functions do the multithreading, using setjmp and longjmp * to save the program counter. ickmtinit sets up the ick_first * thread, and nextthread changes to the ick_next thread in the * sequence. (Note that nextthread rarely actually returns). The * code makes each command atomic, so that ONCE and AGAIN appear * to the user to be atomic operations. * *********************************************************************/ /*@partial@*/ /*@dependent@*/ ickthread* ickmt_cur; /* define ickmt_cur */ /*@partial@*/ /*@dependent@*/ ickthread* ickmt_prev; /* define ickmt_prev */ void ickmtinit(void) { /* Splint linked list problems again; the list is marked as 'dependent', which is correct for everything except adding and removing items in the list. (All annotations are incorrect in some respects.) */ /*@-onlytrans@*/ ickmt_cur = malloc(sizeof(ickthread)); /*@=onlytrans@*/ if(!ickmt_cur) ick_lose(IE991, 1, (const char *) NULL); ickmt_prev = ickmt_cur; ickmt_cur->ick_next = ickmt_cur; topchoice = (ickthread*) NULL; /* No choicepoints */ ickmt_cur->dsi=ickmt_cur; ickmt_cur->usesthis=0; } /* Destroys the current thread, and switches to the ick_next thread. If there are no threads left, terminates the program using exit(0). */ void killthread(void) { static jmp_buf dummy; ick_stashbox* isb, *isbi; int i; if(ick_printflow&&!choicing) fluputs("(kill)"); if(!choicing) while(topchoice) choiceahead(); /* The above line will mark each of the choicepoints as no longer being used by this thread, and free them if neccesary. This has to be done ick_first while this thread's pointers are still valid due to the way that choiceahead works. */ /* If this thread uses another, let the other know about the change */ if(ickmt_cur->dsi!=ickmt_cur) { ickthread* temp=ickmt_cur->dsi; if(ick_printflow) fluputs("(deweave)"); while(!temp||temp->usesthis!=ickmt_cur) { if(!temp) ick_lose(IE778, -1, (const char *) NULL); temp=temp->usesthis; } temp->usesthis=ickmt_cur->usesthis; } /* If this thread is holding data for others, move it somewhere safe */ if(ickmt_cur->usesthis != NULL && ickmt_cur->usesthis->dsi==ickmt_cur) { ickthread* newuses=ickmt_cur->usesthis; ickthread* temp=ickmt_cur->usesthis; if(ick_printflow) fluputs("(shift)"); while(temp) { temp->dsi=newuses; temp=temp->usesthis; } ickmt_cur->dsi=newuses; /* so the data will be transferred later */ } if(ickmt_cur->dsi==ickmt_cur) { /* We aren't storing data for another thread, and we have data of our own, or dsi would point somewhere else (either naturally or because it was changed higher up). */ if(ick_printflow) fluputs("(free)"); /* Deallocate the current thread's data */ i=tailcount; while(i--) { /* free tail data */ if(!ick_tails[i].rank||!ick_tails[i].dims) continue; /* already free */ free(ick_tails[i].dims); free(ick_tails[i].data.tail); } i=hybridcount; while(i--) { /* free hybrid data */ if(!ick_hybrids[i].rank||!ick_hybrids[i].dims) continue; /* already free */ free(ick_hybrids[i].dims); free(ick_hybrids[i].data.hybrid); } /* unqualifiedtrans because although they aren't always only, they're only at the moment; compdestroy because we have just deallocated tail and hybrid data */ /*@-unqualifiedtrans@*/ /*@-compdestroy@*/ free(ick_onespots); free(ick_twospots); free(ick_tails); free(ick_hybrids); free(ick_oneforget); free(ick_twoforget); free(ick_tailforget); free(ick_hyforget); if(ick_oo_onespots) free(ick_oo_onespots); if(ick_oo_twospots) free(ick_oo_twospots); /*@=unqualifiedtrans@*/ /*@=compdestroy@*/ isbi = ick_first; while(isbi) /* Free ick_stash */ { isb=isbi->ick_next; if(isbi->type == ick_TAIL || isbi->type == ick_HYBRID) { free(isbi->save.a->dims); if(isbi->type == ick_TAIL) free(isbi->save.a->data.tail); else free(isbi->save.a->data.hybrid); } free(isbi); isbi=isb; } } else { /* We still need to save our variables for the benefit of woven threads. */ /* save variables */ ickmt_cur->dsi->varforget[0] = ick_onespots; ickmt_cur->dsi->varforget[1] = ick_twospots; ickmt_cur->dsi->varforget[2] = ick_tails; ickmt_cur->dsi->varforget[3] = ick_hybrids; ickmt_cur->dsi->varforget[4] = ick_oneforget; ickmt_cur->dsi->varforget[5] = ick_twoforget; ickmt_cur->dsi->varforget[6] = ick_tailforget; ickmt_cur->dsi->varforget[7] = ick_hyforget; ickmt_cur->dsi->varforget[8] = ick_oo_onespots; ickmt_cur->dsi->varforget[9] = ick_oo_twospots; /* save ick_stashbox */ /*@-unqualifiedtrans@*/ /* the linked list problem again */ ickmt_cur->dsi->sb = ick_first; /*@=unqualifiedtrans@*/ /*@-branchstate@*/ /* it's reference-counted */ } /*@=branchstate@*/ /*@-unqualifiedtrans@*/ /* it is only at this point */ free(ick_next); /* Free NEXT stack */ /*@=unqualifiedtrans@*/ ickmt_prev->ick_next = ickmt_cur->ick_next; if(ickmt_cur->ick_next == ickmt_cur) { /*@-dependenttrans@*/ /* because it isn't really dependent */ free(ickmt_cur); /*@=dependenttrans@*/ exit(0); } else { /* We need to run about half of nextthread. So we pass in a 2 for flags and tell it to skip the ick_first half. */ /*@-dependenttrans@*/ /* because it isn't really dependent */ free(ickmt_cur); /*@=dependenttrans@*/ ickmt_cur = ickmt_prev; nextthread(dummy, -1, 2); /* dummy is not used by nextthread */ ick_lose(IE778, -1, (const char *) NULL); /* nextthread does not return */ } } /* This function does not return in the normal fashion, but by a nonlocal goto to a mysterious location, possibly in multicome1 but possibly in the degenerated code. From the point of view of libickmt.a, we're going to a piece of code that doesn't even exist yet! The general ugliness of INTERCAL multithreading pulls out all the stops when it comes to using unusual and confusing C control structures. It is important to remember that longjmp clobbers all auto variables that have changed since the corresponding setjmp. */ /* In this Threaded INTERCAL implementation, data is saved in a linked ring of threads. A thread runs for a command, then all the data pointers are changed, saving the old ones. This is an improvement on an earlier attempt of mine in which the values themselves were copied, but is still less efficient than Malcom Ryan's method (which didn't involve copying things about except when forking). However, I justify this by saying that it leaves as much existing code as possible untouched, which is helpful for single- thread compatibility, modifying the code in feh.c without an understanding of multithread issues, and because I'm lazy. It also makes the rest of the program shorter. */ void nextthread(jmp_buf pc, int errlineno, int flags) { /* flags | 1 means save this thread. flags | 2 means load the ick_next thread. flags | 4 means don't change thread. */ if(errlineno > -1 && ickmt_cur->ick_next == ickmt_cur && !choicing) longjmp(pc,1); /* If we only have 1 thread, just continue with it. Otherwise: */ if(!(flags&1)) goto advancethread; /* OK, so I've spaghettified this procedure slightly by using goto instead of if. But I was so deep into figuring out setjmp/longjmp, a goto seemed crystal-clear by comparison. */ /* save variables */ ickmt_cur->dsi->varforget[0] = ick_onespots; ickmt_cur->dsi->varforget[1] = ick_twospots; ickmt_cur->dsi->varforget[2] = ick_tails; ickmt_cur->dsi->varforget[3] = ick_hybrids; ickmt_cur->dsi->varforget[4] = ick_oneforget; ickmt_cur->dsi->varforget[5] = ick_twoforget; ickmt_cur->dsi->varforget[6] = ick_tailforget; ickmt_cur->dsi->varforget[7] = ick_hyforget; ickmt_cur->dsi->varforget[8] = ick_oo_onespots; ickmt_cur->dsi->varforget[9] = ick_oo_twospots; /* save NEXT stack */ /*@-unqualifiedtrans@*/ /* because nextstack isn't only really */ ickmt_cur->nextstack = ick_next; /*@=unqualifiedtrans@*/ ickmt_cur->nextpointer = ick_nextindex; /* save ick_stashbox */ /*@-unqualifiedtrans@*/ /* ditto */ ickmt_cur->dsi->sb = ick_first; /*@=unqualifiedtrans@*/ /* save choicepoints */ if(!choicing) ickmt_cur->choicepoint = topchoice; /* save comefrom information */ memcpy((void*)(ickmt_cur->ick_cjb), (const void*)ick_cjb, sizeof(jmp_buf)); ickmt_cur->ick_ccfc = ick_ccfc; ickmt_cur->ick_skipto = ick_skipto; /* save program counter */ memcpy((void*)(ickmt_cur->pc), (const void*)pc, sizeof(jmp_buf)); /* And another thing about setjmp/longjmp. A jmp_buf acts like a structure that passes itself around by reference. However, it cannot be assigned, although just about everything else in C can be, although it can be copied with memcpy (what I'm doing in the line above - remember it passes itself around by reference). Generally speaking, it's some sort of ick_array, even though some implementors use a 1-element ick_array. The exact representation of jmp_buf is one of the most implementation-dependent things in C (I've seen both a 1-element ick_array of structure and an int[12].) */ advancethread: /* change thread */ if(!(flags&4)) { ickmt_prev = ickmt_cur; ickmt_cur = ickmt_cur->ick_next; } if(!(flags&2)) goto returnjmp; /* load variables */ ick_onespots = ickmt_cur->dsi->varforget[0]; ick_twospots = ickmt_cur->dsi->varforget[1]; ick_tails = ickmt_cur->dsi->varforget[2]; ick_hybrids = ickmt_cur->dsi->varforget[3]; ick_oneforget = ickmt_cur->dsi->varforget[4]; ick_twoforget = ickmt_cur->dsi->varforget[5]; ick_tailforget = ickmt_cur->dsi->varforget[6]; ick_hyforget = ickmt_cur->dsi->varforget[7]; ick_oo_onespots = ickmt_cur->dsi->varforget[8]; ick_oo_twospots = ickmt_cur->dsi->varforget[9]; /* load NEXT stack */ /*@-onlytrans@*/ /* the nextstack shouldn't be only */ ick_next = ickmt_cur->nextstack; /*@=onlytrans@*/ ick_nextindex = ickmt_cur->nextpointer; /* load choicepoints */ if(!choicing) topchoice = ickmt_cur->choicepoint; /* load ick_stashbox */ /*@-onlytrans@*/ /* ditto */ ick_first = ickmt_cur->dsi->sb; /*@=onlytrans@*/ /* load comefrom information */ memcpy((void*)ick_cjb, (const void*)(ickmt_cur->ick_cjb), sizeof(jmp_buf)); ick_ccfc = ickmt_cur->ick_ccfc; ick_skipto = ickmt_cur->ick_skipto; returnjmp: /* return to the new current thread's program counter */ if(choicing==2) choicing = 0; longjmp(ickmt_cur->pc, 1); } intercal-0.30/src/PaxHeaders.27456/yuk.c0000644000000000000000000000007411437550756014566 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.542945822 intercal-0.30/src/yuk.c0000644000175000017500000006272111437550756014471 0ustar00esresr00000000000000/**************************************************************************** NAME yuk.c -- C-INTERCAL debugger and profiler code, linked into programs. DESCRIPTION File linked into programs as a debugger or profiler. LICENSE TERMS Copyright (C) 2006 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ****************************************************************************/ #include "config.h" /* AIS: Generated by autoconf */ #include #include #ifdef HAVE_SYS_TIME_H # include # ifdef TIME_WITH_SYS_TIME # include # endif #else # include #endif #include #ifdef HAVE_UNISTD_H # include #endif #include #include #define YUKDEBUG 1 #include "yuk.h" #include "ick_lose.h" #include "sizes.h" #include "abcess.h" #include "uncommon.h" #if YPTIMERTYPE == 4 #include #endif extern signed char onewatch[]; extern signed char twowatch[]; extern ick_type16 oneold[]; extern ick_type32 twoold[]; char** globalargv; int globalargc; int yuklines = 0; int yukloop = 0; int yukcommands = 0; /* these 5 lines because externs must be defined somewhere */ /* Global variable storage types: static: limited to the file unadorned: defining an extern extern: defined elsewhere (unless initialised) */ static char buf[21]; static sig_atomic_t singlestep = 1; /* if 0, run until a breakpoint */ static sig_atomic_t writelines = 1; /* whether to display executed lines onscreen */ static int breakpoints[80]; /* initialised to all 0s. Breakpoint locations */ static int nbreakpoints = 1; /* how many breakpoints we have */ static int monitors[80]; /* monitors give a message when program flow passes them */ static int nmonitors = 0; static int untilnext = -1; /* NEXTING level to break the program at */ static int firstrun = 1; /* ick_first time an interactive command point is reached */ static int yukerrcmdg = -1; /* the aboff that indicates an error in the 'g' command */ static yptimer tickcount; /* yptimer of last run */ static int lastaboff = 0; /* last value of aboff */ static void handlesigint(int i) { /* this is a signal handler, so can't do much */ singlestep = 1; writelines = 1; /*@-noeffect@*/ (void) i; /*@=noeffect@*/ } #if YPTIMERTYPE==1 || YPTIMERTYPE==2 static yptimer yukgettimeofday() { static struct timeval tp; yptimer temp; /* gettimeofday is POSIX; config.sh has checked that it's available, so turn off the unrecog warning */ /*@-unrecog@*/ gettimeofday(&tp,0); /*@=unrecog@*/ temp=(yptimer)tp.tv_usec + (yptimer)tp.tv_sec * (yptimer)1000000LU; /* here we make use of unsigned wraparound. In the case YPTIMERTYPE == 1, it seems quite likely that we're going to wraparound, but because everything is cast to the unsigned integral type yptimer, we get a value that will wraparound in such a way that - will give us the correct time interval. */ return temp; } #elif YPTIMERTYPE == 4 yptimer yuktimes() { static struct tms tp; times(&tp); return tp.tms_utime + tp.tms_stime; } #elif YPTIMERTYPE == 5 static yptimer yukclock_gettime() { static struct timespec ts; yptimer temp; /* We've checked that this function is available; -lrt will be linked in. */ /*@-unrecog@*/ #if defined(_POSIX_CPUTIME) && _POSIX_CPUTIME > 0 clock_gettime(CLOCK_PROCESS_CPUTIME_ID,&ts); #else # if defined(_POSIX_THREAD_CPUTIME) && _POSIX_THREAD_CPUTIME > 0 clock_gettime(CLOCK_THREAD_CPUTIME_ID,&ts); # else # if defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK > 0 clock_gettime(CLOCK_MONOTONIC,&ts); # else # ifndef CLOCK_REALTIME # error clock_gettime is defined, but no clocks seem to be; try changing YPTIMERTYPE in src/yuk.h # endif clock_gettime(CLOCK_REALTIME,&ts); # endif # endif #endif /*@=unrecog@*/ temp=(yptimer)ts.tv_nsec + (yptimer)ts.tv_sec * (yptimer)1000000000LU; /* using wraparound as with gettimeofday */ return temp; } #endif /* YPTIMERTYPE */ void yukterm(void) { int i,lastline,thisline,inrow=0; yptimer avgtime,avgtime2; FILE *dummy; if(yukopts==2) (void) puts("Program ended without error."); if(!(yukopts&1)) return; /* Print profiling information */ (void) puts("Profiling information saved to \"yuk.out\"."); /* Bletch. GCC's unsuppressible warning forces us to this */ dummy = freopen("yuk.out","w",stdout); i=-1; lastline=-1; while(++i.\n"); (void) puts("For help on yuk, type ?.\n"); } i=nbreakpoints; broken=0; while(i--) broken|=breakpoints[i]==lineofaboff[aboff]; if(yukloop&&broken&&*breakpoints!=lineofaboff[aboff]) broken=0; if(broken) { if(*breakpoints!=lineofaboff[aboff]) printf("Breakpoint hit at line %d:\n",lineofaboff[aboff]); singlestep=1; } else { i=nmonitors; while(i--) broken|=monitors[i]==lineofaboff[aboff]; if(yukloop) broken=0; if(broken) printf("Command flowed past line %d:\n",lineofaboff[aboff]); } if(ick_nextindex <= untilnext) { broken = 1; singlestep = 1; } if(!broken&&yukerrcmdg==aboff) { singlestep = 1; (void) puts("There are no commands on that line."); /* To the user, nothing will have happened but the error message! */ } i=-1; while(++i,1) { if(yukvars[i].vartype==YUKEND) break; if(yukvars[i].vartype==ick_ONESPOT) { if(onewatch[yukvars[i].intername] != (char)0) { if(ick_onespots[yukvars[i].intername]!=oneold[yukvars[i].intername]&& onewatch[yukvars[i].intername]>(char)1) { oneold[yukvars[i].intername]=ick_onespots[yukvars[i].intername]; if(onewatch[yukvars[i].intername]==(char)2||!ick_onespots[yukvars[i].intername]) { /*@-formatconst@*/ /* it's safe, I checked it */ printf(onewatch[yukvars[i].intername]==(char)2? "Variable .%d changed.\n":"Variable .%d became 0.\n", yukvars[i].extername); /*@=formatconst@*/ broken=1; singlestep=1; } } if(writelines||broken) { printf(".%d is:\n",yukvars[i].extername); ick_pout(ick_onespots[yukvars[i].intername]); } } } if(yukvars[i].vartype==ick_TWOSPOT) { if(twowatch[yukvars[i].intername] != (char)0) { if(ick_twospots[yukvars[i].intername]!=twoold[yukvars[i].intername]&& twowatch[yukvars[i].intername] > (char)1) { twoold[yukvars[i].intername]=ick_twospots[yukvars[i].intername]; if(twowatch[yukvars[i].intername]==(char)2||!ick_twospots[yukvars[i].intername]) { /*@-formatconst@*/ /* there's just the one %d each way round */ printf(twowatch[yukvars[i].intername]==(char)2? "Variable :%d changed.\n":"Variable :%d became 0.\n", yukvars[i].extername); /*@=formatconst@*/ broken=1; singlestep=1; } } if(writelines||broken) { printf(":%d is:\n",yukvars[i].extername); ick_pout(ick_twospots[yukvars[i].intername]); } } } } if(writelines||broken) { /* write line that we're on */ printf("%5d:\t%s\n",lineofaboff[aboff],text); /* write command within line that we're on */ tempcmd=aboff; while(tempcmd&&lineofaboff[--tempcmd]==lineofaboff[aboff]); printf("On C%d: Abstained %d time%s\n",aboff?aboff-tempcmd:1, ick_abstained[aboff]-yukloop,ick_abstained[aboff]-yukloop==1?".":"s."); } if(singlestep) { (void)signal(SIGINT,handlesigint); /* placing this line here means that a rapid ^C^C will terminate the program, if it's stuck in a loop somewhere */ keeplooping = 1; breakpoints[0] = 0; /* breakpoints[0] goes whenever a breakpoint is hit */ untilnext = -1; if(yukloop) { /* reverse the abstentions that g caused */ i = -1; while(++i\tabstain once from all non-ick_abstained commands on "); (void) puts("b\tset breakpoint at "); (void) puts("c\tcontinue execution until a breakpoint is reached"); (void) puts("d\tdelete breakpoint at "); (void) puts("e\texplain the ick_main expression on "); (void) puts("f\tstop producing messages when commands on are run"); (void) puts("g\tchange currently executing command to the ick_first command"); (void) puts("\ton or the ick_next command if already on "); (void) puts("h\tlist 10 lines either side of the current line"); (void) puts("i\tignore a variable"); (void) puts("j\tremember a variable"); (void) puts("k\tcontinue until we RESUME back to the current nexting level"); (void) puts("\t(that is, step unless we are on a NEXT, in which case execute"); (void) puts("\tuntil a RESUME or FORGET back to the same or smaller NEXT stack)"); (void) puts("l\tlist 10 lines either side of "); (void) puts("m\tproduce a message every time a command on is run"); (void) puts("n\tshow the NEXT stack"); (void) puts("o\tcontinue until we RESUME/FORGET below the current nexting level"); (void) puts("\tie until the NEXT stack becomes smaller than it is at present"); (void) puts("p\tdisplay the values of all onespot and twospot variables"); (void) puts("q\tabort execution"); (void) puts("r\treinstate once all ick_abstained commands on "); (void) puts("s\texecute one command"); (void) puts("t\tcontinue until a breakpoint, displaying all lines executed"); (void) puts("u\texecute until just before is reached"); (void) puts("v\tshow value of variable every time a command is printed"); (void) puts("w\tshow the current line and current command"); (void) puts("x\tremove a variable view, breakchange, or breakzero"); (void) puts("y\tview variable every displayed line, and break on change"); (void) puts("z\tview variable every displayed line, and break on zero"); (void) puts("\tview the value of a onespot or twospot variable"); (void) puts("<\tset the value of a onespot or twospot variable"); (void) puts("*\tview the GNU General Public License"); (void) puts("?\tview this help screen"); (void) puts("@\tview this help screen"); (void) puts("Line numbers refer to lines of source code, not line labels."); (void) puts("Listings have (Axxxxxx) at the start of each line: this shows"); (void) puts("the abstention status of each command on that line."); (void) puts("The values of variables must be input in proper INTERCAL"); (void) puts("notation (i.e. ONE TWO THREE), and are output as butchered"); (void) puts("Roman ick_numerals."); #ifdef __DJGPP__ (void) puts("You can press - to interrupt an executing program."); #else (void) puts("You can press -C to interrupt an executing program."); #endif break; case 'q': exit(0); /*@-unreachable@*/ break; /*@=unreachable@*/ case 'n': i=ick_nextindex; if(!i) { (void) puts("The NEXT stack is empty."); } else { (void) puts("Commands NEXTED from:"); while(i--) { /* write NEXT line */ printf("%5d:\t%s\n",lineofaboff[ick_next[i]-1], textlines[lineofaboff[ick_next[i]-1]]); /* write NEXT command within line */ tempcmd=(int)ick_next[i]; while(tempcmd&&lineofaboff[--tempcmd]==lineofaboff[ick_next[i]-1]); printf("NEXTED from command C%u: Abstained %d time%s\n",ick_next[i]-1? ick_next[i]-1-tempcmd:1,ick_abstained[ick_next[i]-1], ick_abstained[ick_next[i]-1]==1?".":"s."); } } break; case 'w': /* write line that we're on */ printf("%5d:\t%s\n",lineofaboff[aboff],text); /* write command within line that we're on */ tempcmd=aboff; while(tempcmd&&lineofaboff[--tempcmd]==lineofaboff[aboff]); printf("On C%d: Abstained %d time%s\n",aboff?aboff-tempcmd:1,ick_abstained[aboff], ick_abstained[aboff]==1?".":"s."); break; case 'p': i=-1; while(++i,1) { if(yukvars[i].vartype==YUKEND) break; if(yukvars[i].vartype==ick_ONESPOT) { printf("Variable .%d is:\n",yukvars[i].extername); ick_pout(ick_onespots[yukvars[i].intername]); } if(yukvars[i].vartype==ick_TWOSPOT) { printf("Variable :%d is:\n",yukvars[i].extername); ick_pout(ick_twospots[yukvars[i].intername]); } } break; case '.': case ':': temp = sscanf(buf+1,"%d",&templine); if(templine<1 || temp != 1) { (void) puts("Don't know which variable you mean."); break; } i=-1; temp=0; while(++i,!temp) { if(yukvars[i].vartype==YUKEND) break; if((*buf=='.'&&yukvars[i].vartype==ick_ONESPOT)|| (*buf==':'&&yukvars[i].vartype==ick_TWOSPOT)) { if(yukvars[i].extername==templine) { temp=1; if(yukvars[i].vartype==ick_ONESPOT) { ick_pout(ick_onespots[yukvars[i].intername]); (void) puts(ick_oneforget[yukvars[i].intername]? "This variable is currently ignored.": "This variable is currently remembered."); } if(yukvars[i].vartype==ick_TWOSPOT) { ick_pout(ick_twospots[yukvars[i].intername]); (void) puts(ick_twoforget[yukvars[i].intername]? "This variable is currently ignored.": "This variable is currently remembered."); } } } } if(temp) break; (void) puts("That variable is not in the program."); break; case 'v': case 'x': case 'y': case 'z': if(buf[1]!='.'&&buf[1]!=':') { (void) puts("This command only works on onespot and twospot variables."); break; } temp = sscanf(buf+2,"%d",&templine); if(templine<1 || temp != 1) { (void) puts("Don't know which variable you mean."); break; } i=-1; temp=0; while(++i,!temp) { if(yukvars[i].vartype==YUKEND) break; if(yukvars[i].extername==templine) { if(buf[1]=='.'&&yukvars[i].vartype==ick_ONESPOT) { if(*buf=='v') onewatch[yukvars[i].intername]=(char)1; if(*buf=='x') onewatch[yukvars[i].intername]=(char)0; if(*buf=='y') onewatch[yukvars[i].intername]=(char)2; if(*buf=='z') onewatch[yukvars[i].intername]=(char)3; oneold[yukvars[i].intername]=ick_onespots[yukvars[i].intername]; temp=1; } if(buf[1]==':'&&yukvars[i].vartype==ick_TWOSPOT) { if(*buf=='v') twowatch[yukvars[i].intername]=(char)1; if(*buf=='x') twowatch[yukvars[i].intername]=(char)0; if(*buf=='y') twowatch[yukvars[i].intername]=(char)2; if(*buf=='z') twowatch[yukvars[i].intername]=(char)3; twoold[yukvars[i].intername]=ick_twospots[yukvars[i].intername]; temp=1; } } } if(!temp) { (void) puts("That variable is not in the program."); break; } if(*buf=='v') (void) puts("Set a normal variable view."); if(*buf=='x') (void) puts("Removed all views from that variable."); if(*buf=='y') (void) puts("Set a breakchange variable view."); if(*buf=='z') (void) puts("Set a breakzero variable view."); break; case 'i': case 'j': if(buf[1]!='.'&&buf[1]!=':'&&buf[1]!=','&&buf[1]!=';') { (void) puts("That isn't a real sort of variable."); break; } temp = sscanf(buf+2,"%d",&templine); if(templine<1 || temp != 1) { (void) puts("Don't know which variable you mean."); break; } i=-1; temp=0; while(++i,!temp) { if(yukvars[i].vartype==YUKEND) break; if((buf[1]=='.'&&yukvars[i].vartype==ick_ONESPOT)|| (buf[1]==':'&&yukvars[i].vartype==ick_TWOSPOT)|| (buf[1]==','&&yukvars[i].vartype==ick_TAIL)|| (buf[1]==';'&&yukvars[i].vartype==ick_HYBRID)) { if(yukvars[i].extername==templine) { temp=1; if(yukvars[i].vartype==ick_ONESPOT) ick_oneforget[yukvars[i].intername]=*buf=='i'; if(yukvars[i].vartype==ick_TWOSPOT) ick_twoforget[yukvars[i].intername]=*buf=='i'; if(yukvars[i].vartype==ick_TAIL) ick_tailforget[yukvars[i].intername]=*buf=='i'; if(yukvars[i].vartype==ick_HYBRID) ick_hyforget[yukvars[i].intername]=*buf=='i'; } } } if(temp) { if(*buf=='i') (void) puts("Variable ignored."); else (void) puts("Variable remembered."); break; } (void) puts("That variable is not in the program."); break; case '<': if(buf[1]!='.'&&buf[1]!=':') { (void) puts("You cannot set that sort of variable (if it exists at all)."); break; } temp = sscanf(buf+2,"%d",&templine); if(templine<1 || temp != 1) { (void) puts("Don't know which variable you mean."); break; } i=-1; temp=0; while(++i,!temp) { if(yukvars[i].vartype==YUKEND) break; if((buf[1]=='.'&&yukvars[i].vartype==ick_ONESPOT)|| (buf[1]==':'&&yukvars[i].vartype==ick_TWOSPOT)) { if(yukvars[i].extername==templine) { temp=1; if(yukvars[i].vartype==ick_ONESPOT) ick_onespots[yukvars[i].intername]=(ick_type16)ick_pin(); if(yukvars[i].vartype==ick_TWOSPOT) ick_twospots[yukvars[i].intername]=(ick_type32)ick_pin(); /* note that when debugging, you can set an ignored variable */ } } } if(temp) break; (void) puts("That variable is not in the program."); break; case 'g': temp = sscanf(buf+1,"%d",&templine); if(!templine || temp != 1) { (void) puts("Don't know which line you mean."); break; } breakpoints[0] = templine; yukloop = 1; /* This is implemented by incrementing all ABSTAIN counts, even the normally immutable ones on GIVE UP lines, setting a temporary breakpoint ([0]) on the line given, and running the program. When the breakpoint is hit singlestep will see that yukloop is set (its purpose is to cause the program to go back to the start when it reaches the end) and decrement all ABSTAIN counts, putting the commands back the way they were. We set an error breakpoint on this line in case the user is trying to jump to a line with no commands (although this debugger command is called 'g', would I dare to describe this as a GOTO?) */ i = -1; while(++i=80) ick_lose(IE811,emitlineno,(const char*)NULL); } else (void) puts("Don't know which line you mean."); break; case 'd': temp = sscanf(buf+1,"%d",&templine); if(templine && temp == 1) { printf("All breakpoints removed from line %d.\n",templine); i=nbreakpoints; while(i--) if(templine==breakpoints[i]) { memmove(breakpoints+i,breakpoints+i+1,sizeof(int)*(nbreakpoints-i)); nbreakpoints--; } } else (void) puts("Don't know which line you mean."); break; case 'm': temp = sscanf(buf+1,"%d",&templine); if(templine && temp == 1) { printf("Monitor set at line %d.\n",templine); monitors[nmonitors++]=templine; if(nmonitors>=80) ick_lose(IE811,emitlineno,(const char*)NULL); } else (void) puts("Don't know which line you mean."); break; case 'f': temp = sscanf(buf+1,"%d",&templine); if(templine && temp == 1) { printf("All monitors removed from line %d.\n",templine); i=nmonitors; while(i--) if(templine==monitors[i]) { memmove(monitors+i,monitors+i+1,sizeof(int)*(nmonitors-i)); nmonitors--; } } else (void) puts("Don't know which line you mean."); break; case 's': singlestep=1; writelines=1; keeplooping=0; break; case 't': singlestep=0; writelines=1; keeplooping=0; break; case 'u': temp = sscanf(buf+1,"%d",&templine); if(templine && temp == 1) { breakpoints[0]=templine; singlestep=0; writelines=0; keeplooping=0; } else (void) puts("Don't know which line you mean."); break; case 'e': temp = sscanf(buf+1,"%d",&templine); if(!templine || temp != 1) { (void) puts("Don't know which line you mean."); break; } tempcmd=-1; temp=0; i=0; while(++tempcmd=yuklines) templine=yuklines-22; if(templine<1) templine=1; i=templine; while(i9) buf[temp++]='!'; else buf[temp++]='0'+(char)ick_abstained[tempcmd]; if(temp==6) break; } } printf("(A%s)%5d:\t%s\n",buf,i,textlines[i]); i++; } break; case '*': tempcharp=ick_findandtestopen("COPYING.txt",globalargv[1], "r",globalargv[2]); if(tempcharp != NULL) { #ifndef HAVE_SNPRINTF (void) sprintf(copyloc,"more < %s",tempcharp); #else (void) snprintf(copyloc,sizeof copyloc,"more < %s",tempcharp); #endif if (system(copyloc) != 0) /* display the GNU GPL copyright */ (void) puts("Your system is more confused."); } else (void) puts("Couldn't find license file. See the file COPYING.txt that\n" "came with your C-INTERCAL distribution."); break; default: (void) puts("Not sure what you mean. Try typing ?."); break; } } while(keeplooping); } } firstrun=0; } intercal-0.30/src/PaxHeaders.27456/lexer.l0000644000000000000000000000007411437551705015101 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.618945611 intercal-0.30/src/lexer.l0000644000175000017500000003442311437551705015002 0ustar00esresr00000000000000%e 2000 %p 4000 %n 1000 %{ /* the directives above are for Solaris lex, and will be ignored by * flex */ /* * NAME * lexer.l -- source for the C-INTERCAL lexical analyzer. * LICENSE TERMS Copyright (C) 1996 Eric S. Raymond This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #include #include #include #include "ick.h" #include "parser.h" #include "ick_lose.h" /*#undef wchar_t*/ /*#define wchar_t unsigned char*/ #ifndef yywrap static int yywrap(void) { return 1; } #endif /* yywrap */ int iyylineno = 1; #ifdef MAIN YYSTYPE yylval; #endif /* MAIN */ char **textlines = NULL; int textlinecount = 0; int politesse = 0; int stbeginline = 0; /* AIS: Sort out a grammar near-ambiguity */ unsigned long sparkearsstack[SENESTMAX] = {0}; int sparkearslev = 0; /* AIS: Some symbols are ambiguous between C-INTERCAL and CLC-INTERCAL: Symbol C-INTERCAL CLC-INTERCAL NOSPOT _ @ WHIRL @ ? XOR ? yen, or bookworm (bookworm's also C-INTERCAL legal) By default, the C-INTERCAL meanings are used; the extern variable clclex causes CLC-INTERCAL interpretations to be put on the ambiguous symbols. Otherwise, mixing syntaxes freely is allowed. */ extern int clclex; #ifdef FLEX_SCANNER static char linebuf[YY_BUF_SIZE]; #else /* FLEX_SCANNER */ static char linebuf[YYLMAX]; #endif /* FLEX_SCANNER */ static char *lineptr = linebuf; bool re_send_token = false; int lexer(void); static int myatoi(const char *text); void yyerror(const char *errtype); #define SETLINENO \ {if (stbeginline == 0) stbeginline = iyylineno;\ else if (stbeginline < 0) stbeginline = 0;} /* AIS: Keep track of the spark/ears situation */ #define STACKSPARKEARS(a) \ if (sparkearslev+1>=SENESTMAX*32) ick_lose(IE281, iyylineno, (char*) NULL); \ sparkearslev++; sparkearsstack[sparkearslev/32]<<=1; \ sparkearsstack[sparkearslev/32]+=a #define CLEARSPARKEARSTACK {int i=SENESTMAX; \ while(i--) sparkearsstack[i] = 0;} \ sparkearslev = 0 /* * The spectacular ugliness of INTERCAL syntax requires that the lexical * analyzer have two levels. One, embedded in the getc() function, handles * logical-line continuation and the ! abbrev, and stashes each logical * line away in a buffer accessible to the code generator (this is necessary * for the * construct to be interpreted correctly). The upper level is * generated by lex(1) and does normal tokenizing. */ #undef getc int getc(FILE *fp) { extern FILE* yyin; static bool bangflag = false; static bool backflag = false; static bool eolflag = false; if ((size_t)(lineptr - linebuf) > sizeof linebuf) ick_lose(IE666, iyylineno, (char *)NULL); if (bangflag) { bangflag = false; /* *lineptr++ = '!'; */ return('.'); } else if (backflag) /* converting ctrl-H (backspace) to two chars "^H" */ { backflag = false; /* *lineptr++ = '\b'; */ return('H'); } else { int c; char c_char; size_t dummy; /*fprintf(stderr,"about to fgetc(\045p)",(void*)fp);*/ c_char=0; /* AIS */ dummy = fread(&c_char,1,1,fp); /* AIS: ignore the first \r in a row to deal with DOS newlines. The second in a row is definitely an error, though, and will be caught later on. */ if(c_char=='\r') dummy = fread(&c_char,1,1,fp); c = c_char; if(feof(fp)) c=EOF; if(!eolflag && c == EOF) c = '\n'; /*fprintf(stderr,"getc input a character: %c\n",c);*/ if (feof(yyin)) { *lineptr = '\0'; if(eolflag) return(EOF); if(c=='\0' || c==EOF) c='\n'; } eolflag = false; if (c == '!') { *lineptr++ = '!'; bangflag = true; return(c = '\''); } else if (c == '\b') /* convert ctrl-H (backspace) to two chars "^" and "H" so lex can take it */ { *lineptr++ = '\b'; backflag = true; return(c = '^'); } else if (c == '\n') { *lineptr = '\0'; lineptr = linebuf; if (iyylineno >= textlinecount) { textlinecount += ALLOC_CHUNK; if (textlines) textlines = realloc(textlines, textlinecount * sizeof(char*)); else textlines = malloc(textlinecount * sizeof(char*)); if (!textlines) ick_lose(IE666, iyylineno, (char *)NULL); } textlines[iyylineno] = malloc(1 + strlen(linebuf)); if (!textlines[iyylineno]) ick_lose(IE666, iyylineno, (char *)NULL); strcpy(textlines[iyylineno], linebuf); iyylineno++; eolflag=true; return('\n'); } else { return(*lineptr++ = c); } } } /* replace YY_INPUT so that it uses our getc function. */ #undef YY_INPUT #define YY_INPUT(buf,result,max_size) \ { \ int c = getc(yyin); \ if (c == EOF) { \ if (ferror(yyin)) \ YY_FATAL_ERROR("input in flex scanner failed"); \ result = YY_NULL; \ } else { \ buf[0] = c; \ result = 1; \ } \ } %} W [\ \t\n]* D [0-9][\ \t\n0-9]* I [A-Z] %% {D} {yylval.numval = myatoi(yytext); return(NUMBER);} \_ {return(NOSPOT);} \. {return(ick_ONESPOT);} \: {return(ick_TWOSPOT);} \, {return(ick_TAIL);} \; {return(ick_HYBRID);} \# {return(MESH);} \xBD | "c^H/" | "c^H|" {return(MINGLE); /* AIS: CLC-INTERCAL ick_mingle symbols. The \xBD is ISO-8859-1 for cent. */} \$ | \xA2 | \xA3 | \xA4 | \xC2\xA2 | \xC2\xA3 | \xC2\xA4 | \xE2\x82\xA0 | \xE2\x82\xA1 | \xE2\x82\xA2 | \xE2\x82\xA3 | \xE2\x82\xA4 | \xE2\x82\xA5 | \xE2\x82\xA6 | \xE2\x82\xA7 | \xE2\x82\xA8 | \xE2\x82\xA9 | \xE2\x82\xAA | \xE2\x82\xAB | \xE2\x82\xAC | \xE0\xA7\xB2 | \xE0\xA7\xB3 | \xE0\xB8\xBF {return(MINGLE);} \~ {return(SELECT);} \/ {return(SLAT); /* AIS: Operand overloading */} \\ {return(BACKSLAT); /* ditto */} \& {yylval.numval = AND; return(UNARY);} V {yylval.numval = OR; return(UNARY);} \xA5 | \xBE | "V^H-" | \xE2\x88\x80 {yylval.numval = XOR; return(UNARY); /* AIS: CLC-INTERCAL uses \xBE, ISO-8859-1 for yen; for some reason, \xA5 is what was detected by the compiler during my tests, so that's here too */} \? {if(clclex) yylval.numval = WHIRL; else yylval.numval = XOR; return(UNARY); /* AIS: ? is a unary operator in both C-INTERCAL and CLC-INTERCAL, but with different meanings. */} \| | \^ {yylval.numval = FIN; return(UNARY); /* AIS: | is CLC */} @ {if(clclex) return(NOSPOT); /* AIS: a C/CLC ambiguity */ else {yylval.numval = WHIRL; return(UNARY);}} [2-5]{W}@ {yylval.numval = WHIRL + myatoi(yytext) - 1; return(UNARY);} \' {char temp = sparkearsstack[sparkearslev/32]&1; STACKSPARKEARS(0); /* AIS: I added all mentions of STACKSPARKEARS, OPEN\(SPARK\|EARS\), CLOSE\(SPARK\|EARS\), and CLEARSPARKEARSTACK */ return(temp?OPENSPARK:CLOSESPARK);} \" {char temp = sparkearsstack[sparkearslev/32]&1; STACKSPARKEARS(1); return(temp?CLOSEEARS:OPENEARS);} \({W}{D}\) {SETLINENO; yylval.numval = myatoi(yytext); return(LABEL);} DO {SETLINENO; CLEARSPARKEARSTACK; return(DO);} FAC {SETLINENO; CLEARSPARKEARSTACK; return(DO);} PLEASE {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(DO);} PLACET {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(DO);} PLEASE{W}DO {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(DO);} PLACET{W}FACERE {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(DO);} MAYBE {SETLINENO; CLEARSPARKEARSTACK; return(MAYBE);} MAYBE{W}DO {SETLINENO; CLEARSPARKEARSTACK; return(MAYBE);} MAYBE{W}PLEASE {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(MAYBE);} MAYBE{W}PLEASE{W}DO {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(MAYBE); /* AIS: I added all the MAYBE cases. It seems that MAYBE has no simple Latin synonym. */} NOT {return(NOT);} N\'T {return(NOT);} NON {return(NOT);} \xAA {return(NOT); /* AIS: CLC-INTERCAL again, this time it's ISO-8859-1 for the logical NOT symbol... */} \xAC {return(NOT); /* ... but my computer translates it to \xAC */} ONCE {return(ONCE);} QUONDAM {return(ONCE);} AGAIN {return(AGAIN);} ITERUM {return(AGAIN);} \%{W}{D} {yylval.numval = myatoi(yytext); if (yylval.numval && yylval.numval < 100) return(OHOHSEVEN); else ick_lose(IE017, iyylineno, (char *)NULL);} SUB {return(SUB);} MULTIPLICATUS{W}A | BY {return(BY);} \<- {return(GETS);} CALCULANDUM | CALCULATING {yylval.numval = GETS; return(GERUND);} ALIENERE | FORGET {return(FORGET);} ALIENENDUM | FORGETTING {yylval.numval = FORGET; return(GERUND);} RECOLERE | RESUME {return(RESUME);} RECOLERENDUM | RESUMING {yylval.numval = RESUME; return(GERUND);} EXUERE | STASH {return(STASH);} EXUENDUM | STASHING {yylval.numval = STASH; return(GERUND);} INUERE | RETRIEVE {return(RETRIEVE);} INUENDUM | RETRIEVING {yylval.numval = RETRIEVE; return(GERUND);} DISSIMULARE | IGNORE {return(IGNORE);} DISSIMULANDUM | IGNORING {yylval.numval = IGNORE; return(GERUND);} MEMINISSE | REMEMBER {return(REMEMBER);} MEMINISSENDUM | REMEMBERING {yylval.numval = REMEMBER; return(GERUND);} ABSTINERE | ABSTAIN {return(ABSTAIN);} ABSTINENDUM | ABSTAINING {yylval.numval = ABSTAIN; return(GERUND);} REINSTARE | REINSTATE {return(REINSTATE);} REINSTATANDUM | REINSTATING {yylval.numval = REINSTATE; return(GERUND);} LEGERE{W}EX | READ{W}OUT {return(READ_OUT);} LEGENDUM | READING{W}OUT {yylval.numval = READ_OUT; return(GERUND);} SCRIBERE{W}IN | WRITE{W}IN {return(WRITE_IN);} SCRIBENDUM | WRITING{W}IN {yylval.numval = WRITE_IN; return(GERUND);} COMMEMERO | COMMENTS | COMMENTING | COMMENT {yylval.numval = UNKNOWN; return(GERUND); /* AIS: An idea stolen from CLC-INTERCAL. The Latin means literally 'remind' or 'mention'. */} PIN {/* By AIS. I can't find a Latin translation for this. */ return(PIN);} PINNING {/* By AIS */ yylval.numval = PIN; return(GERUND);} DEINDERE{W}A{W}\({W}{D}\) | NEXT{W}FROM{W}\({W}{D}\) {/* AIS */ yylval.numval = myatoi(yytext); return(NEXTFROMLABEL);} DEINDERE{W}A | NEXT{W}FROM {/* AIS: 'next' is not a verb, so the Latin is invented */ return(NEXTFROMEXPR);} DEINDENDUM | NEXTING{W}FROM {/* AIS */ yylval.numval = NEXTFROMLABEL; return(GERUND);} ADVENIRE{W}DE{W}\({W}{D}\) | COME{W}FROM{W}\({W}{D}\) {/* AIS */ yylval.numval = myatoi(yytext); return(COME_FROM);} ADVENIRE{W}DE | COME{W}FROM {/* AIS */ return(COMPUCOME);} ADVENENDUM | COMING{W}FROM {yylval.numval = COME_FROM; return(GERUND);} DEINDE | NEXT {stbeginline = 0; return(NEXT);} PROXIMANDUM | NEXTING {yylval.numval = NEXT; return(GERUND);} FROM {return(FROM); /* AIS: Latin is 'A', which confuses the rest of the parser */} CONCEDERE | DESPERARE | GIVE{W}UP {return(GIVE_UP);} CONOR{W}ITERUM | TRY{W}AGAIN {return(TRY_AGAIN);} WHILE {return(WHILE); /* AIS. Latin for this is needed. */} WHILING | LOOPING {yylval.numval = WHILE; return(GERUND);} TRYING{W}AGAIN {yylval.numval = TRY_AGAIN; return(GERUND);} GO{W}BACK | REDIRE {return(GO_BACK);} GOING{W}BACK | REDENDUM {yylval.numval = GO_BACK; return(GERUND);} GO{W}AHEAD | GRASSOR {return(GO_AHEAD);} GOING{W}AHEAD {yylval.numval = GO_AHEAD; return(GERUND); /* AIS: I'm having a few deponent troubles with the Latin, so there are no Latin gerunds around here. Besides, the Latin 'gerunds' look somewhat like gerundives to me, but that's purely based on memory so I may be wrong. */} CREATE{W}\({W}{D}\) | CONFICE{W}\({W}{D}\) {yylval.numval = myatoi(yytext); return(CREATE);} CREATE | CONFICE {return(COMPUCREATE);} CREATING | CREATION | CONFICENDUM {yylval.numval = CREATE; return(GERUND);} \+ {return(INTERSECTION);} {W} ; {I} {/* AIS */ yylval.numval = *yytext; return(UNKNOWNID);} .\^H. {/* AIS */ yylval.numval = yytext[0]*256 + yytext[3]; if(yytext[0] > yytext[3]) yylval.numval = yytext[0] + yytext[3]*256; return(BADCHAR);} . {yylval.numval = yytext[0]; /* AIS: The line below for debug */ if(yydebug) fprintf(stdout, "yylex: bad char %#x\n",(unsigned char)yytext[0]); return(BADCHAR);} %% int lexer(void) { static int tok = BADCHAR; if (re_send_token) re_send_token = false; else { tok = yylex(); #ifdef YYDEBUG if (yydebug) (void) fprintf(stdout, "yylex: returning token %d\n", tok); #endif /* YYDEBUG */ } #ifdef YYDEBUG if (yydebug) (void) fprintf(stdout, "lexer: returning token %d\n", tok); #endif /* YYDEBUG */ return(tok); } static int myatoi(const char *text) /* AIS */ { #define MAXTEXT 100 static char buf[MAXTEXT]; static char thinbuf[MAXTEXT]; char* bp; char* tp; register int i; for(buf[i = 0] = '\0';*text && i < MAXTEXT;text++) { if(isdigit(*text)) { buf[i++] = *text; } } buf[i] = '\0'; bp=buf; tp=thinbuf; while(((*tp++=*bp++))); /* thinbuf code added by an AIS in case we want to work with wchar_t; the extra brackets tell GCC that this is intended and not a mistaken assignment */ return atoi(thinbuf); } void yyerror(const char *errtype) { #ifdef MAIN (void) printf("lextest: lexer error: %s.\n", errtype); #else /* MAIN */ (void) errtype; #endif /* MAIN */ } #ifdef MAIN int ick_main(void) { int t; while ((t = yylex()) > 0) { (void) printf("%03d %09d\n", t, yylval.numval); yylval.numval = 0; } return 0; } #endif /* MAIN */ intercal-0.30/src/PaxHeaders.27456/ick_lose.c0000644000000000000000000000007411437551705015541 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.526945866 intercal-0.30/src/ick_lose.c0000644000175000017500000000440011437551705015432 0ustar00esresr00000000000000/* * * NAME * ick_lose.c -- report INTERCAL compile- or run-time error * LICENSE TERMS Copyright (C) 1996 Eric S. Raymond This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*LINTLIBRARY*/ #include "config.h" #include #include #include #include "ick.h" /* ugh, just for bool */ #include "ick_lose.h" bool ick_coreonerr; /* AIS */ bool ick_checkforbugs; /* AIS */ /*@-formatconst@*/ void ick_lose(const char *m, int n, const char *s) { (void) fflush(stdout); /* AIS: To stop stdout getting muddled with stderr*/ (void) fprintf(stderr, "ICL%c%c%cI\t", m[0], m[1], m[2]); if (s) (void) fprintf(stderr, m + 4, s, n); else (void) fprintf(stderr, m + 4, n); (void) fprintf(stderr, " CORRECT SOURCE AND RESUBNIT\n"); if(atoi(m)==778&&ick_coreonerr) /* AIS */ { /* AIS: Dump core. */ (void) raise(SIGABRT); } exit(atoi(m)); } /* AIS: This function reports potential bugs. It's paraphrased from ick_lose. */ void ick_lwarn(const char *m, int n, const char *s) { if(!ick_checkforbugs) return; /* Don't report a potential bug without -l */ (void) fflush(stdout); (void) fprintf(stderr, "ICL%c%c%cW\t", m[0],m[1],m[2]); if (s) (void) fprintf(stderr, m + 4, s, n); else if(m[0]!='2'||m[1]!='7'||m[2]!='8') (void) fprintf(stderr, m + 4, n); else (void) fputs(m + 4, stderr); (void) fputs(" RECONSIDER SOURCE AND RESUBNIT\n\n", stderr); /* Don't exit. This is not any error except one not causing immediate termination of program execution. */ } /*@=formatconst@*/ /* ick_lose.c ends here */ intercal-0.30/src/PaxHeaders.27456/abcessh.in0000644000000000000000000000007411474462532015545 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.518945889 intercal-0.30/src/abcessh.in0000644000175000017500000002106511474462532015444 0ustar00esresr00000000000000/* abcess.h -- functions used by compiled INTERCAL programs -*- c -*- */ /* This file is generated from abcessh.in */ /* AIS note: This header file now serves two purposes. For non-multithread programs, it serves as headers to the degenerated code and many support functions. For multithread programs, this header file adds extra functions only when compiling the degenerated code and unravel.c, and holds its previous contents during other files. */ #include #include #include /* We use the +1 trick here, as it works whether the values substituted in are the null string, 0, or positive. */ #ifndef HAVE_STDBOOL_H # define HAVE_STDBOOL_H @HAVE_STDBOOL_H@ + 1 # if HAVE_STDBOOL_H == 1 # undef HAVE_STDBOOL_H # endif #endif #ifndef HAVE__BOOL # define HAVE__BOOL @HAVE__BOOL@ + 1 # if HAVE__BOOL == 1 # undef HAVE__BOOL # endif #endif #ifndef HAVE_STDINT_H # define HAVE_STDINT_H @HAVE_STDINT_H@ + 1 # if HAVE_STDINT_H == 1 # undef HAVE_STDINT_H # endif #endif /* * Duplicates contents of ick_bool.h. Someday maybe we'll install this * and avoid such grottiness. */ /*@-redef@*/ #ifndef __bool_true_false_are_defined # if HAVE_STDBOOL_H >= 1 # include # else # ifndef HAVE__BOOL >= 1 # ifdef HAVE_STDINT_H >= 1 # include typedef int_fast8_t bool; # else typedef int bool; # endif # else typedef _Bool bool; # endif # define true 1 # define false 0 # define __bool_true_false_are_defined 1 # endif #endif /*@=redef@*/ #define ICK_ABCESS_H_INCLUDED #define ick_ONESPOT 0 #define ick_TWOSPOT 1 #define ick_TAIL 2 #define ick_HYBRID 3 #define ick_MAXNEXT 80 /* AIS: Moved from cesspool.c */ /* the following two types must both promote to unsigned int in expressions */ typedef unsigned short ick_type16; typedef unsigned int ick_type32; typedef struct ick_array_t { unsigned int rank; size_t *dims; union { ick_type16 *tail; ick_type32 *hybrid; } data; } ick_array; /* AIS: For operand overloading, a more complicated data type is needed. */ typedef struct ick_overop_t { ick_type32 (*get)(ick_type32); void (*set)(ick_type32, void(*)()); } ick_overop; /* AIS: Moved from cesspool.c */ typedef struct ick_stashbox_t /* this is a save-stack element */ { unsigned int type; /* variable type */ unsigned int index; /* variable's index within the type */ union /* the data itself */ { ick_type16 onespot; ick_type32 twospot; ick_array *a; } save; /*@null@*/ /*@dependent@*/ struct ick_stashbox_t *ick_next; /* pointer to next-older ick_stashbox */ ick_overop overloadinfo; /* AIS: overloading info is stashed too, in a non-overloaded program (ignored otherwise) */ } ick_stashbox; /* AIS: files to take input and output from */ /*@null@*/ extern FILE* ick_cesspoolin; /*@null@*/ extern FILE* ick_cesspoolout; /* defined in cesspool.c */ extern void ick_pushnext(unsigned n); extern unsigned int ick_popnext(unsigned n); extern unsigned int ick_resume(unsigned n); extern unsigned int ick_pin(void); extern void ick_clockface(bool mode); extern void ick_setclcsemantics(bool mode); /* AIS */ extern void ick_pout(unsigned int val); extern void ick_binin(unsigned int type, ick_array *a, bool forget); extern void ick_binout(unsigned int type, const ick_array *a); extern unsigned int ick_assign(char *dest, unsigned int type, bool forget, unsigned int value); /* AIS: yuk, unravel and ick_ec need these */ extern unsigned* ick_next; /*@null@*/ extern jmp_buf* ick_next_jmpbufs; extern int ick_nextindex; extern /*@null@*/ ick_stashbox *ick_first; /* AIS: Implement the +ick_mystery command line option. */ extern unsigned long ick_mysteryc; extern int ick_mystery; #define ick_MYSTERYLINE if(ick_mystery && ick_mysteryc++ > 4000000000LU) exit(42); /* AIS: More command-line options */ extern int ick_wimp_mode; extern int ick_instapipe; /* AIS: Handle multiple COME FROMs aiming at the same line */ extern int ick_multicome0(int errlineno, jmp_buf pc); #ifdef HAVE_STDARG_H /*@dependent@*/ extern void *ick_aref(unsigned int type, ...); extern void ick_resize(unsigned int type, ...); #else /*@dependent@*/ extern void *ick_aref(); extern void ick_resize(); #endif extern void ick_stashinit(void); /* AIS: Added mentions of oo. This is set to 0 in a non-overloaded program. */ extern void ick_stash(unsigned int type, unsigned int index, void *from, ick_overop* oo); extern void ick_retrieve(void *to, unsigned int type, unsigned int index, bool forget, ick_overop* oo); extern unsigned int ick_roll(unsigned int n); /* AIS: Lose with IE277 */ extern ick_type32 ick_ieg277(ick_type32); extern void ick_ies277(ick_type32, void(*)()); /* defined in arrgghh.c */ extern void ick_parseargs(int argc, char **argv); extern int ick_printflow; /* AIS: For the CREATE statement */ typedef struct ick_tag_createdata ick_createdata; struct ick_tag_createdata { int width; /* 16 or 32 (maybe 0 will be allowed at some point) */ int isarray; /* this and the previous determine what vartype it is */ unsigned short varnumber; /* 0 if not a variable, the var's number if it is */ ick_overop accessors;/* how to get and set this lvalue, or {0,0} */ unsigned long value; /* current value of the var or expression */ }; extern void ick_registercreation(const char*,unsigned long); extern unsigned long ick_jicmatch(const char*); /* AIS: Multithreading types and defines */ #if MULTITHREAD != 0 typedef struct tag_ickthread ickthread; /*@refcounted@*/ struct tag_ickthread { void* varforget[10]; /* holds all four variable types, and forgetting data */ unsigned* nextstack; int nextpointer; jmp_buf pc; /* program counter */ ick_stashbox* sb; /* holds all stash data */ /*@partial@*/ /*@dependent@*/ ickthread* ick_next; /*@null@*/ /*@partial@*/ /*@dependent@*/ ickthread* choicepoint; /* the top choicepoint available. Used as a next pointer in the choicepoint stack. */ int stale; /* if this is a choicepoint, whether it's a stale choicepoint. */ int refcount; /* when Threaded INTERCAL and Backtracking INTERCAL are combined, reference-counting on choicepoints is needed so that backtracking past multithreading is possible. This also allows for garbage-collection of choicepoints. (Luckily, choicepoints cannot refer to themselves, so this mechanism works.) This only applies to ickthreads that are acting as choicepoints, not those acting as threads. */ int ick_ccfc; /* number of comefroms currently active */ long ick_skipto; /* compucome line number */ jmp_buf ick_cjb; /* keeps track of compucomes */ /*@partial@*/ /*@dependent@*/ ickthread* dsi; /* which thread's varforget and sb to use */ /*@null@*/ /*@dependent@*/ ickthread* usesthis; /* for garbage collection purposes */ }; /*@partial@*/ /*@dependent@*/ extern ickthread* ickmt_cur; /* current thread */ /*@partial@*/ /*@dependent@*/ extern ickthread*ickmt_prev; /* previous thread: an optimisation to make thread switching O(1), not O(n), with respect to the number of threads */ extern int weaving; /* whether to weave newly created threads */ #define NEXTTHREAD if(ick_printflow) fprintf(stderr,"[%d:%lx]",ick_lineno, \ (unsigned long)ickmt_cur); \ if(setjmp(ick_cjb) == 0) \ nextthread(ick_cjb, ick_lineno, 3); extern void nextthread(jmp_buf pc, int errlineno, int flags); extern void killthread(void); extern void ickmtinit(void); extern int multicome1(int errlineno, jmp_buf pc); extern void choicepoint(void); extern void choiceahead(void); extern void choiceback(void); /* from ick-wrap.c, declare as extern so they can be accessed by cesspool.c, unravel.c */ extern int onespotcount; extern int twospotcount; extern int tailcount; extern int hybridcount; extern int ick_oldabstain; extern int gonebackto; extern int ick_ccfc; extern long ick_skipto; extern jmp_buf btjb; extern jmp_buf ick_cjb; #define MULTICOME multicome1 #else #define MULTICOME ick_multicome0 #endif /* MULTITHREAD */ /* AIS: Used by the debugger, multithread code, external calls */ #if (MULTITHREAD != 0) || (YUKDEBUG != 0) || defined(ICK_EC) extern ick_type16* ick_onespots; extern bool* ick_oneforget; extern ick_type32* ick_twospots; extern bool* ick_twoforget; extern ick_array* ick_tails; extern bool* ick_tailforget; extern ick_array* ick_hybrids; extern bool* ick_hyforget; #if (MULTITHREAD != 0) || defined(ICK_EC) /*@null@*/ extern ick_overop* ick_oo_onespots; /*@null@*/ extern ick_overop* ick_oo_twospots; #endif #endif /* abcess.h ends here */ intercal-0.30/src/PaxHeaders.27456/ick_ec.c0000644000000000000000000000007411437550756015173 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.534945844 intercal-0.30/src/ick_ec.c0000644000175000017500000002541711437550756015077 0ustar00esresr00000000000000/***************************************************************************** NAME ick_ec.c -- external call support between C and C-INTERCAL LICENSE TERMS Copyright (C) 2008 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ***************************************************************************/ /* Implement the INTERCAL flow control operators in C, except for ABSTAIN and REINSTATE. Worryingly, this is freestanding-legal and needs no C headers other than setjmp.h and stdint.h. (The printfs are just for +printflow debug output and don't effect the code flow.) */ #define ICK_EC 1 #include "ick_lose.h" #include "config.h" #include "abcess.h" /* must come before ick_ec.h */ #include "ick_ec.h" #include /* Checkmode values, for reference: * 0: not using checkmode * 1: looking for a COME FROM or NEXT FROM, or COME FROM found * 2: looking for a label to NEXT to or goto * 3: NEXT FROM found * 4: no suitable target found * 5: do a resume(1) if this reaches ick_allecfuncs * 6: starting up, run your init code */ int ick_global_checkmode = 0; /* ick_global_linelabel's marked as volatile to avoid problems with optimisation of assignments to it near setjmps. */ unsigned long ick_global_linelabel; static int ick_forgetamount = 0; unsigned long ick_global_goto; void* ick_global_createdata; extern ick_overop* ick_oo_twospots; /* Do a CREATEd operator check and call. */ /*@maynotreturn@*/ uint32_t ick_dounop(char* unopstr, uint32_t arg1, uint32_t arg2, int emitlineno, unsigned long vi1, unsigned long vi2, unsigned long vi3, ick_type32 (*og1)(ick_type32), ick_type32 (*og2)(ick_type32), ick_type32 (*og3)(ick_type32), void (*os1)(ick_type32, void(*)()), void (*os2)(ick_type32, void(*)()), void (*os3)(ick_type32, void(*)()), /*@observer@*/ const char* errstr) { int st; uint32_t rv; st = ick_jicmatch(unopstr); if(st) { ick_createdata icd[3]; icd[0].width=16; icd[1].width=16; icd[2].width=16; icd[0].isarray=0; icd[1].isarray=0; icd[2].isarray=0; icd[0].varnumber=1601; icd[1].varnumber=1602; icd[2].varnumber=1603; icd[0].accessors.get=og1;icd[1].accessors.get=og2;icd[2].accessors.get=og3; icd[0].accessors.set=os1;icd[1].accessors.set=os2;icd[2].accessors.set=os3; icd[0].value=arg1; icd[1].value=arg2; icd[2].value=0; ick_stash(ick_TWOSPOT, vi1, ick_twospots+vi1, ick_oo_twospots); ick_stash(ick_TWOSPOT, vi2, ick_twospots+vi2, ick_oo_twospots); ick_stash(ick_TWOSPOT, vi3, ick_twospots+vi3, ick_oo_twospots); ick_oo_twospots[vi1]=icd[0].accessors; ick_oo_twospots[vi2]=icd[1].accessors; ick_oo_twospots[vi3]=icd[2].accessors; ick_global_createdata=icd; ick_dogoto(st, emitlineno, 1); rv = og3(ick_twospots[vi3]); ick_retrieve(ick_twospots+vi1, ick_TWOSPOT, vi1, ick_twoforget[vi1], ick_oo_twospots); ick_retrieve(ick_twospots+vi2, ick_TWOSPOT, vi2, ick_twoforget[vi2], ick_oo_twospots); ick_retrieve(ick_twospots+vi3, ick_TWOSPOT, vi3, ick_twoforget[vi3], ick_oo_twospots); } else ick_lose(IE000, emitlineno, errstr); return rv; } /* Do a NEXT or goto. Gotos don't work with an empty NEXT stack, but that's trivial to correct by doing a NEXT at the start of the program. */ /*@maynotreturn@*/ void ick_dogoto(unsigned long linelabel, int emitlineno, int isnext) { /* OK, so auto is never necessary, but the point here is that this is being stored on the stack deliberately so that it can be recalled if this procedure is longjmped to. */ auto volatile int nextlevel = ick_nextindex; if(ick_printflow&&linelabel<=65535&&isnext) fprintf(stderr,"[next:%lu]",linelabel); ick_global_checkmode = 2; /* look for linelabels */ ick_global_linelabel = linelabel; /* If there was a FORGET earlier, implement it now, by removing the relevant NEXT stack entries. Unfortunately, we can't remove them from the main C stack if we care about the return address of this NEXT. If this is a GOTO rather than a NEXT, it's safe to go back to the top NEXT on the NEXT stack and redo it with a different target (because the return address will still be correct), and all FORGETs work using an implied GOTO. (COME FROMs work by telling the suckpoint to GOTO them.) */ if(!isnext) { if(ick_printflow&&ick_forgetamount) fprintf(stderr,"[forget:%d]",ick_forgetamount); else if(ick_printflow&&linelabel<=65535) fprintf(stderr,"[goto:%lu]",linelabel); nextlevel = ick_nextindex -= ick_forgetamount + 1; ick_forgetamount = 0; if(ick_nextindex < 0) ick_nextindex = 0; longjmp(ick_next_jmpbufs[ick_nextindex],2); } else if(ick_nextindex==81) ick_lose(IE123, emitlineno, (const char*)NULL); /* longjmp return codes: 1 = resume, 2 = redo to a different target */ if(setjmp(ick_next_jmpbufs[ick_nextindex])==1) { /* Returning from the next. Clean up the next stack, just in case the callee didn't. */ ick_nextindex = nextlevel; ick_global_checkmode=0; return; } ick_nextindex = nextlevel; /* in case we were longjmped to */ ++ick_nextindex; ick_allecfuncs(); /* If the checkmode is 4, we didn't find a target. */ if(ick_global_checkmode == 4) ick_lose(IE129, emitlineno, (const char*) NULL); /* Otherwise, the function called return(). */ ick_doresume(1,emitlineno); } /* Schedule a FORGET. The actual FORGET is performed at the next GOTO, which should happen immediately. */ void ick_scheduleforget(unsigned short amount) { ick_forgetamount += amount; if(ick_forgetamount >= ick_nextindex) ick_forgetamount = ick_nextindex-1; } /* Resume to a previous NEXT stack entry. */ /*@noreturn@*/ void ick_doresume(unsigned short amount, int emitlineno) { if(ick_printflow) fprintf(stderr,"[resume:%hu]",amount); if(ick_forgetamount) ick_lose(IE778, emitlineno, (const char *)NULL); if(!amount) ick_lose(IE621, emitlineno, (const char *)NULL); ick_nextindex -= amount; if(ick_nextindex < 1) /* the very first NEXT can't be RESUMEd to */ ick_lose(IE632, emitlineno, (const char *)NULL); longjmp(ick_next_jmpbufs[ick_nextindex],1); } /* Run any ick_startup blocks. */ void ick_runstartups(void) { ick_global_checkmode = 6; ick_allecfuncs(); ick_global_checkmode = 0; } /* Check to see if anything tries to steal control from a suckpoint. * This allows line labels > 65535, but bear in mind that such high * line labels cannot be COME FROM or NEXTed FROM or to by the user. * ('High' line labels are used by the implementation to implement * this function, but only as goto targets.) */ /*@maynotreturn@*/ void ick_checksuckpoint(unsigned long linelabel) { /* Check to see if any suckpoints aim here; if not, return. */ ick_global_checkmode=1; ick_global_goto=0; ick_global_linelabel=linelabel; ick_allecfuncs(); if(!ick_global_goto) {ick_global_checkmode=0; return;} /* If this was a COME FROM, goto it. */ if(ick_global_checkmode == 1) { if(ick_printflow) fprintf(stderr,"[comefrom:%lu]",ick_global_linelabel); ick_dogoto(ick_global_goto,-1,0); /* GOTO */ } else if(ick_global_checkmode == 3) { if(ick_printflow) fprintf(stderr,"[nextfrom:%lu]",ick_global_linelabel); ick_dogoto(ick_global_goto,-1,1); /* NEXT */ return; /* we were RESUMEd to */ } /* This line should be unreachable. */ ick_lose(IE778, -1, (const char *)NULL); } uint16_t ick_getonespot(unsigned short extername) { int i=-1; while(++i,1) { if(ick_ec_vars[i].ick_ec_vartype==ICK_EC_VARS_END) break; if(ick_ec_vars[i].ick_ec_vartype==ick_ONESPOT) if(ick_ec_vars[i].ick_ec_extername==extername) return ick_onespots[ick_ec_vars[i].ick_ec_intername]; } ick_lose(IE200,-1,(const char*)NULL); } void ick_setonespot(unsigned short extername, uint16_t value) { int i=-1; while(++i,1) { if(ick_ec_vars[i].ick_ec_vartype==ICK_EC_VARS_END) break; if(ick_ec_vars[i].ick_ec_vartype==ick_ONESPOT) if(ick_ec_vars[i].ick_ec_extername==extername) { if(ick_oneforget[ick_ec_vars[i].ick_ec_intername]) return; ick_onespots[ick_ec_vars[i].ick_ec_intername]=value; return; } } ick_lose(IE200,-1,(const char*)NULL); } uint32_t ick_gettwospot(unsigned short extername) { int i=-1; while(++i,1) { if(ick_ec_vars[i].ick_ec_vartype==ICK_EC_VARS_END) break; if(ick_ec_vars[i].ick_ec_vartype==ick_TWOSPOT) if(ick_ec_vars[i].ick_ec_extername==extername) return ick_twospots[ick_ec_vars[i].ick_ec_intername]; } ick_lose(IE200,-1,(const char*)NULL); } void ick_settwospot(unsigned short extername, uint32_t value) { int i=-1; while(++i,1) { if(ick_ec_vars[i].ick_ec_vartype==ICK_EC_VARS_END) break; if(ick_ec_vars[i].ick_ec_vartype==ick_TWOSPOT) if(ick_ec_vars[i].ick_ec_extername==extername) { if(ick_twoforget[ick_ec_vars[i].ick_ec_intername]) return; ick_twospots[ick_ec_vars[i].ick_ec_intername]=value; return; } } ick_lose(IE200,-1,(const char*)NULL); } /* Register a CREATE target. This is just a wrapper for ick_registercreation that gets around scoping problems. */ void ick_create(const char* sig, unsigned long target) { ick_registercreation(sig, target); } /* Accessor and mutator functions for CREATE data */ int ick_c_i_width(int argpos) { return ((ick_createdata*)ick_global_createdata)[argpos].width; } int ick_c_i_isarray(int argpos) { return ((ick_createdata*)ick_global_createdata)[argpos].isarray; } unsigned short ick_c_i_varnumber(int argpos) { return ((ick_createdata*)ick_global_createdata)[argpos].varnumber; } uint32_t ick_c_i_value(int argpos) { return (uint32_t)(((ick_createdata*)ick_global_createdata)[argpos].value); } uint32_t ick_c_i_getvalue(int argpos) { if(!(((ick_createdata*)ick_global_createdata)[argpos].accessors.get)) return ick_c_i_value(argpos); return ((ick_createdata*)ick_global_createdata)[argpos].accessors. get(ick_c_i_value(argpos)); } void ick_c_i_setvalue(int argpos, uint32_t newval) { if(((ick_createdata*)ick_global_createdata)[argpos].accessors.set) ((ick_createdata*)ick_global_createdata)[argpos].accessors. set(newval,NULL); } intercal-0.30/src/PaxHeaders.27456/uncommon.h0000644000000000000000000000007411437551705015611 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.614945617 intercal-0.30/src/uncommon.h0000644000175000017500000000163611437551705015512 0ustar00esresr00000000000000/* uncommon.h -- declarations for uncommon.c and C files linked to it */ #include "config.h" #include "ick_bool.h" /*@null@*/ /*@dependent@*/ extern FILE* ick_debfopen(/*@observer@*/ const char*, /*@observer@*/ const char*); /*@null@*/ /*@dependent@*/ extern FILE* ick_findandfopen(/*@observer@*/ const char*, /*@observer@*/ const char*, /*@observer@*/ const char*, /*@observer@*/ const char*); /*@observer@*/ /*@null@*/ extern const char* ick_findandtestopen(/*@observer@*/ const char*, /*@observer@*/ const char*, /*@observer@*/ const char*, /*@observer@*/ const char*); /*@null@*/ /*@dependent@*/ extern FILE* ick_findandfreopen(/*@observer@*/ const char*, /*@observer@*/ const char*, /*@observer@*/ const char*, /*@observer@*/ const char*, FILE*); extern int ick_snprintf_or_die(/*@out@*/ char *str, size_t size, /*@observer@*/ const char *format, ...) #ifdef __GNUC__ __attribute__ ((format(printf, 3, 4))) #endif ; intercal-0.30/src/PaxHeaders.27456/latin1.bin0000644000000000000000000000007411437550756015474 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.494945956 intercal-0.30/src/latin1.bin0000644000175000017500000000041711437550756015371 0ustar00esresr00000000000000256 1 hgfedcba   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿintercal-0.30/src/PaxHeaders.27456/oil.y0000644000000000000000000000007411441323356014554 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.550945797 intercal-0.30/src/oil.y0000644000175000017500000006167411441323356014465 0ustar00esresr00000000000000/***************************************************************************** NAME oil.y -- compiler for Optimizer Idiom Language files LICENSE TERMS Copyright (C) 2007 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ***************************************************************************/ %{ #include "config.h" #include #include #include #include #include "ick_bool.h" /* Define strdup if it isn't available */ #ifndef HAVE_STRDUP char* strdup(const char* s) { char* t=malloc(strlen(s)+1); if(t) strcpy(t,s); return t; } #endif /* #define YYDEBUG 1 int yydebug=1; */ /* Each semantic value represents either a constraint on a node that needs to be true for the optimization template to match, or part of the replacement for the optimization template. */ struct ickstype { unsigned depth; /* The number of child nodes this is from the root */ unsigned long path; /* Bits from the end of this number represent the sequence of lvals (=0) or rvals (=1) this is from the root; depth bits from the end are relevant, and the bit nearest the root is least significant */ const char* condition; /* Points to a constant string; the condition to generate on that node. Could also point to something the lexer mallocs, but then the lexer has to keep track of being able to free it again. If this is NULL, it means that there isn't a condition other than maybe mustbemesh */ const char* nodetypename; /* The name of the type of node this condition matches, or NULL for a LEXERLEAF */ bool usec; /* Whether to append the value of c to the condition */ bool mustbemesh; /* Must this node be a mesh or mesh32? */ bool cxneeded; /* True means calculate c and x for the node and the condition is on those; false means append 'condition' to the node itself to form the condition and c and x aren't needed */ bool width32; /* Generate a 32-bit node? */ bool ublo; /* Is this a UBLO (if set, generate conditions to check width)? */ unsigned long c; /* The value to append to the condition */ int replnum; /* Number of this group for replacements */ struct ickstype *n1;/* n1 and n2 are pointers to other conditions that */ struct ickstype *n2;/* also have to be satisified */ }; #define YYSTYPE YYSTYPE #define MAXOPTNAMELEN 64 char optname[MAXOPTNAMELEN]="undefined"; int optnumber = 0; typedef struct ickstype *YYSTYPE; void splitend(void); void splitstart(void); void treedepthup(YYSTYPE, bool); void treefree(YYSTYPE); void gennodepath(unsigned, unsigned long); bool treeshapecond(YYSTYPE, bool); YYSTYPE treenscheck(YYSTYPE, YYSTYPE, int); void treecxcond(YYSTYPE); void treerepcount(YYSTYPE, int*); void treerepgen(YYSTYPE, YYSTYPE*, int*); int countgetchar(void); int countungetc(int, FILE*); int cgccol; int cgcrow; /* #defines for chaining together template expressions; here, s is the type of expression (e.g. select, bitwise and, unary and) that's chaining the expressions together and n is the nonterminal that's the rval */ #define BINARYEXPR(s,m,l,r,w) do{ \ m=malloc(sizeof(struct ickstype)); \ m->n1=l; \ m->n2=r; \ m->usec=0; \ m->condition="->opcode==" s; \ m->nodetypename=s; \ m->mustbemesh=0; \ m->cxneeded=0; \ m->depth=0; \ m->path=0; \ m->replnum=0; \ m->width32=w; \ m->ublo=0; \ treedepthup(m->n1,0); \ treedepthup(m->n2,1); \ } while(0) #define UNARYEXPR(s,m,r,w,u) do{ \ m=malloc(sizeof(struct ickstype)); \ m->n1=0; \ m->n2=r; \ m->usec=0; \ m->condition="->opcode==" s; \ m->nodetypename=s; \ m->mustbemesh=0; \ m->cxneeded=0; \ m->depth=0; \ m->path=0; \ m->replnum=0; \ m->width32=w; \ m->ublo=u; \ treedepthup(m->n2,1); \ } while(0) /* Error handling and lexing */ int yylex(void); int yyerror(char const *); /* Split the output file */ #define SPLITMAX 20 int splitcount=SPLITMAX; int filenumber=0; bool inloop=0; %} /* Various conditions can come out from the lexer. The most common is a char, which represents that C or INTERCAL operation in a template. Non-character tokens are used for the various possible leaves in a template, though: .1 A 16-bit expression (number 1, for replacements) :1 A 32-bit expression (number 1, for replacements) _1 An expression of any width (again, number 1 for replacements) #1 A constant with the value 1 #{x==1}3 A constant which equals 1 (number 3, for replacements) Note that in the last example, the expression is written strictly in C; for instance, #{ick_iselect(x,x)==1}4 would select a constant that's a power of 2 (ick_iselect is the C name for the INTERCAL operation 'select'). .{c&0xfffffffe==0}5 A 16-bit expression (number 5, for replacements) which has been analysed to not possibly have any bits other than the least significant set (c is here the list of all potentially set bits) All of these come out as correctly set LEXERLEAFs. Expressions with identical numbers must be node-for-node identical, except for number 0 (which is like _ in Prolog, it means 'can be anything and disregard the value). This holds true even if they have different sigils. Expressions can use each other's c and x values with the notation c5, x4, and so on; replacement numbers are limited to 1 digit. The other things that can come out from the lexer are sparks, ears, and parentheses (any mix, we're not fussy). */ %token LEXERLEAF %% input: /**/ | input optimization ; optimization: template '-' '>' replacement { static YYSTYPE tempmem[10]; static int replcount[10]; /* Handle splitting the file. */ if(splitcount) splitcount--; if(!splitcount && !inloop) { splitcount=SPLITMAX; splitend(); ++filenumber; splitstart(); } /* This is where we actually generate the optimizer code. */ /* Tree-shape and is-constant conditions */ printf(" checknodeactbits(np);\n"); if(treeshapecond($1,1)) printf(" if(1"); printf(")\n do\n {\n"); /* Nodesame and cxdata conditions */ { int i=10; YYSTYPE temp; while(--i) { temp=treenscheck($1,0,i); if(temp) { printf(" x%d=np",i); gennodepath(temp->depth,temp->path); printf("->constant; c%d=np",i); gennodepath(temp->depth,temp->path); printf("->optdata;\n"); } tempmem[i]=temp; replcount[i]=0; /* we need to zero this somewhere, may as well be here */ } treecxcond($1); } /* If we reach this point in the generated code, we have an optimizer template match. */ printf(" OPTING(%s_%d);\n",optname,++optnumber); /* We now need to replace np with its replacement. This is done by creating a new nodetree, copying across tempmem'd nodes where necessary, and then substituting one for the other. (This is an inefficient but general way to do this.) One special case is needed; because pointers into the root node need to continue pointing there, the temporary node tp is copied member-for-member and then freed again. The root width can change (this is a deviation from previous code), in order to prevent a bug where the new root happens to be a unary. (This means we can get a 16-bit unary applied to 32-bit data; but the optimiser is meant to ensure that this is not problematic.) */ printf(" tp=newnode();\n"); treerepcount($4,replcount); treerepgen($4,tempmem,replcount); printf(" nodefree(np->lval); nodefree(np->rval);\n"); printf(" *np=*tp; free(tp);\n"); printf(" } while(0);\n\n"); /* Free the template and replacement now they're finished being used. */ treefree($1); treefree($4); } | '<' LEXERLEAF '-' LEXERLEAF { if(!$2->mustbemesh||!$4->mustbemesh) { yyerror("syntax error in <#..#()->()> construct"); free($2); free($4); YYERROR; } printf(" r=%luLU; while(r<=%luLU) {\n",$2->c,$4->c); free($2); free($4); inloop=1; } | '>' {printf(" r++;\n }\n"); inloop=0;}; template: expr3 ; expr3: '(' expr2 ')' {$$=$2;} | '"' expr2 '"' {$$=$2;} | '\'' expr2 '\'' {$$=$2;} expr: expr3 | LEXERLEAF ; expr2: expr '$' expr {BINARYEXPR("MINGLE",$$,$1,$3,1);} | expr '~' expr {BINARYEXPR("SELECT",$$,$1,$3,1);} | expr '~' '1' '6' expr {BINARYEXPR("SELECT",$$,$1,$5,0);} | expr '~' '3' '2' expr {BINARYEXPR("SELECT",$$,$1,$5,1);} | '&' '1' '6' expr {UNARYEXPR("AND",$$,$4,0,1);} | '&' '3' '2' expr {UNARYEXPR("AND",$$,$4,1,1);} | 'V' '1' '6' expr {UNARYEXPR("OR",$$,$4,0,1);} | 'V' '3' '2' expr {UNARYEXPR("OR",$$,$4,1,1);} | '?' '1' '6' expr {UNARYEXPR("XOR",$$,$4,0,1);} | '?' '3' '2' expr {UNARYEXPR("XOR",$$,$4,1,1);} | '^' '1' '6' expr {UNARYEXPR("FIN",$$,$4,0,1);} | '^' '3' '2' expr {UNARYEXPR("FIN",$$,$4,1,1);} | '@' '1' '6' expr {UNARYEXPR("WHIRL",$$,$4,0,1);} | '@' '2' '1' '6' expr {UNARYEXPR("WHIRL2",$$,$5,0,1);} | '@' '3' '1' '6' expr {UNARYEXPR("WHIRL3",$$,$5,0,1);} | '@' '4' '1' '6' expr {UNARYEXPR("WHIRL4",$$,$5,0,1);} | '@' '5' '1' '6' expr {UNARYEXPR("WHIRL5",$$,$5,0,1);} | '@' '3' '2' expr {UNARYEXPR("WHIRL",$$,$4,1,1);} | '@' '2' '3' '2' expr {UNARYEXPR("WHIRL2",$$,$5,1,1);} | '@' '3' '3' '2' expr {UNARYEXPR("WHIRL3",$$,$5,1,1);} | '@' '4' '3' '2' expr {UNARYEXPR("WHIRL4",$$,$5,1,1);} | '@' '5' '3' '2' expr {UNARYEXPR("WHIRL5",$$,$5,1,1);} | expr '&' expr {BINARYEXPR("C_AND",$$,$1,$3,1);} | expr '&' '1' '6' expr {BINARYEXPR("C_AND",$$,$1,$5,0);} | expr '&' '3' '2' expr {BINARYEXPR("C_AND",$$,$1,$5,1);} | expr '|' expr {BINARYEXPR("C_OR",$$,$1,$3,1);} | expr '|' '1' '6' expr {BINARYEXPR("C_OR",$$,$1,$5,0);} | expr '|' '3' '2' expr {BINARYEXPR("C_OR",$$,$1,$5,1);} | expr '^' expr {BINARYEXPR("C_XOR",$$,$1,$3,1);} | expr '^' '1' '6' expr {BINARYEXPR("C_XOR",$$,$1,$5,0);} | expr '^' '3' '2' expr {BINARYEXPR("C_XOR",$$,$1,$5,1);} | expr '+' expr {BINARYEXPR("C_PLUS",$$,$1,$3,1);} | expr '+' '1' '6' expr {BINARYEXPR("C_PLUS",$$,$1,$5,0);} | expr '+' '3' '2' expr {BINARYEXPR("C_PLUS",$$,$1,$5,1);} | expr '-' expr {BINARYEXPR("C_MINUS",$$,$1,$3,1);} | expr '-' '1' '6' expr {BINARYEXPR("C_MINUS",$$,$1,$5,0);} | expr '-' '3' '2' expr {BINARYEXPR("C_MINUS",$$,$1,$5,1);} | expr '*' expr {BINARYEXPR("C_TIMES",$$,$1,$3,1);} | expr '*' '1' '6' expr {BINARYEXPR("C_TIMES",$$,$1,$5,0);} | expr '*' '3' '2' expr {BINARYEXPR("C_TIMES",$$,$1,$5,1);} | expr '/' expr {BINARYEXPR("C_DIVIDEBY",$$,$1,$3,1);} | expr '/' '1' '6' expr {BINARYEXPR("C_DIVIDEBY",$$,$1,$5,0);} | expr '/' '3' '2' expr {BINARYEXPR("C_DIVIDEBY",$$,$1,$5,1);} | expr '%' expr {BINARYEXPR("C_MODULUS",$$,$1,$3,1);} | expr '%' '1' '6' expr {BINARYEXPR("C_MODULUS",$$,$1,$5,0);} | expr '%' '3' '2' expr {BINARYEXPR("C_MODULUS",$$,$1,$5,1);} | expr '>' expr {BINARYEXPR("C_GREATER",$$,$1,$3,1);} | expr '>' '1' '6' expr {BINARYEXPR("C_GREATER",$$,$1,$5,0);} | expr '>' '3' '2' expr {BINARYEXPR("C_GREATER",$$,$1,$5,1);} | expr '<' expr {BINARYEXPR("C_LESS",$$,$1,$3,1);} | expr '<' '1' '6' expr {BINARYEXPR("C_LESS",$$,$1,$5,0);} | expr '<' '3' '2' expr {BINARYEXPR("C_LESS",$$,$1,$5,1);} | '~' '1' '6' expr {UNARYEXPR("C_NOT",$$,$4,0,1);} | '~' '3' '2' expr {UNARYEXPR("C_NOT",$$,$4,1,1);} | expr '!' '=' expr {BINARYEXPR("C_NOTEQUAL",$$,$1,$4,0);} | expr '!' '=' '1' '6' expr {BINARYEXPR("C_NOTEQUAL",$$,$1,$6,0);} | expr '!' '=' '3' '2' expr {BINARYEXPR("C_NOTEQUAL",$$,$1,$6,1);} | expr '=' '=' expr {BINARYEXPR("C_ISEQUAL",$$,$1,$4,0);} | expr '=' '=' '1' '6' expr {BINARYEXPR("C_ISEQUAL",$$,$1,$6,0);} | expr '=' '=' '3' '2' expr {BINARYEXPR("C_ISEQUAL",$$,$1,$6,1);} | expr '&' '&' expr {BINARYEXPR("C_LOGICALAND",$$,$1,$4,0);} | expr '&' '&' '1' '6' expr {BINARYEXPR("C_LOGICALAND",$$,$1,$6,0);} | expr '&' '&' '3' '2' expr {BINARYEXPR("C_LOGICALAND",$$,$1,$6,1);} | expr '|' '|' expr {BINARYEXPR("C_LOGICALOR",$$,$1,$4,0);} | expr '|' '|' '1' '6' expr {BINARYEXPR("C_LOGICALOR",$$,$1,$6,0);} | expr '|' '|' '3' '2' expr {BINARYEXPR("C_LOGICALOR",$$,$1,$6,1);} | expr '>' '>' expr {BINARYEXPR("C_RSHIFTBY",$$,$1,$4,1);} | expr '>' '>' '1' '6' expr {BINARYEXPR("C_RSHIFTBY",$$,$1,$6,0);} | expr '>' '>' '3' '2' expr {BINARYEXPR("C_RSHIFTBY",$$,$1,$6,1);} | expr '<' '<' expr {BINARYEXPR("C_LSHIFTBY",$$,$1,$4,1);} | expr '<' '<' '1' '6' expr {BINARYEXPR("C_LSHIFTBY",$$,$1,$6,0);} | expr '<' '<' '3' '2' expr {BINARYEXPR("C_LSHIFTBY",$$,$1,$6,1);} | '!' expr {UNARYEXPR("C_LOGICALNOT",$$,$2,0,0);} | '!' '1' '6' expr {UNARYEXPR("C_LOGICALNOT",$$,$4,0,0);} | '!' '3' '2' expr {UNARYEXPR("C_LOGICALNOT",$$,$4,1,0);} | expr ; replacement: expr3; %% #define MAXTOFREE 1000 char* tofree[MAXTOFREE]={0}; int tfi=0; int yylex(void) { int c; unsigned long acc; /* Whitespace is completely insignificant here, even inside && and other two-character operators. Just to be different, though, it /is/ significant inside constructs like .1 and #{1}2; in such cases, it isn't allowed. */ c=countgetchar(); while(isspace(c)) c=countgetchar(); while(c==';'||c=='[') { /* Comments go from a semicolon/hybrid to the end of the line. */ if(c==';') { c=countgetchar(); while(c!='\n') c=countgetchar(); while(isspace(c)) c=countgetchar(); } /* Square brackets set the name for optimizations. */ if(c=='[') { int i=0; c=countgetchar(); while(c!=']') { optname[i++]=c; c=countgetchar(); if(i==MAXOPTNAMELEN-1) {i=0; yyerror("optimization name too long");} } optnumber=0; optname[i]=0; c=countgetchar(); while(isspace(c)) c=countgetchar(); } } if(c==EOF) return 0; switch(c) { case '#': c=countgetchar(); if(c!='{') { acc=0; while(isdigit(c)) { acc*=10; acc+=(c-'0'); c=countgetchar(); } yylval=malloc(sizeof(struct ickstype)); yylval->depth=0; yylval->path=0; yylval->condition="->constant=="; yylval->nodetypename=0; yylval->usec=1; yylval->mustbemesh=1; yylval->cxneeded=0; yylval->c=acc; yylval->replnum=0; yylval->n1=0; yylval->n2=0; yylval->ublo=0; yylval->width32=1; /* generate MESH32 not MESH; we can still AND16 it, etc., if necessary */ countungetc(c, stdin); return LEXERLEAF; } countungetc(c, stdin); c='#'; /* fall through */ case '_': case ':': case '.': yylval=malloc(sizeof(struct ickstype)); yylval->depth=0; yylval->path=0; yylval->condition=0; /* _ or # */ yylval->width32=1; /* should never matter, but you never know... */ yylval->ublo=0; if(c==':') yylval->condition="->width==32"; if(c=='.') {yylval->condition="->width==16"; yylval->width32=0;} yylval->nodetypename=0; yylval->usec=0; yylval->mustbemesh=c=='#'; yylval->cxneeded=0; c=countgetchar(); if(c=='{') { /* Create a new node to hold the c/x condition */ yylval->n1=malloc(sizeof(struct ickstype)); yylval->n1->depth=0; yylval->n1->path=0; { static char buf[512]; int bi=0; c=countgetchar(); while(c!='}') { buf[bi++]=c; if(bi==511) {yyerror("{quoted} string too long"); bi=0;} c=countgetchar(); } buf[bi]=0; yylval->n1->condition=tofree[tfi++]=strdup(buf); if(tfi==MAXTOFREE) {yyerror("Too many {quoted} strings"); tfi--;} c=countgetchar(); } yylval->n1->nodetypename=0; yylval->n1->usec=0; yylval->n1->mustbemesh=0; yylval->n1->cxneeded=1; yylval->n1->n1=0; yylval->n1->n2=0; yylval->n1->width32=yylval->width32; yylval->n1->ublo=0; } else yylval->n1=0; yylval->replnum=0; if(yylval->n1) yylval->n1->replnum=c-'0'; else yylval->replnum=c-'0'; yylval->n2=0; return LEXERLEAF; default: return c; } } void treedepthup(YYSTYPE v, bool i) { if(!v) return; treedepthup(v->n1,i); treedepthup(v->n2,i); v->depth++; v->path<<=1; v->path|=i; if(v->depth>30) yyerror("Nesting too deep in template or replacement\n"); } void treefree(YYSTYPE v) { if(!v) return; treefree(v->n1); treefree(v->n2); free(v); } void gennodepath(unsigned depth, unsigned long path) { while(depth--) { if(path&1) printf("->rval"); else printf("->lval"); path>>=1; } } bool treeshapecond(YYSTYPE v, bool firstopt) { if(!v) return firstopt; /* To prevent possibly dereferencing a null pointer, check the root ick_first */ if(v->mustbemesh) /* it's a must-be-constant constraint */ { printf(firstopt?" if((np":" &&\n (np"); gennodepath(v->depth,v->path); printf("->opcode==MESH || np"); gennodepath(v->depth,v->path); printf("->opcode==MESH32)"); firstopt=0; } if(v->condition&&!v->cxneeded) /* it's a tree-shape constraint */ { printf(firstopt?" if(np":" &&\n np"); gennodepath(v->depth,v->path); printf("%s",v->condition); if(v->usec) printf("%luLU",v->c); firstopt=0; } if(v->ublo) /* generate a width check */ { printf(firstopt?" if(np":" &&\n np"); gennodepath(v->depth,v->path); printf("->width==%d",v->width32?32:16); firstopt=0; } firstopt=treeshapecond(v->n1,firstopt); return treeshapecond(v->n2,firstopt); } YYSTYPE treenscheck(YYSTYPE v, YYSTYPE prev, int replnum) { if(!v) return prev; prev=treenscheck(v->n1,prev,replnum); prev=treenscheck(v->n2,prev,replnum); if(v->replnum!=replnum) return prev; if(prev) { printf(" if(!nodessame(np"); gennodepath(prev->depth,prev->path); printf(",np"); gennodepath(v->depth,v->path); printf(")) break;\n"); } return v; } void treecxcond(YYSTYPE v) { if(!v) return; if(v->cxneeded&&strcmp(v->condition,"1")) { if(v->replnum) printf(" x=x%d; c=c%d; ",v->replnum,v->replnum); else { printf(" x=np"); gennodepath(v->depth,v->path); printf("->constant;\n c=np"); gennodepath(v->depth,v->path); printf("->optdata;\n "); } printf("if(!(%s)) break;\n",v->condition); } treecxcond(v->n1); treecxcond(v->n2); } void treerepcount(YYSTYPE v, int* rc) { if(!v) return; if(!(v->nodetypename)&&v->replnum&&!(v->cxneeded)) rc[v->replnum]++; treerepcount(v->n1, rc); treerepcount(v->n2, rc); } void treerepgen(YYSTYPE v, YYSTYPE* refs, int* rc) { if(!v) return; /* We absolutely have to generate the root node ick_first here, because otherwise the nodes in question won't exist. */ if(v->nodetypename) /* Generate an intermediate node */ { printf(" MAYBENEWNODE(tp"); gennodepath(v->depth,v->path); printf(");\n tp"); gennodepath(v->depth,v->path); printf("->opcode=%s;\n tp",v->nodetypename); gennodepath(v->depth,v->path); printf("->width=%d;\n",v->width32?32:16); /* optdata will be filled in by checknodeactbits before the ick_next idiom is tested; constant is irrelevant, lval and rval are NULL at present and will be filled in by later recursions of this function, and I seriously hope that nextslat is never filled in by an optimizer idiom. */ } else if(v->replnum&&!(v->cxneeded)) { /* Copy a node from the template. The node ought not to be allocated at this point, so we can safely just ick_assign to it with a new malloced node. */ if(refs[v->replnum]) { if(rc[v->replnum]>1||!refs[v->replnum]->depth) { /* The node actually has to be copied, either because another copy is needed or because it's np itself that's being copied over. */ rc[v->replnum]--; printf(" tp"); gennodepath(v->depth,v->path); printf("=nodecopy(np"); gennodepath(refs[v->replnum]->depth,refs[v->replnum]->path); printf(");\n"); } else { /* This can be optimized slightly by moving rather than copying, zeroing backlinks so that the node won't be freed. */ rc[v->replnum]--; printf(" tp"); gennodepath(v->depth,v->path); printf("=np"); gennodepath(refs[v->replnum]->depth,refs[v->replnum]->path); printf(";\n np"); gennodepath(refs[v->replnum]->depth,refs[v->replnum]->path); printf("=0;\n"); } } else yyerror("Replacement isn't in the template"); } else if(v->cxneeded) { /* Generate a constant node based on an expression (#{expr}0). */ printf(" MAYBENEWNODE(tp"); gennodepath(v->depth,v->path); printf(");\n tp"); gennodepath(v->depth,v->path); printf("->opcode=MESH32;\n tp"); gennodepath(v->depth,v->path); printf("->width=32;\n tp"); gennodepath(v->depth,v->path); printf("->constant=(%s);\n",v->condition); } else if(v->mustbemesh&&!v->n1) { /* Generate a constant node based on a constant (#65535). */ printf(" MAYBENEWNODE(tp"); gennodepath(v->depth,v->path); printf(");\n tp"); gennodepath(v->depth,v->path); printf("->opcode=MESH32;\n tp"); gennodepath(v->depth,v->path); printf("->width=32;\n tp"); gennodepath(v->depth,v->path); printf("->constant=(%luLU);\n",v->c); } else if(v->mustbemesh&&v->n1) /* let this node's n1 handle it */ ; else yyerror("can't figure out how to generate a replacement node\n"); treerepgen(v->n1,refs,rc); treerepgen(v->n2,refs,rc); } int yyerror(char const *s) { fprintf(stderr,"Error at (%d:%d): \"%s\"\n",cgcrow,cgccol,s); return 0; /* this return value is ignored anyway */ } static int cgcpushback=0; int countgetchar(void) { int c=getchar(); if(cgcpushback) {cgcpushback=0; return c;} cgccol++; if(c=='\n') {cgccol=0; cgcrow++;} return c; } int countungetc(int c, FILE* f) { ungetc(c,f); cgcpushback=1; return c; } void splitstart(void) { static char fname[]="oilout00.c"; FILE *dummy; /* GCC 4 un-suppressable warning suck */ if(filenumber>255) { filenumber=255; fprintf(stdout,"Input file too long.\n"); } sprintf(fname,"oilout%02x.c",filenumber); dummy = freopen(fname,"w",stdout); puts("/* Automatically generated output, edit source and recompile to " "change */"); printf("#include \"oil.h\"\n" "int optimize_pass1_%x(node *np)\n" "{" " int opted=0;\n" " unsigned long c,c1,c2,c3,c4,c5,c6,c7,c8,c9;\n" " unsigned long x,x1,x2,x3,x4,x5,x6,x7,x8,x9,r;\n" " int tempw;\n" " node *tp;\n", filenumber); } void splitend(void) { /* Disabling warnings about unused variables. gcc will optimize this right out, and in any case the raise(SIGSEGV) will be unreachable (but will cause a pretty recognizable error because it'll be caught by the handler for SIGSEGV and output an internal error, with an obvious debug backtrace if -U is used). */ printf(" c=c1=c2=c3=c4=c5=c6=c7=c8=c9=0;\n" " x=x1=x2=x3=x4=x5=x6=x7=x8=x9=r=0;\n" " if(c+c1+c2+c3+c4+c5+c6+c7+c8+c9+r+\n" " x+x1+x2+x3+x4+x5+x6+x7+x8+x9) raise(SIGSEGV);\n"); printf(" return opted;\n}\n"); /* do not close stdout; freopen implicitly closes it anyway, and explicitly closing it breaks on DOS */ } int main(void) { int e,i; FILE *dummy; /* GCC 4 un-suppressible warnings suck */ /* " if(!np) return 0;\n" " if(np->lval) opted|=optimize_pass1(np->lval);\n" " if(np->rval) opted|=optimize_pass1(np->rval);\n" */ splitstart(); cgccol=0; cgcrow=1; e=yyparse(); while(tfi--) free(tofree[tfi]); splitend(); dummy = freopen("oilout-m.c","w",stdout); puts("/* Automatically generated output, edit source and recompile to " "change */"); puts("#include \"config.h\""); puts("#include \"ick.h\""); i=filenumber+1; while(i--) printf("extern int optimize_pass1_%x(node*);\n",i); puts("int optimize_pass1(node* np)\n" "{\n" " int opted=0;\n" " if(!np) return 0;\n" " if(np->lval) opted|=optimize_pass1(np->lval);\n" " if(np->rval) opted|=optimize_pass1(np->rval);"); i=filenumber+1; while(i--) printf(" opted|=optimize_pass1_%x(np);\n",i); puts(" return opted;\n" "}"); return e; } intercal-0.30/src/PaxHeaders.27456/pick1.h0000644000000000000000000000007411437550756014772 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.610945634 intercal-0.30/src/pick1.h0000644000175000017500000000631211437550756014667 0ustar00esresr00000000000000/* * pick1.h - Compiler-dependent defines for PIC compilers * * This file allows porting of PIC-INTERCAL output files to different * compilers. Most compilers will require this file to be modified; * as written at the moment, it's ANSI C that invokes undefined * behaviour (in a way that might plausibly produce correct * results). * LICENSE TERMS Copyright (C) 2006 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Place any headers, config fuse selection statements, and device statements your compiler needs here. */ #include /* Define these constants to unsigned data types of the correct bit width. (If your compiler doesn't use 1 bit variables, you could substitute an 8 bit variable, but that would take up extra RAM, which may or may not drive the program over the PIC's RAM limit.) */ #define ICK_INT32 uint32_t #define ICK_INT16 uint16_t #define ICK_INT8 uint8_t #define ICK_INT1 uint1_t /* Define this to an error-handling procedure. You should ignore the arguments, as they won't make too much sense in this context. This should block the program; the SLEEP command is one possibility, somehow getting the PIC to disconnect its own power supply and signal an error is another. */ #define ick_lose(a,b,c) for(;;) /* PORTA, PORTB, TRISA, and TRISB must be variables which, when read or modified, read or modify the corresponding location in the PIC's RAM; these are often at locations 0x05, 0x06, 0x85, and 0x86 respectively. Place the code to do this here, if it isn't added by the header files above. See the section below if your compiler doesn't recognize the volatile keyword, but this code is otherwise correct. */ #define PORTA *(volatile ICK_INT8*)0x05 #define PORTB *(volatile ICK_INT8*)0x06 #define TRISA *(volatile ICK_INT8*)0x85 #define TRISB *(volatile ICK_INT8*)0x86 /* This is a hack for compilers that don't interpret volatile correctly. The uncommented code assumes your compiler knows how to work it correctly; use the replacement below if it doesn't. */ #define seq(a) a /* You may need to use the commented-out code instead if your compiler is confused about volatile. ICK_INT8 seq(ICK_INT8 n) { return n; } */ void pickinit() { /* Place any initialization code that is needed here. */ } /* If your implementation doesn't use function pointers, delete this and don't write any code that uses operator-overloading. */ typedef struct ick_overop_t { ICK_INT32 (*get)(ICK_INT32); void (*set)(ICK_INT32); } ick_overop; #define ick_type16 ICK_INT16 #define ick_type32 ICK_INT32 intercal-0.30/src/PaxHeaders.27456/arrgghh.c0000644000000000000000000000007311437550756015377 xustar0030 atime=1427954558.375140793 29 ctime=1427992235.53094585 intercal-0.30/src/arrgghh.c0000644000175000017500000000701611437550756015277 0ustar00esresr00000000000000/* * SYNOPSIS: ick_parseargs(argc,argv) * FILE : ick_parseargs.c * AUTHOR : Steve Swales * DATE: October 7, 1990 * PURPOSE: Parse arguments for INTERCAL programs. * LICENSE TERMS Copyright (C) 1996 Eric S. Raymond This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include "config.h" #include "abcess.h" #include "ick_lose.h" /*@-redef@*/ /* it's never the case that both are used at once */ int ick_traditional = 0; /*@=redef@*/ int ick_wimp_mode = 0; int ick_instapipe = 0; /* AIS */ int ick_printflow = 0; /* AIS */ int ick_mystery = 0; /* AIS */ unsigned long ick_mysteryc = 0; /* AIS */ void ick_parseargs(int argc, char **argv) { register int i, j; static int helpflag = -1; static const char *flags[] = { "help", "wimpmode", "traditional", "instapipe", /* AIS */ "printflow", /* AIS */ "mystery", /* AIS */ }; static int *bools[] = { &helpflag, &ick_wimp_mode, &ick_traditional, &ick_instapipe, /* AIS */ &ick_printflow, /* AIS */ &ick_mystery, /* AIS */ }; static const int nflags = (int)(sizeof(flags)/sizeof(flags[0])); for(i = 1;i < argc;i++) { if(argv[i][0] != '+' && argv[i][0] != '-') { break; } for(j = 0; j < nflags;j++) { if(0 == strcmp(argv[i]+1,flags[j])) { *(bools[j]) = (argv[i][0] == '+'); break; } } if(j == nflags) { fprintf(stderr,"%s: can't grok %s\n",argv[0],argv[i]); helpflag = 1; } } if(helpflag != -1) { if(!helpflag) { fprintf(stderr, "Once you start messing with INTERCAL... \n"); fprintf(stderr,"\t\tthere is no help for you!\n\n"); } fprintf(stderr,"Current flags (and current state) are:\n"); for(i = 0;i < nflags;i++) { fprintf(stderr,"\t[+/-]%-20.20s\t(%s)\n",flags[i], (*(bools[i]) == 1)?"ON":((*(bools[i]) == 0)?"OFF":"???")); } fprintf(stderr,"All flags must be preceded by either + or -, which\n"); fprintf(stderr," usually will mean turn on or turn off something,\n"); fprintf(stderr," but not always, and not all of them currently\n"); fprintf(stderr," do anything, but you can switch them on or off\n"); fprintf(stderr," if you like anyway. Isn't this helpful?\n\n"); (void) fflush(stderr); ick_lose(IE990, 0, (const char *)NULL); } if(ick_wimp_mode) { fprintf(stderr,"How sad... you have selected to run an INTERCAL\n"); fprintf(stderr,"program in WIMP MODE.\n\n"); fprintf(stderr,"This means that:\n"); fprintf(stderr," A) Rather than the nifty input like:\n"); fprintf(stderr,"\tONE NINER SEVEN TWO OH SIX THREE,\n"); fprintf(stderr," and even niftier output like:\n"); fprintf(stderr,"\t______\n"); fprintf(stderr,"\tMCMLXXMMLXIII,\n"); fprintf(stderr," you will have to settle for plain old number\n"); fprintf(stderr," representations like 1972063; and,\n"); fprintf(stderr," B) You are a WIMP!\n\n"); (void) fflush(stderr); } } intercal-0.30/src/PaxHeaders.27456/perpet.c0000644000000000000000000000013212507155722015241 xustar0030 mtime=1427954642.778848997 30 atime=1427954642.862848705 30 ctime=1427992235.546945805 intercal-0.30/src/perpet.c0000664000175000017500000021142112507155722015144 0ustar00esresr00000000000000/**************************************************************************** NAME perpet.c -- main routine for C-INTERCAL compiler. DESCRIPTION This is where all the dirty work begins and ends. LICENSE TERMS Copyright (C) 1996 Eric S. Raymond This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ****************************************************************************/ /*LINTLIBRARY */ #include "config.h" /* AIS: Generated by autoconf */ #include #include #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #include "ick.h" #include "feh.h" #include "parser.h" #include "sizes.h" #include "ick_lose.h" #include "uncommon.h" /* AIS: split ICKDATADIR from ICKLIBDIR */ #ifndef ICKINCLUDEDIR # define ICKINCLUDEDIR "/usr/local/include" #endif #ifndef ICKSYSDIR # ifdef ICKDATADIR # define ICKSYSDIR ICKDATADIR # else # define ICKSYSDIR "/usr/local/share" # endif #endif #ifndef ICKCSKELDIR # ifdef ICKDATADIR # define ICKCSKELDIR ICKDATADIR # else # define ICKCSKELDIR "/usr/local/share" # endif #endif #ifndef ICKLIBDIR # define ICKLIBDIR "/usr/local/lib" #endif #ifndef ICKBINDIR # define ICKBINDIR "/usr/local/bin" #endif #ifndef CC # define CC "gcc" #endif #define ARGSTRING "abcdefghlmoptuvwxyCEFHOPUYX@" /* unused st variable quiets a GCC4 warning */ #define ICK_SYSTEM(x) do{int st;if(showsystem)fprintf(stderr,"%s\n",x); \ st=system(x);}while(0) #ifdef USE_YYRESTART /* function supplied by lex */ extern void yyrestart(FILE*); #endif /* USE_YYRESTART */ /* function created by yacc */ extern int yyparse(void); int yydebug; /* compilation options */ bool compile_only; /* just compile into C, don't run the linker */ bool ick_traditional; /* insist on strict INTERCAL-72 conformance */ bool nocompilerbug; /* disable error IE774 */ bool yukdebug; /* AIS: Use the yuk debugger. */ bool yukprofile; /* AIS: Use the yuk profiler. */ bool useprintflow; /* AIS: Add +printflow support. */ extern bool ick_coreonerr; /* AIS: Dump core on IE778. (defined in ick_lose.c) */ bool multithread; /* AIS: Allow multithreading and backtracking. */ bool variableconstants; /* AIS: Allow anything on the left of an assignment. */ bool createsused; /* AIS: Allow the use of CREATE. */ bool useickec; /* AIS: Link together INTERCAL and C. */ static bool nosyslib; /* AIS: Don't link syslib under any circumstances. */ static bool showsystem; /* AIS: Show the command lines in system() calls */ bool 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. */ bool flowoptimize; /* AIS: Do flow optimizations (in INTERCAL!). */ bool coopt; /* AIS: The constant-output optimization. This should mean that INTERCAL will beat any other language at many benchmark programs (!) */ extern bool ick_printfopens; /* AIS: Print messages whenever attempting to open a file: from uncommon.c */ extern bool ick_checkforbugs;/* AIS: Try to find possible bugs in the source code */ bool pickcompile; /* AIS: Compile for PIC? */ /*@-exportlocal@*/ /* AIS: relevant to the lexer */ bool clclex; /* AIS: 1 means use CLC-INTERCAL meanings for @, ? */ /*@=exportlocal@*/ bool ick_clcsemantics; /* AIS: CLC semantics for I/O, abstaining GIVE UP, &c*/ static bool outtostdout; /* AIS: Output on stdout rather than the output file */ /* AIS: Autodetected compilation options */ int compucomecount; /* Computed COME FROM count */ bool compucomesused; /* Are computed COME FROMs used? */ bool gerucomesused; /* Is COME FROM gerund used? */ bool nextfromsused; /* Is NEXT FROM used? */ bool opoverused; /* Is operand overloading used? */ /*@null@*/ node* firstslat=0; /* The first slat expression in the program */ /*@null@*/ node* prevslat=0; /* The last slat expression used so far */ static bool dooptimize; /* do optimizations? (controlled by -O) */ static bool ick_clockface; /* set up output to do IIII for IV */ #define SKELETON "ick-wrap.c" #define PSKELETON "pickwrap.c" #define SYSLIB "syslib" /* numeric base defaults, exported to other files */ #define DEFAULT_BASE 2 #define DEFAULT_SMALL_DIGITS 16 #define DEFAULT_LARGE_DIGITS 32 #define DEFAULT_MAX_SMALL 0xffffL #define DEFAULT_MAX_LARGE 0xffffffffL int ick_Base; int ick_Small_digits; int ick_Large_digits; unsigned int ick_Max_small; unsigned int ick_Max_large; int ick_lineno; /* after yyparse, this is the total number of statements */ /* currently supported numeric bases, not exported */ static const int maxbase = 7; static const int smallsizes[8] = {0, 0, 16, 10, 8, 6, 6, 5}; static const unsigned int maxsmalls[8] = {0, 0, 65535, 59048, 65535, 15624, 46655, 16806}; /*@observer@*/ static const char *compiler; atom *oblist = NULL, *obdex; int obcount = 0; int nonespots, ntwospots, ntails, nhybrids; int nmeshes; /* AIS */ tuple *tuples = NULL; int tuplecount = 0; tuple *optuple = NULL; /* AIS: Tuple being optimized */ /* * mappings from magic line ranges to system library components are * declared here. */ struct linerange_t { int start, end; char *libname; }; /* Note! "syslib" must be last in this list, as other parts of perpet.c care about whether syslib in particular was included. */ struct linerange_t lineranges[] = { {5000, 5699, "floatlib"}, /* the floating-point support */ {1000, 1999, "syslib"}, /* the system library */ {0, 0, NULL}, }; extern const assoc varstores[]; /* AIS: Need to know this for PIC compilation */ #ifndef HAVE_UNISTD_H /* AIS: We don't have unistd.h, so we can't use getopt. Write our own version that's less general but good enough. */ int optind=1; int optopt; int getopt(int argc, char * const *argv, const char *options) { if(optind>argc) return EOF; /* Out of command line */ if(!argv[optind]) return EOF; /* Out of command line */ while(!strcmp(argv[optind],"-")) { optind++; /* Go to ick_next argument */ if(!argv[optind]) return EOF; } if(*(argv[optind])!='-') return EOF; /* this arg is not an option */ optopt=argv[optind][1]; memmove(argv[optind]+1,argv[optind]+2,strlen(argv[optind]+1)); if(optopt=='-') {optind++; return EOF;} /* -- means end of options */ if(strchr(options, optopt)) return optopt; /* valid option */ return '?'; /* invalid option */ } #endif static int myfgetc(FILE* in) { char c; size_t dummy; dummy = fread(&c,1,1,in); if(feof(in)) return EOF; return (int)c; } static void abend(int signim) { /*@-noeffect@*/ (void) signim; /*@=noeffect@*/ ick_lose(IE778, iyylineno, (const char *)NULL); } static void print_usage(const char *prog, const char *options) { fprintf(stderr,"Usage: %s [-%s] [ ...]\n",prog,options); fprintf(stderr,"\t-b\t:reduce the probability of E774 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 system libraries (prevents -P)\n"); fprintf(stderr,"\t-t\t:traditional mode, accept only INTERCAL-72\n"); fprintf(stderr,"\t-C\t:clockface output (e.g. use IIII instead of IV)\n"); fprintf(stderr,"\t-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\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"); # endif #else 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\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"); #else fprintf(stderr,"\t-y\t:unsupported on computers without \n"); fprintf(stderr,"\t-p\t:unsupported on computers without \n"); #endif 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-Y\t:display the command line used whenever an external\n" "\t\t program is invoked\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\tINTERCAL source file (use extension .i\n"); fprintf(stderr,"\t\tfor base 2 or .3i, etc., for base 3, etc.).\n"); } #if __DJGPP__ /* AIS: Determine whether an environment variable exists (this is used to find a temp directory) */ static int isenv(char* e) { char* x=getenv(e); return x != NULL && *x != '\0'; } #endif extern int optind; /* set by getopt */ /** * This parses command line options. * @param argc What do you think? * @param argv Likewise. * @note May (directly) call ick_lose() with IE111 and IE256. */ static void parse_options(int argc, char *argv[]) { int c; /* getopt is POSIX, and I provide my own version if the POSIX version isn't found, so the unrecog warning is a false positive. */ /*@-unrecog@*/ while ((c = getopt(argc, argv, ARGSTRING)) != EOF) /*@=unrecog@*/ { switch (c) { case 'b': nocompilerbug = true; break; case 'c': compile_only = true; /* AIS */ coopt = false; break; case 'o': /* AIS */ compile_only = true; outtostdout = true; coopt = false; break; case 'd': yydebug = 1; compile_only = true; /* AIS */ coopt = false; break; case 'e': /* AIS */ useickec = true; multithread = pickcompile = coopt = yukdebug = yukprofile = false; break; case 'E': /* AIS */ nosyslib = true; pickcompile = false; break; case 'C': ick_clockface = true; break; case 't': ick_traditional = true; if(multithread) ick_lose(IE111, 1, (const char*) NULL); /* AIS */ if(pickcompile) ick_lose(IE111, 1, (const char*) NULL); /* AIS */ break; case 'O': dooptimize = true; variableconstants = false; /* AIS */ break; case 'f': /* By AIS */ flowoptimize = true; yukdebug = yukprofile = false; variableconstants = false; break; case 'F': /* By AIS */ coopt = flowoptimize = dooptimize = true; variableconstants = useickec = false; yukdebug = yukprofile = outtostdout = compile_only = cdebug = false; yydebug = 0; if(pickcompile) ick_lose(IE256, 1, (const char*) NULL); break; case 'h': /* By AIS */ optdebug|=1; compile_only=dooptimize=true; coopt=false; break; case 'H': /* By AIS */ optdebug|=2; compile_only=dooptimize=true; coopt=false; break; case 'y': /* By AIS */ #ifdef HAVE_UNISTD_H yukdebug=true; multithread=flowoptimize=coopt=useickec=false; #endif break; case 'p': /* By AIS */ #ifdef HAVE_UNISTD_H yukprofile=true; multithread=flowoptimize=coopt=useickec=false; #endif break; case 'w': /* By AIS */ useprintflow = true; break; case 'm': /* By AIS */ multithread=true; yukprofile=false; yukdebug=false; useickec=false; if(ick_traditional) ick_lose(IE111, 1, (const char*) NULL); break; case 'a': /* By AIS */ createsused=true; pickcompile=false; break; case 'v': /* By AIS */ variableconstants=true; dooptimize=false; flowoptimize=false; coopt=false; pickcompile=false; break; case 'l': /* By AIS */ ick_checkforbugs=true; dooptimize=true; break; case 'U': /* By AIS */ ick_coreonerr=true; break; case 'u': /* By AIS */ ick_printfopens=true; break; case 'Y': /* By AIS */ showsystem=true; break; case 'P': /* By AIS */ pickcompile=true; multithread=coopt=variableconstants=createsused=false; ick_clcsemantics=useickec=nosyslib=false; compile_only=true; dooptimize=flowoptimize=true; /* needed for PICs */ break; case 'X': /* By AIS */ clclex=true; break; case 'x': /* By AIS */ ick_clcsemantics=true; pickcompile=false; break; case 'g': /* By AIS */ cdebug=true; coopt=false; break; case '?': default: case '@': print_usage(argv[0], ARGSTRING); exit(EXIT_FAILURE); /*@-unreachable@*/ break; /*@=unreachable@*/ } } } /** * This code handles archives (for -e). * @param libbuf Pointer to a buffer to which extra files to link in prelink() * will be added. Need to be initialized up to the first zero byte. * @param libbuf_size Size of the buffer libbuf. * @param library The cmd line argument used for the library (but without the * extension). */ static void handle_archive(char *libbuf, size_t libbuf_size, /*@observer@*/ const char* library) { /* AIS: request for a library. Given a filename of the form libwhatever.a, it adds -lwhatever to libbuf (that's with a preceding space). If the filename doesn't start with lib, it instead adds a space and the filename to libbuf. */ if(library[0]=='l'&&library[1]=='i'&& library[2]=='b') (void) ick_snprintf_or_die(libbuf+strlen(libbuf),libbuf_size - strlen(libbuf), " -l%s",library+3); else (void) ick_snprintf_or_die(libbuf+strlen(libbuf),libbuf_size - strlen(libbuf), " %s.a",library); } /** * This handles Befunge 98 (for -e). * @param libbuf Pointer to a buffer to which extra files to link in prelink() * will be added. Need to be initialized up to the first zero byte. * @param libbuf_size Size of the buffer libbuf. * @param libdir The ick library directory. * @param argv0 Should be argv[0], which wasn't modified. * @param filename The file name of the Befunge file (but without the extension). * @note May (directly) call ick_lose() with IE888 and IE899. */ static void handle_befunge98(char *libbuf, size_t libbuf_size, /*@observer@*/ const char* libdir, /*@observer@*/ const char* argv0, /*@observer@*/ const char* filename) { /* AIS: Compile the .b98 file into a .cio so that it can be used later, and include the necessary libraries to use it, or error if the libraries aren't installed yet. I use a somewhat dubious trick here: the .b98 file's .cio, and the necessary libraries, are added in the libraries section of the command line, whereas the space on the command line where the .b98 file was is used for the expansion library ecto_b98. This is because ecto_b98 requires preprocessing/prelinking/interprocessing or whatever you want to call it, whereas unlike for other .cios, the .cio produced from the Befunge file doesn't. */ #define MARKERMAX 128 FILE* of; int x,y,jlb; char outputfilename[BUFSIZ]; int markerposns[MARKERMAX][2]; int markercount=0; /* Error if libick_ecto_b98.a is missing. It might be, and not just due to installation problems. */ if(!ick_findandtestopen("libick_ecto_b98.a",libdir,"rb",argv0)) ick_lose(IE899,-1,(const char *)NULL); /* Compile the .b98 file into a .cio. It's open on stdin right now, so we just need to handle the output side of things. */ (void) ick_snprintf_or_die(outputfilename, sizeof outputfilename, "%s.cio", filename); if(!((of = ick_debfopen(outputfilename,"w")))) ick_lose(IE888,-1,(const char *)NULL); fprintf(of,"const unsigned char* ick_iffi_befungeString=\n\""); x=0; y=0; jlb=0; for(;;) { int c=getchar(); if(c==EOF) break; if(c==0xB7) { /* Middot (0xB7) has special handling. */ c='M'; markerposns[markercount][0]=x; markerposns[markercount++][1]=y; } if(c=='\r') {jlb = 1; x=0; y++; c='\n';} else if(c=='\n' && jlb) {jlb = 0; continue;} else if(c=='\n') {x=0; y++; jlb = 0;} else x++; fprintf(of,"\\x%x",(unsigned int)c); if(!x) fprintf(of,"\"\n\""); } fprintf(of,"\";\n\nint ick_iffi_markercount=%d;\n" "long long ick_iffi_markerposns[][2]={\n",markercount); if(!markercount) fprintf(of,"{0,0}\n"); while(markercount--) fprintf(of,"{%d,%d},\n", markerposns[markercount][0], markerposns[markercount][1]); fprintf(of,"};\n"); (void) fclose(of); /* Put the libraries and .cio file in the command line. */ (void) ick_snprintf_or_die(libbuf+strlen(libbuf),libbuf_size - strlen(libbuf), " %s.cio -lick_ecto_b98 -lm -lncurses", filename); } /** * This computes what type the INTERCAL source file is. * It will change various globals. * @param chp A pointer to the first letter of the extension of the file. Note * that it won't be changed, but can't be const char* due to being * passed as the second parameter to strtol() as well. * @note May (directly) call ick_lose() with IE111, IE256 and IE998. */ static void find_intercal_base(char* chp) { /* wwp: reset the base variables to defaults, because if the */ /* sourcefile has extension .i they will not be reset in the */ /* following chunk of code. but i don't want to modify the */ /* following chunk of code because i think it is very clever; */ /* grabs the base on the first pass, then validates the rest */ /* 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, (const char *)NULL); else if (ick_traditional && ick_Base != 2) ick_lose(IE111, 1, (const char *)NULL); else if (pickcompile && ick_Base != 2) ick_lose(IE256, 1, (const 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; } } /** * This checks if we automagically need to include syslib * @param buffer Output buffer that may be modified to contain the path of * syslib.i or syslib.Ni (where N is 3-7). * @param size Size of buffer. * @param needsyslib Pointer to the bool needsyslib declared in main(). * @param argv0 Should be argv[0], which wasn't modified. * @param ick_sysdir The ick data directory. * @note May (directly) call ick_lose() with IE127. */ static void check_syslib(/*@partial@*/ char *buffer, size_t size, /*@out@*/ bool *needsyslib, /*@observer@*/ const char *argv0, /*@observer@*/ const char *ick_sysdir) { tuple *tp; struct linerange_t *lp; if (nosyslib || pickcompile) { *needsyslib = false; return; } /* * magical inclusion of system libraries is done here */ for (lp = lineranges; lp->start; lp++) { *needsyslib = false; for (tp = tuples; tp->type; tp++) { /* * If some label in the specified range is defined, * then assume the library we seek is already there, so we * can stop searching. */ if (tp->label >= lp->start && tp->label <= lp->end) { *needsyslib = false; goto breakout; } /* * If some label in the specified range is being * called, we might need the library. */ if (tp->type == NEXT && tp->u.target >= lp->start && tp->u.target <= lp->end) *needsyslib = true; } if (*needsyslib) { if (ick_Base == 2) (void) ick_snprintf_or_die(buffer, size, "%s.i", lp->libname); else (void) ick_snprintf_or_die(buffer, size, "%s%d.%di", lp->libname, ick_Base, ick_Base); if (ick_findandfreopen(buffer, ick_sysdir, "r", argv0, stdin) == NULL) ick_lose(IE127, 1, (const char*) NULL); #ifdef USE_YYRESTART yyrestart(stdin); #endif /* USE_YYRESTART */ (void) yyparse(); textlinecount=iyylineno; } breakout: ; } } /** * This code propagates type information up the expression tree. * It also does some unrelated stuff such as checking for WRITE IN and disabling * coopt if that is found. */ static void propagate_typeinfo(void) { tuple *tp; /* * 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 = false; /* AIS: may as well do this here */ } } /** * This runs the optimiser. */ static void run_optimiser(void) { tuple *tp; /* 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(); } /** * Generate random line number for E774. * @returns A random line number, or -1 for no random bug generated. */ static int randomise_bugline(void) { /* decide if and where to place the compiler bug */ #ifdef USG if (!nocompilerbug && lrand48() % 10 == 0) return (int)(lrand48() % ick_lineno); #else if (!nocompilerbug && rand() % 10 == 0) return rand() % ick_lineno; #endif else return -1; } /** * This opens the outfile. * @param filename The filename to open. * @returns A pointer to a FILE for the filename. If the global outtostdout is * set then it will return stdout. * @note May (directly) call ick_lose() with IE888. */ static /*@dependent@*/ FILE* open_outfile(/*@observer@*/ const char * filename) { FILE *ofp; /* 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(filename, "w")) == (FILE *)NULL) ick_lose(IE888, 1, (const char *)NULL); /*@=branchstate@*/ return ofp; } /** * This generates the CC command line. * @param buffer Output buffer. * @param size Size of the output buffer. * @param sourcefile The name of the C file. * @param includedir The ick include directory. * @param path The path of the ick binary (execuding filename). * @param libdir The ick library directory. * @param outputfile The name of the output file. */ static void gen_cc_command(char* buffer, size_t size, /*@observer@*/ const char* sourcefile, /*@observer@*/ const char* includedir, /*@observer@*/ const char* path, /*@observer@*/ const char* libdir, /*@observer@*/ const char* outputfile) { (void) ick_snprintf_or_die(buffer, size, "%s %s%s-I%s -I%s -I%s/../include -L%s -L%s -L%s/../lib -O%c -o %s" EXEEXT " -lick%s%s", #ifdef __DJGPP__ "", #else compiler, #endif #ifdef HAVE_CLOCK_GETTIME /* implies -lrt is available */ sourcefile, yukdebug||yukprofile?" -lyuk -lrt ":" ", #else sourcefile, yukdebug||yukprofile?" -lyuk ":" ", #endif includedir, path, path, libdir, path, path, cdebug?'0':coopt?'3':'2', /* AIS: If coopting, optimize as much as possible JH: [d]on't optimise when compiling with debugger support */ outputfile, 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. */ } /** * This generates the actual C code. * @param ifp This should be opened to either ick-wrap.c or pickwrap.c. * @param ofp The out file. * @param source_name_stem Source name stem * @param needsyslib Pointer to the needsyslib bool in main(). * @param bugline What line number to add a random bug to. * @param compilercommand The compiler command line. * @note May (directly) call ick_lose() with IE256. */ static void generate_code(FILE *ifp, FILE *ofp, /*@observer@*/ const char* source_name_stem, bool *needsyslib, int bugline, /*@observer@*/ const char* compilercommand) { int maxabstain; int c, i; tuple *tp; atom *op; while ((c = myfgetc(ifp)) != EOF) if (c != (int)'$') (void) fputc(c, ofp); else switch(myfgetc(ifp)) { case 'A': /* source name stem */ (void) fputs(source_name_stem, 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 = false; else coopt = false; } 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=true; /* 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 = true; tp->exechance /= 100; } else tp->maybe = false; } else /* AIS: hardcoded abstain bits for PICs */ { if(!tp->abstainable) continue; if(tp->exechance > 0) (void) fprintf(ofp, "ICK_INT1 ICKABSTAINED(%d)=0;\n",(int)(tp-tuples)); else (void) fprintf(ofp, "ICK_INT1 ICKABSTAINED(%d)=1;\n",(int)(tp-tuples)); } } if(!pickcompile) (void) fprintf(ofp, "}"); } break; case 'D': /* linetypes 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) { int j=0; /* AIS */ /* AIS: Changed to use enablersm1 */ 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"); /* AIS: Implement the reverse of this array too (i.e. from line types to lines); this significantly speeds up up reinstate/abstain on gerunds. Joris Huizer originally suggested the optimisation in question; this implements the same algorithm in a more maintainable way. (I didn't want to have to keep five copies of the command list in sync; two is bad enough!) */ (void) fprintf(ofp, "int revlinetype[] = {\n"); for(i=0;i < (int)(sizeof(enablersm1)/sizeof(char *));i++) { (void) fprintf(ofp,"/* %s */",enablersm1[i]); for (tp = tuples; tp->type; tp++) { if((tp->ppnewtype && tp->ppnewtype-GETS == i-1) || (!tp->ppnewtype && tp->preproc && i-1 == PREPROC-GETS) || (!tp->ppnewtype && !tp->preproc && tp->type >= GETS && tp->type <= FROM && tp->type-GETS == i-1) || (!i && !tp->ppnewtype && !tp->preproc && (tp->type < GETS || tp->type > FROM))) (void) fprintf(ofp, " %ld,",(long)(tp-tuples)); } (void) fprintf(ofp,"\n"); } (void) fprintf(ofp, "};\n"); (void) fprintf(ofp, "int revlineindex[] = {\n"); for(i=0;i < (int)(sizeof(enablersm1)/sizeof(char *));i++) { (void) fprintf(ofp,"/* %s */",enablersm1[i]); (void) fprintf(ofp," %d,\n",j); for (tp = tuples; tp->type; tp++) { if((tp->ppnewtype && tp->ppnewtype-GETS == i-1) || (!tp->ppnewtype && tp->preproc && i-1 == PREPROC-GETS) || (!tp->ppnewtype && !tp->preproc && tp->type >= GETS && tp->type <= FROM && tp->type-GETS == i-1) || (!i && !tp->ppnewtype && !tp->preproc && (tp->type < GETS || tp->type > FROM))) j++; } } (void) fprintf(ofp, "/* end */ %d\n};\n",j); } 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(temptype!=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, (const char*) NULL); /* and neither are variable constants */ if(variableconstants) ick_lose(IE256, iyylineno, (const 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(true);\n"); if (ick_clcsemantics) /* AIS */ (void) fprintf(ofp, "ick_setclcsemantics(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 \"config.h\"\n\n"); (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"); /*@+boolint@*/ (void) fprintf(ofp, "int yukopts = %d;\n", yukprofile+yukdebug*2); /*@=boolint@*/ (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," ", #else "","", #endif compilercommand); 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?1:0); /* 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?1:0); /* 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; } } /** * This runs the C compiler, and may invoke yuk. * @param cc_command The compiler command line to use. Constructed by gen_cc_command(). * @param oldstdin The previous stdin, used for yuk. * @param yukcmdstr The command line to use for running yuk. * @param sourcefile The output filename. * @param binaryname The name of the binary. */ static void run_cc_and_maybe_debugger(/*@observer@*/ const char *cc_command, int oldstdin, /*@observer@*/ const char *yukcmdstr, /*@observer@*/ const char *sourcefile, /*@observer@*/ const char *binaryname) { #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 */ ICK_SYSTEM(cc_command); /* AIS: no unlink if cdebug */ if(!cdebug) (void) unlink(sourcefile); } 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) */ ICK_SYSTEM(cc_command); #ifdef HAVE_UNISTD_H (void) dup2(oldstdin,0); /* restore stdin */ #endif ICK_SYSTEM(yukcmdstr); (void) unlink(sourcefile); (void) unlink(binaryname); } #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 */ const 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",cc_command); fclose(rsp); ICK_SYSTEM(tempfn); remove(tempfn+5); if(yukdebug || yukprofile) { char buffer[BUFSIZ]; #ifdef HAVE_UNISTD_H dup2(oldstdin,0); /* restore stdin */ #endif /* FIXME: This looks broken (the buf2 usage and such). */ ick_snprintf_or_die(buffer, sizeof(buffer), "%s" EXEEXT,binaryname); ICK_SYSTEM(yukcmdstr); remove(sourcefile); remove(buffer); } else if(!cdebug) { remove(sourcefile); } } #endif } /** * This runs coopt.sh if -F is given and the program can be "coopted". * @param cooptsh Path to coopt.sh * @param binaryname The output binary filename. */ static void run_coopt(/*@observer@*/ /*@null@*/ /*@unused@*/ const char* cooptsh, /*@observer@*/ /*@unused@*/ const char* binaryname) { /* Note: Params are marked unused because they may not be used if sh isn't supported. */ /* Assume that sh exists if #! does; sh is needed to run autoconf, so this would otherwise have to be set by hand anyway. */ #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) { char commandlinebuf[BUFSIZ]; (void) ick_snprintf_or_die(commandlinebuf, sizeof commandlinebuf, "sh %s %s", cooptsh, binaryname); ICK_SYSTEM(commandlinebuf); /* replaces the output executable if neccesary */ } } #endif } /** * This is for -e, runs prelinking. * @param argc Exactly what you think. * @param argv Also what you think. * @param oldoptind The original optind. * @param libdir The ick library directory. * @param includedir The ick include directory. * @param path The path of the ick binary (execuding filename). * @param libbuf A string with -lfoo to add to compiler command line. * @note May (directly) call ick_lose() with IE666. IE778 and IE888. */ static void prelink(int argc, char *argv[], int oldoptind, /*@observer@*/ const char* libdir, /*@observer@*/ const char *includedir, /*@observer@*/ const char* path, /*@observer@*/ const char* libbuf) { char buffer[BUFSIZ]; FILE* cioin; FILE* cioallec; char* buf2ptr; long remspace; const char* tempfn="ickectmp.c"; int needc=89; #if __DJGPP__ /* Look for a temp directory, as above. */ if(isenv("TMP")) tempfn="/dev/env/TMP/ickectmp.c"; if(isenv("TEMP")) tempfn="/dev/env/TEMP/ickectmp.c"; if(isenv("TMPDIR")) tempfn="/dev/env/TMPDIR/ickectmp.c"; if(isenv("ICKTEMP")) tempfn="/dev/env/ICKTEMP/ickectmp.c"; #else tempfn="/tmp/ickectmp.c"; /* always a valid temporary folder on POSIX */ #endif cioallec=ick_debfopen(tempfn,"w"); if(cioallec == NULL) ick_lose(IE888, -1, (const 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++) { int thisneedc = argv[optind][strlen(argv[optind])+2]=='9'?99: argv[optind][strlen(argv[optind])+2]=='1'?11:89; if(needc==89 || thisneedc==11) needc=thisneedc; (void) ick_snprintf_or_die(buffer, sizeof buffer, "%s --std=c%d -E -DICK_HAVE_STDINT_H=%d " "-I%s -I%s -I%s/../include " "-x c %s.c%c%c > %s.cio", compiler, thisneedc, ICK_HAVE_STDINT_H+1-1, includedir, path, path, argv[optind], thisneedc==99?'9':thisneedc==11?'1':' ', thisneedc==99?'9':thisneedc==11?'1':' ', argv[optind]); if(*(argv[optind]) && /* there is some file to compile */ (argv[optind][strlen(argv[optind])+2]=='\0' /* a .c or .i file */ ||argv[optind][strlen(argv[optind])+3]!='o')) /* not a .cio file */ ICK_SYSTEM(buffer); /* run the C preprocessor */ buf2ptr = strrchr(buffer,'>'); /* 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. */ static long ppnum1=65538L*2L; static long ppnum2=65538L*2L; static long ppnum3=65538L*2L; static long ppnum6=65538L*2L; long ciopos=0L; /*@+charintliteral@*/ /* literal chars are ints */ while(inchar != EOF) { if(inchar=='I') { /* Look for the ICK_EC_PP_ string that indicates preprocessing is needed. This method of doing it works as long as the ICK_EC_PP_ string is never preceded by something which looks like part of the same string, but luckily, it never is. */ if((inchar=fgetc(cioin))!='C') continue; if((inchar=fgetc(cioin))!='K') continue; if((inchar=fgetc(cioin))!='_') continue; if((inchar=fgetc(cioin))!='E') continue; if((inchar=fgetc(cioin))!='C') continue; if((inchar=fgetc(cioin))!='_') continue; if((inchar=fgetc(cioin))!='P') continue; if((inchar=fgetc(cioin))!='P') continue; if((inchar=fgetc(cioin))!='_') continue; inchar=fgetc(cioin); toparencount=0; if(inchar=='0') { fprintf(cioallec,"#undef X\n"); 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; case '6': fprintf(cioin,"%-11ld",ppnum6++/2); break; default: ick_lose(IE778, -1, (const char*) NULL); } (void) fseek(cioin,0L,SEEK_CUR); /* synch the file */ } ciopos=ftell(cioin); inchar=fgetc(cioin); } /*@=charintliteral@*/ (void) fclose(cioin); } } fprintf(cioallec,"if(ick_global_checkmode==2)\n"); fprintf(cioallec," ick_global_checkmode=4;\n"); fprintf(cioallec,"};\n"); (void) fclose(cioallec); /* NOTE: buffer changes use around here. */ /* 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.) */ (void) ick_snprintf_or_die(buffer, sizeof buffer, "%s -L%s -L%s -L%s/../lib -O2 -o %s" EXEEXT "%s " #ifndef __DJGPP__ "-Wl,-z,muldefs " #endif "-DICK_HAVE_STDINT_H=%d -x c --std=c%d %s", compiler, libdir, path, path, argv[oldoptind], cdebug?" -g":"", ICK_HAVE_STDINT_H+1==2?1:0, needc,tempfn); remspace = (long)(sizeof buffer - strlen(buffer) - 1); for(optind=oldoptind; optind < argc; optind++) { if(!*(argv[optind])) continue; remspace -= strlen(argv[optind]) - 5; /* 5 for .cio */ if(remspace <= 0) ick_lose(IE666, -1, (const char*)NULL); strcat(buffer," "); strcat(buffer,argv[optind]); strcat(buffer,".cio"); } remspace -= strlen(libbuf); if(remspace <= 0) ick_lose(IE666, -1, (const char*)NULL); strcat(buffer,libbuf); remspace -= strlen(" -lickec"); if(remspace <= 0) ick_lose(IE666, -1, (const char*)NULL); strcat(buffer," -lickec"); ICK_SYSTEM(buffer); (void) remove(tempfn); } /*@-redef@*/ int main(int argc, char *argv[]) /*@=redef@*/ { char buf[BUFSIZ], buf2[BUFSIZ], *chp, yukcmdstr[BUFSIZ], path[BUFSIZ], libbuf[BUFSIZ]; /*@-shadow@*/ /* no it doesn't, cesspool isn't linked to perpet */ const char *includedir, *libdir, *ick_sysdir, *ick_cskeldir; /*@=shadow@*/ /* AIS: removed getenv(), added ick_sysdir */ const char *cooptsh; /* AIS */ FILE *ifp, *ofp; int /* nextcount, AIS */ bugline; bool needsyslib, firstfile; int oldoptind; #ifdef HAVE_UNISTD_H 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_sysdir = getenv("ICKSYSDIR"))) ick_sysdir = ICKSYSDIR; if (!(ick_cskeldir = getenv("ICKCSKELDIR"))) ick_cskeldir = ICKCSKELDIR; /* AIS: nothing actually uses this at the moment, commenting it out for future use if (!(bindir = getenv("ICKBINDIR"))) bindir = ICKBINDIR; */ if (!(compiler = getenv("CC"))) compiler = CC; /* Parse the options. */ parse_options(argc, argv); (void) signal(SIGSEGV, abend); #ifdef SIGBUS (void) signal(SIGBUS, abend); #endif /* SIGBUS */ if (!nocompilerbug) { #ifdef USG srand48(time(NULL) + getpid()); #else srand((unsigned)time(NULL)); #endif /* UNIX */ } /* AIS: New function for enhanced file-finding */ ifp = ick_findandfopen(pickcompile?PSKELETON:SKELETON, ick_cskeldir, "r", argv[0]); if(!ifp) ick_lose(IE999, 1, (const char *)NULL); /* 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: Save the old stdin, if we can */ #ifdef HAVE_UNISTD_H oldstdin=dup(0); #endif oldoptind=optind; /* AIS */ *libbuf = '\0'; /* AIS */ /* Begin file loop */ for (firstfile = true; optind < argc; optind++, firstfile = 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 && /* AIS */ strcmp(strchr(argv[optind],'.')+1,"a")) ick_lose(IE777, 1, (const char *)NULL); else { /* strip off the file extension */ if(!(chp = strrchr(argv[optind],'.'))) { if(useickec && firstfile == false) /* By AIS */ { /* 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. */ const char* tempfn; FILE* fromcopy; FILE* tocopy; int c2; fixexpansionlibrary: tempfn="%s.c"; (void) ick_snprintf_or_die(buf2, sizeof buf2, "%s.c", argv[optind]); fromcopy = ick_findandfopen(buf2,ick_cskeldir,"rb",argv[0]); if(!fromcopy) /* same error as for syslib */ ick_lose(IE127, 1, (const 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 */ (void) ick_snprintf_or_die(buf2, sizeof buf2, tempfn, argv[optind]); /*@=formatconst@*/ if((tocopy = fopen(buf2,"wb")) == NULL) ick_lose(IE888, 1, (const char*) NULL); 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, (const char*) NULL); strcpy(argv[optind],buf2); *(strrchr(argv[optind],'.')) = '\0'; continue; } ick_lose(IE998, 1, (const char *)NULL); } *chp++ = '\0'; /* Beginning of block that figures out file type from extension. */ if(useickec && (!strcmp(chp,"c") || !strcmp(chp,"cio") || !strcmp(chp,"c99") || !strcmp(chp,"c11"))) /* AIS */ { if(firstfile != false) /* need exactly 1 INTERCAL file */ ick_lose(IE998, 1, (const char *)NULL); continue; /* don't process C or cio files further yet */ } if(useickec && !strcmp(chp,"a")) { /* AIS: request for a library. Given a filename of the form libwhatever.a, it adds -lwhatever to libbuf (that's with a preceding space). If the filename doesn't start with lib, it instead adds a space and the filename to libbuf. */ handle_archive(libbuf, sizeof libbuf, argv[optind] /* Archive name without extension. */); *argv[optind]='\0'; continue; } if(useickec && !strcmp(chp,"b98")) { handle_befunge98(libbuf, sizeof libbuf, libdir, argv[0], argv[optind] /* Filename without extension. */); /* Sort out the ecto_b98 expansion library. */ argv[optind] = "ecto_b98"; goto fixexpansionlibrary; } if(useickec && firstfile == false) /* AIS */ ick_lose(IE998, 1, (const char *)NULL); /* determine the file type from the extension */ /* AN: chp isn't used again after this it seems? */ find_intercal_base(chp); /* End of block that figures out file type from extension. */ /* zero out tuple and oblist storage */ treset(); politesse = 0; /* JH: default to no op-overusage and no computed come from */ opoverused = false; compucomesused = false; compucomecount = 0; gerucomesused = false; /* 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); #endif /* NEED_YYRESTART */ iyylineno = 1; } /* 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); } /* * Miss Manners lives. */ if (ick_lineno > 2) { if (politesse == 0 || (ick_lineno - 1) / politesse >= 5) ick_lose(IE079, iyylineno, (const char *)NULL); else if (ick_lineno / politesse < 3) ick_lose(IE099, iyylineno, (const char *)NULL); } /* Check if we should auto add the system library. */ check_syslib(buf2, sizeof buf2, &needsyslib, argv[0], ick_sysdir); /* * 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. */ propagate_typeinfo(); codecheck(); /* check for compile-time errors */ /* AIS: And importantly, sort out line number references */ run_optimiser(); /* decide if and where to place the compiler bug */ bugline = randomise_bugline(); /* set up the generated C output file name */ (void) ick_snprintf_or_die(buf, sizeof buf, "%s.c", argv[optind]); /* Open output file. */ ofp = open_outfile(buf /* Output filename */); (void) fseek(ifp,0L,0); /* rewind skeleton file */ /* AIS: Before changing argv[0], locate coopt.sh. */ /* AN: Even though argv[0] isn't changed any more this breaks if moved out * of the per-file loop since ick_findandtestopen() returns a pointer to a * static buffer. Should be fixed. */ cooptsh = ick_findandtestopen("coopt.sh", ick_sysdir, "rb", argv[0]); /* AIS: and calculate yukcmdstr. */ (void) ick_snprintf_or_die(yukcmdstr, sizeof yukcmdstr, "%s%s" EXEEXT " %s %s", strchr(argv[optind],'/')||strchr(argv[optind],'\\')? "":"./",argv[optind],ick_sysdir,argv[0]); /* 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,"."); /* Generate the compiler command. */ gen_cc_command(buf2 /* output */, sizeof buf2, buf /* Source filename. */, includedir, path, libdir, argv[optind] /* Output binary filename. */); textlinecount=0; /* AIS: If there are no files, there's no need to free any textlines */ /* Generate code using ick-wrap.c (or pickwrap.c) */ generate_code(ifp, ofp, argv[optind] /* Source file name stem. */, &needsyslib, bugline, buf2 /* CC command. */); if(!outtostdout) (void) fclose(ofp); /* OK, now sic the C compiler on the results */ /* Also: if -y was given, run debugger */ run_cc_and_maybe_debugger(buf2, oldstdin, yukcmdstr, buf /* C file name */, argv[optind] /* Binary filename */); /* Run the constant-output optimizer (a form of post-processor). */ run_coopt(cooptsh, argv[optind]); } } /* Here ends the per-file loop. */ (void) fclose(ifp); if(!compile_only && useickec) /* AIS */ prelink(argc, argv, oldoptind, libdir, includedir, path, libbuf); /* AIS: Free malloc'd memory. */ if(textlines) { /* Marking what textlines points to as only would be the 'right' way to do this (because it is only), but I can't figure out the syntax to do it, so instead I'm supressing the warning that comes up because it isn't marked as only. */ /*@-unqualifiedtrans@*/ while(textlinecount--) free(textlines[textlinecount]); free(textlines); /*@=unqualifiedtrans@*/ } #ifdef HAVE_UNISTD_H (void) close(oldstdin); /* AIS */ #endif /* This point is the very end of the program. So it's correct for normal DO NOT FREE UNDER ANY CIRCUMSTANCES globals to be free at this point, so supressing the warning given as a result. */ /*@-globstate@*/ return 0; /*@=globstate@*/ } /* perpet.c ends here */ intercal-0.30/src/PaxHeaders.27456/cesspool.c0000644000000000000000000000007411442030202015554 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.526945866 intercal-0.30/src/cesspool.c0000644000175000017500000006607111442030202015461 0ustar00esresr00000000000000/***************************************************************************** NAME cesspool.c -- storage management and runtime support for INTERCAL LICENSE TERMS Copyright (C) 1996 Eric S. Raymond This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ***************************************************************************/ /* LINTLIBRARY */ #include #include #include #include #include #include #include "config.h" #ifdef HAVE_STDARG_H #include #else #include #endif #include "sizes.h" /* AIS: To avoid a separate overloaded/nonoverloaded library, we import the overloading defines here and ignore them if we don't need them. */ #define MULTITHREAD 0 #define OVEROPUSED 1 #include "abcess.h" #include "ick_lose.h" #include "numerals.c" /* AIS: because BUFSIZ could theoretically be too large for an int... */ #if BUFSIZ < INT_MAX #define INTBUFSIZ (int)BUFSIZ #else #define INTBUFSIZ (int)INT_MAX #endif /* and likewise, so that we can compare things to INT_MAX */ #ifndef min #define min(x,y) ((x)>(y)?(y):(x)) #endif /* and likewise, define SIZE_MAX */ #ifndef SIZE_MAX #ifdef ULLONG_MAX #define SIZE_MAX (sizeof(unsigned short )==sizeof(size_t)?(size_t) USHRT_MAX : \ sizeof(unsigned int )==sizeof(size_t)?(size_t) UINT_MAX : \ sizeof(unsigned long )==sizeof(size_t)?(size_t) ULONG_MAX : \ sizeof(unsigned long long)==sizeof(size_t)?(size_t)ULLONG_MAX : 0) #else #define SIZE_MAX (sizeof(unsigned short )==sizeof(size_t)?(size_t) USHRT_MAX : \ sizeof(unsigned int )==sizeof(size_t)?(size_t) UINT_MAX : \ sizeof(unsigned long )==sizeof(size_t)?(size_t) ULONG_MAX : 0) #endif #endif /* AIS: These will be set to stdin/stdout at the first opportunity, which is not necessarily here. The annotations are to tell splint that we know what we're doing here with the assignments; the set to stdin/stdout will be done whenever it's necessary. */ /*@null@*/ FILE* ick_cesspoolin =0; /*@null@*/ FILE* ick_cesspoolout=0; /* AIS: To keep ld happy. This shouldn't ever actually get used, but * give it a sane value just in case it does. (This is referenced by * clc-cset.c, but due to the linking-in of the character sets * themselves the reference should never be used.) */ /*@observer@*/ /*@dependent@*/ const char* ick_datadir="."; /********************************************************************** * * The following functions manipulate the nexting stack * *********************************************************************/ unsigned* ick_next; /* AIS: now allocated by ick-wrap.c */ /*@null@*/ jmp_buf* ick_next_jmpbufs = NULL; /* AIS: for ick_ec, if needed */ int ick_nextindex = 0; static int ick_clcsem = 0; /* AIS */ void ick_pushnext(unsigned n) { if (ick_nextindex < ick_MAXNEXT) ick_next[ick_nextindex++] = n; else ick_lose(IE123, ick_lineno, (const char *)NULL); } unsigned int ick_popnext(unsigned int n) { ick_nextindex -= n; if (ick_nextindex < 0) { ick_nextindex = 0; return (unsigned int)-1; } return ick_next[ick_nextindex]; } /* AIS: This is not the ick_resume in ick_ec.h, which is a macro and therefore technically speaking doesn't clash with this function as the header file ick_ec.h isn't included. */ unsigned int ick_resume(unsigned int n) { if (n == 0) { ick_lose(IE621, ick_lineno, (const char *)NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } else if ((n = ick_popnext(n)) == (unsigned int)-1) { ick_lose(IE632, ick_lineno, (const char *)NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } return(n); } /********************************************************************** * * The following functions implement the INTERCAL I/O model * *********************************************************************/ unsigned int ick_pin(void) { char buf[INTBUFSIZ], *cp; unsigned int result = 0; size_t n; assert(buf != NULL); /* AIS: splint seems unable of figuring this out for itself */ if(!ick_cesspoolin) ick_cesspoolin=stdin; /* AIS */ if (fgets(buf, INTBUFSIZ, ick_cesspoolin) == (char *)NULL) ick_lose(IE562, ick_lineno, (const char *)NULL); n = strlen(buf) - 1; if (n > 0 && buf[n-1] == '\r') --n; buf[n] = '\0'; if(ick_wimp_mode) { result = (unsigned int)strtoul(buf, (char **)NULL, 10); n = 1; } else { for(n=0,cp = strtok(buf, " ");cp;cp = strtok((char *)NULL, " "),n++) { int digit = -1; const numeral *np; for (np = ick_numerals; np < ick_numerals + sizeof(ick_numerals)/sizeof(numeral); np++) if (strcmp(np->name, cp) == 0) { digit = np->value; break; } if (digit == -1) ick_lose(IE579, ick_lineno, cp); if (result < 429496729 || (result == 429496729 && digit < 6)) result = result * 10 + digit; else ick_lose(IE533, ick_lineno, (const char *)NULL); } } if (!n) ick_lose(IE562, ick_lineno, (const char *)NULL); if (result > (unsigned int)ick_Max_large) ick_lose(IE533, ick_lineno, (const char *)NULL); return(result); } /********************************************************************** * * Butchered Roman ick_numerals implemented by * Michael Ernst, mernst@theory.lcs.mit.edu. May 7, 1990 * * The INTERCAL manual hints that 3999 should translate to MMMIM * (compare MMMCMXCIX) without specifying what the translation is. * That may be a typo; in any case, this implementation isn't that * butchered. * *********************************************************************/ #define MAXDIGITS 10 /* max base 10 digits */ #define MAXROMANS (MAXDIGITS*4+1) /* max chars in translation */ /* * The ick_first column tells how many of the succeeding columns are used. * The other columns refer to the columns of br_equiv and br_overbar. */ static int ick_br_trans[10][5] = { {0, 0, 0, 0, 0}, {1, 0, 0, 0, 0}, {2, 0, 0, 0, 0}, {3, 0, 0, 0, 0}, {2, 1, 2, 0, 0}, /* or use {4, 0, 0, 0, 0} */ {1, 2, 0, 0, 0}, {2, 2, 1, 0, 0}, {3, 2, 1, 1, 0}, {4, 2, 1, 1, 1}, {2, 1, 3, 0, 0} }; /* * butcher places in the string result the "butchered" Roman numeral for val. * This string should be printed at the beginning of a line; it spans two * lines and already contains newlines. * * 11/24/91 LHH: Removed unnecessary final newline. */ static void butcher(unsigned long val, /*@out@*/ char *result) { int i, j; int digitsig, digitval; char res[MAXROMANS], ovb[MAXROMANS]; /* We need FOUR columns because of the odd way that M and I interact. */ static const char br_equiv[MAXDIGITS][4] = { {'I', 'I', 'V', 'X'}, {'X', 'X', 'L', 'C'}, {'C', 'C', 'D', 'M'}, {'M', 'I', 'V', 'X'}, {'X', 'X', 'L', 'C'}, {'C', 'C', 'D', 'M'}, {'M', 'i', 'v', 'x'}, {'x', 'x', 'l', 'c'}, {'c', 'c', 'd', 'm'}, {'m', 'i', 'v', 'x'}, }; static const char br_overbar[MAXDIGITS][4] = { {' ', ' ', ' ', ' '}, {' ', ' ', ' ', ' '}, {' ', ' ', ' ', ' '}, {' ', '_', '_', '_'}, {'_', '_', '_', '_'}, {'_', '_', '_', '_'}, {'_', ' ', ' ', ' '}, {' ', ' ', ' ', ' '}, {' ', ' ', ' ', ' '}, {' ', '_', '_', '_'}, }; if (val == 0) /* Final newline will be added by puts. (void) strcpy(result, "_\n \n"); */ (void) strcpy(result, "_\n"); else { res[MAXROMANS-1] = '\0'; ovb[MAXROMANS-1] = '\0'; i = MAXROMANS-1; /* the significance of the current digit is 10 ** digitsig */ for (digitsig = 0; (digitsig < MAXDIGITS) && (val > 0); digitsig++) { digitval = (int)(val % 10); for (j = ick_br_trans[digitval][0]; j > 0; j--) { /* printf("In j loop: %d %d\n", j, i); */ res[--i] = br_equiv[digitsig][ick_br_trans[digitval][j]]; ovb[i] = br_overbar[digitsig][ick_br_trans[digitval][j]]; } val = val / 10; } j = i; while ((*result++ = ovb[j++]) != '\0') continue; *--result = '\n'; j = i; while ((*++result = res[j++]) != '\0') continue; /* Final newline will be added by puts. *result++ = '\n'; */ *result = '\0'; } } void ick_clockface(bool mode) /* enable or disable ick_clockface mode (output IIII instead of IV) */ { if (mode) { /* ick_clockface mode */ ick_br_trans[4][0] = 4; ick_br_trans[4][1] = 0; ick_br_trans[4][2] = 0; } else { /* normal mode */ ick_br_trans[4][0] = 2; ick_br_trans[4][1] = 1; ick_br_trans[4][2] = 2; } } void ick_setclcsemantics(bool mode) /* AIS: CLC-INTERCAL semantics mode? */ { ick_clcsem=mode; } void ick_pout(unsigned int val) /* output in `butchered' Roman ick_numerals; see manual, part 4.4.13 */ { char result[2*MAXROMANS+1]; if(!ick_cesspoolout) ick_cesspoolout=stdout; /* AIS */ if(ick_wimp_mode) { (void) fprintf(ick_cesspoolout,"%u\n",val); } else { butcher(val, result); (void) fprintf(ick_cesspoolout,"%s\n",result); } (void) fflush(ick_cesspoolout); } /********************************************************************** * * AIS: CLC-INTERCAL bitwise I/O, only used in CLC-INTERCAL semantics * mode. The I/O is done in extended Baudot for a tail ick_array, or in * mingled form for a hybrid ick_array; for the Baudot, we rely on * clc-cset.c and on the Baudot and Latin-1 character sets that are * linked to libick.a (or libickmt.a), so the final executable doesn't * reference the compiler's libraries. clc-cset.c is designed to * handle this all transparently, though, so we don't have to worry * about the details. I wrote the next two functions. * **********************************************************************/ /* AIS: From clc-cset.c */ extern int ick_clc_cset_convert(const char* in, /*@partial@*/ char* out, const char* incset, const char* outcset, int padstyle, size_t outsize, /*@null@*/ FILE* errsto); static void clcbinin(unsigned int type, ick_array *a, bool forget) { size_t i; int ti; char* buf, *tempcp; /* Allocating one byte per element in the ick_array must be enough, * because the Baudot version cannot possibly be shorter than the * original Latin-1, plus one for the terminating NUL. There is one * potential problem, which is that fgets takes an int for the * number of bytes to read, so we cap the number of bytes to read * at INT_MAX and hope that's enough. */ i=a->dims[0]; /* we already know that there's 1 dim only */ if(SIZE_MAX/6-2<=a->dims[0]) ick_lose(IE252, ick_lineno, (const char*)NULL); /* size is too large */ if(!i) i=1; buf=malloc(i+1); if(!buf) ick_lose(IE252, ick_lineno, (const char*)NULL); if(!ick_cesspoolin) ick_cesspoolin=stdin; if(!fgets(buf,(int)(min(a->dims[0],(size_t)INT_MAX)),ick_cesspoolin)) strcpy(buf,"\n"); /* EOF inputs the null string in CLC-INTERCAL */ tempcp=strrchr(buf,'\n'); /* still working in ASCII at this point */ if(!tempcp) /* input too long for the ick_array is an error */ { free(buf); ick_lose(IE241, ick_lineno, (const char*)NULL); } *tempcp='\0'; /* chomp the final newline */ tempcp=malloc(6*i+12); /* to be on the safe side, even though * Baudot doesn't use 16-byte chars */ if(!tempcp) ick_lose(IE252, ick_lineno, (const char*)NULL); /* Zero the ick_array now. */ i=a->dims[0]; if(!forget) while(i--) if(type==ick_TAIL) a->data.tail[i]=0; else a->data.hybrid[i]=0; ti=ick_clc_cset_convert(buf,tempcp,"latin1","baudot",2,6*a->dims[0]+12,(FILE*)0); /* Negative ti ought to be impossible here; check anyway, and cause * an internal error if it has happened. */ if(ti<0) ick_lose(IE778, ick_lineno, (const char*)NULL); i=(size_t)ti; if(i>a->dims[0]) ick_lose(IE241, ick_lineno, (const char*)0); if(!forget) while(i--) if(type==ick_TAIL) a->data.tail[i]=(ick_type16)tempcp[i]+ (ick_type16)((rand()%256)*256); else a->data.hybrid[i]=(ick_type32)tempcp[i]+ (ick_type32)((rand()%256)*256); free(tempcp); free(buf); } static void clcbinout(unsigned int type, const ick_array* a) { size_t i; int ti; char* buf, *tempcp; if(SIZE_MAX/6-2<=a->dims[0]) ick_lose(IE252, ick_lineno, (const char*)NULL); /* size is too large */ buf=malloc(a->dims[0]+1); if(!buf) ick_lose(IE252, ick_lineno, (const char*) NULL); i=0; tempcp=buf; while(idims[0]) { /* Values above 31 are invalid in Baudot, so cap them at 33 to avoid integer wraparound trouble. */ if(type==ick_TAIL) *tempcp=(char)min(33,a->data.tail[i]); else *tempcp=(char)min(33,a->data.hybrid[i]); i++; if(*tempcp!='\0') tempcp++; /* NULs are ignored for some reason, but * that's the behaviour the CLC-INTERCAL * specs specify */ } *tempcp='\0'; /* tempcp is definitely overkill here, but the *6+6 rule is being * obeyed because that way the code is robust against any future * changes in character sets. */ tempcp=malloc(a->dims[0]*6+12); if(!tempcp) ick_lose(IE252, ick_lineno, (const char*) NULL); ti=ick_clc_cset_convert(buf,tempcp,"baudot","latin1",0,6*a->dims[0]+12,(FILE*)0); if(ti<0) ick_lose(IE778, ick_lineno, (const char*)NULL); i=(size_t)ti; tempcp[i]='\0'; /* CLC-INTERCAL bails out on invalid characters. C-INTERCAL uses * instead the behaviour of replacing them with character code 26. * (This is actually the purpose of character code 26 in ASCII, I * think, although this is derived from memory; I don't know of any * other system that uses it for this purpose, though, and the * ability to confuse Windows with it is worth what might be lost * through standards compliance, because Windows nonstandardly * treats it as an EOF character.) */ while(i--) if(tempcp[i] == '\0') tempcp[i]='\x1a'; if(!ick_cesspoolout) ick_cesspoolout=stdout; fprintf(ick_cesspoolout,"%s\n",tempcp); (void) fflush(ick_cesspoolout); free(tempcp); free(buf); } /********************************************************************** * * The following two routines implement bitwise I/O. They assume * 8 bit characters, but there's no reason more general versions * could not be written. * *********************************************************************/ void ick_binin(unsigned int type, ick_array *a, bool forget) { static int lastin = 0; int c, v; size_t i; if (a->rank != 1) ick_lose(IE241, ick_lineno, (const char *)NULL); if(!ick_cesspoolin) ick_cesspoolin=stdin; /* AIS */ if(ick_clcsem) {clcbinin(type, a, forget); return;} /* AIS */ for (i = 0 ; i < a->dims[0] ; i++) { v = ((c=fgetc(ick_cesspoolin)) == EOF) ? 256 : ((unsigned)c - lastin) % 256; lastin = c; if (!forget) { if (type == ick_TAIL) a->data.tail[i] = (ick_type16) v; else a->data.hybrid[i] = (ick_type32) v; } } } void ick_binout(unsigned int type, const ick_array *a) { static unsigned int lastout = 0; unsigned int c; size_t i; if (a->rank != 1) ick_lose(IE241, ick_lineno, (const char *)NULL); if(!ick_cesspoolout) ick_cesspoolout=stdout; /* AIS */ if(ick_clcsem) {clcbinout(type, a); return;} /* AIS */ for (i = 0 ; i < a->dims[0] ; i++) { if (type == ick_TAIL) c = lastout - a->data.tail[i]; else c = lastout - a->data.hybrid[i]; lastout = c; c = (c & 0x0f) << 4 | (c & 0xf0) >> 4; c = (c & 0x33) << 2 | (c & 0xcc) >> 2; c = (c & 0x55) << 1 | (c & 0xaa) >> 1; (void) fputc((int)c,ick_cesspoolout); if (c == 10 /* \n in INTERCAL */ || /* AIS */ ick_instapipe) (void) fflush(ick_cesspoolout); } } /********************************************************************** * * The following assignment function performs IGNORE and type checks * *********************************************************************/ unsigned int ick_assign(char *dest, unsigned int type, bool forget, unsigned int value) { unsigned int retval = 0; if (type == ick_ONESPOT || type == ick_TAIL) { if (value > (unsigned int)ick_Max_small) ick_lose(IE275, ick_lineno, (const char *)NULL); if (forget) retval = value; else { retval = *(ick_type16*)dest; *(ick_type16*)dest = (ick_type16) value; } } else if (type == ick_TWOSPOT || type == ick_HYBRID) { if (forget) retval = value; else { retval = *(ick_type32*)dest; *(ick_type32*)dest = value; } } return retval; } /********************************************************************** * * The following functions implement the INTERCAL ick_array model * If HAVE_STDARG_H is defined, stdarg is used, otherwise varargs. * *********************************************************************/ #ifdef HAVE_STDARG_H /*@dependent@*/ void *ick_aref(unsigned int type, ...) #else /*@dependent@*/ void *ick_aref(va_alist) va_dcl #endif /* return a pointer to the ick_array location specified by args */ { #ifndef HAVE_STDARG_H unsigned int type; #endif ick_array *a; unsigned int v; va_list ap; size_t address = 0; unsigned int i; #ifdef HAVE_STDARG_H va_start(ap, type); #else va_start(ap); type = va_arg(ap, unsigned int); #endif a = va_arg(ap, ick_array*); if (va_arg(ap, unsigned int) != a->rank) ick_lose(IE241, ick_lineno, (const char *)NULL); for (i = 0 ; i < a->rank ; i++) { v = va_arg(ap, unsigned int); if (v == 0 || (size_t)v > a->dims[i]) ick_lose(IE241, ick_lineno, (const char *)NULL); address = address * a->dims[i] + v - 1; } va_end(ap); if (type == ick_TAIL) return (void*)&(a->data.tail[address]); else return (void*)&(a->data.hybrid[address]); } #ifdef HAVE_STDARG_H void ick_resize(unsigned int type, ...) #else void ick_resize(va_alist) va_dcl #endif /* ick_resize an ick_array to the given shape */ { #ifndef HAVE_STDARG_H unsigned int type; #endif ick_array *a; bool forget; unsigned int i, r; size_t v; va_list ap; int prod = 1; #ifdef HAVE_STDARG_H va_start(ap, type); #else va_start(ap); type = va_arg(ap, unsigned int); #endif a = va_arg(ap, ick_array*); #ifdef BOOL_VARARGS_BROKEN forget = (bool)va_arg(ap, int); #else forget = va_arg(ap, bool); #endif /* AIS: a->dims is no longer initialised. So initialise it here if it isn't already initialised, with an annotation to explain that we aren't freeing the old pointer (because it was never malloced in the first place and is probably invalid anyway.) */ /*@-mustfreeonly@*/ if (!a->rank) a->dims = 0; /*@-mustfreeonly@*/ r = va_arg(ap, unsigned int); if (!forget) { a->rank = r; if (a->dims) free((char*)a->dims); a->dims = malloc(a->rank * sizeof(*(a->dims))); if (a->dims == NULL) ick_lose(IE241, ick_lineno, (const char *)NULL); } for (i = 0 ; i < r ; i++) { v = va_arg(ap, size_t); if (v == 0) ick_lose(IE240, ick_lineno, (const char *)NULL); if (!forget) { assert(a->dims != NULL); /* AIS: it isn't, because !forget, but splint doesn't know that */ a->dims[i] = v; prod *= v; } } if (!forget) { if (type == ick_TAIL) { if (a->data.tail) free((char *)a->data.tail); a->data.tail = (ick_type16*)malloc(prod * sizeof(ick_type16)); if (a->data.tail == NULL) ick_lose(IE241, ick_lineno, (const char *)NULL); } else { if (a->data.hybrid) free((char *)a->data.hybrid); a->data.hybrid = (ick_type32*)malloc(prod * sizeof(ick_type32)); if (a->data.hybrid == NULL) ick_lose(IE241, ick_lineno, (const char *)NULL); } } va_end(ap); } /********************************************************************** * * The following functions implement save/retrieve * *********************************************************************/ /*@null@*/ ick_stashbox *ick_first; /* AIS: made non-static so it can be seen by unravel.c */ void ick_stashinit(void) { ick_first = NULL; } static /*@null@*/ ick_stashbox *fetch(unsigned int type, unsigned int index) /* find a stashed variable in the save stack and extract it */ { ick_stashbox **pp = &ick_first, *sp = ick_first; while (sp != NULL && (sp->type != type || sp->index != index)) { pp = &sp->ick_next; sp = sp->ick_next; } if (sp) *pp = sp->ick_next; /* The annotation here is because Splint can't figure out that ick_first can be modified via pp, and because this function is the place where storage marked 'dependent' is initialised and deinitialised. */ /*@-globstate@*/ /*@-dependenttrans@*/ return (sp); /*@=globstate@*/ /*@=dependenttrans@*/ } void ick_stash(unsigned int type, unsigned int index, void *from, ick_overop* oo) /* stash away the variable's value */ { /*@-nullassign@*/ ick_overop dummyoo; /*@=nullassign@*/ /* create a new ick_stashbox and push it onto the stack */ ick_stashbox *sp; dummyoo.get = (ick_type32 (*)(ick_type32))NULL; dummyoo.set = (void (*)(ick_type32, void(*)()))NULL; sp = (ick_stashbox*)malloc(sizeof(ick_stashbox)); if (sp == NULL) ick_lose(IE222, ick_lineno, (const char *)NULL); sp->ick_next = ick_first; ick_first = sp; /* store the variable in it */ ick_first->type = type; ick_first->index = index; if(oo) ick_first->overloadinfo=oo[index]; /* AIS */ else ick_first->overloadinfo=dummyoo; /* AIS */ if (type == ick_ONESPOT) { memcpy(&ick_first->save.onespot, from, sizeof(ick_type16)); } else if (type == ick_TWOSPOT) memcpy(&ick_first->save.twospot, from, sizeof(ick_type32)); else if (type == ick_TAIL || type == ick_HYBRID) { ick_array *a = (ick_array*)from; int prod; unsigned int i; ick_first->save.a = (ick_array*)malloc(sizeof(ick_array)); if (ick_first->save.a == NULL) ick_lose(IE222, ick_lineno, (const char *)NULL); ick_first->save.a->rank = a->rank; ick_first->save.a->dims = malloc(a->rank * sizeof(*(ick_first->save.a->dims))); if (ick_first->save.a->dims == NULL) ick_lose(IE222, ick_lineno, (const char *)NULL); memcpy(ick_first->save.a->dims, a->dims, a->rank * sizeof(*(a->dims))); prod = a->rank ? 1 : 0; for (i = 0 ; i < a->rank ; i++) { prod *= a->dims[i]; } if (type == ick_TAIL) { ick_first->save.a->data.tail = (ick_type16*)malloc(prod * sizeof(ick_type16)); if (ick_first->save.a->data.tail == NULL) ick_lose(IE222, ick_lineno, (const char *)NULL); memcpy(ick_first->save.a->data.tail, a->data.tail, prod * sizeof(ick_type16)); } else { ick_first->save.a->data.hybrid = (ick_type32*)malloc(prod * sizeof(ick_type32)); if (ick_first->save.a->data.hybrid == NULL) ick_lose(IE222, ick_lineno, (const char *)NULL); memcpy(ick_first->save.a->data.hybrid, a->data.hybrid, prod * sizeof(ick_type32)); } } return; } void ick_retrieve(void *to, unsigned int type, unsigned int index, bool forget, ick_overop* oo) /* restore the value of a variable from the save stack */ { ick_stashbox *sp; if ((sp = fetch(type, index)) == (ick_stashbox *)NULL) ick_lose(IE436, ick_lineno, (const char *)NULL); else if (!forget) { if(oo) oo[index]=sp->overloadinfo; /* AIS */ if (type == ick_ONESPOT) memcpy(to, (const char *)&sp->save.onespot, sizeof(ick_type16)); else if (type == ick_TWOSPOT) memcpy(to, (const char *)&sp->save.twospot, sizeof(ick_type32)); else if (type == ick_TAIL || type == ick_HYBRID) { ick_array *a = (ick_array*)to; /*@-branchstate@*/ /* it's a union, so one valid is correct */ if (a->rank) { free(a->dims); if (type == ick_TAIL) free(a->data.tail); else free(a->data.hybrid); memcpy(to, (const char*)sp->save.a, sizeof(ick_array)); } /*@=branchstate@*/ /* AIS: there isn't a memory leak here, because we memcpyd the pointers elsewhere and so they are yet accessible. You can't expect Splint to figure out what's going on there, though, thus the annotations. */ /*@-compdestroy@*/ free(sp->save.a); /*@=compdestroy@*/ } } else if (type == ick_TAIL || type == ick_HYBRID) { free(sp->save.a->dims); if (type == ick_TAIL) free(sp->save.a->data.tail); else free(sp->save.a->data.hybrid); free(sp->save.a); } free(sp); } /********************************************************************** * * The following function is used for random decision making * *********************************************************************/ unsigned int ick_roll(unsigned int n) /* return true on n% chance, false otherwise */ { #ifdef USG return((unsigned int)(lrand48() % 100) < n); #else return((unsigned int)(rand() % 100) < n); #endif /* UNIX */ } /********************************************************************** * * AIS: This function is called when two COME FROMs reference the same * line at runtime. ick_multicome0 is used in a non-multithread * program; it produces an error. For multicome1, see unravel.c. * *********************************************************************/ int ick_multicome0(int errlineno, jmp_buf pc) { /*@-noeffect@*/ (void) pc; /* it's ignored by this function */ /*@=noeffect@*/ ick_lose(IE555, errlineno, (const char *) NULL); /* this line number is quite possibly going to be wildly inaccurate */ /*@-unreachable@*/ return 0; /*@=unreachable@*/ } /********************************************************************** * * AIS: The next two functions are mine, and handle CREATE statements. * **********************************************************************/ struct ick_jictype { /*@observer@*/ const char* sig; /* a shallow copy of a constant string */ unsigned long target; /*@null@*/ /*@only@*/ struct ick_jictype* next; }; /*@null@*/ /*@only@*/ static struct ick_jictype* jiclist = NULL; /* Return a jic entry that matches the requested signature exactly, creating one if there isn't one yet. */ static struct ick_jictype* jicextract(/*@observer@*/ const char* sig) { struct ick_jictype* jicptr = jiclist; while(jicptr) { if(strcmp(jicptr->sig,sig)==0) return jicptr; if(jicptr->next != NULL) jicptr = jicptr->next; else break; } if(!jicptr) { jiclist=malloc(sizeof *jiclist); jicptr=jiclist; } else { jicptr->next=malloc(sizeof *jiclist); jicptr=jicptr->next; } jicptr->next = NULL; jicptr->sig = sig; jicptr->target = 0; return jicptr; } void ick_registercreation(const char* sig, unsigned long target) { jicextract(sig)->target=target; } unsigned long ick_jicmatch(const char* sig) { return jicextract(sig)->target; } /* AIS: Used by the JIC code to error out when attempting to access an array */ ick_type32 ick_ieg277(ick_type32 ignored) { /*@-noeffect@*/ (void) ignored; /*@=noeffect@*/ ick_lose(IE277, ick_lineno, (const char*) NULL); } void ick_ies277(ick_type32 ignored, void(*ignored2)()) { /*@-noeffect@*/ (void) ignored; (void) ignored2; /*@=noeffect@*/ ick_lose(IE277, ick_lineno, (const char*) NULL); } /* cesspool.c ends here */ intercal-0.30/src/PaxHeaders.27456/baudot.bin0000644000000000000000000000007411437550756015562 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.490945962 intercal-0.30/src/baudot.bin0000644000175000017500000000021611437550756015454 0ustar00esresr0000000000000032 4 xxxedcba Ee3¢ Aa-+ Ss\Ii8#Uu7= Dd$*Rr4{Jj'~Nn,¥Ff!|Cc:^Kk(Ll2]HhYy6@Pp0Qq1£Oo9¬Bb?Gg&Mm.%Xx/_Vv;intercal-0.30/src/PaxHeaders.27456/ick_lose.h0000644000000000000000000000007411437550756015553 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.506945917 intercal-0.30/src/ick_lose.h0000644000175000017500000002621511437550756015454 0ustar00esresr00000000000000/* ick_lose.h --- error message strings */ /* * Note: these error message texts, with one exception, are direct from * the Princeton compiler (INTERCAL-72) sources (transmitted by Don Woods). * The one exception is IE632, which in INTERCAL-72 had the error message * PROGRAM ATTEMPTED TO EXIT WITHOUT ERROR MESSAGE * ESR's "THE NEXT STACK HAS RUPTURED!..." has been retained on the grounds * that it is more obscure and much funnier. For context, find a copy of * Joe Haldeman's SF short story "A !Tangled Web", ick_first published in * Analog magazine in September 1981 and later anthologized in the author's * "Infinite Dreams" (Ace 1985). */ /* An undecodable statement has been encountered in the course of execution. */ #define IE000 "000 %s\n\ ON THE WAY TO %d\n" /* An expression contains a syntax error. */ #define IE017 "017 DO YOU EXPECT ME TO FIGURE THIS OUT?\n\ ON THE WAY TO %d\n" /* Improper use has been made of statement identifiers. */ #define IE079 "079 PROGRAMMER IS INSUFFICIENTLY POLITE\n\ ON THE WAY TO %d\n" /* Improper use has been made of statement identifiers. */ #define IE099 "099 PROGRAMMER IS OVERLY POLITE\n\ ON THE WAY TO %d\n" /* Program has attempted 80 levels of NEXTing */ #define IE123 "123 PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON\n\ ON THE WAY TO %d\n" /* Program has attempted to transfer to a non-existent line label */ #define IE129 "129 PROGRAM HAS GOTTEN LOST\n\ ON THE WAY TO WHO KNOWS WHERE\n" /* An ABSTAIN or REINSTATE statement references a non-existent line label */ #define IE139 "139 I WASN'T PLANNING TO GO THERE ANYWAY\n\ ON THE WAY TO %d\n" /* A line label has been multiply defined. */ #define IE182 "182 YOU MUST LIKE THIS LABEL A LOT!\n\ ON THE WAY TO %d\n" /* An invalid line label has been encountered. */ #define IE197 "197 SO! 65535 LABELS AREN'T ENOUGH FOR YOU?\n\ ON THE WAY TO %d\n" /* An expression involves an unidentified variable. */ #define IE200 "200 NOTHING VENTURED, NOTHING GAINED\n\ ON THE WAY TO %d\n" /* An attempt has been made to give an array a dimension of zero. */ #define IE240 "240 ERROR HANDLER PRINTED SNIDE REMARK\n\ ON THE WAY TO %d\n" /* Invalid dimensioning information was supplied * in defining or using an array. */ #define IE241 "241 VARIABLES MAY NOT BE STORED IN WEST HYPERSPACE\n\ ON THE WAY TO %d\n" /* A 32-bit value has been assigned to a 16-bit variable. */ #define IE275 "275 DON'T BYTE OFF MORE THAN YOU CAN CHEW\n\ ON THE WAY TO %d\n" /* A retrieval has been attempted for an unSTASHed value. */ #define IE436 "436 THROW STICK BEFORE RETRIEVING!\n\ ON THE WAY TO %d\n" /* A WRITE IN statement or interleave ($) operation * has produced value requiring over 32 bits to represent. */ #define IE533 "533 YOU WANT MAYBE WE SHOULD IMPLEMENT 64-BIT VARIABLES?\n\ ON THE WAY TO %d\n" /* Insufficient data. (raised by reading past EOF) */ #define IE562 "562 I DO NOT COMPUTE\n\ ON THE WAY TO %d\n" /* Input data is invalid. */ #define IE579 "579 WHAT BASE AND/OR LANGUAGE INCLUDES %s?\n\ ON THE WAY TO %d\n" /* The expression of a RESUME statement evaluated to #0. */ #define IE621 "621 ERROR TYPE 621 ENCOUNTERED\n\ ON THE WAY TO %d\n" /* Program execution terminated via a RESUME statement instead of GIVE UP. */ #define IE632 "632 THE NEXT STACK RUPTURES. ALL DIE. OH, THE EMBARRASSMENT!\n\ ON THE WAY TO %d\n" /* Execution has passed beyond the last statement of the program. */ #define IE633 "633 PROGRAM FELL OFF THE EDGE\n\ ON THE WAY TO THE NEW WORLD\n" /* A compiler error has occurred (see section 8.1). */ #define IE774 "774 RANDOM COMPILER BUG\n\ ON THE WAY TO %d\n" /* An unexplainable compiler error has occurred (see J. Lyon or D. Woods). */ #define IE778 "778 UNEXPLAINED COMPILER BUG\n\ ON THE WAY TO %d\n" /* * These errors are unique to C-INTERCAL. */ /* You tried to use a C-INTERCAL extension with the `ick_traditional' flag on */ #define IE111 "111 COMMUNIST PLOT DETECTED, COMPILER IS SUICIDING\n\ ON THE WAY TO %d\n" /* Cannot find the magically included system library */ #define IE127 "127 SAYING 'ABRACADABRA' WITHOUT A MAGIC WAND WON'T DO YOU ANY GOOD\n\ ON THE WAY TO THE CLOSET\n" /* Out of stash space */ #define IE222 "222 BUMMER, DUDE!\n\ ON THE WAY TO %d\n" /* (AIS) Out of memory during I/O */ #define IE252 "252 I'VE FORGOTTEN WHAT I WAS ABOUT TO SAY\n\ ON THE WAY TO %d\n" /* (AIS) Can't reverse an expression in an assignment. This is the same error number as in CLC-INTERCAL, but the message is different. */ #define IE277 "277 YOU CAN ONLY DISTORT THE LAWS OF MATHEMATICS SO FAR\n\ ON THE WAY TO %d\n" /* (AIS) The spark/ears nesting is too deep. */ #define IE281 "281 THAT MUCH QUOTATION AMOUNTS TO PLAGIARISM\n\ ON THE WAY TO %d\n" /* Too many variables. */ #define IE333 "333 YOU CAN'T HAVE EVERYTHING, WHERE WOULD YOU PUT IT?\n\ ON THE WAY TO %d\n" /* Out of memory during compilation. */ #define IE345 "345 THAT'S TOO COMPLEX FOR ME TO GRASP\n\ ON THE WAY TO SOMEWHERE\n" /* (AIS, from the suggestion by Malcom Ryan) GO BACK or GO AHEAD was executed without a choicepoint. */ #define IE404 "404 I'M ALL OUT OF CHOICES!\n\ ON THE WAY TO %d\n" /* (AIS) WHILE, MAYBE, GO BACK, or GO AHEAD used without the -m option. */ #define IE405 "405 PROGRAM REJECTED FOR MENTAL HEALTH REASONS\n\ ON THE WAY TO %d\n" /* A COME FROM statement references a non-existent line label. */ #define IE444 "444 IT CAME FROM BEYOND SPACE\n\ ON THE WAY TO %d\n" /* (AIS) We just buffer-overflowed. (Detecting this /before/ the overflow happens is probably more secure, but harder and less fun. As long as we don't return from any functions, it's probably safe in theory, but don't rely on this. */ #define IE553 "553 BETTER LATE THAN NEVER\n\ ON THE WAY TO %d\n" /* More than one COME FROM references the same label. */ #define IE555 "555 FLOW DIAGRAM IS EXCESSIVELY CONNECTED\n\ ON THE WAY TO %d\n" /* Too many source lines, or too many input files, or source line is too long. */ #define IE666 "666 COMPILER HAS INDIGESTION\n\ ON THE WAY TO %d\n" /* No such source file. */ #define IE777 "777 A SOURCE IS A SOURCE, OF COURSE, OF COURSE\n\ ON THE WAY TO %d\n" /* Can't open C output file */ #define IE888 "888 I HAVE NO FILE AND I MUST SCREAM\n\ ON THE WAY TO %d\n" /* Can't open C skeleton file. */ #define IE999 "999 NO SKELETON IN MY CLOSET, WOE IS ME!\n\ ON THE WAY TO %d\n" /* Source file name with invalid extension (use .i or .[3-7]i). */ #define IE998 "998 EXCUSE ME,\n\ YOU MUST HAVE ME CONFUSED WITH SOME OTHER COMPILER\n" /* (AIS) File used of a type for which the required libraries aren't available. */ #define IE899 "899 HELLO?\n\ CAN ANYONE GIVE ME A HAND HERE?\n" /* Illegal possession of a controlled unary operator. */ #define IE997 "997 ILLEGAL POSSESSION OF A CONTROLLED UNARY OPERATOR.\n\ ON THE WAY TO %d\n" /* (AIS) Command found after TRY AGAIN. */ #define IE993 "993 I GAVE UP LONG AGO\n\ ON THE WAY TO %d\n" /* (AIS) Memory allocation failure during multithreading */ #define IE991 "991 YOU HAVE TOO MUCH ROPE TO HANG YOURSELF\n\ ON THE WAY TO %d\n" /* (AIS) Unimplemented feature used. This should never come up, hopefully. */ #define IE995 "995 DO YOU REALLY EXPECT ME TO HAVE IMPLEMENTED THAT?\n\ ON THE WAY TO %d\n" /* Unknown invocation flag */ #define IE990 "990 FLAG ETIQUETTE FAILURE BAD SCOUT NO BISCUIT.\n\ ON THE WAY TO %d\n" /* Code generator encountered an unknown opcode in a tuple */ #define IE994 "994 NOCTURNAL EMISSION, PLEASE LAUNDER SHEETS IMMEDIATELY.\n\ ON THE WAY TO %d\n" /* * AIS: These errors are specific to PIC-INTERCAL */ /* (AIS) Attempted to use an unsupported language feature. */ #define IE256 "256 THAT'S TOO HARD FOR MY TINY BRAIN\n\ ON THE WAY TO %d\n" /* (AIS) Attempted to use a PIC feature in a non-PIC program. */ #define IE652 "652 HOW DARE YOU INSULT ME!\n\ ON THE WAY TO %d\n" /* * AIS: These errors are generated by the yuk debugger */ /* (AIS) fgets' buffer overflowed on debugger comand input. */ #define IE810 "810 ARE ONE-CHARACTER COMMANDS TOO SHORT FOR YOU?\n\ ON THE WAY TO %d\n" /* (AIS) Too many breakpoints. */ #define IE811 "811 PROGRAM IS TOO BADLY BROKEN TO RUN\n\ ON THE WAY TO %d\n" /* * (AIS) Warnings produced by -l. */ /* (AIS) Non-INTERCAL-72 identifier used. */ #define W112 "112 THAT RELIES ON THE NEW WORLD ORDER\n\ ON THE WAY TO %d\n" /* (AIS) That stupid idiom in syslib was used. */ #define W128 "128 SYSLIB IS OPTIMIZED FOR OBFUSCATION\n\ ON THE WAY TO %d\n" /* (AIS) Possibly nonportable unary operator. */ #define W534 "534 KEEP LOOKING AT THE TOP BIT\n\ ON THE WAY TO %d\n" /* (AIS) Expression still contains INTERCAL operators after optimization. Only in binary, because this nearly always happens in the higher bases. Syslib causes quite a lot of these. This warning is fine on INTERCAL-like lines, but flags a mistake on lines that are meant to be translations of C. */ #define W018 "018 THAT WAS MEANT TO BE A JOKE\n\ ON THE WAY TO %d\n" /* (AIS) Possible misplaced unary operator. At the moment, ick -l cannot detect this condition (so it never comes up). It's meant to detect expressions like '?"?.1~#256"$#2'~#3 (from numio.i); in this expression, the second what has no effect (it changes only the msb of the immediately surrounding expression, which is eventually filtered out by the select against #3). But detecting this would probably require code that could check which bits of a result were going to be used elsewhere in an expression, which is something I haven't written yet (but would make a decent optimize_pass3). */ #define W016 "016 DON'T TYPE THAT SO HASTILY\n\ ON THE WAY TO %d\n" /* (AIS) Possibly overflowing assignment or ick_mingle. Syslib causes some of these too, in complicated situations where the bugcatcher can't figure out what's happening, and also in a few blatant statements in the mould of DO .3 <- :3, which are quite clearly possible overflows. Strangely enough, there's a commented-out section of code in feh.c that suggests that someone tried to make this an error (using a more general check which would have caught more correct code involving GETS, but none involving $). As a middle ground, I've made it an -l warning. */ #define W276 "276 YOU CAN'T EXPECT ME TO CHECK BACK THAT FAR\n\ ON THE WAY TO %d\n" /* (AIS) A line will inevitably cause an expression-reversal failure. */ #define W278 "278 FROM A CONTRADICTION, ANYTHING FOLLOWS\n\ ON THE WAY TO A HUGE DISASTER\n" /* (AIS) The two following warnings are both compile-time traps for near-certain runtime errors. As such, they have similar numbers and similar messages. In fact, they're a shameless ripoff of the originals, but should serve as a reminder for anyone aware of the original messages. */ /* (AIS) Dimension given for an ick_array will come out as #0. */ #define W239 "239 WARNING HANDLER PRINTED SNIDE REMARK\n\ ON THE WAY TO %d\n" /* (AIS) RESUME argument will come out as #0. */ #define W622 "622 WARNING TYPE 622 ENCOUNTERED\n\ ON THE WAY TO %d\n" extern int ick_lineno; extern void /*@noreturn@*/ ick_lose(const char *m, int n, /*@null@*/ const char *s) #ifdef __GNUC__ __attribute__ ((noreturn)) #endif ; extern void ick_lwarn(const char *m, int n, /*@null@*/ const char *s); /* ick_lose.h ends here */ intercal-0.30/src/PaxHeaders.27456/sizes.h0000644000000000000000000000007411437550756015120 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.614945617 intercal-0.30/src/sizes.h0000644000175000017500000000037411437550756015017 0ustar00esresr00000000000000/* sizes.h -- constants defining the numeric base for INTERCAL variations */ extern int ick_Base; extern int ick_Small_digits; extern int ick_Large_digits; extern unsigned int ick_Max_small; extern unsigned int ick_Max_large; /* sizes.h ends here */ intercal-0.30/src/PaxHeaders.27456/feh2.c0000644000000000000000000000013212112464516014562 xustar0030 mtime=1361733966.674547276 30 atime=1427954558.375140793 30 ctime=1427992235.546945805 intercal-0.30/src/feh2.c0000664000175000017500000025222112112464516014470 0ustar00esresr00000000000000/**************************************************************************** Name feh2.c -- code-generator back-end for ick parser DESCRIPTION This module provides storage manglement and code degeneration for the INTERCAL compiler. Optimizations (formerly in this file) were split into dekludge.c. LICENSE TERMS Copyright (C) 1996 Eric S. Raymond This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ****************************************************************************/ /*LINTLIBRARY */ #include "config.h" #include #include #include #include #include "sizes.h" #include "ick.h" #include "parser.h" #include "fiddle.h" #include "ick_lose.h" #include "feh.h" /* AIS: Destaticed for dekludge.c */ int emitlineno; /* line number for errors encountered during emit */ /*@-exportlocal@*/ /* the parser uses this */ bool mark112 = 0; /* AIS: Mark the ick_next generated tuple for W112 */ /*@=exportlocal@*/ /* AIS: From perpet.c */ extern bool pickcompile; extern bool ick_clcsemantics; /************************************************************************* * * Node allocation functions. * * Nodes are used to represent expression trees. The emit() function * deallocates them. * **************************************************************************/ /*@partial@*/ node *newnode(void) /* allocate and zero out a new expression node */ { node* temp; temp=calloc(sizeof(node), 1); if(!temp) ick_lose(IE345, 0, (const char*) NULL); return temp; } /*@partial@*/ node *cons(int type, /*@null@*/ /*@keep@*/ node *car, /*@null@*/ /*@keep@*/ node *cdr) { node *np = newnode(); np->opcode = type; np->lval = car; np->rval = cdr; return(np); } /************************************************************************* * * Variable-name mapping * * This permits us to optimize use of variable storage at runtime * **************************************************************************/ unsigned long intern(int type, unsigned long index) { atom *x; /* AIS: Allow use of a modifiable constant 0 or >65535. */ if ((index < 1LU || index > 65535LU) && type!=MESH) ick_lose(IE200, iyylineno, (const char *)NULL); /*@-branchstate@*/ if (!oblist) { /* initialize oblist and obdex */ oblist = malloc(ALLOC_CHUNK * sizeof(atom)); if (!oblist) ick_lose(IE345, iyylineno, (const char *)NULL); obdex = oblist; obcount = ALLOC_CHUNK; } else { /* if it's already on the oblist, return its intindex */ for (x = oblist; x < obdex; x++) if (x->type == type && x->extindex == index) return(x->intindex); } /*@=branchstate@*/ assert(oblist != NULL); /* else we must intern a new symbol */ /* AIS: Splint doesn't understand what's going on here at all. Disabling the warnings; I've checked this and think it's correct. */ /*@-usedef@*/ /*@-usereleased@*/ /*@-branchstate@*/ if (obdex >= oblist + obcount) { obcount += ALLOC_CHUNK; x = realloc(oblist, obcount * sizeof(atom)); if (!x) ick_lose(IE333, iyylineno, (const char *)NULL); obdex = x + (obdex - oblist); oblist = x; } /*@=branchstate@*/ /*@=usereleased@*/ /*@=usedef@*/ obdex->type = type; obdex->extindex = index; obdex->memloc = 0; /* AIS: not placed in memory yet */ if (type == ick_ONESPOT) obdex->intindex = (unsigned)nonespots++; if (type == ick_TWOSPOT) obdex->intindex = (unsigned)ntwospots++; if (type == ick_TAIL) obdex->intindex = (unsigned)ntails++; if (type == ick_HYBRID) obdex->intindex = (unsigned)nhybrids++; if (type == MESH) /* AIS: count meshes too */ obdex->intindex = (unsigned)nmeshes++; ++obdex; /*@-usedef@*/ return(obdex[-1].intindex); /*@=usedef@*/ } /************************************************************************* * * This function insures a label is valid. * **************************************************************************/ /* AIS: I haven't modified this function, but I have repurposed it without changing the code; this function must not now have side effects (apart from an error exit), because some labels are initialised in the preprocessor without causing this. */ void checklabel(int label) { if (label < 1 || label > 65535) ick_lose(IE197, iyylineno, (const char *)NULL); } /************************************************************************* * * AIS: Search for the indexth COME_FROM sucking in the given tuple. * Return an int representing the COME_FROM's tn-tuples+1, or -1. * index is based at 1, not 0 as is usual for C. * ***************************************************************************/ int comefromsearch(tuple* tn, unsigned int index) { tuple* tp; for (tp = tuples; tp < tuples + ick_lineno; tp++) { if((tp->type == COME_FROM || tp->type == NEXTFROMLABEL) && tp->u.target == (unsigned)(tn-tuples+1)) index--; if(!index) return tp-tuples+1; } return -1; } /************************************************************************* * * Tuple allocation functions. * **************************************************************************/ void treset(void) { tuplecount = 0; if (tuples) { /* AIS: Splint doesn't understand lazy allocation, which is why it thinks I'm treating an unqualified as an only (I am, but a lazy list doesn't fit any of Splint's storage classes); also, I am completely destroying the tuples, because any nodes in them ought to have been deallocated in prexpr. */ /*@-unqualifiedtrans@*/ /*@-compdestroy@*/ free(tuples); tuples = NULL; /*@=unqualifiedtrans@*/ /*@=compdestroy@*/ } nmeshes = nonespots = ntwospots = ntails = nhybrids = 0; obdex = oblist; ick_lineno = 0; /* AIS: It's easier to mark tuples as 'always allocated', because it usually is, and just supress the warnings. Maybe the 'proper' way to do it would be to assert that tuples was non-null everywhere, but again this is just problems with Splint not understanding how lazy allocation works. So I tell Splint that it's allocated everywhere and just supress the warnings it produces when it isn't. */ /*@-globstate@*/ } /*@=globstate@*/ /*@out@*/ /*@dependent@*/ tuple *newtuple(void) /* allocate and zero out a new expression tuple */ { /* Patch by Joris Huizer: must leave at least 1 tuple empty */ if (ick_lineno >= tuplecount - 1 || tuples == NULL) { tuplecount += ALLOC_CHUNK; if (tuples) tuples = (tuple *)realloc(tuples, tuplecount * sizeof(tuple)); else tuples = (tuple *)malloc(tuplecount * sizeof(tuple)); if (!tuples) ick_lose(IE666, iyylineno, (const char *)NULL); memset(tuples + ick_lineno, 0, (tuplecount - ick_lineno) * sizeof(tuple)); } if(mark112) tuples[ick_lineno].warn112 = true; mark112 = false; /* AIS */ /* Yes, tuples is strictly speaking 'partial' at this point, but it's going to be filled in later, and isn't marked as partial due to it not being partial through most of the code, and you can't write out on a global. So instead I'm just suppressing the warning, because it doesn't lead to a problem long-term. */ /*@-compdef@*/ return(tuples + ick_lineno++); /*@=compdef@*/ } void tupleswap(int distback1, int distback2) { tuple temp; memcpy(&temp, &tuples[ick_lineno-distback1], sizeof(tuple)); memcpy(&tuples[ick_lineno-distback1], &tuples[ick_lineno-distback2], sizeof(tuple)); memcpy(&tuples[ick_lineno-distback2], &temp, sizeof(tuple)); /* Splint doesn't understand memcpy, and so falsely things this is a memory leak. */ /*@-compdestroy@*/ } /*@=compdestroy@*/ void ppinit(int tuplecount) { while(tuplecount) { /* 0 is an impossible exechance; make sure it's set for tuple elements. */ if(!tuples[ick_lineno-tuplecount].exechance) tuples[ick_lineno-tuplecount].exechance=100; /* The onceagainflag also needs to be set. */ tuples[ick_lineno-tuplecount].onceagainflag=onceagain_NORMAL; tuplecount--; } } /************************************************************************* * * The typecaster * * The theory here is that we associate a type with each node in order to * know what widths of unary-logical operator to use. * **************************************************************************/ void typecast(node *np) { /* recurse so we typecast each node after all its subnodes */ if (np == (node *)NULL) return; else if (np->lval != (node *)NULL) typecast(np->lval); if (np->rval != (node *)NULL) typecast(np->rval); /* * This is an entire set of type-deducing machinery right here. */ /*@-nullderef@*/ /* AIS: because the opcode defines whether lval or rval are nonnull */ if (np->opcode == MESH || np->opcode == ick_ONESPOT || np->opcode == ick_TAIL) np->width = 16; else if (np->opcode == ick_TWOSPOT || np->opcode == ick_HYBRID || np->opcode == MINGLE || np->opcode == MESH32 || np->opcode == UNKNOWNOP /* AIS */) np->width = 32; else if (np->opcode == AND || np->opcode == OR || np->opcode == XOR || np->opcode == FIN || (np->opcode >= WHIRL && np->opcode <= WHIRL5)) np->width = np->rval->width; else if (np->opcode == SELECT) np->width = np->rval->width; /* n-bit select has an n-bit result */ else if (np->opcode == INTERSECTION) /* AIS */ np->width = (np->rval ? np->lval ? np->rval->width == 16 ? np->lval->width : 32 : np->rval->width : np->lval ? np->lval->width : 32); else if (np->opcode == BADCHAR) /* AIS */ np->width = 16; else if (np->opcode == SUB) np->width = np->lval->width; /* type of the array */ else if (np->opcode == SLAT || np->opcode == BACKSLAT) np->width = np->lval->width; /* AIS: \ and / return their left arg */ /*@=nullderef@*/ } /************************************************************************* * * The codechecker * * This checks for nasties like mismatched types in assignments that * can be detected at compile time -- also for errors that could cause * the compilation of the generated C to fail, like generated gotos to * nonexistent labels or duplicate labels. * * AIS: codecheck has another important job, that of filling in information * about COME FROM suckpoints and ABSTAIN/REINSTATE command numbers * into the tuples. * **************************************************************************/ void codecheck(void) { tuple *tp, *up; int notpast1900; /* AIS */ /* check for assignment type mismatches */ /* This check can't be done at compile time---RTFM. [LHH] */ /* for (tp = tuples; tp < tuples + ick_lineno; tp++) if (tp->type == GETS) if (tp->u.node->lval->width == 16 && tp->u.node->rval->width == 32) ick_lose(IE275, tp - tuples + 1, (const char *)NULL); */ /* check for duplicate labels */ for (tp = tuples; tp < tuples + ick_lineno; tp++) if (tp->label) for (up = tuples; up < tuples + ick_lineno; up++) if (tp != up && tp->label == up->label) ick_lose(IE182, tp - tuples + 1, (const char *)NULL); /* * Check that every NEXT, ABSTAIN, REINSTATE and COME_FROM actually has a * legitimate target label. */ notpast1900 = 1; for (tp = tuples; tp < tuples + ick_lineno; tp++) { if (tp->label == 1900) notpast1900 = false; /* AIS */ if (tp->type == NEXT || tp->type == ABSTAIN || tp->type == REINSTATE || tp->type == COME_FROM || tp->type == FROM || tp->type == NEXTFROMLABEL) /* AIS: added FROM, NEXTFROMLABEL. */ { bool foundit = false; if (tp->u.target >= 1900 && tp->u.target <= 1998) { /* AIS: This program uses syslib.i's random number feature... or are we in syslib already? */ if(notpast1900) coopt = 0; } if (tp->u.target > 65535 && !tp->preproc) /* AIS */ ick_lose(IE197, tp - tuples + 1, (const char*) NULL); for (up = tuples; up < tuples + ick_lineno; up++) if (tp->u.target == up->label) { foundit = true; break; } if (!foundit) { /* AIS: Added the pickcompile check. Syslib has to be optimized for PICs, so syslib.i isn't imported and so none of the lables in it will appear in the program. Also added the useickec check, as that's another legitimate way for a NEXT to target a nonexistent line label */ if (tp->type == NEXT && !useickec && (!pickcompile||tp->u.target<1000||tp->u.target>1999)) ick_lose(IE129, tp - tuples + 1, (const char *)NULL); else if (tp->type == NEXT) /* AIS */ {tp->nexttarget=0; continue;} else if (useickec) /* AIS */ continue; /* AIS: NEXTFROMLABEL's basically identical to COME_FROM */ else if (tp->type == COME_FROM || tp->type == NEXTFROMLABEL) ick_lose(IE444, tp - tuples + 1, (const char *)NULL); else ick_lose(IE139, tp - tuples + 1, (const char *)NULL); } /* tell the other tuple if it is a COME FROM target */ /* AIS: NEXTFROMLABEL again */ else if (tp->type == COME_FROM || tp->type == NEXTFROMLABEL) { if (up->ncomefrom && !multithread) /* AIS: multithread check */ ick_lose(IE555, iyylineno, (const char *)NULL); else up->ncomefrom++; /* AIS: to handle multiple COME FROMs */ } /* this substitutes line numbers for label numbers AIS: COME FROM now uses this too. This changes the logic slightly so that an !foundit condition would fall through, but as long as ick_lose doesn't return, it's not a problem. (I removed the else before the if.) */ if (tp->type != NEXT) { /* AIS: added this useickec condition. */ if(!useickec || (tp->type!=NEXTFROMLABEL && tp->type!=COME_FROM)) tp->u.target = (unsigned)(up - tuples + 1); } else /* AIS */ { tp->nexttarget = (unsigned)(up - tuples + 1); up->nextable = true; } } } } /* AIS: Added the third argument to prexpr and prvar. It specifies whether the node should be freed or not. I added the third argument in all calls of prexpr/prvar. This protoype has been moved up through the file so it can be used earlier. Destaticed so it can be referenced by dekludge.c. */ void prexpr(node *np, FILE *fp, int freenode); /************************************************************************* * * Code degeneration * * The theory behind this crock is that we've been handed a pointer to * a tuple representing a single INTERCAL statement, possibly with an * expression tree hanging off it and twisting slowly, slowly in the wind. * * Our mission, should we choose to accept it, is to emit C code which, * when linked to the INTERCAL run-time support, will do something * resembling the right thing. * **************************************************************************/ /* * If the order of statement-token defines in parser.y ever changes, * this will need to be reordered. */ /*@observer@*/ const char *enablersm1[MAXTYPES+1] = { "UNKNOWN", /* AIS: so comments can be ABSTAINED/REINSTATED */ "GETS", "RESIZE", "NEXT", "GO_AHEAD", /* AIS: Added for backtracking */ "GO_BACK", /* AIS: Added for backtracking */ "FORGET", "RESUME", "STASH", "RETRIEVE", "IGNORE", "REMEMBER", "ABSTAIN", "REINSTATE", "DISABLE", "ENABLE", "MANYFROM", /* AIS: Added ABSTAIN expr FROM gerunds */ "GIVE_UP", "READ_OUT", "WRITE_IN", "PIN", "COME_FROM", "NEXTFROMLABEL", /* AIS */ "NEXTFROMEXPR", /* AIS */ "NEXTFROMGERUND", /* AIS */ "COMPUCOME", /* AIS: Added COMPUCOME */ "GERUCOME", /* AIS: This is COME FROM gerunds */ "PREPROC", /* AIS: Nonexistent statement */ "WHILE", /* AIS: statement WHILE statement */ "TRY_AGAIN", /* AIS: Added TRY AGAIN */ "CREATE", /* AIS */ "COMPUCREATE", /* AIS */ "FROM", /* AIS: ABSTAIN expr FROM LABEL */ }; const char** enablers = enablersm1+1; const assoc vartypes[] = { { ick_ONESPOT, "ick_ONESPOT" }, { ick_TWOSPOT, "ick_TWOSPOT" }, { ick_TAIL, "ick_TAIL" }, { ick_HYBRID, "ick_HYBRID" }, { 0, (const char *)NULL } }; static const assoc forgetbits[] = { { ick_ONESPOT, "ick_oneforget" }, { ick_TWOSPOT, "ick_twoforget" }, { ick_TAIL, "ick_tailforget" }, { ick_HYBRID, "ick_hyforget" }, { 0, (const char *)NULL } }; /* AIS: Destatic. This is now needed in perpet.c. */ const assoc varstores[] = { { ick_ONESPOT, "ick_onespots" }, { ick_TWOSPOT, "ick_twospots" }, { ick_TAIL, "ick_tails" }, { ick_HYBRID, "ick_hybrids" }, { 0, (const char *)NULL } }; /* AIS: A demangled version */ static const assoc varstoresdem[] = { { ick_ONESPOT, "onespots" }, { ick_TWOSPOT, "twospots" }, { ick_TAIL, "tails" }, { ick_HYBRID, "hybrids" }, { 0, (const char *)NULL } }; static const assoc typedefs[] = { { ick_ONESPOT, "ick_type16" }, { ick_TWOSPOT, "ick_type32" }, { ick_TAIL, "ick_type16" }, { ick_HYBRID, "ick_type32" }, { 0, (const char *)NULL } }; /*@observer@*/ /*@null@*/ const char *nameof(int value, const assoc table[]) /* return string corresponding to value in table */ { const assoc *ap; for (ap = table; ap->name; ap++) if (ap->value == value) return(ap->name); return((const char *)NULL); } /* AIS: Code for printing explanations (mixed C/INTERCAL code that lets the user know what the meaning of an expression is). This is paraphrased from the prexpr/prvar code lower down. It's passed to yuk so that the explain ('e') command works. It's also included in the degenerated C code when the option -c is used, so the person looking at the code can debug both the INTERCAL and ick itself more effectively, and used by -h to produce its optimizer-debug output, and used to produce the variable numbers used in ick_createdata. */ unsigned long varextern(unsigned long intern, int vartype) { atom *x; if(!oblist) ick_lose(IE778, emitlineno, (const char*) NULL); for (x = oblist; x < obdex; x++) if (x->type == vartype && (unsigned long)x->intindex == intern) return(x->extindex); if(vartype==MESH) return 0; /* the mesh wasn't used after all */ ick_lose(IE778, emitlineno, (const char*) NULL); /*@-unreachable@*/ return 0; /*@=unreachable@*/ } static void explvar(node* np, FILE* fp) { node *sp; switch(np->opcode) { case ick_ONESPOT: (void) fprintf(fp, ".%lu", varextern(np->constant,ick_ONESPOT)); break; case ick_TWOSPOT: (void) fprintf(fp, ":%lu", varextern(np->constant,ick_TWOSPOT)); break; case ick_TAIL: (void) fprintf(fp, ",%lu", varextern(np->constant,ick_TAIL)); break; case ick_HYBRID: (void) fprintf(fp, ";%lu", varextern(np->constant,ick_HYBRID)); break; case SUB: (void) fprintf(fp, "("); explvar(np->lval, fp); (void) fprintf(fp, " SUB "); for (sp = np->rval ; sp ; sp = sp->rval) explexpr(sp->lval, fp); (void) fprintf(fp, ")"); break; default: ick_lose(IE778, emitlineno, (const char*) NULL); } } /* unlike prexpr, this doesn't free its operands */ void explexpr(node* np, FILE* fp) { if(!np) return; switch (np->opcode) { case MINGLE: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " $ "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case SELECT: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " ~ "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case UNKNOWNOP: (void) fprintf(fp, "("); explexpr(np->rval->lval, fp); if(np->lval->constant < 256) (void) fprintf(fp, " %c ", (char)np->lval->constant); else (void) fprintf(fp, " %c^H%c ", (char)(np->lval->constant / 256), (char)(np->lval->constant % 256)); explexpr(np->rval->rval, fp); (void) fprintf(fp, ")"); break; case SLAT: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " / "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case BACKSLAT: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " \\ "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case AND: (void) fprintf(fp, "(&%d ", np->width); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case OR: (void) fprintf(fp, "(V%d ", np->width); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case XOR: (void) fprintf(fp, "(?%d ", np->width); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case FIN: if (ick_Base < 3) ick_lose(IE997, emitlineno, (const char *)NULL); (void) fprintf(fp, "(^%d ", np->width); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case WHIRL: case WHIRL2: case WHIRL3: case WHIRL4: case WHIRL5: if (np->opcode - WHIRL + 3 > ick_Base) ick_lose(IE997, emitlineno, (const char *)NULL); if(np->opcode == WHIRL) (void) fprintf(fp, "(@%d ", np->width); else (void) fprintf(fp, "(%d@%d ", np->opcode - WHIRL + 1, np->width); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case MESH: if(variableconstants) /* AIS */ (void) fprintf(fp, "meshes[%lu]", np->constant); else (void) fprintf(fp, "0x%lx", np->constant); break; case MESH32: (void) fprintf(fp, "0x%lx", np->constant); break; case ick_ONESPOT: case ick_TWOSPOT: case ick_TAIL: case ick_HYBRID: case SUB: explvar(np, fp); break; /* cases from here down are generated by the optimizer */ case C_AND: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " & "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_OR: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " | "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_XOR: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " ^ "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_NOT: (void) fprintf(fp, "(~%d ", np->width); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_NOTEQUAL: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " != "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_A: (void) fprintf(fp, "a"); break; case C_RSHIFTBY: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " >> "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_LOGICALNOT: (void) fprintf(fp, "(! "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_LSHIFTBY: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " << "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_PLUS: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " + "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_MINUS: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " - "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_TIMES: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " * "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_DIVIDEBY: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " / "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_MODULUS: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " %% "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_GREATER: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " > "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_LESS: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " < "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_ISEQUAL: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " == "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_LOGICALAND: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " && "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case C_LOGICALOR: (void) fprintf(fp, "("); explexpr(np->lval, fp); (void) fprintf(fp, " || "); explexpr(np->rval, fp); (void) fprintf(fp, ")"); break; case INTERSECTION: explexpr(np->lval, fp); (void) fprintf(fp, " + "); explexpr(np->rval, fp); break; case GETS: case RESIZE: explexpr(np->lval, fp); (void) fprintf(fp, " <- "); explexpr(np->rval, fp); break; case BY: explexpr(np->lval, fp); (void) fprintf(fp, " BY "); explexpr(np->rval, fp); break; default: ick_lose(IE778, emitlineno, (const char*) NULL); /*@-unreachable@*/ break; /*@=unreachable@*/ } } /* AIS: Added the third argument to prexpr and prvar. It specifies whether the node should be freed or not. I added the third argument in all calls of prexpr/prvar. */ /* AIS: I moved prexpr's prototype higher in the file. Destaticed so the optimizer can access it. */ static void prvar(node *np, FILE *fp, int freenode) /* print out args to pass to storage manager for reference */ { node *sp; int dim; switch (np->opcode) { case ick_ONESPOT: (void) fprintf(fp, "ick_onespots[%lu]", np->constant); break; case ick_TWOSPOT: (void) fprintf(fp, "ick_twospots[%lu]", np->constant); break; case ick_TAIL: (void) fprintf(fp, "ick_TAIL, &ick_tails[%lu]", np->constant); break; case ick_HYBRID: (void) fprintf(fp, "ick_HYBRID, &ick_hybrids[%lu]", np->constant); break; case SUB: { (void) fprintf(fp, "ick_aref("); prvar(np->lval, fp, freenode); dim = 0; for (sp = np->rval ; sp ; sp = sp->rval) dim++; (void) fprintf(fp, ", %d", dim); for (sp = np->rval ; sp ; sp = sp->rval) { (void) fprintf(fp, ", "); prexpr(sp->lval, fp, freenode); } (void) fprintf(fp, ")"); } break; default: /* Added by AIS */ ick_lose(IE778, emitlineno, (const char*) NULL); /*@-unreachable@*/ break; /*@=unreachable@*/ } } static void ooprvar(node *np, FILE *fp, int freenode) /* AIS: Print out the overloaded version */ { node *sp; int dim; switch (np->opcode) { case ick_ONESPOT: (void) fprintf(fp, "ick_oo_onespots[%lu]", np->constant); break; case ick_TWOSPOT: (void) fprintf(fp, "ick_oo_twospots[%lu]", np->constant); break; case ick_TAIL: case ick_HYBRID: /* This should never be reached */ ick_lose(IE778, emitlineno, (const char*) NULL); /*@-unreachable@*/ break; /*@=unreachable@*/ case SUB: { (void) fprintf(fp, "ick_aref("); prvar(np->lval, fp, freenode); dim = 0; for (sp = np->rval ; sp ; sp = sp->rval) dim++; (void) fprintf(fp, ", %d", dim); for (sp = np->rval ; sp ; sp = sp->rval) { (void) fprintf(fp, ", "); prexpr(sp->lval, fp, freenode); } (void) fprintf(fp, ")"); } break; default: ick_lose(IE778, emitlineno, (const char*) NULL); /*@-unreachable@*/ break; /*@=unreachable@*/ } } /* AIS: Give us a mesh with value x */ static unsigned long meshval(unsigned long x) { if(variableconstants) return intern(MESH, x); else return x; } /* AIS: This is the reverse of prexpr, in a way. It degenerates an expression that causes *np to become equal to *target. If this is impossible at any point, it degenerates code that causes error 277 (and itself causes error 278 if the situation is inevitable). As for the annotations; there quite possibly are memory allocation mistakes here, but just about every line is a false positive (because we're operating at the subobject level in terms of copy/free/allocate) for Splint, and so disabling the warnings doesn't make the output any less useful. (When there are so many false positives, disabling the true positives doesn't make them any harder to find by eye. */ /*@-temptrans@*/ /*@-kepttrans@*/ /*@-compdestroy@*/ /*@-branchstate@*/ /*@-nullpass@*/ static void revprexpr(node *np, FILE *fp, node *target) { node* temp; switch (np->opcode) { case MINGLE: /* We can use select to determine what np->lval and np->rval have to become equal to, as long as we're in base 2. */ if(ick_Base!=2) { fprintf(fp, " ick_lose(IE277, ick_lineno, (const char*) NULL);\n"); ick_lwarn(W278, emitlineno, (const char*) NULL); break; } temp=cons(MESH,0,0); temp->constant=meshval(0xAAAAAAAALU); temp->width=32; temp=cons(SELECT,target,temp); temp->width=target->width; revprexpr(np->lval, fp, temp); free(temp->rval); free(temp); temp=cons(MESH,0,0); temp->constant=meshval(0x55555555LU); temp->width=32; temp=cons(SELECT,target,temp); temp->width=target->width; revprexpr(np->rval, fp, temp); free(temp->rval); free(temp); break; case SELECT: /* Set the left of the select to the target, and the right to 0xffffffff or 0xffff. This only works in base 2. */ if(ick_Base!=2) { fprintf(fp, " ick_lose(IE277, ick_lineno, (const char*) NULL);\n"); ick_lwarn(W278, emitlineno, (const char*) NULL); break; } temp=cons(MESH,0,0); temp->constant=meshval(target->width==32?0xFFFFFFFFLU:0xFFFFLU); temp->width=target->width; revprexpr(np->lval, fp, target); revprexpr(np->rval, fp, temp); free(temp); break; case UNKNOWNOP: /* don't be silly */ fprintf(fp, " ick_lose(IE277, ick_lineno, (const char*) NULL);\n"); ick_lwarn(W278, emitlineno, (const char*) NULL); break; case BACKSLAT: /* Unimplemented. This isn't even in the parser yet, so it's a ick_mystery how we got here. */ ick_lose(IE778, emitlineno, (const char*) NULL); /*@-unreachable@*/ break; /*@=unreachable@*/ case SLAT: /* We need to set the true value of the LHS... */ /* Copied and modified from the GETS code */ if(!pickcompile) { (void) fprintf(fp," (void) ick_assign((char*)&"); prvar(np->lval, fp, 0); (void) fprintf(fp,", %s", nameof(np->lval->opcode, vartypes)); (void) fprintf(fp,", %s[%lu], ", nameof(np->lval->opcode, forgetbits), np->lval->constant); prexpr(target, fp, 0); (void) fprintf(fp,"); \n"); } else /* AIS: Added this case for the simpler PIC assignment rules */ { (void) fprintf(fp,"\t""if(ignore%s%lu) ", nameof(np->lval->opcode,varstores), np->lval->constant); prexpr(np->lval, fp, 0); (void) fprintf(fp, " = "); prexpr(target, fp, 0); (void) fprintf(fp, "; \n"); } /* ... and we need to cause overloading to happen. This is a copy of part of the code for SLAT, modified to work in this context. */ ooprvar(np->lval, fp, 0); /* Do something highly non-portable with pointers that should work anyway. Each pointer needs to be given a unique code; so we use the hex representation of np casted to an unsigned long. Technically speaking, np->rval could be casted to anything; but all implementations I've ever seen cast unique pointers to unique numbers, which is good enough for our purposes. */ (void) fprintf(fp, ".get=ick_og%lx;\n ", (unsigned long)np->rval); ooprvar(np->lval, fp, 0); (void) fprintf(fp, ".set=ick_os%lx;\n", (unsigned long)np->rval); break; case AND: case OR: case XOR: case FIN: case WHIRL: case WHIRL2: case WHIRL3: case WHIRL4: case WHIRL5: temp=cons(np->opcode-AND+REV_AND,0,target); temp->width=temp->rval->width=np->width; revprexpr(np->rval, fp, temp); free(temp); break; case MESH: if(!variableconstants) { /* Can't set a mesh in this case */ fprintf(fp, " ick_lose(IE277, ick_lineno, (const char*) NULL);\n"); ick_lwarn(W278, emitlineno, (const char*) NULL); break; } (void) fprintf(fp," meshes[%lu] = ",np->constant); prexpr(target, fp, 0); (void) fprintf(fp,";\n"); break; case ick_ONESPOT: case ick_TWOSPOT: case ick_TAIL: case ick_HYBRID: case SUB: /* Copy the code for the GETS statement; this is almost the same thing. Modified because we're assigning target to np, not np->lval to np->rval, and to not free(). */ if(opoverused&& (np->opcode==ick_ONESPOT||np->opcode==ick_TWOSPOT)) /* AIS */ { (void) fprintf(fp," "); ooprvar(np, fp, 0); (void) fprintf(fp,".set("); prexpr(target, fp, 0); (void) fprintf(fp,",os%dspot%lu);\n", ((np->opcode==ick_TWOSPOT)?1:0)+1, np->constant); } else if(!pickcompile) { node* sp; if (np->opcode != SUB) { sp = np; (void) fprintf(fp," (void) ick_assign((char*)&"); } else { sp = np->lval; (void) fprintf(fp," (void) ick_assign("); } prvar(np, fp, 0); (void) fprintf(fp,", %s", nameof(sp->opcode, vartypes)); (void) fprintf(fp,", %s[%lu], ", nameof(sp->opcode, forgetbits), sp->constant); prexpr(target, fp, 0); (void) fprintf(fp,");\n"); } else /* AIS: Added this case for the simpler PIC assignment rules */ { (void) fprintf(fp," if(ignore%s%lu) ", nameof(np->opcode,varstores), np->constant); prexpr(np, fp, 0); (void) fprintf(fp, " = "); prexpr(target, fp, 0); (void) fprintf(fp, ";\n"); } break; /* cases from here down are generated by the optimizer, and so should never come up here and are errors. The exception is C_A, which should only ever appear in a target expression, so is also an error. */ case MESH32: case C_AND: case C_OR: case C_XOR: case C_NOT: case C_NOTEQUAL: case C_A: case C_RSHIFTBY: case C_LOGICALNOT: case C_LSHIFTBY: case C_PLUS: case C_MINUS: case C_TIMES: case C_DIVIDEBY: case C_MODULUS: case C_GREATER: case C_LESS: case C_ISEQUAL: case C_LOGICALAND: case C_LOGICALOR: case GETS: /* should never come up */ default: ick_lose(IE778, emitlineno, (const char*) NULL); /*@-unreachable@*/ break; /*@=unreachable@*/ } } /*@=temptrans@*/ /*@=kepttrans@*/ /*@=compdestroy@*/ /*@=branchstate@*/ /*@observer@*/ static char* E000string; /* AIS */ static int prunknownstr(node*, FILE*); /* AIS */ /* AIS: Destaticed */ /* Splint doesn't understand the concept of a function which might or might not free its argument. That's a pity, because its checking would come in useful here, but as it is we have to annotate memory checking off for this function. */ /*@-temptrans@*/ /*@-onlytrans@*/ /*@-compdestroy@*/ /*@-branchstate@*/ void prexpr(node *np, FILE *fp, int freenode) /* print out C-function equivalent of an expression */ { int tempint; switch (np->opcode) { case MINGLE: (void) fprintf(fp, "ick_mingle("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, ", "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case SELECT: (void) fprintf(fp, "ick_iselect("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, ", "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case UNKNOWNOP: /* AIS */ if(!useickec || !createsused) { /* CREATEd operators require -ea */ (void) fprintf(fp, "(ick_lose(IE000, ick_lineno, \"%s\"),0)", E000string); break; } /* We need to do the same as UNKNOWN statements, but as an expression. This is achieved with the helper function ick_dounop in ick_ec.c. */ (void) fprintf(fp, "ick_dounop(\""); (void) prunknownstr(np->lval, fp); if(freenode) free(np->lval); (void) fprintf(fp, "\", "); prexpr(np->rval->lval, fp, 0); (void) fprintf(fp, ", "); prexpr(np->rval->rval, fp, 0); (void) fprintf(fp, ", ick_lineno, %luUL, %luUL, %luUL" ", ick_og%lx, ick_og%lx, og2spot%lu" ", ick_os%lx, ick_os%lx, os2spot%lu, \"%s\")", intern(ick_TWOSPOT, 1601), intern(ick_TWOSPOT, 1602), intern(ick_TWOSPOT, 1603), (unsigned long) np->rval->lval, (unsigned long) np->rval->rval, intern(ick_TWOSPOT, 1603), (unsigned long) np->rval->lval, (unsigned long) np->rval->rval, intern(ick_TWOSPOT, 1603), E000string); if(freenode) free(np->rval); break; case BACKSLAT: /* AIS */ /* Unimplemented. This isn't even in the parser yet, so it's a ick_mystery how we got here. */ ick_lose(IE778, emitlineno, (const char*) NULL); /*@-unreachable@*/ break; /*@=unreachable@*/ case SLAT: /* AIS */ (void) fprintf(fp,"(("); ooprvar(np->lval, fp, 0); /* Do something highly non-portable with pointers that should work anyway. Each pointer needs to be given a unique code; so we use the hex representation of np casted to an unsigned long. Technically speaking, np->rval could be casted to anything; but all implementations I've ever seen cast unique pointers to unique numbers, which is good enough for our purposes. */ (void) fprintf(fp, ".get=ick_og%lx),(", (unsigned long)np->rval); ooprvar(np->lval, fp, 0); (void) fprintf(fp, ".set=ick_os%lx),(", (unsigned long)np->rval); prvar(np->lval, fp, freenode); /* np->rval will be freed later, when its expression is printed */ (void) fprintf(fp, "))"); return; /* mustn't be freed */ case AND: (void) fprintf(fp, "ick_and%d(", np->width); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case OR: (void) fprintf(fp, "ick_or%d(", np->width); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case XOR: (void) fprintf(fp, "ick_xor%d(", np->width); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case FIN: if (ick_Base < 3) ick_lose(IE997, emitlineno, (const char *)NULL); (void) fprintf(fp, "ick_fin%d(", np->width); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case WHIRL: case WHIRL2: case WHIRL3: case WHIRL4: case WHIRL5: if (np->opcode - WHIRL + 3 > ick_Base) ick_lose(IE997, emitlineno, (const char *)NULL); (void) fprintf(fp, "ick_whirl%d(%d, ", np->width, np->opcode - WHIRL + 1); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; /* AIS: Reversed operations */ case REV_AND: (void) fprintf(fp, "ick_rev_and%d(", np->width); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case REV_OR: (void) fprintf(fp, "ick_rev_or%d(", np->width); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case REV_XOR: (void) fprintf(fp, "ick_rev_xor%d(", np->width); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case REV_FIN: if (ick_Base < 3) ick_lose(IE997, emitlineno, (const char *)NULL); (void) fprintf(fp, "rev_fin%d(", np->width); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case REV_WHIRL: case REV_WHIRL2: case REV_WHIRL3: case REV_WHIRL4: case REV_WHIRL5: if (np->opcode - WHIRL + 3 > ick_Base) ick_lose(IE997, emitlineno, (const char *)NULL); (void) fprintf(fp, "rev_whirl%d(%d, ", np->width, np->opcode - WHIRL + 1); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case MESH: if(variableconstants) /* AIS */ (void) fprintf(fp, "meshes[%lu]", np->constant); else (void) fprintf(fp, "0x%lx", np->constant); break; case MESH32: (void) fprintf(fp, "0x%lx", np->constant); break; case ick_ONESPOT: case ick_TWOSPOT: case ick_TAIL: case ick_HYBRID: if(!opoverused||np->opcode==ick_TAIL||np->opcode==ick_HYBRID) prvar(np, fp, freenode); else /* AIS */ { ooprvar(np, fp, freenode); fprintf(fp, ".get("); prvar(np, fp, freenode); fprintf(fp,")"); } break; case SUB: (void) fprintf(fp, "*(%s*)", nameof(np->lval->opcode, typedefs)); prvar(np, fp, freenode); break; /* cases from here down are generated by the optimizer */ case C_AND: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " & "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_OR: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " | "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_XOR: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " ^ "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_NOT: (void) fprintf(fp, "(~"); tempint=np->width; /* AIS */ prexpr(np->rval, fp, freenode); if (tempint == ick_Small_digits) (void) fprintf(fp, " & ick_Max_small)"); else (void) fprintf(fp, " & ick_Max_large)"); break; /* AIS: I added the rest of the cases */ case C_NOTEQUAL: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " != "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_A: (void) fprintf(fp, "a"); break; case C_RSHIFTBY: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " >> "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_LOGICALNOT: (void) fprintf(fp, "(!"); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_LSHIFTBY: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " << "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_PLUS: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " + "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_MINUS: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " - "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_TIMES: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " * "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_DIVIDEBY: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " / "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_MODULUS: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " %% "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_GREATER: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " > "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_LESS: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " < "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_ISEQUAL: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " == "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_LOGICALAND: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " && "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case C_LOGICALOR: (void) fprintf(fp, "("); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " || "); prexpr(np->rval, fp, freenode); (void) fprintf(fp, ")"); break; case GETS: /* AIS: this is used only if freenode == 0 */ if(freenode) ick_lose(IE778, emitlineno, (const char*) NULL); prexpr(np->lval, fp, freenode); (void) fprintf(fp, " = "); prexpr(np->rval, fp, freenode); break; default: /* Added by AIS */ if(!freenode) break; /* Be less careful when not freeing, because this is used by -hH to print out its intermediate optimization stages */ ick_lose(IE778, emitlineno, (const char*) NULL); /*@-unreachable@*/ break; /*@=unreachable@*/ } if(freenode) (void) free(np); } /*@=temptrans@*/ /*@=onlytrans@*/ /*@=compdestroy@*/ /*@=branchstate@*/ /* By AIS: Helper function for prunknown */ static int prunknownstr(node *np, FILE* fp) { int i; switch(np->opcode) { case INTERSECTION: i=prunknownstr(np->lval, fp); i+=prunknownstr(np->rval, fp); return i; case BADCHAR: if (np->constant > 256) (void) fprintf(fp, "o%xx%x", (unsigned int)(np->constant / 256), (unsigned int)(np->constant % 256)); else (void) fprintf(fp, "u%x", (unsigned int)np->constant); return 2; case US_ID: (void) fputc((char)np->constant, fp); return 0; case US_ELEM: (void) fputc(';', fp); return 1; case US_SCALAR: (void) fputc('.', fp); return 1; case US_ARRVAR: (void) fputc(',', fp); return 1; case US_EXPR: (void) fputc('~', fp); return 1; default: ick_lose(IE778, emitlineno, (const char*) NULL); } /*@-unreachable@*/ return 0; /*@=unreachable@*/ } /* By AIS: Helper function for prunknown */ static void prunknowncreatedata(node *np, FILE* fp) { unsigned long ve; switch(np->opcode) { case INTERSECTION: prunknowncreatedata(np->lval, fp); prunknowncreatedata(np->rval, fp); return; case US_ID: return; /* nothing to do */ case US_SCALAR: ve=varextern(np->rval->constant,np->rval->opcode); fprintf(fp,"\t\t{%d,0,%lu,",np->rval->width,ve); break; case US_ARRVAR: /* an array doesn't itself have a value */ ve=varextern(np->rval->constant,np->rval->opcode); fprintf(fp,"\t\t{%d,1,%lu,{ick_ieg277,ick_ies277},0},\n", np->rval->width,ve); return; case US_ELEM: /* these two cases are actually treated the same way, */ case US_EXPR: /* because expressions can be assigned to */ fprintf(fp,"\t\t{%d,0,0,",np->rval->width); break; default: ick_lose(IE778, emitlineno, (const char*) NULL); } if(createsused) fprintf(fp,"{ick_og%lx,ick_os%lx},", (unsigned long)np->rval,(unsigned long)np->rval); else fprintf(fp,"{0,0},"); prexpr(np->rval,fp,0); fprintf(fp,"},\n"); } /* This function by AIS. Print a check to see if a just-in-case compiled statement actually has a meaning yet, or if we should error. */ static void prunknown(node *np, FILE* fp) { static long negcounter=-65538; int i,j; fprintf(fp,"\tif((ick_skipto=ick_jicmatch(\""); i=prunknownstr(np, fp); fprintf(fp, "\")))\n\t{\n\t ick_createdata icd[]={\n"); prunknowncreatedata(np, fp); fprintf(fp, "\t };\n"); if(createsused) { j=i; while(j--) (void) fprintf(fp, "\t\t""ICKSTASH(ick_TWOSPOT, %lu, " "ick_twospots, ick_oo_twospots);\n" "\t\t""ick_oo_twospots[%lu]=icd[%d].accessors;\n", intern(ick_TWOSPOT,(unsigned long)(1601+j)), intern(ick_TWOSPOT,(unsigned long)(1601+j)),j); } if(useickec) { fprintf(fp,"\t\t""ick_global_createdata=icd;\n"); fprintf(fp,"\t\t""ick_dogoto(ick_skipto,ick_lineno,1);\n"); } else { fprintf(fp,"\t\t""ick_pushnext(%ld); ick_skipto=-ick_skipto; goto top; " "case %ld:;\n",negcounter,negcounter); negcounter--; } if(createsused) { j=i; while(j--) (void) fprintf(fp, "\t\t""ICKRETRIEVE(ick_twospots, %lu, " "ick_TWOSPOT, ick_twoforget, ick_oo_twospots);\n", intern(ick_TWOSPOT,(unsigned long)(1601+j))); } fprintf(fp, "\t} else\n"); } /*@dependent@*/ static char *nice_text(char *texts[], int lines) { #define MAXNICEBUF 512 static char buf[MAXNICEBUF]; char *cp, *text; int i; if (lines < 1) lines = 1; for (cp = buf, i = 0 ; i < lines ; ++i) { if (cp>buf+MAXNICEBUF-10) { (*cp++) = '.'; (*cp++) = '.'; (*cp++) = '.'; *cp = '\0'; return buf; } if (i) { (*cp++) = '\\'; (*cp++) = 'n'; (*cp++) = '\\'; (*cp++) = '\n'; (*cp++) = '\t'; } for (text = texts[i] ; text != NULL && *text != '\0'; cp++, text++) { if (cp>buf+MAXNICEBUF-10) { (*cp++) = '.'; (*cp++) = '.'; (*cp++) = '.'; *cp = '\0'; return buf; } if(*text == '"' || *text == '\\') { (*cp++) = '\\'; } if(*text == 'K') /* AIS: break the string so that the ick_ec preprocessor doesn't trigger on the string ICKNUMBERPAIR */ { (*cp++) = '"'; (*cp++) = '"'; } *cp = *text; } } *cp = '\0'; return buf; } static void emit_guard(tuple *tn, FILE *fp) /* emit execution guard for giiven tuple (note the unbalanced trailing {!) */ { if(tn->maybe) /* AIS */ { if(!multithread) ick_lose(IE405, emitlineno, (const char *)NULL); (void) fprintf(fp, " gonebackto = setjmp(btjb); choicepoint();\n"); } if(!flowoptimize || tn->abstainable) /* This condition by AIS */ { (void) fprintf(fp, " if ("); if (tn->maybe) /* AIS */ (void) fprintf(fp, "gonebackto == !("); if (tn->exechance < 100) (void) fprintf(fp, "ick_roll(%d) && ", tn->exechance); if ((tn->type != NEXT && tn->type != GO_BACK && tn->type != COME_FROM && /* AIS */ tn->type != NEXTFROMLABEL && tn->type != UNKNOWN) || tn->onceagainflag == onceagain_NORMAL) (void) fprintf(fp, "!ICKABSTAINED(%d))%s {\n", (int)(tn - tuples), /* AIS */ tn->maybe?")":""); else /* AIS: [NEXT, GO_BACK, COME_FROM] ONCE needs specially handled abstentions */ (void) fprintf(fp, "!ick_oldabstain)%s {\n", /* AIS */ tn->maybe?")":""); } else { /* AIS */ if(tn->maybe) ick_lose(IE778, emitlineno, (const char*) NULL); if(!tn->initabstain) { if(tn->type != COMPUCOME && tn->type != GERUCOME && tn->type != NEXTFROMEXPR && tn->type != NEXTFROMGERUND) (void) fprintf(fp, " {\n"); else (void) fprintf(fp, " if(1) {\n"); /* COMPUCOME specifically needs an if() so it can have an else. */ } else (void) fprintf(fp, " if(0) {\n"); /* for exceptional cases like DON'T COME FROM #1 where we need a label or an else. */ } } void emittextlines(FILE *fp) { int i=0; /* The first textline is line 1 */ (void) fprintf(fp, "\"\",\n"); while(++iick_lineno); if (tn->label) { if(!useickec) /* AIS */ (void) fprintf(fp, "case -%u: ; L%u:\n", tn->label, tn->label); else /* AIS: start one of ick_ec's labeled blocks. */ (void) fprintf(fp, "ick_labeledblock(%uU,{",tn->label); } if (yydebug || cdebug || compile_only) { (void) fprintf(fp, "\t""/* %s */", textlines[tn->ick_lineno]); /* AIS: grind out an expression explanation */ if (tn->type == GETS || tn->type == FORGET || tn->type == RESUME || tn->type == FROM || tn->type == COMPUCOME || tn->type == MANYFROM || tn->type == NEXTFROMEXPR) { (void) fprintf(fp, "\n\t/* Expression is "); explexpr(tn->type == MANYFROM ? tn->u.node->lval : tn->type == GETS ? tn->u.node->rval : tn->u.node, fp); (void) fprintf(fp, " */"); } } (void) fputc('\n', fp); /* set up the "next" lexical line number for error messages */ if (tn->type == NEXT) { tuple *up; for (up = tuples; up < tuples + ick_lineno; up++) if (tn->u.target == up->label) { emitlineno = up->ick_lineno; break; } } else if (tn->ncomefrom) { /* AIS: For multithreading. Return the 1st if we're forking. */ emitlineno = comefromsearch(tn,1); if(emitlineno != -1) emitlineno = tuples[emitlineno-1].ick_lineno; } else if (tn < tuples + ick_lineno - 1) emitlineno = tn[1].ick_lineno; else emitlineno = iyylineno; if(!pickcompile) /* AIS: PICs can't report errors, so don't bother with ick_lineno */ (void) fprintf(fp, " ick_lineno = %d;\n", emitlineno); /* AIS: figure out which line we're on, so E000 can be done correctly */ if (tn < tuples + ick_lineno - 1) dim = tn[1].ick_lineno - tn->ick_lineno; else dim = iyylineno - tn->ick_lineno; if (tn->sharedline) ++dim; E000string=nice_text(textlines + tn->ick_lineno, dim); /* AIS: set weaving status if necessary */ if(tn->setweave) (void) fprintf(fp, " weaving = %d;\n", (tn->setweave>0)?1:0); /* AIS: print warnings on -l */ if(ick_checkforbugs) { if(tn->warn112) ick_lwarn(W112, emitlineno, (const char*) NULL); if(tn->warn128) ick_lwarn(W128, emitlineno, (const char*) NULL); if(tn->warn534) ick_lwarn(W534, emitlineno, (const char*) NULL); if(tn->warn018) ick_lwarn(W018, emitlineno, (const char*) NULL); if(tn->warn016) ick_lwarn(W016, emitlineno, (const char*) NULL); if(tn->warn276) ick_lwarn(W276, emitlineno, (const char*) NULL); if(tn->warn239) ick_lwarn(W239, emitlineno, (const char*) NULL); if(tn->warn622) ick_lwarn(W622, emitlineno, (const char*) NULL); } /* AIS: emit debugging information */ if (yukdebug||yukprofile) { (void) fprintf(fp, " YUK(%d,%d);\n", (int)(tn-tuples),emitlineno); } /* AIS: The +mystery option on degenerated code causes the code to unexpectedly terminate after 4 billion commands are run, thus preventing an infinite loop. Of course, it will enhance the fun if we don't tell the user that. (This is necessary for the constant-output optimizer to work properly.) */ if(coopt) (void) fprintf(fp, " ick_MYSTERYLINE;\n"); /* AIS: If the tuple is ONCE/AGAIN flagged, we need a delayed-action set of its abstention status to the AGAIN-flagged status. The problem is that some statements, like COME FROM, need to set after the command has finished, and some, like NEXT, need it before the command has started. At the moment, only NEXT and GO_BACK have a ONCE/AGAIN before it, rather than after (because neither of them continue in the normal fashion). UNKNOWN is also handled this way, because CREATEd statements can be NEXT-like but not COME FROM-like. */ if ((tn->type == NEXT || tn->type == GO_BACK || tn->type == UNKNOWN) && tn->onceagainflag != onceagain_NORMAL) { /* ONCE/AGAIN has already been swapped by perpet.c in the case of a preabstained statement ('DO NOT'...). So if we currently have a ONCE, it means that being abstained is the attractive state, and if we currently have an AGAIN, it means that being reinstated is the attractive state. Semantics with computed ABSTAIN: Don't change the abstention count unless necessary, in which case change it to 0 or 1. */ fprintf(fp," ick_oldabstain = ICKABSTAINED(%d);\n", (int)(tn - tuples)); fprintf(fp," ICKABSTAINED(%d) = %s;\n", (int)(tn - tuples), tn->onceagainflag==onceagain_ONCE ? "ick_oldabstain ? ick_oldabstain : 1" : "0"); /* This test-and-set must be atomic. As all statements are atomic anyway in the current version of ick, that isn't a problem, but if anyone wants to try using POSIX's multithreading features, the above two lines need to be a critical section. */ } /* AIS: in the case of COMPUCOME, we need an extra guard unless useickec. */ if ((!useickec && (tn->type == COMPUCOME || tn->type == NEXTFROMEXPR)) || tn->type == GERUCOME || tn->type == NEXTFROMGERUND) { fprintf(fp," if(0)\n {\n"); fprintf(fp,"CCF%d:\n",compucomecount++); if(tn->type == COMPUCOME || tn->type == NEXTFROMEXPR) { fprintf(fp," if(ick_skipto&&ick_skipto=="); prexpr(tn->u.node, fp, 1); } else if(tn->type == GERUCOME || tn->type == NEXTFROMGERUND) { fprintf(fp," if("); for (np = tn->u.node; np; np = np->rval) { if (np->constant == ABSTAIN) { (void) fprintf(fp, "linetype[truelineno] == %s || linetype[truelineno] == %s || " "linetype[truelineno] == %s || linetype[truelineno] == %s || ", enablers[np->constant-GETS], enablers[np->constant-GETS+2], enablers[FROM-GETS], enablers[MANYFROM-GETS]); } else if (np->constant == REINSTATE) { (void) fprintf(fp, "linetype[truelineno] == %s || linetype[truelineno] == %s || ", enablers[np->constant-GETS], enablers[np->constant-GETS+2]); } else if (np->constant == GETS) { (void) fprintf(fp, "linetype[truelineno] == %s || linetype[truelineno] == %s || ", enablers[GETS-GETS], enablers[RESIZE-GETS]); } else if (np->constant == COME_FROM) { (void) fprintf(fp, "linetype[truelineno] == %s || linetype[truelineno] == %s || " "linetype[truelineno] == %s || ", enablers[COME_FROM-GETS], enablers[COMPUCOME-GETS], enablers[GERUCOME-GETS]); } else if (np->constant == NEXTFROMLABEL) { (void) fprintf(fp, "linetype[truelineno] == %s || linetype[truelineno] == %s || " "linetype[truelineno] == %s || ", enablers[NEXTFROMLABEL-GETS], enablers[NEXTFROMEXPR-GETS], enablers[NEXTFROMGERUND-GETS]); } else { (void) fprintf(fp, "linetype[truelineno] == %s || ", enablers[np->constant-GETS]); } } fprintf(fp, "0"); } fprintf(fp,") {\n"); } /* AIS: With this block placed here, you can't even have a comment after a TRY AGAIN line. Move it below the next check if this seems to be undesirable behaviour. */ if(pasttryagain) /* AIS */ { ick_lose(IE993, emitlineno, (const char*)NULL); } if(flowoptimize && tn->initabstain && !tn->abstainable && tn->type != COMPUCOME && tn->type != COME_FROM && tn->type != NEXT && tn->type != GERUCOME && tn->type != NEXTFROMLABEL && tn->type != NEXTFROMEXPR && tn->type != NEXTFROMGERUND) /* AIS */ goto skipcomment; /* Look, a comment! We can completely skip all degeneration of this statement (although with -c, comments will appear in the degenerated code in its place). The COMPUCOME condition is because it is so weird. COME_FROM and NEXT are exempted so labels are generated. */ /* emit conditional-execution prefixes */ /* AIS: added the useickec condition */ if ((tn->type != COME_FROM && tn->type != NEXTFROMLABEL) || useickec) emit_guard(tn, fp); /* now emit the code for the statement body */ switch(tn->type) { case GETS: /* AIS: variableconstants means GETS has been generalised */ if(variableconstants) { revprexpr(tn->u.node->lval, fp, tn->u.node->rval); nodefree(tn->u.node); break; } /* Start of AIS optimization */ np = tn->u.node; if(np->lval->opcode == SUB) np = np->lval; if(flowoptimize && ick_Base == 2 && !opoverused && !variableconstants && (np->lval->opcode == ick_TWOSPOT || np->lval->opcode == ick_HYBRID || !(tn->u.node->rval->optdata & ~0xffffLU))) { atom* op; int ignorable = 1; assert(oblist != NULL); for(op = oblist; op < obdex; op++) { if(op->type == np->lval->opcode && (unsigned long)op->intindex == np->lval->constant) { ignorable &= op->ignorable; } } if(!ignorable) { /* Variable can't be ignored, and expression must be in range */ (void) fprintf(fp,"\t"""); prexpr(tn->u.node->lval, fp, 1); (void) fprintf(fp, " = "); prexpr(tn->u.node->rval, fp, 1); (void) fprintf(fp, ";\n"); break; } } /* End of AIS optimization */ if(opoverused&& (tn->u.node->lval->opcode==ick_ONESPOT|| tn->u.node->lval->opcode==ick_TWOSPOT)) /* AIS */ { (void) fprintf(fp,"\t"""); ooprvar(tn->u.node->lval, fp, 1); (void) fprintf(fp,".set("); prexpr(tn->u.node->rval, fp, 1); (void) fprintf(fp,",os%dspot%lu);\n", ((tn->u.node->lval->opcode==ick_TWOSPOT)?1:0)+1, tn->u.node->lval->constant); } else if(!pickcompile) { np = tn->u.node; if (np->lval->opcode != SUB) { sp = np->lval; (void) fprintf(fp,"\t""(void) ick_assign((char*)&"); } else { sp = np->lval->lval; (void) fprintf(fp,"\t""(void) ick_assign("); } prvar(np->lval, fp, 1); (void) fprintf(fp,", %s", nameof(sp->opcode, vartypes)); (void) fprintf(fp,", %s[%lu], ", nameof(sp->opcode, forgetbits), sp->constant); prexpr(np->rval, fp, 1); (void) fprintf(fp,");\n"); } else /* AIS: Added this case for the simpler PIC assignment rules */ { (void) fprintf(fp,"\t""if(ignore%s%lu) ", nameof(tn->u.node->lval->opcode,varstores), tn->u.node->lval->constant); prexpr(tn->u.node->lval, fp, 1); (void) fprintf(fp, " = "); prexpr(tn->u.node->rval, fp, 1); (void) fprintf(fp, ";\n"); } break; case RESIZE: if(pickcompile) ick_lose(IE256, emitlineno, (const char*) NULL); /* AIS */ np = tn->u.node; dim = 0; for (sp = np->rval; sp; sp = sp->rval) dim++; (void) fprintf(fp, "\t""ick_resize("); prvar(np->lval, fp, 1); #ifdef BOOL_VARARGS_BROKEN (void) fprintf(fp, ", (int)%s[%lu]", nameof(np->lval->opcode, forgetbits), np->lval->constant); #else (void) fprintf(fp, ", %s[%lu]", nameof(np->lval->opcode, forgetbits), np->lval->constant); #endif (void) fprintf(fp, ", %d", dim); for (sp = np->rval; sp; sp = sp->rval) { (void) fprintf(fp, ", (size_t)"); prexpr(sp->lval, fp, 1); } (void) fprintf(fp, ");\n"); break; case NEXT: /* AIS: if using ickec, use its features for the next */ if(useickec) { (void) fprintf(fp,"\t""ick_dogoto(%uU,ick_lineno,1);\n",tn->u.target); break; } /* Start of AIS optimization */ if(tn->u.target>=1000 && tn->u.target<=1999 && pickcompile) { /* optimize syslib call on a PIC */ (void) fprintf(fp, "\t""syslibopt%u();\n", tn->u.target); break; } if(tn->optversion) { /* optimizef has checked that this is a valid optimization */ (void) fprintf(fp, "\t""if(1 == "); prexpr(tn->u.node, fp, 1); /* frees optimizef's nodecopy */ /* AIS: Everything now in one giant switch(), with some very strange constructs (including ;{;} as a null statement; this makes degenerating the code slightly easier) */ (void) fprintf(fp, ") {ick_pushnext(%d); ick_skipto=%uU; goto top;}} case %d:;{;\n", (int)(tn - tuples + 1), tn->nexttarget, (int)(tn - tuples + 1)); break; } /* End of AIS optimization */ (void) fprintf(fp, /* same change as above (case rather than a label) */ "\t""ick_pushnext(%d); goto L%u;} case %d:;{;\n", (int)(tn - tuples + 1), tn->u.target, (int)(tn - tuples + 1)); break; case GO_BACK: /* By AIS */ if(!multithread) ick_lose(IE405, emitlineno, (const char*) NULL); (void) fprintf(fp, "\t""choiceback();\n"); break; case GO_AHEAD: /* By AIS */ if(!multithread) ick_lose(IE405, emitlineno, (const char*) NULL); (void) fprintf(fp, "\t""choiceahead();\n"); break; case RESUME: if(useickec) /* AIS */ { (void) fprintf(fp, "\t""ick_doresume("); prexpr(tn->u.node, fp, 1); (void) fprintf(fp, ", ick_lineno);\n"); break; } (void) fprintf(fp, "\t""ick_skipto = ick_resume("); prexpr(tn->u.node, fp, 1); (void) fprintf(fp, "); goto top;\n"); break; case FORGET: if(useickec) /* AIS */ { (void) fprintf(fp, "\t""ick_forget("); prexpr(tn->u.node, fp, 1); (void) fprintf(fp, ");\n"); break; } (void) fprintf(fp, "\t""ick_popnext("); prexpr(tn->u.node, fp, 1); (void) fprintf(fp, ");\n"); break; case STASH: for (np = tn->u.node; np; np = np->rval) (void) fprintf(fp, "\t""ICKSTASH(%s, %lu, %s, %s%s);\n", nameof(np->opcode, vartypes), np->constant, nameof(np->opcode, varstores), /* AIS */(opoverused&&(np->opcode==ick_ONESPOT|| np->opcode==ick_TWOSPOT)? "ick_oo_":"0"), /* AIS */(opoverused&&(np->opcode==ick_ONESPOT|| np->opcode==ick_TWOSPOT)? nameof(np->opcode, varstoresdem):"0")); break; case RETRIEVE: for (np = tn->u.node; np; np = np->rval) (void) fprintf(fp, "\t""ICKRETRIEVE(%s, %lu, %s, %s, %s%s);\n", nameof(np->opcode, varstores), np->constant, nameof(np->opcode, vartypes), nameof(np->opcode, forgetbits), /* AIS */(opoverused&&(np->opcode==ick_ONESPOT|| np->opcode==ick_TWOSPOT)? "ick_oo_":"0"), /* AIS */(opoverused&&(np->opcode==ick_ONESPOT|| np->opcode==ick_TWOSPOT)? nameof(np->opcode, varstoresdem):"0")); break; case IGNORE: for (np = tn->u.node; np; np = np->rval) (void) fprintf(fp,"\t""ICKIGNORE(%s,%lu,%s) = true;\n", nameof(np->opcode, forgetbits), np->constant, nameof(np->opcode, varstores)); break; case REMEMBER: for (np = tn->u.node; np; np = np->rval) (void) fprintf(fp,"\t""ICKIGNORE(%s,%lu,%s) = false;\n", nameof(np->opcode, forgetbits), np->constant, nameof(np->opcode, varstores)); break; /* All abstention code has been edited by AIS to allow for the new abstention rules */ case ABSTAIN: /* AIS: In CLC-INTERCAL, you can't abstain a GIVE UP line, so I copied a modified version of Joris's REINSTATE patch here as well */ if (!ick_clcsemantics || (tuples + tn->u.target - 1)->type != GIVE_UP) { if(!pickcompile) (void) fprintf(fp, "\t""if(!ICKABSTAINED(%u)) ICKABSTAINED(%u) = 1;\n", tn->u.target - 1, tn->u.target-1); else (void) fprintf(fp, "ICKABSTAINED(%u) = 1;\n", tn->u.target-1); } else (void) fprintf(fp, "\t""/* not abstaining from a GIVE UP line */\n");; break; case FROM: if(pickcompile) ick_lose(IE256, emitlineno, (const char*) NULL); (void) fprintf(fp, "\t""ICKABSTAINED(%u)+=", tn->u.target-1); tn->u.node->width = 32; prexpr(tn->u.node,fp, 1); (void) fprintf(fp, ";\n"); break; case REINSTATE: /* (Joris Huizer) ensure it is not a GIVE UP statement */ if ((tuples + tn->u.target - 1)->type != GIVE_UP) { if(!pickcompile) (void) fprintf(fp, "\t""if(ICKABSTAINED(%u)) ICKABSTAINED(%u)--;\n", tn->u.target - 1, tn->u.target-1); else (void) fprintf(fp, "\t""ICKABSTAINED(%u)=0;\n", tn->u.target - 1); } else (void) fprintf(fp, "\t""/* not reinstating a GIVE UP line */\n"); break; case ENABLE: case DISABLE: case MANYFROM: /* AIS: This code has been rewritten to make use of the revlinetype array (an optimisation that Joris Huizer came up with; however, I am not using his code, but rewriting it, to make use of a single array and an index to it, rather than one array for each command type, for maintainability reasons. */ if(pickcompile) ick_lose(IE256, emitlineno, (const char*) NULL); (void) fprintf(fp,"\tint i;\n"); np=tn->u.node; if(tn->type==MANYFROM) { np=np->rval; fprintf(fp,"\tint j = "); prexpr(tn->u.node->lval, fp, 1); fprintf(fp,";\n"); } for(; np; np = np->rval) { int npc = np->constant; anothertype: (void) fprintf(fp,"\n\tfor(i=revlineindex[%s];itype) { case ENABLE: (void) fprintf(fp,"\t if (ick_abstained[revlinetype[i]])" "\t\tick_abstained[revlinetype[i]]--;\n"); break; case DISABLE: (void) fprintf(fp,"\t if(!ick_abstained[revlinetype[i]])" "\t\tick_abstained[revlinetype[i]]=1;\n"); break; case MANYFROM:(void) fprintf(fp,"\tick_abstained[revlinetype[i]]+=j;\n"); break; default: ick_lose(IE994, emitlineno, (const char *)NULL); } switch(npc) { case GETS: npc=RESIZE; goto anothertype; case ABSTAIN: npc=DISABLE; goto anothertype; case DISABLE: npc=FROM; goto anothertype; case FROM: npc=MANYFROM; goto anothertype; case REINSTATE: npc=ENABLE; goto anothertype; case COME_FROM: npc=COMPUCOME; goto anothertype; case COMPUCOME: npc=GERUCOME; goto anothertype; case NEXTFROMLABEL: npc=NEXTFROMEXPR; goto anothertype; case NEXTFROMEXPR: npc=NEXTFROMGERUND; goto anothertype; default: break; } } break; case NEXTFROMEXPR: case NEXTFROMGERUND: case GERUCOME: case COMPUCOME: /* By AIS. Note that this doesn't even have balanced braces; it's designed to work with COMPUCOME's crazy guarding arrangements */ if(pickcompile) ick_lose(IE256, emitlineno, (const char*) NULL); /* AIS */ if(useickec) /* use ick_ec's features for next from and come from*/ { if(tn->type == COMPUCOME) { fprintf(fp,"\t""ick_docomefromif("); prexpr(tn->u.node, fp, 1); fprintf(fp,",ick_lineno,({int i=0;"); emit_guard(tn,fp); /* re-emit the guard */ fprintf(fp,"i=1;};i;}));\n"); break; } else if(tn->type == NEXTFROMEXPR) { fprintf(fp,"\t""ick_donextfromif("); prexpr(tn->u.node, fp, 1); fprintf(fp,",ick_lineno,({int i=0;"); emit_guard(tn,fp); /* re-emit the guard */ fprintf(fp,"i=1;};i;}));\n"); break; } } fprintf(fp,"\t""%s;} else goto CCF%d;\n", multithread?"NEXTTHREAD":useprintflow? "if(ick_printflow) fprintf(stderr,\"[%d]\",ick_lineno)":"", compucomecount); break; case GIVE_UP: /* AIS: Edited to allow for yuk */ if(yukprofile||yukdebug) fprintf(fp, "\t""YUKTERM;\n"); if(multithread) fprintf(fp, "\t""killthread();\n"); else { if(nonespots||opoverused) fprintf(fp,"\t""if(ick_onespots) free(ick_onespots);\n"); if(ntwospots||opoverused) fprintf(fp,"\t""if(ick_twospots) free(ick_twospots);\n"); if(ntails) fprintf(fp,"\t""if(ick_tails) free(ick_tails);\n"); if(nhybrids) fprintf(fp,"\t""if(ick_hybrids) free(ick_hybrids);\n"); if(nonespots||opoverused) fprintf(fp,"\t""if(ick_oneforget) free(ick_oneforget);\n"); if(ntwospots||opoverused) fprintf(fp,"\t""if(ick_twoforget) free(ick_twoforget);\n"); if(ntails) fprintf(fp,"\t""if(ick_tailforget) free(ick_tailforget);\n"); if(nhybrids) fprintf(fp,"\t""if(ick_hyforget) free(ick_hyforget);\n"); if(opoverused) { fprintf(fp,"\t""if(ick_oo_onespots) free(ick_oo_onespots);\n"); fprintf(fp,"\t""if(ick_oo_twospots) free(ick_oo_twospots);\n"); } fprintf(fp,"\t""if(ick_next) free(ick_next);\n"); if(useickec) fprintf(fp,"\t""if(ick_next_jmpbufs) free(ick_next_jmpbufs);\n"); } (void) fprintf(fp, "\t""exit(0);\n"); break; case TRY_AGAIN: /* By AIS */ (void) fprintf(fp, "\t""goto ick_restart;\n }\n"); if(yukprofile||yukdebug) fprintf(fp, " if(yukloop) goto ick_restart;\n"); if(yukprofile||yukdebug) fprintf(fp, " YUKTERM;\n"); if(multithread) fprintf(fp, "\t""killthread();\n"); else { if(nonespots||opoverused) fprintf(fp,"\t""if(ick_onespots) free(ick_onespots);\n"); if(ntwospots||opoverused) fprintf(fp,"\t""if(ick_twospots) free(ick_twospots);\n"); if(ntails) fprintf(fp,"\t""if(ick_tails) free(ick_tails);\n"); if(nhybrids) fprintf(fp,"\t""if(ick_hybrids) free(ick_hybrids);\n"); if(nonespots||opoverused) fprintf(fp,"\t""if(ick_oneforget) free(ick_oneforget);\n"); if(ntwospots||opoverused) fprintf(fp,"\t""if(ick_twoforget) free(ick_twoforget);\n"); if(ntails) fprintf(fp,"\t""if(ick_tailforget) free(ick_tailforget);\n"); if(nhybrids) fprintf(fp,"\t""if(ick_hyforget) free(ick_hyforget);\n"); if(opoverused) { fprintf(fp,"\t""if(ick_oo_onespots) free(ick_oo_onespots);\n"); fprintf(fp,"\t""if(ick_oo_twospots) free(ick_oo_twospots);\n"); } } (void) fprintf(fp, " {\n\treturn(0);\n"); /* because if TRY AGAIN is the last line, falling off the end isn't an error */ pasttryagain=1; /* flag an error if we try any more commands */ break; case WRITE_IN: if(pickcompile) ick_lose(IE256, emitlineno, (const char*) NULL); /* AIS */ for (np = tn->u.node; np; np = np->rval) { if (np->lval->opcode == ick_TAIL || np->lval->opcode == ick_HYBRID) { (void) fprintf(fp,"\t""ick_binin("); prvar(np->lval, fp, 1); (void) fprintf(fp, ", %s[%lu]", nameof(np->lval->opcode, forgetbits), np->lval->constant); (void) fprintf(fp,");\n"); } else { if (np->lval->opcode != SUB) { sp = np->lval; (void) fprintf(fp,"\t""(void) ick_assign((char*)&"); } else { sp = np->lval->lval; (void) fprintf(fp,"\t""(void) ick_assign("); } prvar(np->lval, fp, 1); (void) fprintf(fp,", %s", nameof(sp->opcode, vartypes)); (void) fprintf(fp,", %s[%lu]", nameof(sp->opcode, forgetbits), sp->constant); (void) fprintf(fp,", ick_pin());\n"); } } break; case READ_OUT: if(pickcompile) ick_lose(IE256, emitlineno, (const char*) NULL); /* AIS */ for (np = tn->u.node; np; np = np->rval) { if (np->lval->opcode == ick_TAIL || np->lval->opcode == ick_HYBRID) { (void) fprintf(fp,"\t""ick_binout("); prvar(np->lval, fp, 1); (void) fprintf(fp,");\n"); } else { (void) fprintf(fp, "\t""ick_pout("); prexpr(np->lval, fp, 1); (void) fprintf(fp, ");\n"); } } break; case PIN: /* AIS, with some code borrowed from the GETS code */ np = tn->u.node; (void) fprintf(fp, "\t""TRISA = seq(~(("); prexpr(np, fp, 0); (void) fprintf(fp, " >> 16) & 255));\n"); (void) fprintf(fp, "\t""TRISB = seq(~("); prexpr(np, fp, 0); (void) fprintf(fp, " >> 24));\n"); (void) fprintf(fp, "\t""PORTA = seq(~("); prexpr(np, fp, 0); (void) fprintf(fp, " & 255));\n"); (void) fprintf(fp, "\t""PORTB = seq(~(("); prexpr(np, fp, 0); (void) fprintf(fp, " >> 8) & 255));\n"); { atom* op; int ignorable = 1; assert(oblist != NULL); for(op = oblist; op < obdex; op++) { if(op->type == np->opcode && (unsigned long)op->intindex == np->constant) { ignorable &= op->ignorable; } } if(!ignorable) { /* Variable can't be ignored, and expression must be in range */ (void) fprintf(fp,"\t"""); prexpr(np, fp, 1); (void) fprintf(fp, " = "); } else { np = tn->u.node; (void) fprintf(fp,"\t""if(ignore%s%lu) ", nameof(np->opcode,varstores), np->constant); prexpr(np, fp, 1); (void) fprintf(fp, " = "); } } (void) fprintf(fp,"(TRISB<<24) | (TRISA<<16) | (PORTB<<8) | PORTA;\n"); break; case CREATE: /* By AIS */ if(createsused == 0) goto splatme; (void) fprintf(fp,"\t""ick_registercreation(\""); (void) prunknownstr(tn->u.node, fp); (void) fprintf(fp,"\",%uU);\n",tn->u.target); break; case COMPUCREATE: /* By AIS */ if(createsused == 0) goto splatme; (void) fprintf(fp,"\t""ick_registercreation(\""); (void) prunknownstr(tn->u.node->rval, fp); (void) fprintf(fp,"\","); prexpr(tn->u.node->lval, fp, 1); (void) fprintf(fp,");\n"); free(tn->u.node); /* don't free the rval */ break; case UNKNOWN: /* By AIS */ /* We generate a check to see if the unknown statement has gained a meaning since it was compiled, or otherwise continue to the splattered case. Not for PIC-INTERCAL, though. */ if(!pickcompile) prunknown(tn->u.node, fp); /*@fallthrough@*/ case SPLATTERED: /* AIS: The code previously here could access unallocated memory due to a bug if the comment was a COME FROM target. The problem is that emitlineno (the line to show an error on) is usually the line after this one, but not always, and in this case the line after this one is always what we want, so I copied the relevant part of the emitlineno logic here to fix the bug. */ splatme: if (tn < tuples + ick_lineno - 1) dim = tn[1].ick_lineno - tn->ick_lineno; else dim = iyylineno - tn->ick_lineno; if (tn->sharedline) ++dim; (void) fprintf(fp, "\t""ick_lose(IE000, %d, \"%s\");\n", emitlineno, nice_text(textlines + tn->ick_lineno, dim)); break; case PREPROC: /* AIS: 'DO NOTHING', but not enterable into a program. This is generated by the preprocessor. */ fprintf(fp,"\t""; /* do nothing */\n"); break; case COME_FROM: case NEXTFROMLABEL: /* AIS */ if(useickec) /* AIS */ { if(tn->type == COME_FROM) { fprintf(fp,"\t""ick_docomefromif(%uU,ick_lineno,({int i=0;", tn->u.target); emit_guard(tn,fp); /* re-emit the guard */ fprintf(fp,"i=1;};i;}));\n"); break; } else /* (tn->type == NEXTFROMLABEL) */ { fprintf(fp,"\t""ick_donextfromif(%uU,ick_lineno,({int i=0;", tn->u.target); emit_guard(tn,fp); /* re-emit the guard */ fprintf(fp,"i=1;};i;}));\n"); break; } } (void) fprintf(fp, "if(0) {C%ld: %s;%s}\n", (long)(tn-tuples+1), tn->type==NEXTFROMLABEL ? "ick_pushnext(truelineno+1)":"", multithread?" NEXTTHREAD;":!useprintflow?"" :" if(ick_printflow) " "fprintf(stderr,\"[%d]\",ick_lineno);"); /* AIS: Changed so all COME_FROMs have unique labels even if two of them aim at the same line, and added the NEXT FROM case (which involves hiding COME FROM labels in an unreachable if()). */ break; case WHILE: /* AIS: fall through to the error, because this shouldn't come up yet. */ default: ick_lose(IE994, emitlineno, (const char *)NULL); /*@-unreachable@*/ break; /*@=unreachable@*/ } if ((tn->type != COME_FROM && tn->type != NEXTFROMLABEL) || /*AIS*/ useickec) (void) fprintf(fp, " }\n"); skipcomment: if ((!useickec && (tn->type == COMPUCOME || tn->type == NEXTFROMEXPR)) || tn->type == NEXTFROMGERUND || tn->type == GERUCOME ) { /* By AIS */ (void) fprintf(fp," else goto CCF%d;\n",compucomecount); (void) fprintf(fp," ick_ccfc++;\n"); /* Note that due to the semantics of setjmp, this has to be written as 2 separate ifs. The MULTICOME macro expands to a non-multithreaded or multithreaded function for handling a COME FROM clash. */ (void) fprintf(fp," if(ick_ccfc==1||MULTICOME(%d,ick_cjb))\n" "\t""if(setjmp(ick_cjb) == 0) goto CCF%d;\n", emitlineno, compucomecount); /* Of course, emitlineno is unlikely to be helpful! */ if(tn->type == NEXTFROMEXPR || tn->type == NEXTFROMGERUND) { /* Stack up the statement we've NEXTed from */ (void) fprintf(fp," ick_pushnext(truelineno+1);\n"); } (void) fprintf(fp," }\n"); } /* AIS: Before any COMING FROM this line is done, we need to sort out ONCE and AGAIN situations, unless this line was a NEXT or GO_BACK. COME FROM is also excluded because it acts at the suckpoint, not at the place it's written in the program. */ if (tn->onceagainflag != onceagain_NORMAL && tn->type != NEXT && tn->type != GO_BACK && tn->type != UNKNOWN && ((tn->type != COME_FROM && tn->type != NEXTFROMLABEL) || useickec)) { /* See my comments against the NEXT code for more information. This code is placed here so COME FROM ... ONCE constructs work properly (the line is ick_abstained if the COME FROM is reached in execution, or its suckpoint is reached in execution). */ fprintf(fp," ick_oldabstain = ICKABSTAINED(%d);\n", (int)(tn - tuples)); fprintf(fp," ICKABSTAINED(%d) = %s;\n", (int)(tn - tuples), tn->onceagainflag==onceagain_ONCE ? "ick_oldabstain ? ick_oldabstain : 1" : "0"); } /* AIS: This is where we start the COME FROM suckpoint code. */ /* AIS: The ickec version is very simple! We just finish the labeled block started at the start of the command. */ if(tn->label && useickec) (void) fprintf(fp, "});\n"); /* AIS: We need to keep track of how many COME FROMs are aiming here at runtime, if we don't have the very simple situation of no COMPUCOMEs and a single-thread program (in which case the check is done at compile-time by codecheck). Even without COMPUCOME, this can change in a multithread program due to abstentions. */ if((tn->ncomefrom && multithread) || (tn->label && compucomesused) || gerucomesused) (void) fprintf(fp, " ick_ccfc = 0;\n"); /* AIS: For NEXTING FROM this line */ if(nextfromsused && tn->ncomefrom) { (void) fprintf(fp, " truelineno = %d;\n", (int)(tn-tuples)); } /* * If the statement that was just degenerated was a COME FROM target, * emit the code for the jump to the COME FROM. * AIS: Changed most of this to allow for multithreading. */ while(tn->ncomefrom && !useickec) /* acts as an if if singlethreading */ { tuple* cf; /* local to this block */ if(multithread || compucomesused) generatecfjump = 1; cf = tuples+comefromsearch(tn,tn->ncomefrom)-1; if (yydebug || compile_only) (void) fprintf(fp, " /* line %03d is a suck point for the COME FROM " "at line %03d */\n", tn->ick_lineno, cf->ick_lineno); if (cf->onceagainflag != onceagain_NORMAL) { /* Calculate ONCE/AGAIN when the suckpoint is passed */ fprintf(fp," ick_oldabstain = ICKABSTAINED(%d);\n", (int)(cf - tuples)); fprintf(fp," ICKABSTAINED(%d) = %s;\n", (int)(cf - tuples), cf->onceagainflag==onceagain_ONCE ? "ick_oldabstain ? ick_oldabstain : 1" : "0"); } emit_guard(cf, fp); if(multithread || compucomesused) (void) fprintf(fp, "\t""ick_ccfc++;\tif(ick_ccfc==1||MULTICOME(%d,ick_cjb)) " "if(setjmp(ick_cjb) == 1) goto C%ld;\n }\n", emitlineno, (long)(cf-tuples+1)); else /* optimize for the simple case */ (void) fprintf(fp, "\t""goto C%ld;\n }\n", (long)(cf-tuples+1)); tn->ncomefrom--; } /* AIS: If the statement has a label, it might be a computed COME FROM target. Also check the flag that says this code is needed in a multithread non-COMPUCOME program. If (at runtime) ick_ccfc is nonzero, we know ick_cjb has already been set; otherwise, set it now. In the case of a multithread non-COMPUCOME program, the goto will just jump to a longjmp, switching to the one and only one COME FROM that hasn't been given its own thread. However, skip all the compucomes and gerucomes if preproc is set, because COMING FROM a preproc should only ever be done by label. */ if (((tn->label && compucomesused) || generatecfjump || gerucomesused) && (!tn->preproc || generatecfjump) && (!useickec || gerucomesused)) { if(compucomesused) { (void) fprintf(fp, " ick_skipto = %u;\n", tn->label); } if(gerucomesused || nextfromsused) { (void) fprintf(fp, " truelineno = %d;\n", (int)(tn-tuples)); } if(generatecfjump) (void) fprintf(fp, " if(ick_ccfc) goto CCF%s;\n", tn->preproc?"L":"0"); if((compucomesused || gerucomesused) && !tn->preproc) { /* check all the COMPUCOMES */ (void) fprintf(fp, " %sif(setjmp(ick_cjb) == 0) goto CCF0;\n", generatecfjump?"else ":""); } generatecfjump = 0; /* AIS: If NEXT FROM's used, this might be a NEXT return target. Don't generate case labels for NEXT, as it has them already. */ if(nextfromsused && tn->type != NEXT) { (void) fprintf(fp, " case %u:;\n", (unsigned)(tn-tuples+1)); } } /* AIS: Now we've finished the statement, let's switch to the next thread in a multithread program. */ if(multithread) (void) fputs(" NEXTTHREAD;\n", fp); else if(useprintflow) (void) fputs(" if(ick_printflow) fprintf(stderr," "\"[%d]\",ick_lineno);\n",fp); } /*@=nestedextern@*/ /* AIS: Generate prototypes for slat expressions, args to UNKNOWN */ void emitslatproto(FILE* fp) { node* np=firstslat; const char* t="ick_type32"; while(np) { fprintf(fp,"%s ick_og%lx(%s);\nvoid ick_os%lx(%s, void(*)());\n", t,(unsigned long)np,t,(unsigned long)np,t); np=np->nextslat; } } /* AIS: Generate bodies for slat expressions, args to UNKNOWN */ void emitslat(FILE* fp) { node* np=firstslat; node* temp, *temp2; const char* t="ick_type32"; while(np) { fprintf(fp, "void ick_os%lx(%s a, void(*f)())\n{\n static int l=0;\n" " if(l)\n {\n if(!f) ick_lose(IE994, ick_lineno, (const char *)NULL);\n" " f(a,0);\n return;\n }\n l=1;\n", (unsigned long)np,t); temp=cons(C_A, 0, 0); revprexpr(np, fp, temp); /* revprexpr can't free */ fprintf(fp," l=0;\n}\n"); fprintf(fp,"%s ick_og%lx(%s t)\n{\n %s a;\n static int l=0;\n" " if(l) return t;\n l=1;\n a=", t,(unsigned long)np,t,t); prexpr(np, fp, 0); fprintf(fp,";\n l=0;\n return a;\n}\n"); np=np->nextslat; } np=firstslat; /* Note that the order in which the parser assembles nodes means that we have to free the nodes in reverse order so we don't free child nodes twice. */ temp2=0; while(np) { temp=np->nextslat; np->nextslat=temp2; /* reverse the chain */ temp2=np; np=temp; } np=temp2; while(np) { temp=np->nextslat; nodefree(np); np=temp; } /* JH: clear firstslat */ firstslat = 0; } /* feh.c ends here */ intercal-0.30/src/PaxHeaders.27456/dekludge.c0000644000000000000000000000007411440130757015527 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.546945805 intercal-0.30/src/dekludge.c0000644000175000017500000005252411440130757015432 0ustar00esresr00000000000000/**************************************************************************** Name dekludge.c -- C-INTERCAL expression and flow optimizers DESCRIPTION This file contains optimizations used by the C-INTERCAL compiler. LICENSE TERMS Copyright (C) 1996 Eric S. Raymond This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ****************************************************************************/ /*LINTLIBRARY */ #include "config.h" #include #include #include #include "sizes.h" #include "ick.h" #include "parser.h" #include "fiddle.h" #include "ick_lose.h" #include "feh.h" extern int emitlineno; /* AIS: From feh2.c */ /* AIS: The following macro produces optimization debug data. I added all occurences of it in this source file. It also keeps track of whether optimizations have taken place. */ #define OPTING(x) if(optdebug == 2) {\ explexpr(optdebugnode,stderr);\ putc('\n',stderr); } \ if(optdebug == 3) {\ prexpr(optdebugnode,stderr,0);\ putc('\n',stderr); } \ if(optdebug) fprintf(stderr,"[%s]",#x);\ if(optdebug >= 2) putc('\n',stderr);\ opted = 1; void checknodeactbits(node *np); /* AIS: This prototype needed early */ extern void prexpr(node *np, FILE* fp, int freenode); /* AIS */ /* By AIS. This function looks remarkably like a C++ copy-constructor to me, just with extra arrows in. The annotations here show that nulls are allowed when called recursively, but not otherwise. */ /*@-incondefs@*/ /*@null@*/ node *nodecopy(/*@null@*/ const node* n) /*@=incondefs@*/ { node* np; if(!n) return 0; np = cons(n->opcode, nodecopy(n->lval), nodecopy(n->rval)); np->constant = n->constant; np->optdata = n->optdata; np->width = n->width; return np; } /* This function by AIS. Compares expressions. In C++, I'd call this node::operator== . */ bool nodessame(/*@observer@*/ const node* n1, /*@observer@*/ const node* n2) { if(!n1) return !n2; if(!n2) return 0; if(n1->opcode!=n2->opcode) return (((n1->opcode == MESH && n2->opcode == MESH32) || (n1->opcode == MESH32 && n2->opcode == MESH)) && n1->constant == n2->constant); if(!nodessame(n1->lval,n2->lval)) return 0; if(!nodessame(n1->rval,n2->rval)) return 0; switch(n1->opcode) { case ick_ONESPOT: case ick_TWOSPOT: case ick_HYBRID: case ick_TAIL: case MESH: case MESH32: return n1->constant == n2->constant; case AND: case OR: case XOR: return n1->width == n2->width; default: return true; } } /* AIS: Checks if an abstention could affect a tuple. */ static int abstainmatch(int npconstant, int tptype) { if(npconstant == tptype) return 1; if(npconstant == ABSTAIN) if(tptype == FROM || tptype == MANYFROM || tptype == DISABLE) return 1; if(npconstant == REINSTATE) if(tptype == ENABLE) return 1; if(npconstant == GETS) if(tptype == RESIZE) return 1; if(npconstant == UNKNOWN) /* JH */ if(tptype == SPLATTERED) return 1; return 0; } /************************************************************************* * * AIS: Flow optimizer. (I wrote the whole of optimizef.) * * This analyses the flow of the program, checking to see which lines can * have their guards omitted, which lines can be omitted altogether, which * variables can never be ignored, etc. The degenerator lower down can take * this information into account, producing faster and shorter source code. * In an ideal world, we'd end up with the produced INTERCAL looking like * proper C code, but somehow I think that's unlikely to happen. * At the moment, it just checks for unused !ick_abstained[] guards on * statements and removes them (possibly removing comments altogether). * This is minor, but should clear up degenerated code substantially. * It also allows the code for gets to replace ick_assign() with the faster = * in cases where this doesn't affect the behaviour of the program. * See the function itself for what I did to NEXT. * *************************************************************************/ void optimizef(void) { tuple* tp, *tpa, *tpb; atom* op; node* np; if(!flowoptimize) ick_lose(IE778, iyylineno, (const char *) NULL); for (tp = tuples; tp < tuples + ick_lineno; tp++) tp->abstainable = 0; /* abstainable holds whether a line's abstention status can change */ for (op = oblist; op != NULL && op < obdex; op++) op->ignorable = 0; /* ignorable holds whether a variable's ignorance status can change */ for (tp = tuples; tp < tuples + ick_lineno; tp++) { /* allow for warnings to be generated during flow optimisations */ /* AIS: I marked tuples as only deliberately, so that it produced warnings when aliased in an unsafe way. However, tuples isn't realloced during optimisation, so we can safely ignore the warning for it produced here. */ /*@-onlytrans@*/ optuple = tp; /*@=onlytrans@*/ if(tp->maybe) tp->abstainable = true; if(tp->exechance < 0) tp->initabstain = true; if(tp->exechance != 100 && tp->exechance != -100) tp->abstainable = true; if(tp->onceagainflag != onceagain_NORMAL) tp->abstainable = true; if(tp->type == ABSTAIN || tp->type == FROM) { tpa = tp->u.target - 1 + tuples; if(tpa->exechance >= 0) tpa->abstainable = true; } if(tp->type == REINSTATE) { tpa = tp->u.target - 1 + tuples; if(tpa->exechance < 0) tpa->abstainable = true; } if(tp->type == DISABLE || tp->type == MANYFROM) { for (tpa = tuples; tpa < tuples + ick_lineno; tpa++) { np = tp->u.node; if(tp->type == MANYFROM) np = np->rval; for(; np; np = np -> rval) if(abstainmatch((int)np->constant, (int)tpa->type)) if(tpa->exechance >= 0) tpa->abstainable = true; } } if(tp->type == ENABLE) { for (tpa = tuples; tpa < tuples + ick_lineno; tpa++) { np = tp->u.node; for(; np; np = np -> rval) if(abstainmatch((int)np->constant, (int)tpa->type)) if(tpa->exechance < 0) tpa->abstainable = true; } } if(tp->type == GETS && ick_Base == 2 && !opoverused) checknodeactbits(tp->u.node->rval); /* If optdata shows that the value must always fit in the variable, and the variable cannot be ignored, ick_assign can be replaced by the cheaper =. */ if(tp->type == IGNORE) { for (np = tp->u.node; np; np = np->rval) { for (op = oblist; op != NULL && op < obdex; op++) { if(op->type == np->opcode && (unsigned long)op->intindex == np->constant) op->ignorable = 1; } } } /* REMEMBERING variables has no effect on this code, because all variables are initially remembered anyway, and so an IGNORE would be needed (and caught above) to have an effect. */ } /* There are some flow idioms that maybe should be optimized. The most common is the NEXTing idiom for if(), which looks like this: DO (1) NEXT block 2 escape via NEXTING or COMEFROM (1) DO (2) NEXT DO FORGET #1 block 1 and elsewhere in the program: (2) DO RESUME <1-or-2-condition> Recognizing this idiom is quite difficult because there are a number of problems and common variations. First, the FORGET might be placed elsewhere, or replaced with a higher FORGET later or a higher RESUME later. If there is, in fact, a RESUME #1 as the ick_next NEXT-control statement, the idiom won't quite work properly. So to handle this, we need to push the original return address on the NEXT stack if block 1 is taken, unless the ick_next statement is a FORGET #1. Second, there may be abstentions or COME FROMs messing with control flow in the area. The flow optimizer ought to be able to detect this and not optimize the statement if true. (This means that a program which uses gerund abstention on NEXTING or RESUMING, or that uses computed COME FROM, will probably not benefit from this optimization). Third, how should a <1-or-2-condition> be detected? Throughout syslib, the most common condition to use is .5, which isn't inherently 1 or 2. The way round this seems to be to detect a <1-or-2-assignment> as the previous statement, again with checks for COME FROM and abstentions. (I treat MAYBE as a sort of abstention, albeit a temporally undecided one.) So ignorance of the relevant variable needs to be checked for also. The checks are done partly in optimizef() and partly in emit(). */ if(compucomesused||ick_Base!=2||opoverused) return; np = (node*) NULL; for (tp = tuples; tp < tuples + ick_lineno; tp++) { if(tp->type == GETS) { /* if(tp->u.node->rval->opcode == C_AND1ADD1 || tp->u.node->rval->opcode == C_2SUBAND1 || ((tp->u.node->rval->opcode == C_1PLUS || tp->u.node->rval->opcode == C_2MINUS) && tp->u.node->rval->rval->optdata == 1)) //debug for now */ if(0) { /* This won't catch all <1-or-2-expressions>, but will get most of them. */ if(tp->u.node->lval->opcode != SUB) np = tp->u.node->lval; } else if(np != NULL && nodessame(np, tp->u.node->lval)) np = (node*) NULL; if(tp->nextable) np = (node*) NULL; if(tp->maybe||tp->abstainable) np = (node*) NULL; if(tp->ncomefrom&&multithread) np = (node*) NULL; if(np) { /* IGNORING np might prevent it getting its <1-or-2-value>. */ atom* op2; int ignorable = 1; for(op2 = oblist; op2 != NULL && op2 < obdex; op2++) { if(op2->type == np->opcode && (unsigned long)op2->intindex == np->constant) { ignorable &= op2->ignorable; } } if(ignorable) np = (node*) NULL; } /* np will only have a nonnull value if it's a variable that must be set to a <1-or-2-value> to reach line tp. Regardless of whether maybes have been parsed or not, either maybe or abstainable or both will be 1 on a MAYBE line. The last check is a precaution against MAYBE COME FROM sneakily modifying a variable (although I think it's unlikely that anyone would deliberately try to fool -f like this, it is INTERCAL after all!) */ } if(tp->type == COME_FROM || tp->type == COMPUCOME) np = (node*) NULL; if(tp->type == NEXT) { tpa = tuples + tp->nexttarget - 1; if(tpa->type == NEXT && !tp->abstainable && !tpa->abstainable && !tp->ncomefrom && !tpa->ncomefrom) { tpb = tuples + tpa->nexttarget - 1; if(tpb->type == RESUME && (/*(tpb->u.node->opcode == C_AND1ADD1 || tpb->u.node->opcode == C_2SUBAND1 || ((tpb->u.node->opcode == C_1PLUS || tpb->u.node->opcode == C_2MINUS) && tpb->u.node->rval->optdata == 1)) ||*/ (np != NULL && nodessame(tpb->u.node,np))) && !tpb->abstainable) /* No COMING FROM a nonabstainable RESUME line! */ { tp->optversion = true; free(tp->u.node); tp->u.node = nodecopy(tpb->u.node); /* If tp->u.node is 2, then the statement should translate to a no-op (NEXT...NEXT...RESUME #2). However, if tp->u.node is 1, the statement should translate to a NEXT to the line after the one it's aiming for. As it's aiming for a NEXT, the solution is to NEXT to the return label of the NEXT it's aiming for. This won't trigger any COME FROMs or ONCE/AGAIN flags, or even MAYBEs, on the commands missed out, so the code has checked that they aren't there. */ } } np = (node*) NULL; } } /*@-nullstate@*/ /* no tuples->u.node can't be null */ } /*@=nullstate@*/ /************************************************************************* * * Expression optimizer. * * It's not a very good optimizer, is it? * * AIS: All free'd pointers set to NULL, to help trace memory problems. * The optimizer can now recognize the majority of syslib's idioms. * The optimizer will make multiple passes. Although I am now happy * with the quality of this optimizer, I'll keep the paragraph above * this one for history's sake. The optimizing functions return 1 * if any optimizations were made, apart from optimize itself, which * is void. * **************************************************************************/ extern int optimize_pass1(node *np); /* Read from idiotism.c */ static void checkforintercaloperators(const node *np); static void checkW534(const node *np); node* optdebugnode; /* This function by AIS */ void optimize(node *np) { int optflag; if(opoverused) return; /* what chance do we have of optimizing this? */ if(ick_Base==2) { checknodeactbits(np); checkW534(np); /* This must be done before optimization, and depends on checknodeactbits. */ } if(optdebug == 1) explexpr(np,stderr); if(optdebug == 1) fprintf(stderr," becomes "); if(optdebug >= 2) optdebugnode = np; if(ick_Base==2) (void) optimize_pass1(np); /* Optimize idioms; from idiotism.oil */ if(ick_Base!=2) { if(optdebug && optdebug != 3) explexpr(np,stderr); if(optdebug == 3) prexpr(np,stderr,0); if(optdebug) fprintf(stderr,"\n"); if(optdebug >= 2) fprintf(stderr,"-----\n"); return; } do { optflag = optimize_pass1(np); } while(optflag); /* Keep optimizing until no optimizations are found */ if(optdebug && optdebug != 3) explexpr(np,stderr); if(optdebug == 3) prexpr(np,stderr,0); if(optdebug) fprintf(stderr,"\n"); if(optdebug >= 2) fprintf(stderr,"-----\n"); checkforintercaloperators(np); if(optuple->type == RESUME && !np->optdata) optuple->warn622 = true; } /* By AIS. This relies on free'd pointers being NULLed. The annotations are basically trying to describe how the function operates. */ void nodefree(/*@keep@*/ /*@null@*/ node *np) { if(!np) return; /*@-mustfreeonly@*/ if(np->nextslat) return; /* don't free, has oo data */ if(np==prevslat) return; /* likewise */ /*@=mustfreeonly@*/ /*@-keeptrans@*/ nodefree(np->lval); nodefree(np->rval); free(np); /*@=keeptrans@*/ } /* By AIS. This checks W534. */ static void checkW534(const node *np) { if(!np) return; if(np->opcode == AND || np->opcode == OR || np->opcode == XOR) { if(np->rval->opcode == SELECT && np->rval->rval->width == 32 && !(np->rval->rval->optdata&0xffff0000lu)) { /* This looks suspicious, in that C-INTERCAL will do an op32, but INTERCAL-72 would have done an op16. */ optuple->warn534=true; } } checkW534(np->lval); checkW534(np->rval); } /* By AIS. This checks W018. */ static void checkforintercaloperators(const node *np) { if(!np) return; switch(np->opcode) { /* This only comes up in binary. */ case AND: case OR: case XOR: case MINGLE: case SELECT: optuple->warn018 = true; break; default: checkforintercaloperators(np->lval); checkforintercaloperators(np->rval); return; } } /* By AIS (with a few code fragments copied from elsewhere in this file) This generates the values of c used by the OIL idiom file idiotism.oil. */ void checknodeactbits(node *np) { int temp; if (np == (node *)NULL) return; else if (np->lval != (node *)NULL) checknodeactbits(np->lval); if (np->rval != (node *)NULL) checknodeactbits(np->rval); switch (np->opcode) { case MINGLE: /*@-nullderef@*/ /* mingle has two nonnull arguments */ if(np->lval->optdata & 0xffff0000LU) optuple->warn276 = true; if(np->rval->optdata & 0xffff0000LU) optuple->warn276 = true; np->optdata = ick_mingle((unsigned)(np->lval->optdata & 0xffff), (unsigned)(np->rval->optdata & 0xffff)); /*@=nullderef@*/ /* The bitmask is needed because the output of ~ might always be 16-bit at runtime, but appear 32-bit at compile-time. But this is somewhat suspicious, so we can at least give a warning (W276) if -l is used. */ break; case SELECT: /* The result could be the selected optdata, or have a 1 anywhere to the right of a 1 in the resulting selection if there are 0s in rval where there could have been 1s */ /*@-nullderef@*/ np->optdata = ick_iselect((unsigned)np->lval->optdata, (unsigned)np->rval->optdata); /*@=nullderef@*/ temp=32; while(temp--) np->optdata|=(np->optdata>>1); /* fill in gaps in optdata */ break; case AND: if(np->width==16) np->optdata = ick_and16((unsigned)np->rval->optdata); else np->optdata = ick_and32((unsigned)np->rval->optdata); break; case OR: case XOR: if(np->width==16) np->optdata = ick_or16((unsigned)np->rval->optdata); else np->optdata = ick_or32((unsigned)np->rval->optdata); /* This is or in both cases. */ break; case FIN: case WHIRL: case WHIRL2: case WHIRL3: case WHIRL4: case WHIRL5: /* We must be in binary to reach this point, so: */ ick_lose(IE997, emitlineno, (const char*) NULL); /*@-unreachable@*/ break; /*@=unreachable@*/ case MESH: case MESH32: np->optdata = np->constant; /* It's trivial to tell which bits can be nonzero! */ break; case ick_ONESPOT: case ick_TWOSPOT: case ick_TAIL: case ick_HYBRID: case SUB: np->optdata = np->width == 16 ? 0xffffLU : 0xffffffffLU; break; /* cases from here down are generated by optimize_pass1 */ case C_AND: /*@-nullderef@*/ np->optdata = np->lval->optdata & np->rval->optdata; /*@=nullderef@*/ break; case C_OR: case C_XOR: /*@-nullderef@*/ np->optdata = np->lval->optdata | np->rval->optdata; /*@=nullderef@*/ /* bitwise-or is correct in both cases */ break; case C_NOT: np->optdata = np->width == 16 ? 0xffffLU : 0xffffffffLU; break; case C_A: np->optdata = 0xffffffffLU; break; case C_NOTEQUAL: case C_ISEQUAL: case C_LOGICALNOT: case C_LOGICALAND: case C_LOGICALOR: case C_GREATER: case C_LESS: np->optdata = 1; /* this is a logical function */ break; case C_RSHIFTBY: /*@-nullderef@*/ if(np->rval->opcode == MESH || np->rval->opcode == MESH32) np->optdata = np->lval->optdata >> np->rval->constant; else np->optdata = (np->width == 16 ? 0xffffLU : 0xffffffffLU); /*@=nullderef@*/ /* Play safe if the RHS isn't a constant */ break; case C_LSHIFTBY: /*@-nullderef@*/ if(np->rval->opcode == MESH || np->rval->opcode == MESH32) np->optdata = np->lval->optdata << np->rval->constant; else np->optdata = (np->width == 16 ? 0xffffLU : 0xffffffffLU); /*@=nullderef@*/ /* Play safe if the RHS isn't a constant */ break; case C_PLUS: /* A bit could be set if it's set in either of the numbers, or if it's set by a carry; so OR together the two numbers and their sum. */ /*@-nullderef@*/ np->optdata = np->lval->optdata | np->rval->optdata | (np->lval->optdata + np->rval->optdata); /*@=nullderef@*/ break; case C_MINUS: case C_DIVIDEBY: /* The optimizer shouldn't be able to generate negative answers or divisions by 0, so just fill in all bits from lval rightwards */ /*@-nullderef@*/ np->optdata = np->lval->optdata; np->optdata |= np->optdata >> 1; np->optdata |= np->optdata >> 2; np->optdata |= np->optdata >> 4; np->optdata |= np->optdata >> 8; np->optdata |= np->optdata >> 16; /*@=nullderef@*/ break; case C_MODULUS: /* The answer must be smaller than both inputs, but we can't tell anything else */ /*@-nullderef@*/ np->optdata = np->lval->optdata; if(np->rval->optdata < np->optdata) np->optdata = np->rval->optdata; np->optdata |= np->optdata >> 1; np->optdata |= np->optdata >> 2; np->optdata |= np->optdata >> 4; np->optdata |= np->optdata >> 8; np->optdata |= np->optdata >> 16; /*@=nullderef@*/ break; case C_TIMES: /* Convolve one set of active bits with the other, ORadding the results */ np->optdata=0; temp=32; /*@-nullderef@*/ /*@-shiftnegative@*/ while(temp--) if(np->lval->optdata & (1LU << temp)) np->optdata = np->optdata | (np->rval->optdata << temp) | ((np->rval->optdata << temp) + np->optdata); /*@=nullderef@*/ /*@=shiftnegative@*/ break; case GETS: /* Of course, this doesn't return a value. So this uses the default code just below it, which is why it doesn't end in break;. This has its own case so that W276 can be given on an assignment. */ /*@-nullderef@*/ if(np->lval->optdata == 0xffff && np->rval->optdata & 0xffff0000lu) optuple->warn276 = true; /*@=nullderef@*/ /*@fallthrough@*/ case UNKNOWNOP: default: /*@-nullderef@*/ if(np->opcode == BY && !np->lval->optdata) optuple->warn239 = true; /*@=nullderef@*/ np->optdata = (np->width == 16 ? 0xffffLU : 0xffffffffLU); /* Some values of opcode are used as placeholders, to save more than 1 piece of information in a node. The optdata for these is probably irrelevant, but just in case, we mark all possible bits as active. */ break; } } intercal-0.30/src/PaxHeaders.27456/atari.bin0000644000000000000000000000007411437550756015404 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.490945962 intercal-0.30/src/atari.bin0000644000175000017500000000021711437550756015277 0ustar00esresr00000000000000128 1 xgfedcba   !"#¢%&'()*+,-./0123456789:;<=>¥?ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]|@`abcdefghijklmnopqrstuvwxyz{}~intercal-0.30/src/PaxHeaders.27456/numerals.c0000644000000000000000000000007411437550756015604 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.526945866 intercal-0.30/src/numerals.c0000644000175000017500000001064611437550756015506 0ustar00esresr00000000000000/* * numeral.c -- internationalization support for INTERCAL input. * * After release 0.5, I wrote: * * 2. (ESR) Input format internationalization -- allow WRITE IN input digits in * major languages such as Nahuatl, Tagalog, Sanskrit, and Basque. * * The twisted loons in the alt.folklore.computers crowd loved this * idea, and I actually got sent digit lists for Nahuatl, Tagalog, * Sanskrit, and Basque -- also, Kwakiutl, Georgian, Ojibwe. Albanian, * and Volap\"uk. I've left out Albanian (didn't want to keep track * of the dipthong diacritical) and Ojibwe (no zero digit). So: * Nahuatl, Tagalog, Sanskrit, Basque, Georgian, Kwakiutl, and * Volap\"uk are now supported in addition to English. * * As of release 0.18, Volap\"uk digits can be entered in either ick_traditional * Tex format, Latin-1, or UTF-8. Latin is also now a supported language, * to fulfill the requirement for Ancient Roman localization. * LICENSE TERMS Copyright (C) 1996 Eric S. Raymond This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" typedef struct { /*@observer@*/ const char *name; const int value; } numeral; const numeral ick_numerals[] = { /* English */ { "OH", 0 }, { "ZERO", 0 }, { "ONE", 1 }, { "TWO", 2 }, { "THREE", 3 }, { "FOUR", 4 }, { "FIVE", 5 }, { "SIX", 6 }, { "SEVEN", 7 }, { "EIGHT", 8 }, { "NINE", 9 }, { "NINER", 9 }, /* For all you junior birdmen */ /* Sanskrit */ { "SUTYA", 0 }, /* Retroflex s, pronounced halfway to sh */ { "SHUTYA", 0 }, { "EKA", 1 }, { "DVI", 2 }, { "TRI", 3 }, { "CHATUR", 4 }, { "PANCHAN", 5 }, { "SHASH", 6 }, { "SAPTAM", 7 }, { "ASHTAN", 8 }, { "NAVAN", 9 }, /* Basque */ { "ZEROA", 0 }, { "BAT", 1 }, { "BI", 2 }, { "HIRO", 3 }, { "LAU", 4 }, { "BORTZ", 5 }, { "SEI", 6 }, { "ZAZPI", 7 }, { "ZORTZI", 8 }, { "BEDERATZI", 9 }, /* Tagalog */ { "WALA", 0 }, { "ISA", 1 }, { "DALAWA", 2 }, { "TATLO", 3 }, { "APAT", 4 }, { "LIMA", 5 }, { "ANIM", 6 }, { "PITO", 7 }, { "WALO", 8 }, { "SIYAM", 9 }, /* Classical Nahuatl */ { "AHTLE", 0 }, /* Actually `nothing'; no separate zero word is known */ { "CE", 1 }, { "OME", 2 }, { "IEI", 3 }, { "NAUI", 4 }, { "NACUILI", 5 }, { "CHIQUACE", 6 }, { "CHICOME", 7 }, { "CHICUE", 8 }, { "CHICUNAUI", 9 }, /* Georgian */ { "NULI", 0 }, { "ERTI", 1 }, { "ORI", 2 }, { "SAMI", 3 }, { "OTXI", 4 }, { "XUTI", 5 }, { "EKSVI", 6 }, { "SHVIDI", 7 }, { "RVA", 8 }, { "CXRA", 9 }, /* Kwakiutl (technically, Kwak'wala) */ { "KE'YOS", 0 }, /* Actually `nothing'; no separate zero word is known */ { "'NEM", 1 }, { "MAL'H", 2 }, { "YUDEXW", 3 }, { "MU", 4 }, { "SEK'A", 5 }, { "Q'ETL'A", 6 }, { "ETLEBU", 7 }, { "MALHGWENALH", 8 }, { "'NA'NE'MA", 9 }, /* Volap\"uk */ { "NOS", 0 }, { "BAL", 1 }, { "TEL", 2 }, { "KIL", 3 }, { "FOL", 4 }, { "LUL", 5 }, { "M\\\"AL", 6 }, { "M\xC4L", 6 }, /* Latin-1 support */ { "M\xA3\xA4L", 6 }, /* UTF-8 support */ { "VEL", 7 }, { "J\\\"OL", 8 }, { "J\xD6L", 8 }, /* Latin-1 support */ { "J\xA3\x96L", 8 }, /* UTF-8 support */ { "Z\\\"UL", 9 }, { "Z\xDCL", 9 }, /* Latin-1 support */ { "Z\xA3\x9CL", 9 }, /* UTF-8 support */ /* Latin localization */ { "NIL", 0 }, { "NIHIL", 0 }, { "UNUS", 1 }, { "UNA", 1 }, { "UNUM", 1 }, { "DUO", 2 }, { "DUAE", 2 }, { "TRES", 3 }, { "QUATTUOR", 4 }, { "QUATUOR", 4 }, { "QUINQUE", 5 }, { "SEX", 6 }, { "SEPTEM", 7 }, { "OCTO", 8 }, { "NOVEM", 9 }, }; /* numeral.c ends here */ intercal-0.30/src/PaxHeaders.27456/ick_bool.h0000644000000000000000000000007411474462532015537 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.510945911 intercal-0.30/src/ick_bool.h0000644000175000017500000000126011474462532015431 0ustar00esresr00000000000000/* * Hide difference between compilers with the C99 bool type and those without. * The main reason this is desirable is so splint can do more rigorous checking * on bools. This also allows for compilers that define _Bool but not true or * false, etc. */ /*@-redef@ -incondefs*/ #ifndef __bool_true_false_are_defined # if HAVE_STDBOOL_H >= 1 # include # else # if !defined(HAVE__BOOL) || HAVE__BOOL < 1 # if HAVE_STDINT_H >= 1 # include typedef int_fast8_t bool; # else typedef int bool; # endif # else typedef _Bool bool; # endif # define true 1 # define false 0 # define __bool_true_false_are_defined 1 # endif #endif /*@=redef =incondefs@*/ intercal-0.30/src/PaxHeaders.27456/pickwrap.c0000644000000000000000000000007411437550756015576 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.498945939 intercal-0.30/src/pickwrap.c0000644000175000017500000000124211437550756015470 0ustar00esresr00000000000000$L /* $A.c -- generated PIC C-code file for INTERCAL program $A.i */ /* This code is explicitly *not* GPLed. Use, abuse, and redistribute freely */ $M $E $K #define ICKABSTAINED(d) abstain##d #define ICKSTASH(a,b,c,d) c##ick_stash[b]=c[b] #define ICKRETRIEVE(a,b,c,d,e) a[b]=a##ick_stash[b] #define ICKIGNORE(a,b,c) ignore##c##b ICK_INT16 ick_skipto=0; $O $C $D $P int ick_main(void) { pickinit(); /* degenerated code */ ick_restart: top: switch(ick_skipto) { case 0: $G } #ifdef YUK if(yukloop) goto ick_restart; #endif ick_lose(IE633, $J, (const char *)0); $H return 0; } $Q /* Generated code for $A.i ends here */ intercal-0.30/src/PaxHeaders.27456/ebcdic.bin0000644000000000000000000000007411437550756015515 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.490945962 intercal-0.30/src/ebcdic.bin0000644000175000017500000000041711437550756015412 0ustar00esresr00000000000000256 1 hgfedcba  ¢.<(+!&]$*);¬-/¥|,%_>?:#@'="abcdefghijklmnopqr{[~stuvwxyz®^£©ABCDEFGHIJKLMNOPQR}STUVWXYZ0123456789intercal-0.30/src/PaxHeaders.27456/ick-wrap.c0000644000000000000000000000007411437550756015473 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.494945956 intercal-0.30/src/ick-wrap.c0000644000175000017500000000347611437550756015400 0ustar00esresr00000000000000$L /* $A.c -- generated C-code file for INTERCAL program $A.i */ /* This code is explicitly *not* GPLed. Use, abuse, and redistribute freely */ #include #include #include #include $M #include "fiddle.h" #include "abcess.h" #include "ick_lose.h" $K #ifdef ICK_EC #include "ick_ec.h" void ick_main(void); #endif #define ICKABSTAINED(d) ick_abstained[d] #define ICKSTASH(a,b,c,d) ick_stash(a, b, c+b, d) #define ICKRETRIEVE(a,b,c,d,e) ick_retrieve(a+b, c, b, d[b], e) #define ICKIGNORE(a,b,c) a[b] extern int ick_printflow; int ick_lineno; jmp_buf ick_cjb; int ick_ccfc; long ick_skipto=0; $O char* ick_globalargv0; int ick_oldabstain; int ick_abstained[$B]$C; $D $E $P int main(int argc, char *argv[]) { #ifndef YUK ick_parseargs(argc,argv); #endif ick_skipto = 0; ick_next = calloc(80, sizeof *ick_next); #ifdef ICK_EC ick_next_jmpbufs = malloc(81 * sizeof *ick_next_jmpbufs); #endif $N ick_globalargv0=argv[0]; #ifdef YUK yuklines = $J; yukcommands = $B; globalargv = argv; globalargc = argc; #endif /* set seed for random error generation */ #ifdef USG srand48(time(0) + getpid()); #else srand(time(0)); #endif /* UNIX */ #if MULTITHREAD == 1 ickmtinit(); #endif /* set up stash storage */ ick_stashinit(); $F #ifdef ICK_EC ick_runstartups(); ick_next(0); } ICK_EC_FUNC_START(ick_main) { ick_linelabelnosp(0); #endif /* degenerated code */ ick_restart: top: switch((int)ick_skipto) { case 0: $G default: ick_lose(IE129, 0, (const char *)0); } #ifdef YUK if(yukloop) goto ick_restart; #endif ick_lose(IE633, $J, (const char *)0); $H #ifndef ICK_EC return 0; #else return; #endif } #ifdef ICK_EC ICK_EC_FUNC_END #endif $Q /* Generated code for $A.i ends here */ intercal-0.30/src/PaxHeaders.27456/ick_ec.h0000644000000000000000000000007411437550756015200 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.502945933 intercal-0.30/src/ick_ec.h0000644000175000017500000002366611437550756015110 0ustar00esresr00000000000000/***************************************************************************** NAME ick_ec.h -- external call support between C and C-INTERCAL LICENSE TERMS Copyright (C) 2008 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ***************************************************************************/ /* The external calls to C work via ICK_EC_FUNCs; whenever a suckpoint is encountered, all ICK_EC_FUNCs are run with ick_global_checkmode set to 1, and when a NEXT is called but finds no target in the INTERCAL program, all ICK_EC_FUNCs are run with ick_global_checkmode set to 2. COME FROMs and NEXT FROMs don't steal control immediately (they know where to steal control from using ick_global_linelabel), but instead set ick_global_goto to a 'high' line label (one of the internal ones above 65536 which are allocated for this sort of purpose, and inside the preprocessor) or error if it's set nonzero already. After verifying that exactly one COME or NEXT FROM is involved, the INTERCAL program will NEXT to the high line label (whether it leaves a NEXT stack entry will depend on whether COME FROM or NEXT FROM was used, which is communicated by a NEXT FROM setting the checkmode to 3, which is identical to 1 in all other respects). To prevent this process running the program out of stack space (which would happen with a naive implementation if there were many COME FROMs from inside the C program back to inside the C program), all transitions but NEXTs are done indirectly, by jumping back inside a relevant invocation of ick_dogoto and changing its targets. (So effectively, to GOTO a particular destination, you go back in time to the last time you NEXTed - or to implement a FORGET, the last-but-n-time you NEXTed - and redo it with a different target.) */ #if ICK_HAVE_STDINT_H+1 == 2 #include #else /* Ensure that uint32_t, etc, aren't implemented as compatibility macros so that we can implement them as typedefs. */ #undef uint32_t #undef uint16_t typedef unsigned int uint32_t; typedef unsigned short uint16_t; #endif #ifndef ICK_ABCESS_H_INCLUDED typedef unsigned short ick_type16; typedef unsigned int ick_type32; #endif #define ICK_EC_FUNC_START(id) \ ICK_EC_PP_0(id) \ void id(void) \ { \ void* ick_local_createdata = \ ick_global_createdata; \ int ick_local_checkmode = ick_global_checkmode; \ if(ick_global_checkmode==6) \ { \ goto ick_l6_ICK_EC_PP_6; \ } \ if(ick_global_checkmode==2) \ { \ goto ick_l2_ICK_EC_PP_2; \ } \ else if(ick_global_checkmode==1 || \ ick_global_checkmode==3) \ { \ goto ick_l1_ICK_EC_PP_1; \ } \ ick_local_checkmode=ick_global_checkmode=0; #define ick_linelabel(expr) ick_labeledblock(expr,0) #define ick_labeledblock(expr,block) \ do { \ if(0) \ { \ ick_l2_ICK_EC_PP_2: ; \ if(ick_global_linelabel != (expr) || (expr) > 65535) \ goto ick_l2_ICK_EC_PP_2; \ ick_global_checkmode = 0; \ } \ block ; \ ick_checksuckpoint(expr); \ } \ while(0) #define ick_linelabelnosp(expr) \ do { \ if(0) \ { \ ick_l2_ICK_EC_PP_2: ; \ if(ick_global_linelabel != (expr) || (expr) > 65535) \ goto ick_l2_ICK_EC_PP_2; \ ick_global_checkmode = 0; \ } \ } \ while(0) #define ick_forget(amount) \ do { \ ick_scheduleforget(amount); \ ick_dogoto(ICK_EC_PP_3,-1,0); \ ick_lose(ICK_IE778, -1, (char*) NULL); \ return; \ ick_l2_ICK_EC_PP_2: ; \ if(ick_global_linelabel != ICK_EC_PP_3) \ goto ick_l2_ICK_EC_PP_2; \ ick_global_checkmode = 0; \ } while(0) #define ick_startup(block) \ if(0) \ { \ ick_l6_ICK_EC_PP_6: \ ick_global_checkmode=0; \ block ; \ ick_global_checkmode=ick_local_checkmode; \ goto ick_l6_ICK_EC_PP_6; \ } #define ick_comefrom(expr) \ if(0) \ { \ ick_l1_ICK_EC_PP_1: ; \ if(ick_global_linelabel == (expr) && (expr) <= 65535) \ { \ if(ick_global_goto) ick_lose(ICK_IE555, -1, (char*)0); \ ick_global_goto = ICK_EC_PP_3; \ } \ goto ick_l1_ICK_EC_PP_1; \ ick_l2_ICK_EC_PP_2: ; \ if(ick_global_linelabel != ICK_EC_PP_3) \ goto ick_l2_ICK_EC_PP_2; \ ick_global_checkmode = 0; \ } #define ick_comefromif(expr,condition) \ ick_docomefromif(expr,-1,condition) #define ick_docomefromif(expr,lbl,condition) \ if(0) \ { \ ick_l1_ICK_EC_PP_1: ; \ if(ick_global_linelabel == (expr) && (expr) <= 65535) \ if(condition) \ { \ if(ick_global_goto) ick_lose(ICK_IE555, lbl, (char*)0); \ ick_global_goto = ICK_EC_PP_3; \ } \ goto ick_l1_ICK_EC_PP_1; \ ick_l2_ICK_EC_PP_2: ; \ if(ick_global_linelabel != ICK_EC_PP_3) \ goto ick_l2_ICK_EC_PP_2; \ ick_global_checkmode = 0; \ } #define ick_nextfrom(expr) \ if(0) \ { \ ick_l1_ICK_EC_PP_1: ; \ if(ick_global_linelabel == (expr) && (expr) <= 65535) \ { \ if(ick_global_goto) ick_lose(ICK_IE555, -1, (char*)0); \ ick_global_goto = ICK_EC_PP_3; \ ick_global_checkmode = 3; \ } \ goto ick_l1_ICK_EC_PP_1; \ ick_l2_ICK_EC_PP_2: ; \ if(ick_global_linelabel != ICK_EC_PP_3) \ goto ick_l2_ICK_EC_PP_2; \ ick_global_checkmode = 0; \ } #define ick_nextfromif(expr,condition) \ ick_donextfromif(expr,-1,condition) #define ick_donextfromif(expr,lbl,condition) \ if(0) \ { \ ick_l1_ICK_EC_PP_1: ; \ if(ick_global_linelabel == (expr) && (expr) <= 65535) \ if(condition) \ { \ if(ick_global_goto) ick_lose(ICK_IE555, lbl, (char*)0); \ ick_global_goto = ICK_EC_PP_3; \ ick_global_checkmode = 3; \ } \ goto ick_l1_ICK_EC_PP_1; \ ick_l2_ICK_EC_PP_2: ; \ if(ick_global_linelabel != ICK_EC_PP_3) \ goto ick_l2_ICK_EC_PP_2; \ ick_global_checkmode = 0; \ } #define ICK_EC_FUNC_END \ if(ick_local_checkmode) ick_resume(1); \ ick_l1_ICK_EC_PP_1: ; \ ick_l6_ICK_EC_PP_6: ; \ ick_l2_ICK_EC_PP_2: return; \ } #define ick_next(label) do{ \ if((label)<=65535) \ ick_dogoto((label),-1,1); \ } while(0) #define ick_goto(label) do{ \ if((label)<=65535) \ ick_dogoto((label),-1,0); \ } while(0) #define ick_resume(amount) ick_doresume((amount),-1) #define ick_return_or_resume() do{ \ if(ick_local_checkmode) ick_doresume(1,-1); \ return; \ } while(0) /*@maynotreturn@*/ void ick_dogoto(unsigned long, int, int); void ick_scheduleforget(unsigned short); /*@noreturn@*/ void ick_doresume(unsigned short, int); /*@maynotreturn@*/ void ick_checksuckpoint(unsigned long); void ick_runstartups(void); /*@maynotreturn@*/ uint32_t ick_dounop(char*, uint32_t, uint32_t, int, unsigned long, unsigned long, unsigned long, ick_type32(*)(ick_type32), ick_type32(*)(ick_type32), ick_type32(*)(ick_type32), void(*)(ick_type32, void(*)()), void(*)(ick_type32, void(*)()), void(*)(ick_type32, void(*)()), /*@observer@*/ const char*); void ick_allecfuncs(void); /* in generated program */ extern int ick_global_checkmode; extern unsigned long ick_global_linelabel; extern unsigned long ick_global_goto; extern void* ick_global_createdata; /* Variables. */ typedef struct ick_ec_var_tag { int ick_ec_vartype; int ick_ec_extername; int ick_ec_intername; } ick_ec_var; extern ick_ec_var ick_ec_vars[]; #define ICK_EC_VARS_END 5 uint16_t ick_getonespot(unsigned short); void ick_setonespot(unsigned short, uint16_t); uint32_t ick_gettwospot(unsigned short); void ick_settwospot(unsigned short, uint32_t); void ick_create(const char*, unsigned long); /* For accessing the arguments to an ick_created command */ int ick_c_i_width(int); int ick_c_i_isarray(int); unsigned short ick_c_i_varnumber(int); uint32_t ick_c_i_value(int); /* These require -a to work */ uint32_t ick_c_i_getvalue(int); void ick_c_i_setvalue(int, uint32_t); #define ick_c_width(a) ick_c_i_width((ick_global_createdata=ick_local_createdata,(a))) #define ick_c_isarray(a) ick_c_i_isarray((ick_global_createdata=ick_local_createdata,(a))) #define ick_c_varnumber(a) ick_c_i_varnumber((ick_global_createdata=ick_local_createdata,(a))) #define ick_c_value(a) ick_c_i_value((ick_global_createdata=ick_local_createdata,(a))) #define ick_c_getvalue(a) ick_c_i_getvalue((ick_global_createdata=ick_local_createdata,(a))) #define ick_c_setvalue(a,n) ick_c_i_setvalue((ick_global_createdata=ick_local_createdata,(a)),(n)) /* Fragments of ick_lose.h, that don't impinge on unmangled namespace. */ #define ICK_IE555 "555 FLOW DIAGRAM IS EXCESSIVELY CONNECTED\n\ ON THE WAY TO %d\n" #define ICK_IE778 "778 UNEXPLAINED COMPILER BUG\n\ ON THE WAY TO %d\n" extern void /*@noreturn@*/ ick_lose(const char *m, int n, /*@null@*/ const char *s) #ifdef __GNUC__ __attribute__ ((noreturn)) #endif ; intercal-0.30/src/PaxHeaders.27456/oil.h0000644000000000000000000000007311440130757014532 xustar0030 atime=1427954558.379140774 29 ctime=1427992235.60694564 intercal-0.30/src/oil.h0000644000175000017500000000673311440130757014437 0ustar00esresr00000000000000/* Header file for compiled OIL programs Does name mangling, defines macros Copyright (C) Alex Smith 2008 See oil.y for copyright conditions. */ #include "config.h" #include #include #include #include #include "sizes.h" #include "ick.h" #include "parser.h" #include "fiddle.h" #include "ick_lose.h" #include "feh.h" #define OPTING(x) \ if(optdebug == 2) \ { \ explexpr(optdebugnode,stderr); \ putc('\n',stderr); \ } \ if(optdebug == 3) \ { \ prexpr(optdebugnode,stderr,0); \ putc('\n',stderr); \ } \ if(optdebug) fprintf(stderr,"[%s]",#x); \ if(optdebug >= 2) putc('\n',stderr); \ opted = 1; #define MAYBENEWNODE(n) if(!(n)) (n)=newnode(); #define Base ick_Base #define Large_digits ick_Large_digits #define Max_large ick_Max_large #define Max_small ick_Max_small #define Small_digits ick_Small_digits #define and16 ick_and16 #define and32 ick_and32 #define aref ick_aref #define assign ick_assign #define binin ick_binin #define binout ick_binout #define bitencout ick_bitencout #define br_trans ick_br_trans #define cesspoolin ick_cesspoolin #define cesspoolout ick_cesspoolout #define checkforbugs ick_checkforbugs #define clc_cset_atari ick_clc_cset_atari #define clc_cset_baudot ick_clc_cset_baudot #define clc_cset_convert ick_clc_cset_convert #define clc_cset_ebcdic ick_clc_cset_ebcdic #define clc_cset_hardcoderead ick_clc_cset_hardcoderead #define clc_cset_latin1 ick_clc_cset_latin1 #define clc_cset_load ick_clc_cset_load #define clc_cset_ptr ick_clc_cset_ptr #define clcsem ick_clcsem #define clcsemantics ick_clcsemantics #define clockface ick_clockface #define coreonerr ick_coreonerr #define cset_recent ick_cset_recent #define csetow ick_csetow #define datadir ick_datadir #define debfopen ick_debfopen #define fin ick_fin #define fin16 ick_fin16 #define fin32 ick_fin32 #define findandfopen ick_findandfopen #define findandfreopen ick_findandfreopen #define findandtestopen ick_findandtestopen #define first ick_first #define globalargv0 ick_globalargv0 #define iselect ick_iselect #define lineno ick_lineno #define lose ick_lose #define lwarn ick_lwarn #define mingle ick_mingle #define multicome0 ick_multicome0 #define mystery ick_mystery #define mysteryc ick_mysteryc #define next ick_next #define nextindex ick_nextindex #define numerals ick_numerals #define or16 ick_or16 #define or32 ick_or32 #define parseargs ick_parseargs #define pin ick_pin #define popnext ick_popnext #define pout ick_pout #define printflow ick_printflow #define printfopens ick_printfopens #define pushnext ick_pushnext #define resize ick_resize #define resume ick_resume #define retrieve ick_retrieve #define rev_and16 ick_rev_and16 #define rev_and32 ick_rev_and32 #define rev_fin16 ick_rev_fin16 #define rev_fin32 ick_rev_fin32 #define rev_or16 ick_rev_or16 #define rev_or32 ick_rev_or32 #define rev_whirl16 ick_rev_whirl16 #define rev_whirl32 ick_rev_whirl32 #define rev_xor16 ick_rev_xor16 #define rev_xor32 ick_rev_xor32 #define roll ick_roll #define rotleft16 ick_rotleft16 #define rotleft32 ick_rotleft32 #define setbitcount ick_setbitcount #define smudgeleft ick_smudgeleft #define smudgeright ick_smudgeright #define stash ick_stash #define stashinit ick_stashinit #define traditional ick_traditional #define whirl ick_whirl #define whirl16 ick_whirl16 #define whirl32 ick_whirl32 #define wimp_mode ick_wimp_mode #define xor ick_xor #define xor16 ick_xor16 #define xor32 ick_xor32 #define xselx ick_xselx intercal-0.30/src/PaxHeaders.27456/clc-cset.c0000644000000000000000000000007411437550756015453 xustar0030 atime=1427954558.375140793 30 ctime=1427992235.534945844 intercal-0.30/src/clc-cset.c0000644000175000017500000003471711437550756015362 0ustar00esresr00000000000000/***************************************************************************** NAME clc-cset.c -- CLC-INTERCAL character set support for C-INTERCAL LICENSE TERMS Copyright (C) 2007 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ***************************************************************************/ /* The input is read from files such as latin1.bin and ebcdic.bin. These contain three lines of text data that specify the length of the character set (number of characters in each shift state), the number of shift states, and the bit order of the input. The bit order can either be 8 characters long (msb down to lsb) or 16 (the ick_first byte in a pair, followed by the second); each bit of the input is transferred to the corresponding bit in a binary table that follows (a for the lsb, b for the second least significant bit, up to l for the 12th least significant bit; at most 12 significant bits are allowed), or x for a don't care on the bit. The table that follows is the relevant character codes in Latin-1 (which is used as the interconversion language); if shift states are used, they're represented by character codes 1, 2, 3, etc.. Invalid characters are represented by character code 0, and changed to nulls on output. The order of the bytes is 'Latin-1 for this set's char 0 in shift state 1', 'Latin-1 for this set's char 0 in shift state 2', ..., 'Latin-1 for this set's char 1 in shift state 1', and so on. Note that as the character set feature is designed to mirror CLC-INTERCAL's, I've sprinkled a bit of idiomatic Perl throughout the code. This is quite rare, though, as it has to be also legal in C. */ #include #include #include #include "uncommon.h" #define NCSETRECENT 8 /* Sometimes we want to link the character set files to the program * rather than reading them from disk; in this case, these extern * variables will be set non-null by object files invented * specifically for the purpose. */ extern /*@null@*/ const char* ick_clc_cset_atari; extern /*@null@*/ const char* ick_clc_cset_baudot; extern /*@null@*/ const char* ick_clc_cset_ebcdic; extern /*@null@*/ const char* ick_clc_cset_latin1; static /*@null@*/ const char* ick_clc_cset_ptr=0; /* Fake that we're reading hardcoded characters from a file. This * method of doing it is obviously not thread-safe. */ static int ick_clc_cset_hardcoderead(FILE* ignored) { /*@-noeffect@*/ (void) ignored; /*@=noeffect@*/ return (int)*ick_clc_cset_ptr++; } struct cset { unsigned char set[4096]; /* allow up to 12 bits of data+shifts */ unsigned short setlen; int shifts; char setname[9]; /* 8.3 filenames are enforced! */ char bitorder[16]; int nbytes; }; /* In particular, this initialises the setnames to the null string, * and clears nbytes. Both of these are used to determine whether a * cset is valid or not. */ /*@-initallelements@*/ /*@-type@*/ static struct cset ick_cset_recent[NCSETRECENT]={{{0},0,0,{0},{0},0}}; /*@=initallelements@*/ /*@=type@*/ static int ick_csetow=0; /* which cset to overwrite ick_next */ /* For help finding files */ /*@observer@*/ extern char* ick_globalargv0; /*@observer@*/ extern const char* ick_datadir; /*@-mustfreefresh@*/ /* because Splint doesn't understand how findandfopen works */ static void ick_clc_cset_load(/*@unique@*/ struct cset* cs, /*@unique@*/ const char* fname) { FILE* in; char buf[13]; /* enough for an 8.3 filename */ int i,j,c; int (*ipf)(FILE*); /* Avoid buffer-overflow attacks. */ if(strlen(fname)>8) return; /* If ick_clc_cset_atari is non-null, then don't read from disk. */ if(ick_clc_cset_atari) { /* If the character sets have been hardcoded, only accept * hardcoded chararacter sets. */ ick_clc_cset_ptr=0; if(!strcmp(fname,"atari")) ick_clc_cset_ptr=ick_clc_cset_atari; if(!strcmp(fname,"baudot")) ick_clc_cset_ptr=ick_clc_cset_baudot; if(!strcmp(fname,"ebcdic")) ick_clc_cset_ptr=ick_clc_cset_ebcdic; if(!strcmp(fname,"latin1")) ick_clc_cset_ptr=ick_clc_cset_latin1; if(!ick_clc_cset_ptr) return; /* not a hardcoded charset */ in=(FILE*)0; ipf=ick_clc_cset_hardcoderead; } else { /* We already checked above that this isn't a buffer overflow. */ /*@-bufferoverflowhigh@*/ sprintf(buf,"%s.bin",fname); /*@=bufferoverflowhigh@*/ if(!(in=ick_findandfopen(buf,ick_datadir,"rb",ick_globalargv0))) return; ipf=fgetc; } /* First row: setlen */ cs->setlen=0; do { /* The input is definitely in ASCII, even if the C program isn't, which is why numeric codes are used. */ /* Here, ipf allows NULL input iff in is actually NULL; this situation is impossible to explain with an annotation, so instead just disable the warning. */ /*@-nullpass@*/ c=ipf(in); /*@=nullpass@*/ if(c==EOF) {if(in) (void)fclose(in); return;} if(c<48||c>57) break; cs->setlen*=10; cs->setlen+=c-48; } while(1); if(c!=10) {if(in) (void)fclose(in); return;} /* Second row: shifts. This can be from 1 to 9. */ /*@-nullpass@*/ c=ipf(in); /*@=nullpass@*/ if(c<49||c>57) {if(in) (void)fclose(in); return;} cs->shifts=c-48; /*@-nullpass@*/ if(ipf(in)!=10) {if(in) (void)fclose(in); return;} /*@=nullpass@*/ /* Third row: byte order. */ i=0; /*@-nullpass@*/ while(((c=ipf(in)))>96&&i<16) cs->bitorder[i++]=(char)c; /*@=nullpass@*/ /* Sanity check; that it is a whole number of bytes, that the input * format is correct, and that there are at most 4096 bytes of data * total. */ if(c!=10||i%8||!i||cs->setlen*cs->shifts>4096) return; /* i/8 is now the number of bytes, but don't set that yet in case * there's an error later. */ /* Rest of file: the bytes themselves. */ j=0; /*@-nullpass@*/ while(jsetlen*cs->shifts) if((cs->set[j++]=(unsigned char)(c=ipf(in))),c==EOF && in != NULL) {if(in) (void)fclose(in); return;} /*@=nullpass@*/ if(in) (void) fclose(in); /* Now set the name and number of bytes, indicating a successful * load. */ cs->nbytes=i/8; strcpy(cs->setname,fname); } /*@=mustfreefresh@*/ /* Helper function for fixing bit order in output. */ static void ick_bitencout(char** pop, const struct cset* co, unsigned short val, int padstyle) { unsigned short outword=0; int i=co->nbytes*8; /*@-shiftnegative@*/ /* i can't go above it's initial value here */ while(i--) if(co->bitorder[i]>'l') { if((padstyle==1&&(i==1||i==9) && !(outword&(1<<(co->nbytes*8-i)))) || (padstyle==2&&(rand()%2||!outword))) outword |= 1<<(co->nbytes*8-i-1); } /* Copy the appropriate bit from val to outword. */ else outword |= (unsigned short)((val>>(co->bitorder[i]-'a'))&1) << (co->nbytes*8-i-1); /*@=shiftnegative@*/ if(co->nbytes==2) *(*pop)++=(char)(outword/256); *(*pop)++=(char)(outword%256); } /* padstyle is 0 to pad with zeros, 1 to pad to make the output * printable characters, or 2 to pad with garbage, avoiding 0s. * Return value is the number of characters in the output string, * which may contain embedded NULs if the input contained invalid * characters. Returns -1 on error. The caller is responsible for * making sure that out is big enough, but as a check, no more than * outsize-1 characters and a NUL will be written to out. The code is * conservative about this; to be safe, make outsize six times as long * as the in is (including in's terminal NUL), plus 6. */ int ick_clc_cset_convert(const char* in, /*@partial@*/ char* out, const char* incset, const char* outcset, int padstyle, size_t outsize, /*@null@*/ FILE* errsto) { int ic=-1, oc=-1; int i; int ssi, sso; unsigned short tus, csi; const char* ip; char* op; struct cset *csri, *csro; int noconvwarn=0; int substwarn=0; /* First, see if we have a recently-used version of incset or outcset. */ i=NCSETRECENT; while(i--) { (void)(strcmp(incset,ick_cset_recent[i].setname) || (ic=i)); (void)(strcmp(outcset,ick_cset_recent[i].setname) || (oc=i)); } /* Find a blank entry to load on top of. */ if(ic==-1) for(i=NCSETRECENT;i--;) if(!ick_cset_recent[i].nbytes) ic=i; if(oc==-1) for(i=NCSETRECENT;i--;) if(!ick_cset_recent[i].nbytes&&i!=ic) oc=i; /* Failing that, find any entry to load on top of. */ (void)(ic==-1 && (ick_cset_recent[ic=ick_csetow++].nbytes=0)); if(ick_csetow==ic) ick_csetow++; ick_csetow%=NCSETRECENT; (void)(oc==-1 && (ick_cset_recent[oc=ick_csetow++].nbytes=0)); ick_csetow%=NCSETRECENT; /* If the character set hasn't been loaded, load it now. */ ick_cset_recent[ic].nbytes || (ick_clc_cset_load(ick_cset_recent+ic,incset),0); ick_cset_recent[oc].nbytes || (ick_clc_cset_load(ick_cset_recent+oc,outcset),0); csri=ick_cset_recent+ic; csro=ick_cset_recent+oc; /* If a character set failed to load, bail out. */ if(!csri->nbytes) { if(errsto) fprintf(errsto,"Error: Nonexistent input character set.\n"); return -1; } if(!csro->nbytes) { if(errsto) fprintf(errsto,"Error: Nonexistent output character set.\n"); return -1; } /* There is no initial shift state. */ ssi=sso=0; csri->shifts==1 && (ssi=1); csro->shifts==1 && (sso=1); ip=in; op=out; while(*ip != '\0' && (size_t)(op-out)nbytes==2) { tus*=256; tus+=(unsigned short)(unsigned char)*ip++; } i=csri->nbytes*8; csi=0; while(i--) { if(csri->bitorder[i]>'l') continue; /* Copy the appropriate bit from tus to csi. */ /*@-shiftnegative@*/ csi |= (unsigned short)((tus>>(csri->nbytes*8-i-1))&1) << (csri->bitorder[i]-'a'); /*@=shiftnegative@*/ } if(csi>csri->setlen) { ick_bitencout(&op,csro,0,padstyle); /* not in the charset */ if(!noconvwarn && errsto != NULL) fprintf(errsto,"Warning: some characters could not be translated," " they were replaced with NUL.\n"); noconvwarn=1; } else { /* The more interesting case. */ csi*=csri->shifts; if(!ssi) { /* We're at the start of a shift-stated string, but not actually in any shift state. There is no general solution here, so use one that works for Baudot: starting in each state in turn, choose the option that takes the longest until it ends up not changing shift state, then perform one shift from that option. */ int sstesting, ssbestsf, ssrecord, j, k; sstesting=csri->shifts+1; ssbestsf=ssrecord=0; while(--sstesting) { k=sstesting; j=0; while(csri->set[csi+i-1] != (unsigned char)0 && (int)csri->set[csi+i-1]!=k && (int)csri->set[csi+i-1]<=csri->shifts) {k=(int)csri->set[csi+i-1]; j++;} if(ssbestsfset[csi]; /* we now have the Latin-1 conversion! */ if(tus>=1&&tus<=(unsigned short)csri->shifts&&csri->shifts>1) { /* That wasn't a character, but a shift command. */ ssi=(int)tus; continue; } /* Look for the character in the output's character * set. Preferably we want something in the current shift * state, but failing that, any character will do. */ spacenowtab: i=csro->shifts*csro->setlen; csi=10000; while(i--) (void)((unsigned short)csro->set[i]==tus && (csi==10000 || (int)csi%csro->shifts!=sso-1) && (csi=(unsigned short)i)); if(csi==10000&&tus==9 /* latin-1 tab */) { if(!substwarn && errsto != NULL) fprintf(errsto,"Warning: no tab in output character set," " space was used instead.\n"); substwarn=1; tus=32; /* latin-1 space */ goto spacenowtab; } if(csi==10000) { ick_bitencout(&op,csro,0,padstyle); /* not in the charset */ if(!noconvwarn && errsto != NULL) fprintf(errsto,"Warning: some characters could not be translated," " they were replaced with NUL.\n"); noconvwarn=1; } else if((int)(csi%csro->shifts)==(int)sso-1) /* in the right shift state already */ ick_bitencout(&op,csro,(unsigned short)(csi/csro->shifts),padstyle); else { int tempi; /* Generate shift codes. If sso isn't 0, generate from where * we are at the moment; if it is 0, generate worse-case * shifts by assuming we're in a shift state that can't shift * to the state we want directly, if possible. */ if(!sso) { int j=csro->shifts+1; while(--j>0) { if(j-1==(int)(csi%csro->shifts)) continue; i=(int)csro->setlen; while(i--) if((int)csro->set[i*csro->shifts+j-1]==csi%csro->shifts+1) {j=-j; break; /* there is one in this set */}; j=-j; if(j<0) break; } /* Pick the worst-case if we found one, or otherwise just * any state we aren't in at the moment. */ sso=(j<0?-j:(int)(csi%csro->shifts)); if(!sso) sso=csro->shifts; } /* Look for the shift code, if there is one. */ i=(int)csro->setlen; while(i--) if((int)csro->set[i*csro->shifts+sso-1]==csi%csro->shifts+1) break; tempi=i*csro->shifts+sso-1; if(i==-1) { int intershift=-1; /* That didn't work. Look for the shift code in some shift * state other than the one we're aiming for. */ retry: i=csro->setlen*csro->shifts; while(i--) if((int)csro->set[i]==csi%csro->shifts+1&& i%csro->shifts!=(int)(csi%csro->shifts)&& i%csro->shifts+1!=intershift) break; if(i==-1) return -1; /* no way to get into the right state */ intershift=i%csro->shifts+1; tempi=i; i=(int)csro->setlen; while(i--) if((int)csro->set[i*csro->shifts+sso-1]==intershift) break; if(i==-1) goto retry; /* try once more */ ick_bitencout(&op,csro,(unsigned short)i,padstyle); /* sso=intershift here but we're going to overwrite it * immediately anyway, so no point in the assignment */ } ick_bitencout(&op,csro,(unsigned short)(tempi/csro->shifts),padstyle); ick_bitencout(&op,csro,(unsigned short)(csi/csro->shifts),padstyle); sso=csi%csro->shifts+1; } } } *op='\0'; return op-out; } intercal-0.30/src/PaxHeaders.27456/yuk.h0000644000000000000000000000007411437550756014573 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.506945917 intercal-0.30/src/yuk.h0000644000175000017500000001110011437550756014457 0ustar00esresr00000000000000/* yuk.h - header file for yuk.c and debugging versions of ick-wrap.c */ /* Copyright (C) Alex Smith 2006. See yuk.c for copyright conditions. This file is GPL'd, and so can be freely redistributed but has absolutely no warranty. */ #define YUK(t,u) yukline(t,u) #define YUKTERM yukterm() #define YUKEND 5 /*@-exportlocal@*/ /* because these are used by generated programs */ extern void yukline(int,int); extern void yukterm(void); extern int ick_abstained[]; extern int yukopts; extern int ick_lineno; extern int yuklines; extern int yukcommands; /*@-incondefs@*/ /* because it's a different textlines to the one in ick.h */ extern char *textlines[]; /*@=incondefs@*/ extern int lineofaboff[]; extern char *yukexplain[]; extern int yukloop; /*@=exportlocal@*/ /* Defines that change the functions used for profiling. */ /* Define the following to the timing function you want for profiling, or leave it undef to use the value computed by config.sh. */ #undef YPTIMERTYPE /* 0 to use clock(), 1 to use gettimeofday() and long, 2 to use gettimeofday() and long long, 3 to use gethrtime() 4 to use times(), 5 to use clock_gettime */ /* Note: On many systems, 0's resolution is too low to produce any output 1 and 2 produce the same output; use 2 if your system can handle long long because the overflow is dealt with more simply. 3 is a system-specific function. If there are more system-specific functions around that return more accurate times than the others used here, it would improve the profiler on those systems. According to the DJGPP documentation, it's impossible to get times with decent accuracy under DOS. DJGPP implements timer types 0, 1, and 2, so it will 'work' with the default value of 2, but the results you get will be basically meaningless as the base information can't be accurately obtained (the resolution is slightly worse than 50ms, which is far too slow for profiling). */ #ifndef YPTIMERTIME # ifdef HAVE_GETHRTIME # define YPTIMERTYPE 3 # else # if defined(HAVE_CLOCK_GETTIME) && SIZEOF_LONG_LONG_INT + 0 > 0 # define YPTIMERTYPE 5 # else # ifdef HAVE_GETTIMEOFDAY /* Allow for an erroneous blank value for SIZEOF_LONG_LONG_INT. */ # if SIZEOF_LONG_LONG_INT + 0 > 0 # define YPTIMERTYPE 2 # else # define YPTIMERTYPE 1 # endif # else # define YPTIMERTYPE 0 # endif # endif # endif #endif #if YPTIMERTYPE == 0 #define YPTIMERTFORMAT "lu" #define YPCOUNTERTFORMAT "lu" #define YPTIMERTFORMATD "6" YPTIMERTFORMAT #define YPTIMERSCALE CLOCKS_PER_SEC #define YPGETTIME clock() typedef unsigned long yptimer; typedef unsigned long ypcounter; #elif YPTIMERTYPE == 1 #define YPTIMERTFORMAT "lu" #define YPCOUNTERTFORMAT "lu" #define YPTIMERTFORMATD "6" YPTIMERTFORMAT #define YPTIMERSCALE 1000000LU #define YPGETTIME yukgettimeofday() typedef unsigned long yptimer; typedef unsigned long ypcounter; #elif YPTIMERTYPE == 2 #define YPTIMERTFORMAT "llu" #define YPCOUNTERTFORMAT "lu" #define YPTIMERTFORMATD "6" YPTIMERTFORMAT #define YPTIMERSCALE 1000000LU #define YPGETTIME yukgettimeofday() typedef unsigned long long yptimer; typedef unsigned long ypcounter; #elif YPTIMERTYPE == 3 #define YPTIMERTFORMAT "llu" #define YPCOUNTERTFORMAT "lu" #define YPTIMERTFORMATD "9" YPTIMERTFORMAT #define YPTIMERSCALE 1000000000LLU #define YPGETTIME gethrtime() typedef unsigned long long yptimer; typedef unsigned long ypcounter; #elif YPTIMERTYPE == 4 #define YPTIMERTFORMAT "lu" #define YPCOUNTERTFORMAT "lu" #define YPTIMERTFORMATD "6" YPTIMERTFORMAT #define YPTIMERSCALE CLK_TCK #define YPGETTIME yuktimes() typedef unsigned long yptimer; typedef unsigned long ypcounter; #elif YPTIMERTYPE == 5 #define YPTIMERTFORMAT "llu" #define YPCOUNTERTFORMAT "lu" #define YPTIMERTFORMATD "9" YPTIMERTFORMAT #define YPTIMERSCALE 1000000000LLU #define YPGETTIME yukclock_gettime() typedef unsigned long long yptimer; typedef unsigned long ypcounter; #else #error Invalid YPTIMERTYPE in yuk.h #endif /* YPTIMERTYPE cases */ extern yptimer ypexectime[]; extern ypcounter ypexecount[]; extern ypcounter ypabscount[]; typedef struct yukvar_tag { int vartype; int extername; int intername; } yukvar; extern yukvar yukvars[]; /*@-exportlocal@*/ /* this needs to be global */ extern char** globalargv; extern int globalargc; /*@=exportlocal@*/ /* Give our own definition of sig_atomic_t for systems that don't have it. char ought to be atomic, on most systems (especially as we don't touch anything but the bottom byte). */ #if SIZEOF_SIG_ATOMIC_T + 0 == 0 #undef sig_atomic_t typedef char sig_atomic_t; #endif intercal-0.30/src/PaxHeaders.27456/parser.y0000644000000000000000000000007411437551705015273 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.614945617 intercal-0.30/src/parser.y0000644000175000017500000006327511437551705015203 0ustar00esresr00000000000000/***************************************************************************** NAME parser.y -- grammar for the INTERCAL language DESCRIPTION This YACC grammar parses the INTERCAL language by designed by Don R. Woods and James M. Lyon. There are several syntax extensions over the original INTERCAL-72 language. LICENSE TERMS Copyright (C) 1996 Eric S. Raymond This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *****************************************************************************/ %{ #include "config.h" #include #include #include "sizes.h" #include "ick.h" #include "feh.h" #include "ick_lose.h" extern int yyerror(const char*); /* Intervene our ick_first-stage lexer. */ extern int lexer(void); #define yylex() lexer() static node *rlist; /* pointer to current right-hand node list */ /*static node *llist;*/ /* pointer to current left-hand node list */ static node *np; /* variable for building node lists */ extern int stbeginline; /* line number of last seen preamble */ static int thisline; /* line number of beginning of current statement */ extern int mark112; /* AIS: Mark the tuple for W112 when it's created. */ static int lineuid=65537; /* AIS: a line number not used anywhere else */ static int cacsofar=0; /* AIS: Number of args in a CREATE statement */ static tuple *splat(int); static tuple *prevtuple = NULL; #define GETLINENO \ {if (stbeginline < 0) thisline = -stbeginline; \ else {thisline = stbeginline; stbeginline = 0;}} #define ACTION(x, nt, nn) \ {x = newtuple(); x->type = nt; x->ick_lineno = thisline; x->u.node = nn;} #define TARGET(x, nt, nn) \ {x = newtuple(); x->type = nt; x->ick_lineno = thisline; x->u.target = nn;} #define ACTARGET(x, nt, nn, nn2)\ {x = newtuple(); x->type = nt; x->ick_lineno = thisline;\ x->u.node = nn; x->u.target = nn2;} /* AIS : The macro above was added for ABSTAIN expr FROM. */ #define NEWFANGLED mark112 = 1; /* AIS: Added the mention of mark112 */ \ if (ick_traditional) ick_lose(IE111,iyylineno,(char*)NULL); else #define DESTACKSE1 sparkearsstack[sparkearslev--/32] >>= 1 #define DESTACKSPARKEARS DESTACKSE1; DESTACKSE1 %} %start program %union { int numval; /* a numeric value */ tuple *tuple; /* a code tuple */ node *node; /* an expression-tree node */ } /* * Don't change this statement token list gratuitously! * Some code in feh2.c depends on GETS being the least * statement type and on the order of the ones following. * When adding a new statement, also update MAXTYPES in ick.h * and the token list in feh2.c. * AIS: Note that although GETS is the lowest statement type (with index 0 * in feh2.c), UNKNOWN (i.e. a line that causes error 000) is an even * lower statement type, with index -1. perpet.c uses indexes 1 higher. * AIS: Added FROM, MANYFROM, TRY_AGAIN, COMPUCOME, GERUCOME, WHILE, three * NEXT FROM cases, and CREATE. Also added PREPROC; this is for when the * parser acts like a preprocessor, translating an INTERCAL statement into * a sequence of INTERCAL statements with the same net effect. * AIS: COME_FROM now merged with the label following it, * to distinguish it from COMPUCOME, in the lexer. This changes * the parser somewhat. */ %token UNKNOWN /* AIS: This is so comments can be REINSTATED */ %token GETS RESIZE NEXT GO_AHEAD GO_BACK FORGET RESUME STASH RETRIEVE IGNORE %token REMEMBER ABSTAIN REINSTATE %token DISABLE ENABLE MANYFROM GIVE_UP READ_OUT WRITE_IN /* AIS: */PIN %token COME_FROM NEXTFROMLABEL %token NEXTFROMEXPR NEXTFROMGERUND COMPUCOME GERUCOME %token PREPROC WHILE TRY_AGAIN %token CREATE %token COMPUCREATE FROM /* AIS: ONCE and AGAIN added, for multithread support; also, NOSPOT added, so that I can reserve _ for future use (it's nowhere in the grammar yet) */ %token MAYBE DO PLEASE NOT ONCE AGAIN MESH NOSPOT ick_ONESPOT ick_TWOSPOT ick_TAIL ick_HYBRID %token MINGLE SELECT UNKNOWNOP /* AIS: SPARK EARS */ SUB BY /* AIS: For operand overloading */ %token SLAT BACKSLAT %token NUMBER UNARY OHOHSEVEN GERUND LABEL BADCHAR %token INTERSECTION /* * These are not tokens returned by the lexer, but they are used as * tokens elsewhere. We define them here to insure that the values * will not conflict with the other tokens. It is important that * WHIRL through WHIRL5 be a continuous sequence. */ /* AIS: Added new tokens for optimizer output */ %token SPLATTERED MESH32 %token C_AND C_OR C_XOR C_NOT C_LOGICALNOT C_LSHIFTBY C_RSHIFTBY %token C_NOTEQUAL C_A C_PLUS C_MINUS C_TIMES C_DIVIDEBY C_MODULUS %token C_GREATER C_LESS C_ISEQUAL C_LOGICALAND C_LOGICALOR /* The reverse unary operators have to be in the same order as the forward unary operators. */ %token AND OR XOR FIN WHIRL WHIRL2 WHIRL3 WHIRL4 WHIRL5 %token REV_AND REV_OR REV_XOR REV_FIN %token REV_WHIRL REV_WHIRL2 REV_WHIRL3 REV_WHIRL4 REV_WHIRL5 /* (AIS) Tokens for just-in-case compilation; UNKNOWNID is returned by the lexer for unknown 'identifiers'. And yes, it does contain a number. */ %token UNKNOWNID /* (AIS) Five possibilities for an unknown statement chain: identifiers, scalars, arrays, array elements, and other expressions. */ %token US_ID US_SCALAR US_ARRVAR US_ELEM US_EXPR %type expr limexpr varlist variable constant lvalue inlist outlist %type subscr byexpr scalar scalar2s ick_array initem outitem sublist %type unambig limunambig subscr1 sublist1 oparray osubscr osubscr1 %type notanlvalue nlunambig lunambig unknownstatement unknownatom %type unknownsin unknownsif unknownaid unop %type preproc perform mtperform %type please preftype %nonassoc OPENEARS OPENSPARK CLOSEEARS CLOSESPARK %nonassoc HIGHPREC %nonassoc UNARYPREC %nonassoc LOWPREC /* AIS: I reversed this precedence, to sort out the near-ambiguity. UNARYPREC and LOWPREC are to give the C-INTERCAL meaning of a statement precedence above its CLC-INTERCAL meaning. */ %% /* beginning of rules section */ /* A program description consists of a sequence of statements */ program : /* EMPTY */ | program command ; /* * Each command consists of an optional label, followed by a preamble, * followed by an optional probability, followed by the statement body. * Negative exechance values indicate initial abstentions, and will be * made positive before code is emitted. * AIS: An exechance above 100 indicates a MAYBE situation (e.g. 4545 * means MAYBE DO %45 ...). This means %0 should be illegal. I modified * all these to allow for MAYBE. */ command : please mtperform {$2->label = 0; $2->exechance = $1 * 100;} | please OHOHSEVEN mtperform {$3->label = 0; $3->exechance = $1 * $2;} | LABEL please mtperform {checklabel($1); $3->label = $1; $3->exechance = $2 * 100;} | LABEL please OHOHSEVEN mtperform {checklabel($1); $4->label = $1; $4->exechance = $2 * $3;} | error {/* AIS: catch errors which occur after the end of a statement (highly likely when comments are being written, as the start of them will be parsed as an UNKNOWN) */ yyerrok; yyclearin; cacsofar=0; if(prevtuple) {prevtuple->type=SPLATTERED; splat(0);} else splat(1); /* this is the first statement */ } ; /* * AIS: added for the ONCE/AGAIN qualifiers. It copies a pointer to the tuple, * so command will set the values in the original tuple via the copy. * I also added prevtuple so that after-command splattering works. */ mtperform : preproc {$1->onceagainflag = onceagain_NORMAL; prevtuple = $$ = $1;} | preproc ONCE {NEWFANGLED {$1->onceagainflag = onceagain_ONCE; prevtuple = $$ = $1;}} | preproc AGAIN {NEWFANGLED {$1->onceagainflag = onceagain_AGAIN; prevtuple = $$ = $1;}} /* AIS: Either we do a simple 'perform', or preprocessing is needed. I wrote all of this. The way the preprocessor works is to add a whole load of new tuples. The tuples are written in the correct order, except for where one of the commands referenced in the preproc is needed; then one command from near the start is written, and swapped into place using tupleswap. ppinit must also be called giving the number of tuples at the end, to sort out each of the tuples. Note that preprocs can't be nested (so no DO a WHILE b WHILE c), and that lineuid can be used to create unreplicable numbers. preproc must also be set by hand on all commands that you want to be immune to ABSTAIN, etc., from outside the preproc, and $$ is set to the command that gets the line number and can be NEXTED to and from. */ preproc : perform {$$ = $1;} /* the simple case */ | perform WHILE perform { if(!multithread) ick_lose(IE405, iyylineno, (char*)NULL); NEWFANGLED{ /* (x) DO a WHILE b is equivalent to #11 (l0) DO REINSTATE (l3) #10 (l1) DO COME FROM (l2) AGAIN #9 DO b #8 DO COME FROM (l0) #7 DO NOTHING #6 DO NOTHING #5 (l2) DO NOTHING #4 DO GIVE UP #3 DO COME FROM (l0) #2 (x) DO a #1 (l3) DON'T ABSTAIN FROM (l1) AGAIN */ tuple* temptuple; TARGET(temptuple, COME_FROM, lineuid+2); temptuple->label=lineuid+1; temptuple->preproc=1; /* #10 */ TARGET(temptuple, COME_FROM, lineuid+0); temptuple->preproc=1; /* #8 */ ACTION(temptuple, PREPROC, 0); temptuple->preproc=1; /* #7 */ ACTION(temptuple, PREPROC, 0); temptuple->preproc=1; /* #6 */ ACTION(temptuple, PREPROC, 0); temptuple->label=lineuid+2; temptuple->preproc=1; /* #5 */ ACTION(temptuple, GIVE_UP, 0); temptuple->preproc=1; /* #4 */ TARGET(temptuple, COME_FROM, lineuid+0); temptuple->preproc=1; /* #3 */ TARGET(temptuple, REINSTATE, lineuid+3); temptuple->setweave=1; temptuple->label=lineuid+0; temptuple->preproc=1; /* #11 */ TARGET(temptuple, ABSTAIN, lineuid+1); temptuple->label=lineuid+3; /* #1 */ temptuple->preproc=1; temptuple->setweave=-1; temptuple->exechance=-100; politesse += 3; /* Keep the politeness checker happy */ ppinit(11); tupleswap(10,9); tupleswap(11,2); lineuid+=4; /* #2, #9 */ tuples[ick_lineno-10].onceagainflag=onceagain_AGAIN; tuples[ick_lineno-1].onceagainflag=onceagain_AGAIN; $$=&(tuples[ick_lineno-2]); }} /* There are two (AIS: now four) forms of preamble returned by the lexer */ please : DO {GETLINENO; $$ = 1;} | DO NOT {GETLINENO; $$ = -1;} | MAYBE {NEWFANGLED {GETLINENO; $$ = 101;}} | MAYBE NOT {NEWFANGLED {GETLINENO; $$ = -101;}} ; /* Here's how to parse statement bodies */ perform : lvalue GETS expr {ACTION($$, GETS, cons(GETS,$1,$3));} | ick_array GETS byexpr {ACTION($$, RESIZE, cons(RESIZE,$1,$3));} | notanlvalue GETS expr %prec LOWPREC {/* AIS: This is for variableconstants, and an error otherwise.*/ if(variableconstants) ACTION($$, GETS, cons(GETS,$1,$3)) else {yyerrok; yyclearin; $$=splat(1);}} | LABEL NEXT {TARGET($$, NEXT, $1);} | FORGET expr {ACTION($$, FORGET, $2);} | RESUME expr {ACTION($$, RESUME, $2);} | STASH varlist {ACTION($$, STASH, rlist);} | RETRIEVE varlist {ACTION($$, RETRIEVE, rlist);} | IGNORE varlist {ACTION($$, IGNORE, rlist);} | REMEMBER varlist {ACTION($$, REMEMBER, rlist);} | ABSTAIN FROM LABEL {stbeginline=0; TARGET($$, ABSTAIN, $3);} | ABSTAIN FROM gerunds {ACTION($$, DISABLE, rlist);} | ABSTAIN expr FROM LABEL {/* AIS */ NEWFANGLED {stbeginline=0; ACTARGET($$, FROM, $2, $4);}} | ABSTAIN expr FROM gerunds {/* AIS */ NEWFANGLED {$$ = newtuple(); $$->type = MANYFROM; $$->ick_lineno = thisline; \ {node* tempnode=newnode(); $$->u.node = tempnode; tempnode->lval=$2; tempnode->rval=rlist; tempnode->opcode=MANYFROM;}}} | REINSTATE LABEL {stbeginline=0; TARGET($$, REINSTATE, $2);} | REINSTATE gerunds {ACTION($$, ENABLE, rlist);} | WRITE_IN inlist {ACTION($$, WRITE_IN, $2);} | READ_OUT outlist {ACTION($$, READ_OUT, $2);} | PIN scalar2s {ACTION($$, PIN, $2);} | GIVE_UP {ACTION($$, GIVE_UP, 0);} | GO_AHEAD {/* AIS */ NEWFANGLED {ACTION($$, GO_AHEAD, 0);}} | GO_BACK {/* AIS */ NEWFANGLED {ACTION($$, GO_BACK, 0);}} | TRY_AGAIN {/* AIS */ NEWFANGLED {ACTION($$,TRY_AGAIN,0);}} | COME_FROM {/* AIS: Modified */ NEWFANGLED {TARGET($$,COME_FROM,$1);}} | COMPUCOME gerunds {/* AIS: COME FROM gerund */ NEWFANGLED{ACTION($$,GERUCOME,rlist); compucomesused=1; gerucomesused=1;}} | COMPUCOME expr {/* AIS */NEWFANGLED {ACTION($$,COMPUCOME,$2); compucomesused=1;}} /* AIS: NEXT FROM works along the same lines as COME FROM */ | NEXTFROMLABEL {NEWFANGLED {TARGET($$,NEXTFROMLABEL,$1);} nextfromsused=1;} | NEXTFROMEXPR gerunds{NEWFANGLED{ACTION($$,NEXTFROMGERUND,rlist); compucomesused=1; gerucomesused=1;} nextfromsused=1;} | NEXTFROMEXPR expr {NEWFANGLED {ACTION($$,NEXTFROMEXPR,$2); compucomesused=1; nextfromsused=1;}} /* AIS: CREATE takes an 'unknown statement' as a template */ | CREATE unknownstatement {NEWFANGLED{ACTARGET($$,CREATE,$2,$1); cacsofar=0;}} | COMPUCREATE expr unknownsif {NEWFANGLED{ACTION($$,COMPUCREATE, cons(INTERSECTION,$2,$3)); cacsofar=0;}} /* AIS: or an unknown expression */ | CREATE unop {NEWFANGLED{ACTARGET($$,CREATE,$2,$1); cacsofar=0;}} | COMPUCREATE unambig unop {NEWFANGLED{ACTION($$,COMPUCREATE, cons(INTERSECTION,$2,$3)); cacsofar=0;}} /* AIS: Just-in-case compilation of unknown statements */ | unknownstatement {NEWFANGLED {ACTION($$,UNKNOWN,$1); cacsofar=0;}} /* AIS: Added the yyerrok */ | BADCHAR {yyclearin; yyerrok; $$ = splat(1); cacsofar=0;} | error {yyclearin; yyerrok; $$ = splat(1); cacsofar=0;} ; /* AIS: Unknown statements. The rule here is that we can't have two non-ID unknowns in a row, but two IDs in a row are acceptable. */ unknownstatement : unknownatom {$$ = $1; intern(ick_TWOSPOT,cacsofar+++1601);} | unknownsin unknownatom {$$=cons(INTERSECTION,$1,$2); intern(ick_TWOSPOT,cacsofar+++1601);} | unknownsin {$$ = $1;} ; unknownsif : unknownaid {$$ = $1;} | unknownaid unknownstatement {$$=cons(INTERSECTION,$1,$2);} unknownsin : unknownaid {$$ = $1;} | unknownstatement unknownaid {$$=cons(INTERSECTION,$1,$2);} /* Each of the possible unknown atoms, apart from arrays and IDs, generates operand overloading info if CREATEs or external calls are used, so that the implied overloading of a CREATE will work. */ unknownatom : subscr {$$=cons(US_ELEM,0,$1); if(createsused){ opoverused=1; if(!firstslat) firstslat=$1; else prevslat->nextslat=$1; prevslat=$1; $1->nextslat=0;}} | scalar {$$=cons(US_SCALAR,0,$1); if(createsused){ opoverused=1; if(!firstslat) firstslat=$1; else prevslat->nextslat=$1; prevslat=$1; $1->nextslat=0;}} | notanlvalue {$$=cons(US_EXPR,0,$1); if(createsused){ opoverused=1; if(!firstslat) firstslat=$1; else prevslat->nextslat=$1; prevslat=$1; $1->nextslat=0;}} | ick_array {$$=cons(US_ARRVAR,0,$1);} ; unknownaid : UNKNOWNID {$$=newnode(); $$->opcode=US_ID; $$->constant=$1;} ; /* gerund lists are used by ABSTAIN and REINSTATE */ gerunds : GERUND {rlist = np = newnode(); np->constant = $1;} | gerunds INTERSECTION GERUND { np->rval = newnode(); np = np->rval; np->constant = $3; } ; /* OK, here's what a variable reference looks like */ variable: scalar | ick_array; lvalue : scalar | subscr; scalar2s: ick_TWOSPOT NUMBER /* AIS: for TWOSPOTs only */ { $$ = newnode(); $$->opcode = ick_TWOSPOT; $$->constant = intern(ick_TWOSPOT, $2); } scalar : ick_ONESPOT NUMBER { $$ = newnode(); $$->opcode = ick_ONESPOT; $$->constant = intern(ick_ONESPOT, $2); } | ick_TWOSPOT NUMBER { $$ = newnode(); $$->opcode = ick_TWOSPOT; $$->constant = intern(ick_TWOSPOT, $2); } ; ick_array : ick_TAIL NUMBER { $$ = newnode(); $$->opcode = ick_TAIL; $$->constant = intern(ick_TAIL, $2); } | ick_HYBRID NUMBER { $$ = newnode(); $$->opcode = ick_HYBRID; $$->constant = intern(ick_HYBRID, $2); } ; /* Array with unary operator is a special intermediate case; these nodes will be rearranged when the subscript list is added */ oparray : ick_TAIL UNARY NUMBER %prec UNARYPREC { $$ = newnode(); $$->opcode = $2; $$->rval = newnode(); $$->rval->opcode = ick_TAIL; $$->rval->constant = intern(ick_TAIL, $3); } | ick_HYBRID UNARY NUMBER %prec UNARYPREC { $$ = newnode(); $$->opcode = $2; $$->rval = newnode(); $$->rval->opcode = ick_HYBRID; $$->rval->constant = intern(ick_HYBRID, $3); } ; /* And a constant looks like this */ constant: MESH NUMBER { /* enforce the 16-bit constant constraint */ if ((unsigned int)$2 > ick_Max_small) ick_lose(IE017, iyylineno, (char *)NULL); $$ = newnode(); $$->opcode = MESH; if(variableconstants) /* AIS */ $$->constant = intern(MESH, $2); else $$->constant = $2; } ; /* variable lists are used in STASH, RETRIEVE, IGNORE, REMEMBER */ varlist : variable {rlist = np = $1;} | varlist INTERSECTION variable {np = np->rval = $3; /* newnode(); */ } ; /* scalars and subscript exprs are permitted in WRITE IN lists */ /* new: arrays are also permitted to allow for bitwise I/0 */ initem : scalar | subscr | ick_array; inlist : initem INTERSECTION inlist {$$=cons(INTERSECTION,$1,$3);} | initem {$$=cons(INTERSECTION,$1,0);} ; /* scalars, subscript exprs & constants are permitted in READ OUT lists */ /* new: arrays are also permitted to allow for bitwise I/0 */ outitem : scalar | subscr | constant | ick_array; outlist : outitem INTERSECTION outlist {$$=cons(INTERSECTION,$1,$3);} | outitem {$$=cons(INTERSECTION,$1,0);} ; /* Now the gnarly part -- expression syntax */ /* Support ick_array dimension assignment */ byexpr : expr BY byexpr {$$ = cons(BY, $1, $3);} | expr {$$ = cons(BY, $1, 0);} ; /* Support ick_array subscripts (as lvalues) */ subscr : subscr1 {$$ = $1;} | ick_array SUB sublist {$$ = cons(SUB, $1, $3);} ; subscr1 : ick_array SUB sublist1 {$$ = cons(SUB, $1, $3);} ; sublist : unambig sublist {$$ = cons(INTERSECTION, $1, $2);} | unambig sublist1 {$$ = cons(INTERSECTION, $1, $2);} ; sublist1: subscr1 {$$ = cons(INTERSECTION, $1, 0);} | osubscr1 {$$ = cons(INTERSECTION, $1, 0);} | unambig %prec HIGHPREC {$$ = cons(INTERSECTION, $1, 0);} ; /* Unary operators with arrays act like arrays only in expressions */ osubscr : osubscr1 {$$ = $1;} | oparray SUB sublist {$$ = $1; $$->rval = cons(SUB, $$->rval, $3);} ; osubscr1: oparray SUB sublist1 {$$ = $1; $$->rval = cons(SUB, $$->rval, $3);} ; /* AIS: Unknown operators */ unop : BADCHAR {$$ = newnode(); $$->opcode = BADCHAR; $$->constant = $1;} ; /* here goes the general expression syntax */ expr : unambig {$$ = $1;} /* AIS: CLC-INTERCAL allows right-association of SELECT and MINGLE. (Strangely, that simplifies this section somewhat.) */ | unambig SELECT expr {$$ = cons(SELECT, $1, $3);} | unambig MINGLE expr {$$ = cons(MINGLE, $1, $3);} | unambig unop expr {$$ = cons(UNKNOWNOP, $2, cons(INTERSECTION, $1, $3)); if(useickec && createsused) { if(!firstslat) firstslat=$1; else prevslat->nextslat=$1; $1->nextslat=$3; prevslat=$3; $3->nextslat=0; opoverused=1; intern(ick_TWOSPOT, 1601); intern(ick_TWOSPOT, 1602); intern(ick_TWOSPOT, 1603);}} /* AIS: Operand overloading */ | scalar SLAT expr {NEWFANGLED{$$ = cons(SLAT, $1, $3); opoverused=1; if(!firstslat) firstslat=$3; else prevslat->nextslat=$3; prevslat=$3; $3->nextslat=0;}} | subscr {$$ = $1;} | osubscr {$$ = $1;} ; /* AIS: Any expression that isn't an lvalue */ notanlvalue:nlunambig {$$ = $1;} | osubscr {$$ = $1;} | unambig SELECT expr {$$ = cons(SELECT, $1, $3);} | unambig MINGLE expr {$$ = cons(MINGLE, $1, $3);} | unambig unop expr {$$ = cons(UNKNOWNOP, $2, cons(INTERSECTION, $1, $3)); if(useickec && createsused) { if(!firstslat) firstslat=$1; else prevslat->nextslat=$1; $1->nextslat=$3; prevslat=$3; $3->nextslat=0; opoverused=1; intern(ick_TWOSPOT, 1601); intern(ick_TWOSPOT, 1602); intern(ick_TWOSPOT, 1603);}} | scalar SLAT expr {NEWFANGLED{$$ = cons(SLAT, $1, $3); opoverused=1; if(!firstslat) firstslat=$3; else prevslat->nextslat=$3; prevslat=$3; $3->nextslat=0;}} ; /* AIS: an expr that doesn't start with a unary operator */ limexpr : limunambig {$$ = $1;} | limunambig SELECT expr {$$ = cons(SELECT, $1, $3);} | limunambig MINGLE expr {$$ = cons(MINGLE, $1, $3);} | limunambig unop expr {$$ = cons(UNKNOWNOP, $2, cons(INTERSECTION, $1, $3)); if(useickec && createsused) { if(!firstslat) firstslat=$1; else prevslat->nextslat=$1; $1->nextslat=$3; prevslat=$3; $3->nextslat=0; opoverused=1; intern(ick_TWOSPOT, 1601); intern(ick_TWOSPOT, 1602); intern(ick_TWOSPOT, 1603);}} | scalar SLAT expr {NEWFANGLED{$$ = cons(SLAT, $1, $3); opoverused=1; if(!firstslat) firstslat=$3; else prevslat->nextslat=$3; prevslat=$3; $3->nextslat=0;}} | subscr {$$ = $1;} | osubscr {$$ = $1;} ; preftype: MESH {$$=MESH; } | ick_ONESPOT {$$=ick_ONESPOT;} | ick_TWOSPOT {$$=ick_TWOSPOT;}; /* AIS: unambig split into limunambig (unambigs that don't start with a unary operator), nlunambig (unambigs that aren't lvalues), lunambig (both), and unambig (the general case) */ lunambig: constant {$$ = $1;} /* deal with the bizarre unary-op syntax */ | preftype UNARY NUMBER %prec UNARYPREC { $$ = newnode(); $$->opcode = $2; $$->rval = newnode(); $$->rval->opcode = $1; if($1 == MESH) { /* enforce the 16-bit constant constraint */ if ((unsigned int)$3 > ick_Max_small) ick_lose(IE017, iyylineno, (char *)NULL); if(variableconstants) /* AIS, patched by JH */ $$->rval->constant = intern(MESH, $3); else $$->rval->constant = $3; } else { $$->rval->constant = intern($1, $3); } } /* Now deal with the screwy unary-op interaction with grouping */ /* AIS: Modified to allow for maintenance of the SPARK/EARS stack */ | eitherspark UNARY expr CLOSESPARK %prec UNARYPREC { $$ = newnode(); $$->opcode = $2; $$->rval = $3; DESTACKSPARKEARS; } | eitherears UNARY expr CLOSEEARS %prec UNARYPREC { $$ = newnode(); $$->opcode = $2; $$->rval = $3; DESTACKSPARKEARS; } /* AIS: limexpr, a limited expression that isn't allowed to start with a unary operator, is used here to avoid a reduce/reduce conflict. */ | eitherspark limexpr CLOSESPARK {$$ = $2; DESTACKSPARKEARS;} | eitherears limexpr CLOSEEARS {$$ = $2; DESTACKSPARKEARS;} ; limunambig: lunambig {$$ = $1;} | scalar {$$ = $1;} ; nlunambig: lunambig {$$ = $1;} | UNARY unambig %prec LOWPREC {$$=newnode(); $$->opcode = $1; $$->rval = $2;} ; /* AIS: A bit of CLC-INTERCAL compatibility here. The syntax now allows any number of unary operators before, and one inside, an expression. In ambiguous cases like '&VV#1~#5', the & applies to the whole expression (one operator inside is allowed, and inside takes precedence), but the Vs apply just to the #1, because only one operator inside is allowed. */ unambig : limunambig {$$ = $1;} | UNARY unambig %prec LOWPREC {$$=newnode(); $$->opcode = $1; $$->rval = $2;} ; eitherspark : OPENSPARK ; | CLOSESPARK ; ; eitherears : OPENEARS ; | CLOSEEARS ; ; %% static tuple *splat(int gentuple) /* try to recover from an invalid statement. */ { tuple *sp; int tok, i; extern bool re_send_token; /* * The idea * here is to skip to the ick_next DO, PLEASE or label, then unget that token. * which we can do with a tricky flag on the lexer (re_send_token). */ if(re_send_token == true) /* By AIS */ { /* We're still cleaning up from the previous error. */ return prevtuple; } /* fprintf(stderr,"attempting to splat at line %d....\n",iyylineno); */ /* AIS: Set the flag to true the first time round, false for subsequent iterations. That way, if the error was triggered on a DO or label, we use that token as the start of the next statement. */ for(i = 0,re_send_token = true;;i++,re_send_token = false) { tok = lexer(); if (!tok) { re_send_token = true; tok = ' '; /* scanner must not see a NUL */ break; } else if (tok == DO || tok == PLEASE || tok == LABEL /* AIS */ || tok == MAYBE) { re_send_token = true; break; } } /* fprintf(stderr,"found %d on line %d after %d other tokens.\n", tok,iyylineno,i); */ /* generate a placeholder tuple for the text line */ if(gentuple /* AIS */) {TARGET(sp, SPLATTERED, 0); prevtuple=sp;} else sp=NULL; return(sp); } /* parser.y ends here */ intercal-0.30/src/PaxHeaders.27456/idiotism.oil0000644000000000000000000000007411442030202016107 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.538945827 intercal-0.30/src/idiotism.oil0000644000175000017500000006147611442030202016020 0ustar00esresr00000000000000; ; NAME ; idiotism.oil -- optimizer idioms for C-INTERCAL ; ; LICENSE TERMS ; Copyright (C) 2007 Alex Smith ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ; ; Optimizer Idiom Language input file for C-INTERCAL ; See the appendix "Optimizer Idiom Language" in the Revamped manual ; for information about the format of this file. ; Some useful constants: ; 0x55555555 1431655765 ; 0xAAAAAAAA 2863311530 ; 0x0000FFFF 65535 ; 0xFFFF0000 4294901760 ; 0xFFFFFFFF 4294967295 ; Constant folding [minglefold] (#{x<=65535}1$#{x<=65535}2)->(#{mingle(x1,x2)}0) [selectfold] (#{1}1~#{1}2)->(#{iselect(x1,x2)}0) [and32fold] (&32 #{1}1)->(#{and32(x1)}0) [or32fold] (V32 #{1}1)->(#{or32(x1)}0) [xor32fold] (?32 #{1}1)->(#{xor32(x1)}0) [and16fold] (&16 #{1}1)->(#{and16(x1)}0) [or16fold] (V16 #{1}1)->(#{or16(x1)}0) [xor16fold] (?16 #{1}1)->(#{xor16(x1)}0) ; C operations can, and should, be folded too [cfold] (#{1}1 & #{1}2)->(#{x1 & x2}0) (#{1}1 | #{1}2)->(#{x1 | x2}0) (#{1}1 ^ #{1}2)->(#{x1 ^ x2}0) (#{1}1 + #{1}2)->(#{x1 + x2}0) (#{1}1 - #{1}2)->(#{x1 - x2}0) (#{1}1 * #{1}2)->(#{x1 * x2}0) (#{1}1 / #{1}2)->(#{x1 / x2}0) (#{1}1 % #{1}2)->(#{x1 % x2}0) (#{1}1 > #{1}2)->(#{x1 > x2}0) (#{1}1 < #{1}2)->(#{x1 < x2}0) (#{1}1 >> #{1}2)->(#{x1 >> x2}0) (#{1}1 << #{1}2)->(#{x1 << x2}0) (#{1}1 == #{1}2)->(#{x1 == x2}0) (#{1}1 != #{1}2)->(#{x1 != x2}0) (! #{1}1)->(#{!x1}0) ; Reducing constants inside a C or operation can help to recognize idioms [cfoldintoorinand] (((_1) | #{(x != (x & x3))}2) & #{1}3)->(((_1) | #{x2 & x3}0) & _3) ; Binary bitwise optimizations [cbinand] ((&32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))~ #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->((_1 & _2) & #{iselect(x3,1431655765LU)}0) [cbinor] ((V32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))~ #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->((_1 | _2) & #{iselect(x3,1431655765LU)}0) [cbinxor] ((?32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))~ #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->((_1 ^ _2) & #{iselect(x3,1431655765LU)}0) ; Sometimes, an expanded output is wanted, optimizations happen in the wrong ; order, and we end up with & rather than ~ on the previous idiom. Correct ; such situations now. [cbinandnoselect] ((&32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))& #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(#0 $ ((_1 & _2) & #{iselect(x3,1431655765LU)}0)) [cbinornoselect] ((V32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))& #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(#0 $ ((_1 | _2) & #{iselect(x3,1431655765LU)}0)) [cbinxornoselect] ((?32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))& #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(#0 $ ((_1 ^ _2) & #{iselect(x3,1431655765LU)}0)) ; Sometimes, there isn't even a mingle... [cbinandnomingle] ((&32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))~ #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(((_2 >> #1) & _1) ~ _3) ((&32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))~ #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(((_2 >> #1) & _1) ~ _3) ((&32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))& #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(((_2 >> #1) & _1) & _3) ((&32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))& #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(((_2 >> #1) & _1) & _3) [cbinornomingle] ((V32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))~ #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(((_2 >> #1) | _1) ~ _3) ((V32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))~ #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(((_2 >> #1) | _1) ~ _3) ((V32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))& #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(((_2 >> #1) | _1) & _3) ((V32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))& #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(((_2 >> #1) | _1) & _3) [cbinxornomingle] ((?32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))~ #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(((_2 >> #1) ^ _1) ~ _3) ((?32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))~ #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(((_2 >> #1) ^ _1) ~ _3) ((?32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))& #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(((_2 >> #1) ^ _1) & _3) ((?32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))& #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3 )->(((_2 >> #1) ^ _1) & _3) ; Bitwise complements. (The INTERCAL which ultimately leads to cases 3 and 4 ; is not the most efficient way to do this, by the way.) [cnot1] (#65535 ^ .{!(c&4294901760LU)}1)->(~16 .1) [cnot2] (.{!(c&4294901760LU)}1 ^ #65535)->(~16 .1) [cnot3] (#4294967295 ^ :1)->(~32 :1) [cnot4] (:1 ^ #4294967295)->(~32 :1) ; bitwise logical equivalence [cxorand16] ((.1 ^ .2) & .2)->((~16 .1) & .2) ((.2 ^ .1) & .2)->((~16 .1) & .2) ((.1 & .2) ^ .2)->((~16 .1) & .2) ((.2 & .1) ^ .2)->((~16 .1) & .2) (.2 ^ (.1 & .2))->((~16 .1) & .2) (.2 ^ (.2 & .1))->((~16 .1) & .2) (.2 & (.1 ^ .2))->((~16 .1) & .2) (.2 & (.2 ^ .1))->((~16 .1) & .2) [cxorandmixed] ; This requires typecasting .1 to 32 bits. ((.1 ^ :2) & :2)->((~32 .1) & :2) ((:2 ^ .1) & :2)->((~32 .1) & :2) ((.1 & :2) ^ :2)->((~32 .1) & :2) ((:2 & .1) ^ :2)->((~32 .1) & :2) (:2 ^ (.1 & :2))->((~32 .1) & :2) (:2 ^ (:2 & .1))->((~32 .1) & :2) (:2 & (.1 ^ :2))->((~32 .1) & :2) (:2 & (:2 ^ .1))->((~32 .1) & :2) [cxorand32] ((:1 ^ _2) & _2)->((~32 _1) & _2) ((_2 ^ :1) & _2)->((~32 _1) & _2) ((:1 & _2) ^ _2)->((~32 _1) & _2) ((_2 & :1) ^ _2)->((~32 _1) & _2) (_2 ^ (:1 & _2))->((~32 _1) & _2) (_2 ^ (_2 & :1))->((~32 _1) & _2) (_2 & (:1 ^ _2))->((~32 _1) & _2) (_2 & (_2 ^ :1))->((~32 _1) & _2) ; Special cases of select ; Selecting the rightmost bits of a number [xselpow2m1] (_1 ~ #{x==xselx(x)}2)->(_1 & _2) ; Selecting one bit from a number [xselpow2] (_1 ~ #{xselx(x)==1}2)->(!(!(_1 & _2))) ; Selecting a number against itself and then selecting 1 from that [xselxsel1] ((_1~_1)~#1)->(!(!_1)) ((_1~_1))->(!(!_1)) (#1&(_1~_1))->(!(!_1)) ((_1~_1)&_{c==1}2)->(_1 && _2) (_{c==1}2&(_1~_1))->(_1 && _2) ; Selecting a number from a constant that's just below a power of 2 [pow2m1selx] ((#{x==xselx(x)}1 ~ _2) ~ #1)->(!(!(_1 & _2))) ; Boolean-negating a select [notselect] (!(_1~_2))->(!(_1&_2)) ; Sometimes select and mingle cancel each other out [selectmingle1] ((_1~#2863311530)$_2)->((_1�)|(#0$_2)) [selectmingle2] (_1$(_2~#1431655765))->((_1$#0)|(_2�)) [selectmingle3] ((_1~#1431655765)$_2)->(((_1�)<<#1)|(#0$_2)) [selectmingle4] (_1$(_2~#2863311530))->(((_2�)>>#1)|(_1$#0)) [selectmingle5] ;3579139412=0xd5555554 ((_{!(c&4294901760UL)}1$_{!(c&4294901760UL)}2)~#3579139412) ->((_1耀)|(_2>>#1)) ; special cases of V16/?16; the top bit was 0, so becomes equal to the ; bottom bit [or16and] ((V16 _{!(c&4294934528UL)}1)耀)->((_1)<<#15) [xor16and] ((?16 _{!(c&4294934528UL)}1)耀)->((_1)<<#15) ; Shifts ; Rightshift some of the bits [rshift] <#1-#31 (_1~#{xselx(x)<((_1&_2)>>#{r}0) > ; General 16-bit leftshifts ; ; Large left-shifts can be written in an optimized way using knowledge of the ; rightmost bits to shift more than one bit at a time. ; If the rightmost few bits of a number are known to be 0, it can be mingled ; with 0, and then selected with a number which has many 0s to do a leftshift. ; Here, if none of the bits marked l are set this is a right-shift by 3, and ; for each bit set, the shift goes 1 leftwards. ; (xxxxxxxxxxxxxttt $ 000000000000uuuu) ~ (h0h0h0h0h0h0h0h0h0h0h0h01lllllll) ; x0x0x0x0x0x0x0x0x0x0x0x0xutututu ; h0h0h0h0h0h0h0h0h0h0h0h01lllllll ; There's three cases here for each possible width for the ts, including one ; which has them as zeros and two which have them higher. [lshift16] <#0-#14 ((_{c<=65535&&!(c&((1LU<((((_1>>#{r}0)~#{iselect(x3>>(r*2+1),1431655765LU)}0) <<#{setbitcount(x3&((2LU<<(r*2))-1))}0)|#{iselect(mingle(0,x2),x3)}0) (((_{c<=65535&&!(c&((1LU<((((_1>>#{r}0)~#{iselect(x3>>(r*2+1),1431655765LU)}0) <<#{setbitcount(x3&((2LU<<(r*2))-1))}0)|#{iselect(mingle(x4,x2),x3)}0) (((#{x<=65535&&!(c&~((1LU<((((_1>>#{r}0)~#{iselect(x3>>(r*2+1),1431655765LU)}0) <<#{setbitcount(x3&((2LU<<(r*2))-1))}0)|#{iselect(mingle(x4,x2),x3)}0) > ; A helper in calculating 32-bit shifts; this is a shift on half the bits of ; a 32-bit number. [lshift32half] (#0$((:1~#715827882)<<#1))->((:1�)<<#1) (#0$((:1�)~#715827883))->((:1�)<<#1) ; 32-bit leftshift by 1; there are 8 ways to write this. [lshift32by1] (((_1�)<<#1)|((_1�)<<#1))->((_1�)<<#1) (((#1431655765&_1)<<#1)|((_1�)<<#1))->((_1�)<<#1) (((_1�)<<#1)|((#715827882&_1)<<#1))->((_1�)<<#1) (((#1431655765&_1)<<#1)|((#715827882&_1)<<#1))->((_1�)<<#1) (((_1�)<<#1)|((_1�)<<#1))->((_1�)<<#1) (((_1�)<<#1)|((#1431655765&_1)<<#1))->((_1�)<<#1) (((#715827882&_1)<<#1)|((_1�)<<#1))->((_1�)<<#1) (((#715827882&_1)<<#1)|((#1431655765&_1)<<#1))->((_1�)<<#1) ; Move rshift, AND out of neg [rshiftoutofneg] (~16 (.1 >> #1))->(((~16 .1) >> #1) | #32768) (~32 (:1 >> #1))->(((~32 :1) >> #1) | #2147483648) [andoutofneg] (~16 (.1 & #{1}2))->(((~16 .1) & _2) | #{(~x2)&65535}0) (~32 (:1 & #{1}2))->(((~32 :1) & _2) | #{~x2}0) ; Move AND inside shifts, and OR and XOR outside shifts [andintoshift] ((_1 << #{1}2) & #{1}3)->((_1 & #{x3>>x2}0) << _2) ((_1 >> #{1}2) & #{1}3)->((_1 & #{x3<> _2) [oroutofshift] ((_1 | #{1}2) << #{1}3)->((_1 << _3) | #{x2<> #{1}3)->((_1 >> _3) | #{x2>>x3}0) [xoroutofshift] ((_1 ^ #{1}2) << #{1}3)->((_1 << _3) ^ #{x2<> #{1}3)->((_1 >> _3) ^ #{x2>>x3}0) ; Larger leftshifts can be created by combining smaller ones, although there ; are shortcuts that can be used and this idiom only works if they haven't ; been. Also, idioms later on can create shifts that cancel each other out, so ; the code for cancelling them is here. [combinellshift] ((_1 << #{1}2) << #{1}3)->(_1 << #{x2+x3}0) [combinelrshift] ((.{65535LU>>x2 >= c}1 << #{1}2) >> #{x>x2}3)->(.1 >> #{x3-x2}0) ((.{65535LU>>x2 >= c}1 << #{1}2) >> #{x==x2}3)->(.1) ((.{65535LU>>x2 >= c}1 << #{1}2) >> #{x(.1 << #{x2-x3}0) ((:{4294967295LU>>x2 >= c}1 << #{1}2) >> #{x>x2}3)->(:1 >> #{x3-x2}0) ((:{4294967295LU>>x2 >= c}1 << #{1}2) >> #{x==x2}3)->(:1) ((:{4294967295LU>>x2 >= c}1 << #{1}2) >> #{x(:1 << #{x2-x3}0) [combinerlshift] ((_{!(((1LU<> #{1}2) << #{x>x2}3)->(_1 << #{x3-x2}0) ((_{!(((1LU<> #{1}2) << #{x==x2}3)->(_1) ((_{!(((1LU<> #{1}2) << #{x(_1 >> #{x2-x3}0) [combinerrshift] ((_1 >> #{1}2) >> #{1}3)->(_1 >> #{x2+x3}0) [nullshift] (_1 >> #0)->(_1) (_1 << #0)->(_1) ; INTERCAL logical values are 1 and 2. [xorto1or2] ((?32(_{!(c&4294901760LU)}1$#1)))->((_1)+#1) ((?32(_{!(c&4294901760LU)}1$#2)))->(#2-(_1)) ; Removing, combining and weakening unneeded C_ANDs [unneededand] (_1&#{!(c1&~x)}0)->(_1) (#{!(c1&~x)}0&_1)->(_1) [combineand] ((_1&#{1}2)&#{1}3)->(_1&#{x2&x3}0) ((#{1}2&_1)&#{1}3)->(_1&#{x2&x3}0) (#{1}3&(_1&#{1}2))->(_1&#{x2&x3}0) (#{1}3&(#{1}2&_1))->(_1&#{x2&x3}0) [weakenand] (_1&#{(~c1)&x}2)->(_1&#{c1&x2}0) (#{(~c1)&x}2&_1)->(_1&#{c1&x2}0) ; 32-bit complements ; Complement odd bits, zero even bits [com1z0] (((?32(_1|#1431655765))�)<<#1)->((_1�)^#2863311530) (((?32(#1431655765|_1))�)<<#1)->((_1�)^#2863311530) ((#1431655765&(?32(_1|#1431655765)))<<#1)->((_1�)^#2863311530) ((#1431655765&(?32(#1431655765|_1)))<<#1)->((_1�)^#2863311530) ; Complement even bits, zero odd bits [com0z1] ((?32(((_1�)<<#1)|#1431655765))�) ->((_1�)^#1431655765) ((?32(((#1431655765&_1)<<#1)|#1431655765))�) ->((_1�)^#1431655765) ((?32(#1431655765|((_1�)<<#1)))�) ->((_1�)^#1431655765) ((?32(#1431655765|((#1431655765&_1)<<#1)))�) ->((_1�)^#1431655765) (#1431655765&(?32(((_1�)<<#1)|#1431655765))) ->((_1�)^#1431655765) (#1431655765&(?32(((#1431655765&_1)<<#1)|#1431655765))) ->((_1�)^#1431655765) (#1431655765&(?32(#1431655765|((_1�)<<#1)))) ->((_1�)^#1431655765) (#1431655765&(?32(#1431655765|((#1431655765&_1)<<#1)))) ->((_1�)^#1431655765) ; 32-bit complements, in full [cnot5] (((:1&#{1}2)^#{x==x2}0)|((:1&#{(x^x2)==4294967295LU}3)^#{x==x3}0))->(~32 :1) ; Distributive laws ; Several of these laws go towards helping finish off 32-bit C binary logical ; operations, but are useful in other places as well (especially distributions ; involving shifts). [distribll] ((_1&_3)&(_2&_3))->((_1&_2)&_3) ((_1|_3)&(_2|_3))->((_1&_2)|_3) ((_1&_3)|(_2&_3))->((_1|_2)&_3) ((_1|_3)|(_2|_3))->((_1|_2)|_3) ((_1&_3)^(_2&_3))->((_1^_2)&_3) ((_1<<_3)&(_2<<_3))->((_1&_2)<<_3) ((_1<<_3)|(_2<<_3))->((_1|_2)<<_3) ((_1<<_3)^(_2<<_3))->((_1^_2)<<_3) ((_1>>_3)&(_2>>_3))->((_1&_2)>>_3) ((_1>>_3)|(_2>>_3))->((_1|_2)>>_3) ((_1>>_3)^(_2>>_3))->((_1^_2)>>_3) [distribrl] ((_3&_1)&(_2&_3))->((_1&_2)&_3) ((_3|_1)&(_2|_3))->((_1&_2)|_3) ((_3&_1)|(_2&_3))->((_1|_2)&_3) ((_3|_1)|(_2|_3))->((_1|_2)|_3) ((_3&_1)^(_2&_3))->((_1^_2)&_3) [distriblr] ((_1&_3)&(_3&_2))->((_1&_2)&_3) ((_1|_3)&(_3|_2))->((_1&_2)|_3) ((_1&_3)|(_3&_2))->((_1|_2)&_3) ((_1|_3)|(_3|_2))->((_1|_2)|_3) ((_1&_3)^(_3&_2))->((_1^_2)&_3) [distribrr] ((_3&_1)&(_3&_2))->((_1&_2)&_3) ((_3|_1)&(_3|_2))->((_1&_2)|_3) ((_3&_1)|(_3&_2))->((_1|_2)&_3) ((_3|_1)|(_3|_2))->((_1|_2)|_3) ((_3&_1)^(_3&_2))->((_1^_2)&_3) [distribunary] ((!_1)&(!_2))->(!(_1|_2)) ; 32-bit C binary logical operations ; Strangely enough, these can be done for the most part with the combined ; effect of many small optimizations (of course, that's the best way to do it). ; The only potential problem is that the distributive law isn't quite general ; enough for some cases involving constants, and for some cases where one side ; or the other is known to have no set evenbits or no set oddbits. ; Some generalised versions of the distributive law are needed here. ; Unfortunately, there are lots of binary operators here that need to be ; written both ways round. The 96 cases that follow, combined with weakenand, ; should be enough for all but the most pathological cases. [distribhalfxoroveror1] (((_1 ^ _2) & _3) | (_1 & _{(c&c3)==0}4))->((_1 & (_3 | _4)) ^ (_2 & _3)) ((_1 & _{(c&c3)==0}4) | ((_1 ^ _2) & _3))->((_1 & (_3 | _4)) ^ (_2 & _3)) (((_1 ^ _2) & _3) | (_{(c&c3)==0}4 & _1))->((_1 & (_3 | _4)) ^ (_2 & _3)) ((_{(c&c3)==0}4 & _1) | ((_1 ^ _2) & _3))->((_1 & (_3 | _4)) ^ (_2 & _3)) ((_3 & (_1 ^ _2)) | (_1 & _{(c&c3)==0}4))->((_1 & (_3 | _4)) ^ (_2 & _3)) ((_1 & _{(c&c3)==0}4) | (_3 & (_1 ^ _2)))->((_1 & (_3 | _4)) ^ (_2 & _3)) ((_3 & (_1 ^ _2)) | (_{(c&c3)==0}4 & _1))->((_1 & (_3 | _4)) ^ (_2 & _3)) ((_{(c&c3)==0}4 & _1) | (_3 & (_1 ^ _2)))->((_1 & (_3 | _4)) ^ (_2 & _3)) (((_2 ^ _1) & _3) | (_1 & _{(c&c3)==0}4))->((_1 & (_3 | _4)) ^ (_2 & _3)) ((_1 & _{(c&c3)==0}4) | ((_2 ^ _1) & _3))->((_1 & (_3 | _4)) ^ (_2 & _3)) (((_2 ^ _1) & _3) | (_{(c&c3)==0}4 & _1))->((_1 & (_3 | _4)) ^ (_2 & _3)) ((_{(c&c3)==0}4 & _1) | ((_2 ^ _1) & _3))->((_1 & (_3 | _4)) ^ (_2 & _3)) ((_3 & (_2 ^ _1)) | (_1 & _{(c&c3)==0}4))->((_1 & (_3 | _4)) ^ (_2 & _3)) ((_1 & _{(c&c3)==0}4) | (_3 & (_2 ^ _1)))->((_1 & (_3 | _4)) ^ (_2 & _3)) ((_3 & (_2 ^ _1)) | (_{(c&c3)==0}4 & _1))->((_1 & (_3 | _4)) ^ (_2 & _3)) ((_{(c&c3)==0}4 & _1) | (_3 & (_2 ^ _1)))->((_1 & (_3 | _4)) ^ (_2 & _3)) [distribhalfxoroveror2] (((_1 & _3) ^ _{(c&c3)==c}2) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4)) ((_1 & _{(c&c3)==0}4) | ((_1 & _3) ^ _{(c&c3)==c}2))->((_1 ^ _2) & (_3 | _4)) (((_1 & _3) ^ _{(c&c3)==c}2) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4)) ((_{(c&c3)==0}4 & _1) | ((_1 & _3) ^ _{(c&c3)==c}2))->((_1 ^ _2) & (_3 | _4)) ((_{(c&c3)==c}2 ^ (_1 & _3)) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4)) ((_1 & _{(c&c3)==0}4) | (_{(c&c3)==c}2 ^ (_1 & _3)))->((_1 ^ _2) & (_3 | _4)) ((_{(c&c3)==c}2 ^ (_1 & _3)) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4)) ((_{(c&c3)==0}4 & _1) | (_{(c&c3)==c}2 ^ (_1 & _3)))->((_1 ^ _2) & (_3 | _4)) (((_3 & _1) ^ _{(c&c3)==c}2) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4)) ((_1 & _{(c&c3)==0}4) | ((_3 & _1) ^ _{(c&c3)==c}2))->((_1 ^ _2) & (_3 | _4)) (((_3 & _1) ^ _{(c&c3)==c}2) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4)) ((_{(c&c3)==0}4 & _1) | ((_3 & _1) ^ _{(c&c3)==c}2))->((_1 ^ _2) & (_3 | _4)) ((_{(c&c3)==c}2 ^ (_3 & _1)) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4)) ((_1 & _{(c&c3)==0}4) | (_{(c&c3)==c}2 ^ (_3 & _1)))->((_1 ^ _2) & (_3 | _4)) ((_{(c&c3)==c}2 ^ (_3 & _1)) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4)) ((_{(c&c3)==0}4 & _1) | (_{(c&c3)==c}2 ^ (_3 & _1)))->((_1 ^ _2) & (_3 | _4)) ; We require bits in common between 1 and 2 to prevent an infinite loop; ; otherwise this swaps (1<=>3, 2<=>4) indefinitely. [distribhalforoveror1] (((_1 | _{c&c1}2) & _3) | (_1 & _{(c&c3)==0}4))->((_1 & (_3 | _4)) | (_2 & _3)) ((_1 & _{(c&c3)==0}4) | ((_1 | _{c&c1}2) & _3))->((_1 & (_3 | _4)) | (_2 & _3)) (((_1 | _{c&c1}2) & _3) | (_{(c&c3)==0}4 & _1))->((_1 & (_3 | _4)) | (_2 & _3)) ((_{(c&c3)==0}4 & _1) | ((_1 | _{c&c1}2) & _3))->((_1 & (_3 | _4)) | (_2 & _3)) ((_3 & (_1 | _{c&c1}2)) | (_1 & _{(c&c3)==0}4))->((_1 & (_3 | _4)) | (_2 & _3)) ((_1 & _{(c&c3)==0}4) | (_3 & (_1 | _{c&c1}2)))->((_1 & (_3 | _4)) | (_2 & _3)) ((_3 & (_1 | _{c&c1}2)) | (_{(c&c3)==0}4 & _1))->((_1 & (_3 | _4)) | (_2 & _3)) ((_{(c&c3)==0}4 & _1) | (_3 & (_1 | _{c&c1}2)))->((_1 & (_3 | _4)) | (_2 & _3)) (((_{c&c1}2 | _1) & _3) | (_1 & _{(c&c3)==0}4))->((_1 & (_3 | _4)) | (_2 & _3)) ((_1 & _{(c&c3)==0}4) | ((_{c&c1}2 | _1) & _3))->((_1 & (_3 | _4)) | (_2 & _3)) (((_{c&c1}2 | _1) & _3) | (_{(c&c3)==0}4 & _1))->((_1 & (_3 | _4)) | (_2 & _3)) ((_{(c&c3)==0}4 & _1) | ((_{c&c1}2 | _1) & _3))->((_1 & (_3 | _4)) | (_2 & _3)) ((_3 & (_{c&c1}2 | _1)) | (_1 & _{(c&c3)==0}4))->((_1 & (_3 | _4)) | (_2 & _3)) ((_1 & _{(c&c3)==0}4) | (_3 & (_{c&c1}2 | _1)))->((_1 & (_3 | _4)) | (_2 & _3)) ((_3 & (_{c&c1}2 | _1)) | (_{(c&c3)==0}4 & _1))->((_1 & (_3 | _4)) | (_2 & _3)) ((_{(c&c3)==0}4 & _1) | (_3 & (_{c&c1}2 | _1)))->((_1 & (_3 | _4)) | (_2 & _3)) [distribhalforoveror2] (((_1 & _3) | _2) | (_1 & _{(c&c3)==0}4))->((_1 & (_3 | _4)) | _2) ((_1 & _{(c&c3)==0}4) | ((_1 & _3) | _2))->((_1 & (_3 | _4)) | _2) (((_1 & _3) | _2) | (_{(c&c3)==0}4 & _1))->((_1 & (_3 | _4)) | _2) ((_{(c&c3)==0}4 & _1) | ((_1 & _3) | _2))->((_1 & (_3 | _4)) | _2) ((_2 | (_1 & _3)) | (_1 & _{(c&c3)==0}4))->((_1 & (_3 | _4)) | _2) ((_1 & _{(c&c3)==0}4) | (_2 | (_1 & _3)))->((_1 & (_3 | _4)) | _2) ((_2 | (_1 & _3)) | (_{(c&c3)==0}4 & _1))->((_1 & (_3 | _4)) | _2) ((_{(c&c3)==0}4 & _1) | (_2 | (_1 & _3)))->((_1 & (_3 | _4)) | _2) (((_3 & _1) | _2) | (_1 & _{(c&c3)==0}4))->((_1 & (_3 | _4)) | _2) ((_1 & _{(c&c3)==0}4) | ((_3 & _1) | _2))->((_1 & (_3 | _4)) | _2) (((_3 & _1) | _2) | (_{(c&c3)==0}4 & _1))->((_1 & (_3 | _4)) | _2) ((_{(c&c3)==0}4 & _1) | ((_3 & _1) | _2))->((_1 & (_3 | _4)) | _2) ((_2 | (_3 & _1)) | (_1 & _{(c&c3)==0}4))->((_1 & (_3 | _4)) | _2) ((_1 & _{(c&c3)==0}4) | (_2 | (_3 & _1)))->((_1 & (_3 | _4)) | _2) ((_2 | (_3 & _1)) | (_{(c&c3)==0}4 & _1))->((_1 & (_3 | _4)) | _2) ((_{(c&c3)==0}4 & _1) | (_2 | (_3 & _1)))->((_1 & (_3 | _4)) | _2) [distribhalfandoveror1] (((_1 & _2) & _3) | (_1 & _{(c&c3)==0}4))->(((_3 & _2) | _4) & _1) ((_1 & _{(c&c3)==0}4) | ((_1 & _2) & _3))->(((_3 & _2) | _4) & _1) (((_1 & _2) & _3) | (_{(c&c3)==0}4 & _1))->(((_3 & _2) | _4) & _1) ((_{(c&c3)==0}4 & _1) | ((_1 & _2) & _3))->(((_3 & _2) | _4) & _1) ((_3 & (_1 & _2)) | (_1 & _{(c&c3)==0}4))->(((_3 & _2) | _4) & _1) ((_1 & _{(c&c3)==0}4) | (_3 & (_1 & _2)))->(((_3 & _2) | _4) & _1) ((_3 & (_1 & _2)) | (_{(c&c3)==0}4 & _1))->(((_3 & _2) | _4) & _1) ((_{(c&c3)==0}4 & _1) | (_3 & (_1 & _2)))->(((_3 & _2) | _4) & _1) (((_2 & _1) & _3) | (_1 & _{(c&c3)==0}4))->(((_3 & _2) | _4) & _1) ((_1 & _{(c&c3)==0}4) | ((_2 & _1) & _3))->(((_3 & _2) | _4) & _1) (((_2 & _1) & _3) | (_{(c&c3)==0}4 & _1))->(((_3 & _2) | _4) & _1) ((_{(c&c3)==0}4 & _1) | ((_2 & _1) & _3))->(((_3 & _2) | _4) & _1) ((_3 & (_2 & _1)) | (_1 & _{(c&c3)==0}4))->(((_3 & _2) | _4) & _1) ((_1 & _{(c&c3)==0}4) | (_3 & (_2 & _1)))->(((_3 & _2) | _4) & _1) ((_3 & (_2 & _1)) | (_{(c&c3)==0}4 & _1))->(((_3 & _2) | _4) & _1) ((_{(c&c3)==0}4 & _1) | (_3 & (_2 & _1)))->(((_3 & _2) | _4) & _1) [distribhalfandoveror2] (((_1 & _3) & _2) | (_1 & _{(c&c3)==0}4))->(((_3 & _2) | _4) & _1) ((_1 & _{(c&c3)==0}4) | ((_1 & _3) & _2))->(((_3 & _2) | _4) & _1) (((_1 & _3) & _2) | (_{(c&c3)==0}4 & _1))->(((_3 & _2) | _4) & _1) ((_{(c&c3)==0}4 & _1) | ((_1 & _3) & _2))->(((_3 & _2) | _4) & _1) ((_2 & (_1 & _3)) | (_1 & _{(c&c3)==0}4))->(((_3 & _2) | _4) & _1) ((_1 & _{(c&c3)==0}4) | (_2 & (_1 & _3)))->(((_3 & _2) | _4) & _1) ((_2 & (_1 & _3)) | (_{(c&c3)==0}4 & _1))->(((_3 & _2) | _4) & _1) ((_{(c&c3)==0}4 & _1) | (_2 & (_1 & _3)))->(((_3 & _2) | _4) & _1) (((_3 & _1) & _2) | (_1 & _{(c&c3)==0}4))->(((_3 & _2) | _4) & _1) ((_1 & _{(c&c3)==0}4) | ((_3 & _1) & _2))->(((_3 & _2) | _4) & _1) (((_3 & _1) & _2) | (_{(c&c3)==0}4 & _1))->(((_3 & _2) | _4) & _1) ((_{(c&c3)==0}4 & _1) | ((_3 & _1) & _2))->(((_3 & _2) | _4) & _1) ((_2 & (_3 & _1)) | (_1 & _{(c&c3)==0}4))->(((_3 & _2) | _4) & _1) ((_1 & _{(c&c3)==0}4) | (_2 & (_3 & _1)))->(((_3 & _2) | _4) & _1) ((_2 & (_3 & _1)) | (_{(c&c3)==0}4 & _1))->(((_3 & _2) | _4) & _1) ((_{(c&c3)==0}4 & _1) | (_2 & (_3 & _1)))->(((_3 & _2) | _4) & _1) ; A right-shift idiom in syslib that was written in an unneccessarily complex ; way, by doing the bits separately the same way as left-shifts have to be done ; (of course, select can right-shift by any difference without much trouble); ; the next idiom is a helper for that. Previous code produced a warning when ; this idiom was used, but the optimizer has now been enhanced to the extent ; that it can deal with it without much special-casing, and therefore there's ; no way now to tell that that case is being used, so the warning has been ; removed. ; lshift32half done in the other direction; note that the large constant here ; is 0x55555554, not the all-5s number [rshift32half] ((_1~#1431655764)$#0)->((_1�)>>#1) ; and piecing together this with selectmingle4 gives the syslib idiom, which ; optimizes through distributions over C_OR and then constant folding ; When a 0 is on one side of a C binary logic operation, or the two sides are ; the same, simplification is often possible. [noopor] (_1|#0)->(_1) (#0|_1)->(_1) [noopxor] (_1^#0)->(_1) (#0^_1)->(_1) [anditself] (_1&_1)->(_1) [and0] (_1�)->(#0) (#0&_1)->(#0) [oritself] (_1|_1)->(_1) [xoritself] (_1^_1)->(#0) ; The following four idioms by JH ((_1^_2)^_1) -> (_2) ((_2^_1)^_1) -> (_2) (_1^(_1^_2)) -> (_2) (_1^(_2^_1)) -> (_2) ; Equality and inequality [xortoequal] (!(_1^_2))->(_1==_2) [negatingequal] (!(_1==_2))->(_1!=_2) (!(_1!=_2))->(_1==_2) ; Greater than and less than [greaterthan32] ((_1~:2)~((?32(:2~:2))^#2147483648))->(_1>(:2^_1)) ((_1~:2)~(#2147483648^(?32(:2~:2))))->(_1>(:2^_1)) [greaterthan16] ((_1~.2)~((?16(.2~.2))^#32768))->(_1>(.2^_1)) ((_1~.2)~(#32768^(?16(.2~.2))))->(_1>(.2^_1)) ; Consistency in C logical operation nesting, when it doesn't matter [xoroutsideand] ((_1^_2)&_2)->((_1&_2)^_2) (_2&(_1^_2))->((_1&_2)^_2) ((_2^_1)&_2)->((_1&_2)^_2) (_2&(_2^_1))->((_1&_2)^_2) ; Boolean algebra, on 0s and 1s or on 1s and 2s. Unary bitwidth is irrelevant. [booleannot] (_{c==1}1^#1)->(!_1) [not21] (#2-(!(_{c==1}1)))->(_1+#1) (#1+(!(_{c==1}1)))->(#2-_1) ((!(_{c==1}1))+#1)->(#2-_1) [nullmingle] (#0$_{c==1}1)->(_1) ; Thanks to Joris Huizer for suggesting the idea behind the next one; ; this is a more general idiom than the suggested [triplenot]. [redundantdoublenot] (!(!(_{c==1}1)))->(_1) intercal-0.30/src/PaxHeaders.27456/pick2.h0000644000000000000000000000007411437550756014773 xustar0030 atime=1427954558.379140774 30 ctime=1427992235.610945634 intercal-0.30/src/pick2.h0000644000175000017500000001065111437550756014671 0ustar00esresr00000000000000/* * pick2.h - Runtime library for INTERCAL, for use by PIC C compilers * * Some of the code here was originally in fiddle.c, some was originally * in cesspool.c. The rest is a translation into C of syslib.i. * LICENSE TERMS Copyright (C) 1996 Eric S. Raymond Copyright (C) 2006 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define ick_resume ick_popnext ICK_INT32 ick_mingle(ICK_INT16 r, ICK_INT16 s) { r = ((r & 0x0000ff00) << 8) | (r & 0x000000ff); r = ((r & 0x00f000f0) << 4) | (r & 0x000f000f); r = ((r & 0x0c0c0c0c) << 2) | (r & 0x03030303); r = ((r & 0x22222222) << 1) | (r & 0x11111111); s = ((s & 0x0000ff00) << 8) | (s & 0x000000ff); s = ((s & 0x00f000f0) << 4) | (s & 0x000f000f); s = ((s & 0x0c0c0c0c) << 2) | (s & 0x03030303); s = ((s & 0x22222222) << 1) | (s & 0x11111111); return (r << 1) | s; } ICK_INT32 ick_iselect(ICK_INT32 r, ICK_INT32 s) { ICK_INT32 i = 1, t = 0; while (s) { if (s & i) { t |= r & i; s ^= i; i <<= 1; } else { s >>= 1; r >>= 1; } } return t; } ICK_INT16 ick_and16(ICK_INT16 n) { ICK_INT16 m; m = (n >> 1); if (n & 1) m |= 0x8000; return(m & n); } ICK_INT16 ick_or16(ICK_INT16 n) { ICK_INT16 m; m = (n >> 1); if (n & 1) m |= 0x8000; return(m | n); } ICK_INT32 ick_and32(ICK_INT32 n) { ICK_INT32 m; m = (n >> 1); if (n & 1) m |= 0x80000000; return(m & n); } ICK_INT32 ick_or32(ICK_INT32 n) { ICK_INT32 m; m = (n >> 1); if (n & 1) m |= 0x80000000; return(m | n); } ICK_INT16 ick_xor16(ICK_INT16 n) { ICK_INT16 m; m = (n >> 1); if (n & 1) m |= 0x8000; return(m ^ n); } ICK_INT32 ick_xor32(ICK_INT32 n) { ICK_INT32 m; m = (n >> 1); if (n & 1) m |= 0x80000000; return(m ^ n); } ICK_INT8 ick_nextindex = 0; ICK_INT16 ick_next[16]; void ick_pushnext(ICK_INT16 n) { ick_next[ick_nextindex++] = n; } ICK_INT16 ick_popnext(ICK_INT8 n) { if (ick_nextindex < n) { ick_nextindex = 0; return (ICK_INT16)-1; } else ick_nextindex -= n; return(ick_next[ick_nextindex]); } /* It's hard to do randomization on a PIC. */ ICK_INT1 ick_roll(ICK_INT8 n) { return n>50; } /* Syslib, implemented in C to save ROM space. */ #if defined(ONESPOT1)&&defined(ONESPOT2)&&defined(TWOSPOT1) void syslibopt1050() { ONESPOT2=0; if(ONESPOT1) ONESPOT2=TWOSPOT1/ONESPOT1; } void syslibopt1520() { TWOSPOT1=((ICK_INT32)ONESPOT1<<16)|ONESPOT2; } #endif /* .1 .2 :1 */ #if defined(TWOSPOT1)&&defined(TWOSPOT2)&&defined(TWOSPOT3) void syslibopt1550() { TWOSPOT3=0; if(TWOSPOT2) TWOSPOT3=TWOSPOT1/TWOSPOT2; } void syslipopt1500() { TWOSPOT3=TWOSPOT2+TWOSPOT1; } void syslibopt1510() { TWOSPOT3=TWOSPOT1-TWOSPOT2; } void syslibopt1530() { TWOSPOT3=TWOSPOT1*TWOSPOT2; } void syslibopt1540() { TWOSPOT3=0; if(TWOSPOT2) TWOSPOT3=TWOSPOT1/TWOSPOT2; } #ifdef TWOSPOT4 void syslibopt1509() { TWOSPOT3=TWOSPOT2+TWOSPOT1; TWOSPOT4=1; if(TWOSPOT30xffffffff/TWOSPOT2) TWOSPOT4=2; TWOSPOT3=TWOSPOT1*TWOSPOT2; } #endif /* :4 */ #endif /* :1 :2 :3 */ #if defined(ONESPOT1)&&defined(ONESPOT2)&&defined(ONESPOT3) void syslipopt1000() { ONESPOT3=ONESPOT2+ONESPOT1; } void syslibopt1010() { ONESPOT3=ONESPOT1-ONESPOT2; } void syslibopt1030() { ONESPOT3=ONESPOT1*ONESPOT2; } void syslibopt1040() { ONESPOT3=0; if(ONESPOT2) ONESPOT3=ONESPOT1/ONESPOT2; } #ifdef ONESPOT4 void syslibopt1009() { ONESPOT3=ONESPOT2+ONESPOT1; ONESPOT4=1; if(ONESPOT30xffff/ONESPOT2) ONESPOT4=2; ONESPOT3=ONESPOT1*ONESPOT2; } #endif /* .4 */ #endif /* .1 .2 .3 */ #ifdef ONESPOT1 void syslibopt1020() { ONESPOT1++; } #endif intercal-0.30/PaxHeaders.27456/NEWS0000644000000000000000000000013212507267155013512 xustar0030 mtime=1427992173.759117613 30 atime=1427992173.771117579 30 ctime=1427992235.522945872 intercal-0.30/NEWS0000644000175000017500000000132212507267155013410 0ustar00esresr00000000000000 This is the short-form history of the project, used mainly for generating release announcements via shipper. For the long form, see the file HISTORY. * 0.30: 2015=04-02 Mostly minor build and test fixes. This release was actually forced by the impending doom of gitorious.org; the project hosting had to change and the metadata with it. * 0.29: 2010-11-28 The first merged release from ESR and Alex Smith, with encouragement from Donald Knuth. The compiler now has a regression-test suite. More error checks (E990 and E004) have been added. A new program, guess.i, writhes in the pit. The mystery and history of the "Atari implementation" has been clarified. Various minor bugs have been fixed. intercal-0.30/PaxHeaders.27456/BUGS0000644000000000000000000000007411437617027013501 xustar0030 atime=1427954558.343140896 30 ctime=1427992235.602945656 intercal-0.30/BUGS0000644000175000017500000000620311437617027013375 0ustar00esresr00000000000000= C-INTERCAL Bug and To-Do list = There are still some known bugs in INTERCAL (and no doubt many we don't even suspect as yet). The following list accumulates current bug reports and TO DO agenda items through the current release. ESR = Eric S. Raymond SS = Steve Swales LHH = Louis Howell BLR = Brian Raiter AIS = Alex Smith == Known Bugs == 1. (ESR) INTERCAL would be intrinsically a crock even if it worked right. 2. (BLR) I have hacked up a fix to the problem with line numbers being off due to statements sharing/spanning lines. The parser now stores the starting line number for all tuples, not just the splatted ones. Not only does this give synchronized lines in the comments in the degenerated C code, but run-time error messages are just as reliable as the parse/compile-time ones. The line number in the error message is actually the line number of the next statement (e.g., if the next statement is on the same line, the line number of both statements will be used). Note that I said "just as reliable," as opposed to "fully reliable". Since the lexer doesn't know where the line ends until after it's already parsed the preamble (DO-PLEASE combo, line label, oh-oh-seven number, etc) of the following line, it actually stores as the starting line number the first non-whitespace of the statement proper. So if a statement has its preamble on one line and the rest of it on the next, the preamble will be beheaded. Still, it's a vast improvement, and as LHH pointed out, it's not going to get much better without writing a preprocessing lexer that can actually separate out the statements before any real parsing begins. Until someone wants to do that, this will do nicely, I think. As a side bonus, splatting now shows the entire statement. (Er, except when the statement both spans and shares a line. If a multi- line statement ends on the same line as the beginning of the next statement, the last part will get truncated. Again, not a case we want to be encouraging people to explore anyway.) 3. (BLR) Interleave does not check the type of its arguments. The manual insinuates that interleaving 32-bit values should result in error 533; instead, C-INTERCAL silently truncates them to 16 bits. Unfortunately, the modified behavior of select's return type depends on this, so there's not much we can do about it as things stand. 4. (AIS) Reverse assignments (those with the expression on the left) are very unlikely to work in bases other than 2. (The current code calculates what the answer would be in base 2 and throws an error if it isn't correct for the current base.) 5. (AIS) Some of the newer features in intercal.el are not yet fully implemented and have a tendency to print 'Unimplemented' rather than doing anything useful. 6. (AIS) The external call system only works with gcc (due to its need to pass command-line arguments like -x and -E to it), and fails when mixed with come-from-gerund and next-from-gerund. == To Do == 1. (ESR) Add more optimization templates, esp. idioms for +, -, *, /. 2. (ESR) Forget this @!%$#! crock and take a long vacation. intercal-0.30/PaxHeaders.27456/prebuilt0000644000000000000000000000013212507267255014565 xustar0030 mtime=1427992237.746939686 30 atime=1427992237.754939663 30 ctime=1427992237.746939686 intercal-0.30/prebuilt/0000775000175000017500000000000012507267255014544 5ustar00esresr00000000000000intercal-0.30/prebuilt/PaxHeaders.27456/lexer.c0000644000000000000000000000007411437552054016125 xustar0030 atime=1417959270.093163363 30 ctime=1427992237.742939702 intercal-0.30/prebuilt/lexer.c0000644000175000017500000026206411437552054016032 0ustar00esresr00000000000000 #line 3 "lexer.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 168 #define YY_END_OF_BUFFER 169 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[646] = { 0, 164, 164, 169, 167, 164, 164, 49, 7, 11, 167, 37, 48, 167, 163, 5, 3, 35, 1, 1, 4, 6, 167, 43, 46, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 38, 165, 36, 45, 2, 167, 44, 34, 12, 13, 14, 39, 64, 65, 8, 40, 167, 167, 167, 0, 164, 0, 70, 0, 0, 1, 1, 47, 74, 0, 0, 0, 0, 73, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 17, 0, 0, 0, 0, 0, 70, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 63, 61, 0, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, 0, 31, 32, 33, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 42, 166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 9, 10, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 0, 0, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 158, 0, 135, 0, 0, 0, 85, 78, 142, 0, 149, 0, 0, 0, 0, 94, 0, 0, 89, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 53, 0, 0, 0, 0, 0, 0, 150, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 0, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 153, 0, 0, 154, 0, 0, 0, 0, 0, 147, 58, 0, 0, 0, 0, 138, 122, 0, 0, 0, 0, 0, 67, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 114, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 132, 0, 0, 0, 118, 0, 0, 0, 0, 0, 0, 0, 160, 161, 0, 0, 0, 0, 87, 0, 0, 0, 96, 91, 111, 109, 0, 0, 0, 126, 0, 0, 0, 55, 0, 0, 0, 81, 152, 0, 0, 98, 84, 90, 0, 0, 0, 88, 144, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 0, 140, 0, 0, 0, 0, 0, 156, 0, 0, 125, 141, 0, 0, 0, 151, 0, 97, 0, 0, 0, 0, 0, 0, 0, 0, 105, 0, 106, 0, 0, 0, 0, 0, 0, 0, 116, 104, 0, 133, 131, 79, 0, 0, 0, 0, 134, 119, 0, 157, 0, 0, 127, 0, 0, 0, 0, 80, 155, 0, 0, 0, 0, 0, 0, 0, 0, 112, 0, 0, 0, 0, 92, 115, 113, 0, 103, 0, 0, 75, 76, 0, 130, 162, 143, 0, 0, 0, 93, 59, 0, 0, 0, 124, 128, 0, 137, 0, 0, 108, 100, 148, 0, 0, 0, 123, 0, 0, 0, 0, 0, 56, 83, 0, 0, 129, 95, 60, 99, 0, 107, 0, 72, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 5, 6, 7, 8, 9, 10, 11, 1, 12, 13, 14, 15, 16, 17, 17, 18, 18, 18, 18, 17, 17, 17, 17, 19, 20, 21, 1, 1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 33, 1, 49, 1, 50, 51, 1, 1, 1, 52, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 53, 1, 54, 1, 55, 1, 56, 1, 1, 1, 1, 1, 57, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 1, 1, 1, 1, 1, 71, 72, 1, 1, 1, 1, 73, 1, 1, 1, 1, 74, 75, 76, 1, 1, 77, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 78, 1, 79, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[80] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int16_t yy_base[647] = { 0, 0, 0, 967, 916, 78, 80, 915, 914, 913, 82, 912, 911, 84, 910, 909, 908, 907, 86, 88, 906, 905, 79, 904, 903, 83, 44, 71, 87, 67, 102, 103, 902, 112, 118, 123, 122, 70, 113, 72, 111, 131, 128, 901, 135, 900, 899, 898, 897, 896, 895, 894, 893, 892, 891, 890, 889, 888, 887, 127, 121, 108, 905, 94, 180, 188, 190, 193, 197, 199, 968, 968, 893, 889, 909, 900, 968, 896, 87, 902, 138, 887, 968, 884, 901, 885, 887, 879, 210, 899, 885, 877, 892, 889, 880, 869, 880, 880, 871, 866, 166, 886, 874, 195, 872, 871, 194, 867, 883, 881, 857, 873, 871, 870, 870, 968, 968, 968, 153, 824, 185, 844, 0, 254, 256, 968, 855, 869, 864, 867, 868, 232, 202, 869, 855, 852, 848, 861, 968, 858, 851, 858, 259, 854, 860, 846, 840, 843, 852, 838, 850, 838, 851, 843, 831, 968, 830, 968, 968, 844, 834, 844, 845, 821, 830, 839, 827, 201, 827, 835, 818, 820, 828, 817, 968, 263, 844, 822, 813, 216, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 246, 818, 817, 816, 808, 273, 814, 822, 821, 816, 806, 803, 818, 816, 811, 240, 814, 968, 236, 813, 814, 809, 796, 796, 245, 792, 248, 803, 806, 796, 800, 288, 968, 799, 802, 787, 796, 800, 290, 791, 788, 783, 781, 786, 785, 788, 794, 787, 294, 787, 779, 968, 266, 271, 968, 968, 783, 777, 272, 968, 785, 777, 303, 770, 780, 271, 782, 782, 307, 283, 779, 765, 769, 777, 775, 759, 310, 762, 776, 765, 321, 760, 293, 770, 768, 759, 767, 765, 755, 324, 759, 751, 327, 748, 751, 750, 743, 757, 748, 759, 331, 745, 737, 752, 752, 750, 734, 751, 303, 747, 746, 741, 748, 741, 968, 733, 334, 732, 731, 739, 729, 724, 301, 740, 725, 338, 734, 718, 732, 731, 341, 715, 345, 312, 316, 733, 712, 711, 968, 711, 968, 726, 968, 356, 721, 727, 709, 968, 712, 704, 968, 968, 703, 358, 716, 362, 707, 709, 701, 707, 703, 710, 709, 368, 372, 714, 701, 706, 692, 693, 689, 968, 708, 703, 968, 693, 684, 331, 691, 695, 374, 696, 376, 688, 694, 691, 346, 695, 693, 693, 691, 345, 682, 382, 676, 675, 320, 674, 390, 686, 392, 388, 683, 675, 684, 682, 668, 673, 671, 674, 968, 677, 678, 968, 673, 666, 665, 401, 653, 968, 968, 671, 656, 665, 660, 407, 968, 410, 671, 413, 656, 656, 968, 415, 968, 664, 655, 273, 649, 659, 391, 661, 659, 656, 648, 418, 654, 968, 968, 422, 646, 655, 653, 636, 428, 635, 968, 651, 645, 431, 638, 637, 637, 968, 645, 435, 441, 645, 630, 444, 446, 968, 968, 626, 448, 641, 644, 968, 630, 642, 631, 968, 968, 968, 968, 640, 635, 636, 463, 465, 620, 634, 968, 632, 467, 614, 620, 968, 628, 428, 623, 968, 968, 617, 609, 472, 968, 968, 628, 474, 614, 620, 605, 968, 612, 476, 619, 610, 601, 607, 478, 480, 607, 968, 612, 968, 482, 484, 597, 596, 505, 968, 603, 487, 507, 968, 385, 608, 610, 968, 594, 598, 610, 510, 512, 594, 603, 586, 586, 600, 968, 589, 968, 586, 585, 591, 580, 489, 557, 558, 968, 968, 548, 968, 516, 968, 542, 535, 522, 525, 968, 968, 530, 968, 528, 525, 968, 535, 532, 519, 516, 968, 968, 503, 469, 450, 549, 551, 435, 394, 396, 968, 384, 387, 377, 366, 968, 968, 968, 282, 968, 553, 555, 968, 968, 568, 968, 968, 968, 557, 578, 257, 968, 574, 244, 235, 580, 968, 968, 235, 968, 205, 183, 968, 968, 968, 585, 597, 602, 968, 148, 590, 141, 123, 88, 968, 968, 91, 607, 968, 968, 968, 968, 604, 968, 609, 968, 968, 97 } ; static yyconst flex_int16_t yy_def[647] = { 0, 645, 1, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 646, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 646, 645, 645, 646, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 0, 645 } ; static yyconst flex_int16_t yy_nxt[1048] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 4, 14, 15, 4, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 32, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 32, 43, 44, 32, 32, 45, 46, 47, 48, 49, 50, 4, 4, 4, 4, 4, 51, 52, 53, 54, 4, 4, 4, 4, 55, 4, 56, 4, 4, 4, 57, 58, 4, 59, 60, 61, 63, 63, 63, 63, 64, 64, 66, 66, 68, 68, 69, 69, 76, 71, 62, 77, 63, 63, 197, 65, 65, 67, 67, 68, 68, 68, 68, 101, 72, 78, 73, 70, 79, 74, 83, 80, 105, 62, 75, 81, 62, 62, 62, 131, 132, 82, 84, 642, 62, 62, 641, 98, 62, 62, 62, 87, 62, 62, 62, 106, 85, 88, 90, 86, 89, 102, 93, 95, 103, 91, 99, 96, 62, 62, 104, 92, 94, 107, 62, 640, 100, 62, 62, 62, 120, 121, 112, 97, 62, 110, 134, 62, 62, 62, 108, 109, 113, 62, 62, 639, 135, 62, 64, 64, 638, 62, 118, 115, 116, 117, 123, 123, 66, 66, 119, 124, 124, 65, 65, 68, 68, 69, 69, 157, 125, 123, 123, 67, 67, 158, 124, 124, 142, 142, 68, 68, 68, 68, 165, 161, 166, 167, 70, 162, 180, 181, 168, 635, 206, 238, 169, 207, 252, 239, 143, 144, 170, 171, 274, 274, 208, 634, 145, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 123, 123, 124, 124, 203, 142, 142, 633, 204, 246, 246, 125, 205, 253, 254, 123, 123, 124, 124, 260, 260, 271, 255, 632, 275, 272, 281, 143, 144, 284, 282, 247, 631, 285, 290, 290, 298, 298, 312, 248, 246, 246, 313, 314, 318, 628, 261, 315, 319, 260, 260, 324, 325, 328, 328, 330, 274, 274, 496, 331, 497, 291, 247, 623, 292, 345, 299, 341, 341, 346, 353, 353, 300, 290, 290, 372, 261, 298, 298, 373, 380, 380, 387, 329, 391, 391, 388, 328, 328, 342, 343, 398, 398, 400, 401, 354, 460, 402, 275, 399, 291, 403, 341, 341, 415, 415, 461, 355, 353, 353, 381, 392, 439, 300, 425, 425, 440, 329, 427, 427, 443, 443, 380, 380, 342, 343, 455, 449, 391, 391, 416, 450, 456, 354, 467, 467, 463, 463, 398, 398, 622, 426, 444, 428, 464, 355, 399, 415, 415, 468, 468, 621, 381, 487, 487, 392, 425, 425, 620, 427, 427, 492, 492, 500, 443, 443, 577, 501, 507, 507, 578, 465, 619, 416, 513, 513, 618, 518, 518, 617, 488, 463, 463, 426, 428, 519, 444, 524, 524, 464, 467, 467, 528, 528, 531, 531, 549, 493, 508, 514, 550, 529, 525, 525, 551, 468, 468, 528, 528, 541, 541, 487, 487, 492, 492, 616, 532, 542, 555, 555, 507, 507, 513, 513, 518, 518, 566, 566, 524, 524, 570, 570, 519, 531, 531, 555, 555, 613, 488, 571, 612, 567, 567, 525, 525, 570, 570, 514, 556, 493, 508, 528, 528, 575, 575, 532, 541, 541, 584, 584, 529, 576, 599, 599, 542, 556, 528, 528, 566, 566, 600, 603, 603, 585, 585, 611, 570, 570, 607, 607, 604, 575, 575, 567, 567, 571, 603, 603, 610, 576, 609, 570, 570, 608, 608, 584, 584, 614, 614, 599, 599, 624, 624, 607, 607, 606, 615, 600, 605, 602, 585, 585, 614, 614, 603, 603, 625, 625, 608, 608, 629, 629, 601, 604, 626, 626, 614, 614, 598, 603, 603, 624, 624, 627, 597, 615, 629, 629, 596, 626, 626, 614, 614, 636, 636, 630, 625, 625, 626, 626, 643, 643, 637, 636, 636, 643, 643, 627, 636, 636, 595, 630, 637, 626, 626, 594, 593, 592, 636, 636, 591, 590, 644, 589, 588, 587, 586, 644, 583, 582, 581, 580, 579, 574, 573, 572, 569, 568, 565, 564, 563, 562, 561, 560, 559, 558, 557, 554, 553, 552, 548, 547, 546, 545, 544, 543, 540, 539, 538, 537, 536, 535, 534, 533, 530, 527, 526, 523, 522, 521, 520, 517, 516, 515, 512, 511, 510, 509, 506, 505, 504, 503, 502, 499, 498, 495, 494, 491, 490, 489, 486, 485, 484, 483, 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, 472, 471, 470, 469, 466, 462, 459, 458, 457, 454, 453, 452, 451, 448, 447, 446, 445, 442, 441, 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, 424, 423, 422, 421, 420, 419, 418, 417, 414, 413, 412, 411, 410, 409, 408, 407, 406, 405, 404, 397, 396, 395, 394, 393, 390, 389, 386, 385, 384, 383, 382, 379, 378, 377, 376, 375, 374, 371, 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, 360, 359, 358, 357, 356, 352, 351, 350, 349, 348, 347, 344, 340, 339, 338, 337, 336, 335, 334, 333, 332, 327, 326, 323, 322, 321, 320, 317, 316, 311, 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, 297, 296, 295, 294, 293, 289, 288, 287, 286, 283, 280, 279, 278, 277, 276, 273, 270, 269, 268, 267, 266, 265, 264, 263, 262, 259, 258, 257, 256, 251, 250, 249, 245, 244, 243, 242, 241, 240, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 202, 201, 200, 199, 198, 196, 182, 179, 178, 177, 176, 175, 174, 173, 172, 164, 163, 160, 159, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 141, 140, 139, 138, 137, 136, 133, 130, 129, 128, 127, 126, 122, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 114, 62, 62, 62, 111, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 645, 3, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645 } ; static yyconst flex_int16_t yy_chk[1048] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 6, 6, 10, 10, 13, 13, 18, 18, 19, 19, 26, 22, 26, 27, 63, 63, 646, 10, 10, 13, 13, 18, 18, 19, 19, 37, 25, 27, 25, 19, 27, 25, 29, 28, 39, 29, 25, 28, 37, 27, 39, 78, 78, 28, 30, 635, 5, 22, 632, 36, 10, 25, 13, 31, 18, 28, 19, 40, 30, 31, 33, 30, 31, 38, 34, 35, 38, 33, 36, 35, 30, 31, 38, 33, 34, 41, 61, 631, 36, 40, 33, 38, 61, 61, 44, 35, 34, 42, 80, 60, 36, 35, 41, 41, 44, 59, 42, 630, 80, 41, 64, 64, 628, 44, 60, 59, 59, 59, 65, 65, 66, 66, 60, 67, 67, 64, 64, 68, 68, 69, 69, 100, 67, 65, 65, 66, 66, 100, 67, 67, 88, 88, 68, 68, 69, 69, 106, 103, 106, 106, 69, 103, 118, 118, 106, 620, 132, 167, 106, 132, 179, 167, 88, 88, 106, 106, 216, 216, 132, 619, 88, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 123, 123, 124, 124, 131, 142, 142, 617, 131, 175, 175, 124, 131, 179, 198, 123, 123, 124, 124, 203, 203, 213, 198, 613, 216, 213, 222, 142, 142, 224, 222, 175, 612, 224, 229, 229, 236, 236, 250, 175, 246, 246, 250, 251, 256, 609, 203, 251, 256, 260, 260, 263, 263, 266, 266, 267, 274, 274, 435, 267, 435, 229, 246, 597, 229, 280, 236, 278, 278, 280, 287, 287, 236, 290, 290, 306, 260, 298, 298, 306, 314, 314, 320, 266, 323, 323, 320, 328, 328, 278, 278, 330, 330, 331, 331, 287, 394, 332, 274, 330, 290, 332, 341, 341, 351, 351, 394, 287, 353, 353, 314, 323, 375, 298, 361, 361, 375, 328, 362, 362, 378, 378, 380, 380, 341, 341, 389, 384, 391, 391, 351, 384, 389, 353, 399, 399, 396, 396, 398, 398, 593, 361, 378, 362, 396, 353, 398, 415, 415, 399, 399, 592, 380, 423, 423, 391, 425, 425, 591, 427, 427, 431, 431, 438, 443, 443, 534, 438, 447, 447, 534, 396, 590, 415, 452, 452, 588, 457, 457, 587, 423, 463, 463, 425, 427, 457, 443, 464, 464, 463, 467, 467, 468, 468, 472, 472, 497, 431, 447, 452, 497, 468, 464, 464, 497, 467, 467, 468, 468, 486, 486, 487, 487, 492, 492, 586, 472, 486, 503, 503, 507, 507, 513, 513, 518, 518, 519, 519, 524, 524, 525, 525, 518, 531, 531, 555, 555, 583, 487, 525, 582, 519, 519, 524, 524, 525, 525, 513, 503, 492, 507, 528, 528, 532, 532, 531, 541, 541, 542, 542, 528, 532, 562, 562, 541, 555, 528, 528, 566, 566, 562, 567, 567, 542, 542, 581, 570, 570, 576, 576, 567, 575, 575, 566, 566, 570, 567, 567, 578, 575, 577, 570, 570, 576, 576, 584, 584, 585, 585, 599, 599, 600, 600, 607, 607, 573, 585, 599, 572, 565, 584, 584, 585, 585, 603, 603, 600, 600, 607, 607, 611, 611, 564, 603, 608, 608, 614, 614, 560, 603, 603, 624, 624, 608, 557, 614, 629, 629, 556, 608, 608, 614, 614, 625, 625, 611, 624, 624, 626, 626, 641, 641, 625, 636, 636, 643, 643, 626, 625, 625, 554, 629, 636, 626, 626, 553, 552, 551, 636, 636, 549, 547, 641, 546, 545, 544, 543, 643, 540, 539, 538, 536, 535, 530, 527, 526, 522, 520, 517, 516, 515, 514, 512, 510, 509, 508, 506, 502, 501, 498, 496, 494, 493, 491, 489, 488, 485, 484, 483, 478, 477, 476, 474, 473, 471, 466, 465, 462, 460, 459, 458, 456, 455, 453, 451, 450, 449, 448, 444, 442, 441, 440, 439, 437, 436, 434, 433, 429, 428, 426, 422, 421, 420, 419, 416, 414, 413, 412, 410, 409, 407, 406, 405, 404, 403, 402, 401, 400, 397, 395, 393, 392, 390, 388, 387, 386, 385, 383, 382, 381, 379, 377, 376, 374, 373, 371, 370, 368, 367, 366, 365, 364, 363, 360, 359, 358, 357, 356, 355, 354, 352, 350, 347, 346, 344, 343, 342, 339, 337, 335, 334, 333, 329, 327, 326, 325, 324, 322, 321, 319, 318, 317, 316, 315, 313, 311, 310, 309, 308, 307, 305, 304, 303, 302, 301, 300, 299, 297, 296, 295, 294, 293, 292, 291, 289, 288, 286, 285, 284, 283, 282, 281, 279, 277, 276, 275, 273, 272, 271, 270, 269, 268, 265, 264, 262, 261, 259, 258, 255, 254, 248, 247, 245, 244, 243, 242, 241, 240, 239, 238, 237, 235, 234, 233, 232, 231, 228, 227, 226, 225, 223, 221, 220, 219, 218, 217, 214, 212, 211, 210, 209, 208, 207, 206, 205, 204, 202, 201, 200, 199, 178, 177, 176, 173, 172, 171, 170, 169, 168, 166, 165, 164, 163, 162, 161, 160, 159, 156, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 141, 140, 139, 137, 136, 135, 134, 133, 130, 129, 128, 127, 126, 121, 119, 114, 113, 112, 111, 110, 109, 108, 107, 105, 104, 102, 101, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 87, 86, 85, 84, 83, 81, 79, 77, 75, 74, 73, 72, 62, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 43, 32, 24, 23, 21, 20, 17, 16, 15, 14, 12, 11, 9, 8, 7, 4, 3, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lexer.l" #line 5 "lexer.l" /* the directives above are for Solaris lex, and will be ignored by * flex */ /* * NAME * lexer.l -- source for the C-INTERCAL lexical analyzer. * LICENSE TERMS Copyright (C) 1996 Eric S. Raymond This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #include #include #include #include "ick.h" #include "parser.h" #include "ick_lose.h" /*#undef wchar_t*/ /*#define wchar_t unsigned char*/ #ifndef yywrap static int yywrap(void) { return 1; } #endif /* yywrap */ int iyylineno = 1; #ifdef MAIN YYSTYPE yylval; #endif /* MAIN */ char **textlines = NULL; int textlinecount = 0; int politesse = 0; int stbeginline = 0; /* AIS: Sort out a grammar near-ambiguity */ unsigned long sparkearsstack[SENESTMAX] = {0}; int sparkearslev = 0; /* AIS: Some symbols are ambiguous between C-INTERCAL and CLC-INTERCAL: Symbol C-INTERCAL CLC-INTERCAL NOSPOT _ @ WHIRL @ ? XOR ? yen, or bookworm (bookworm's also C-INTERCAL legal) By default, the C-INTERCAL meanings are used; the extern variable clclex causes CLC-INTERCAL interpretations to be put on the ambiguous symbols. Otherwise, mixing syntaxes freely is allowed. */ extern int clclex; #ifdef FLEX_SCANNER static char linebuf[YY_BUF_SIZE]; #else /* FLEX_SCANNER */ static char linebuf[YYLMAX]; #endif /* FLEX_SCANNER */ static char *lineptr = linebuf; bool re_send_token = false; int lexer(void); static int myatoi(const char *text); void yyerror(const char *errtype); #define SETLINENO \ {if (stbeginline == 0) stbeginline = iyylineno;\ else if (stbeginline < 0) stbeginline = 0;} /* AIS: Keep track of the spark/ears situation */ #define STACKSPARKEARS(a) \ if (sparkearslev+1>=SENESTMAX*32) ick_lose(IE281, iyylineno, (char*) NULL); \ sparkearslev++; sparkearsstack[sparkearslev/32]<<=1; \ sparkearsstack[sparkearslev/32]+=a #define CLEARSPARKEARSTACK {int i=SENESTMAX; \ while(i--) sparkearsstack[i] = 0;} \ sparkearslev = 0 /* * The spectacular ugliness of INTERCAL syntax requires that the lexical * analyzer have two levels. One, embedded in the getc() function, handles * logical-line continuation and the ! abbrev, and stashes each logical * line away in a buffer accessible to the code generator (this is necessary * for the * construct to be interpreted correctly). The upper level is * generated by lex(1) and does normal tokenizing. */ #undef getc int getc(FILE *fp) { extern FILE* yyin; static bool bangflag = false; static bool backflag = false; static bool eolflag = false; if ((size_t)(lineptr - linebuf) > sizeof linebuf) ick_lose(IE666, iyylineno, (char *)NULL); if (bangflag) { bangflag = false; /* *lineptr++ = '!'; */ return('.'); } else if (backflag) /* converting ctrl-H (backspace) to two chars "^H" */ { backflag = false; /* *lineptr++ = '\b'; */ return('H'); } else { int c; char c_char; size_t dummy; /*fprintf(stderr,"about to fgetc(\045p)",(void*)fp);*/ c_char=0; /* AIS */ dummy = fread(&c_char,1,1,fp); /* AIS: ignore the first \r in a row to deal with DOS newlines. The second in a row is definitely an error, though, and will be caught later on. */ if(c_char=='\r') dummy = fread(&c_char,1,1,fp); c = c_char; if(feof(fp)) c=EOF; if(!eolflag && c == EOF) c = '\n'; /*fprintf(stderr,"getc input a character: %c\n",c);*/ if (feof(yyin)) { *lineptr = '\0'; if(eolflag) return(EOF); if(c=='\0' || c==EOF) c='\n'; } eolflag = false; if (c == '!') { *lineptr++ = '!'; bangflag = true; return(c = '\''); } else if (c == '\b') /* convert ctrl-H (backspace) to two chars "^" and "H" so lex can take it */ { *lineptr++ = '\b'; backflag = true; return(c = '^'); } else if (c == '\n') { *lineptr = '\0'; lineptr = linebuf; if (iyylineno >= textlinecount) { textlinecount += ALLOC_CHUNK; if (textlines) textlines = realloc(textlines, textlinecount * sizeof(char*)); else textlines = malloc(textlinecount * sizeof(char*)); if (!textlines) ick_lose(IE666, iyylineno, (char *)NULL); } textlines[iyylineno] = malloc(1 + strlen(linebuf)); if (!textlines[iyylineno]) ick_lose(IE666, iyylineno, (char *)NULL); strcpy(textlines[iyylineno], linebuf); iyylineno++; eolflag=true; return('\n'); } else { return(*lineptr++ = c); } } } /* replace YY_INPUT so that it uses our getc function. */ #undef YY_INPUT #define YY_INPUT(buf,result,max_size) \ { \ int c = getc(yyin); \ if (c == EOF) { \ if (ferror(yyin)) \ YY_FATAL_ERROR("input in flex scanner failed"); \ result = YY_NULL; \ } else { \ buf[0] = c; \ result = 1; \ } \ } #line 1120 "lexer.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy (void ); int yyget_debug (void ); void yyset_debug (int debug_flag ); YY_EXTRA_TYPE yyget_extra (void ); void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); void yyset_in (FILE * in_str ); FILE *yyget_out (void ); void yyset_out (FILE * out_str ); int yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 227 "lexer.l" #line 1310 "lexer.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 646 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 968 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: /* rule 1 can match eol */ YY_RULE_SETUP #line 229 "lexer.l" {yylval.numval = myatoi(yytext); return(NUMBER);} YY_BREAK case 2: YY_RULE_SETUP #line 230 "lexer.l" {return(NOSPOT);} YY_BREAK case 3: YY_RULE_SETUP #line 231 "lexer.l" {return(ick_ONESPOT);} YY_BREAK case 4: YY_RULE_SETUP #line 232 "lexer.l" {return(ick_TWOSPOT);} YY_BREAK case 5: YY_RULE_SETUP #line 233 "lexer.l" {return(ick_TAIL);} YY_BREAK case 6: YY_RULE_SETUP #line 234 "lexer.l" {return(ick_HYBRID);} YY_BREAK case 7: YY_RULE_SETUP #line 235 "lexer.l" {return(MESH);} YY_BREAK case 8: #line 238 "lexer.l" case 9: #line 239 "lexer.l" case 10: YY_RULE_SETUP #line 239 "lexer.l" {return(MINGLE); /* AIS: CLC-INTERCAL ick_mingle symbols. The \xBD is ISO-8859-1 for cent. */} YY_BREAK case 11: #line 242 "lexer.l" case 12: #line 243 "lexer.l" case 13: #line 244 "lexer.l" case 14: #line 245 "lexer.l" case 15: #line 246 "lexer.l" case 16: #line 247 "lexer.l" case 17: #line 248 "lexer.l" case 18: #line 249 "lexer.l" case 19: #line 250 "lexer.l" case 20: #line 251 "lexer.l" case 21: #line 252 "lexer.l" case 22: #line 253 "lexer.l" case 23: #line 254 "lexer.l" case 24: #line 255 "lexer.l" case 25: #line 256 "lexer.l" case 26: #line 257 "lexer.l" case 27: #line 258 "lexer.l" case 28: #line 259 "lexer.l" case 29: #line 260 "lexer.l" case 30: #line 261 "lexer.l" case 31: #line 262 "lexer.l" case 32: #line 263 "lexer.l" case 33: YY_RULE_SETUP #line 263 "lexer.l" {return(MINGLE);} YY_BREAK case 34: YY_RULE_SETUP #line 265 "lexer.l" {return(SELECT);} YY_BREAK case 35: YY_RULE_SETUP #line 267 "lexer.l" {return(SLAT); /* AIS: Operand overloading */} YY_BREAK case 36: YY_RULE_SETUP #line 268 "lexer.l" {return(BACKSLAT); /* ditto */} YY_BREAK case 37: YY_RULE_SETUP #line 270 "lexer.l" {yylval.numval = AND; return(UNARY);} YY_BREAK case 38: YY_RULE_SETUP #line 271 "lexer.l" {yylval.numval = OR; return(UNARY);} YY_BREAK case 39: #line 273 "lexer.l" case 40: #line 274 "lexer.l" case 41: #line 275 "lexer.l" case 42: YY_RULE_SETUP #line 275 "lexer.l" {yylval.numval = XOR; return(UNARY); /* AIS: CLC-INTERCAL uses \xBE, ISO-8859-1 for yen; for some reason, \xA5 is what was detected by the compiler during my tests, so that's here too */} YY_BREAK case 43: YY_RULE_SETUP #line 279 "lexer.l" {if(clclex) yylval.numval = WHIRL; else yylval.numval = XOR; return(UNARY); /* AIS: ? is a unary operator in both C-INTERCAL and CLC-INTERCAL, but with different meanings. */} YY_BREAK case 44: #line 284 "lexer.l" case 45: YY_RULE_SETUP #line 284 "lexer.l" {yylval.numval = FIN; return(UNARY); /* AIS: | is CLC */} YY_BREAK case 46: YY_RULE_SETUP #line 285 "lexer.l" {if(clclex) return(NOSPOT); /* AIS: a C/CLC ambiguity */ else {yylval.numval = WHIRL; return(UNARY);}} YY_BREAK case 47: /* rule 47 can match eol */ YY_RULE_SETUP #line 287 "lexer.l" {yylval.numval = WHIRL + myatoi(yytext) - 1; return(UNARY);} YY_BREAK case 48: YY_RULE_SETUP #line 289 "lexer.l" {char temp = sparkearsstack[sparkearslev/32]&1; STACKSPARKEARS(0); /* AIS: I added all mentions of STACKSPARKEARS, OPEN\(SPARK\|EARS\), CLOSE\(SPARK\|EARS\), and CLEARSPARKEARSTACK */ return(temp?OPENSPARK:CLOSESPARK);} YY_BREAK case 49: YY_RULE_SETUP #line 295 "lexer.l" {char temp = sparkearsstack[sparkearslev/32]&1; STACKSPARKEARS(1); return(temp?CLOSEEARS:OPENEARS);} YY_BREAK case 50: /* rule 50 can match eol */ YY_RULE_SETUP #line 299 "lexer.l" {SETLINENO; yylval.numval = myatoi(yytext); return(LABEL);} YY_BREAK case 51: YY_RULE_SETUP #line 301 "lexer.l" {SETLINENO; CLEARSPARKEARSTACK; return(DO);} YY_BREAK case 52: YY_RULE_SETUP #line 302 "lexer.l" {SETLINENO; CLEARSPARKEARSTACK; return(DO);} YY_BREAK case 53: YY_RULE_SETUP #line 303 "lexer.l" {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(DO);} YY_BREAK case 54: YY_RULE_SETUP #line 304 "lexer.l" {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(DO);} YY_BREAK case 55: /* rule 55 can match eol */ YY_RULE_SETUP #line 305 "lexer.l" {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(DO);} YY_BREAK case 56: /* rule 56 can match eol */ YY_RULE_SETUP #line 306 "lexer.l" {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(DO);} YY_BREAK case 57: YY_RULE_SETUP #line 307 "lexer.l" {SETLINENO; CLEARSPARKEARSTACK; return(MAYBE);} YY_BREAK case 58: /* rule 58 can match eol */ YY_RULE_SETUP #line 308 "lexer.l" {SETLINENO; CLEARSPARKEARSTACK; return(MAYBE);} YY_BREAK case 59: /* rule 59 can match eol */ YY_RULE_SETUP #line 309 "lexer.l" {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(MAYBE);} YY_BREAK case 60: /* rule 60 can match eol */ YY_RULE_SETUP #line 310 "lexer.l" {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(MAYBE); /* AIS: I added all the MAYBE cases. It seems that MAYBE has no simple Latin synonym. */} YY_BREAK case 61: YY_RULE_SETUP #line 314 "lexer.l" {return(NOT);} YY_BREAK case 62: YY_RULE_SETUP #line 315 "lexer.l" {return(NOT);} YY_BREAK case 63: YY_RULE_SETUP #line 316 "lexer.l" {return(NOT);} YY_BREAK case 64: YY_RULE_SETUP #line 317 "lexer.l" {return(NOT); /* AIS: CLC-INTERCAL again, this time it's ISO-8859-1 for the logical NOT symbol... */} YY_BREAK case 65: YY_RULE_SETUP #line 319 "lexer.l" {return(NOT); /* ... but my computer translates it to \xAC */} YY_BREAK case 66: YY_RULE_SETUP #line 321 "lexer.l" {return(ONCE);} YY_BREAK case 67: YY_RULE_SETUP #line 322 "lexer.l" {return(ONCE);} YY_BREAK case 68: YY_RULE_SETUP #line 323 "lexer.l" {return(AGAIN);} YY_BREAK case 69: YY_RULE_SETUP #line 324 "lexer.l" {return(AGAIN);} YY_BREAK case 70: /* rule 70 can match eol */ YY_RULE_SETUP #line 326 "lexer.l" {yylval.numval = myatoi(yytext); if (yylval.numval && yylval.numval < 100) return(OHOHSEVEN); else ick_lose(IE017, iyylineno, (char *)NULL);} YY_BREAK case 71: YY_RULE_SETUP #line 331 "lexer.l" {return(SUB);} YY_BREAK case 72: /* rule 72 can match eol */ #line 333 "lexer.l" case 73: /* rule 73 can match eol */ YY_RULE_SETUP #line 333 "lexer.l" {return(BY);} YY_BREAK case 74: YY_RULE_SETUP #line 335 "lexer.l" {return(GETS);} YY_BREAK case 75: #line 337 "lexer.l" case 76: YY_RULE_SETUP #line 337 "lexer.l" {yylval.numval = GETS; return(GERUND);} YY_BREAK case 77: #line 340 "lexer.l" case 78: YY_RULE_SETUP #line 340 "lexer.l" {return(FORGET);} YY_BREAK case 79: #line 342 "lexer.l" case 80: YY_RULE_SETUP #line 342 "lexer.l" {yylval.numval = FORGET; return(GERUND);} YY_BREAK case 81: #line 344 "lexer.l" case 82: YY_RULE_SETUP #line 344 "lexer.l" {return(RESUME);} YY_BREAK case 83: #line 346 "lexer.l" case 84: YY_RULE_SETUP #line 346 "lexer.l" {yylval.numval = RESUME; return(GERUND);} YY_BREAK case 85: #line 348 "lexer.l" case 86: YY_RULE_SETUP #line 348 "lexer.l" {return(STASH);} YY_BREAK case 87: #line 350 "lexer.l" case 88: YY_RULE_SETUP #line 350 "lexer.l" {yylval.numval = STASH; return(GERUND);} YY_BREAK case 89: #line 352 "lexer.l" case 90: YY_RULE_SETUP #line 352 "lexer.l" {return(RETRIEVE);} YY_BREAK case 91: #line 354 "lexer.l" case 92: YY_RULE_SETUP #line 354 "lexer.l" {yylval.numval = RETRIEVE; return(GERUND);} YY_BREAK case 93: #line 356 "lexer.l" case 94: YY_RULE_SETUP #line 356 "lexer.l" {return(IGNORE);} YY_BREAK case 95: #line 358 "lexer.l" case 96: YY_RULE_SETUP #line 358 "lexer.l" {yylval.numval = IGNORE; return(GERUND);} YY_BREAK case 97: #line 360 "lexer.l" case 98: YY_RULE_SETUP #line 360 "lexer.l" {return(REMEMBER);} YY_BREAK case 99: #line 362 "lexer.l" case 100: YY_RULE_SETUP #line 362 "lexer.l" {yylval.numval = REMEMBER; return(GERUND);} YY_BREAK case 101: #line 364 "lexer.l" case 102: YY_RULE_SETUP #line 364 "lexer.l" {return(ABSTAIN);} YY_BREAK case 103: #line 366 "lexer.l" case 104: YY_RULE_SETUP #line 366 "lexer.l" {yylval.numval = ABSTAIN; return(GERUND);} YY_BREAK case 105: #line 368 "lexer.l" case 106: YY_RULE_SETUP #line 368 "lexer.l" {return(REINSTATE);} YY_BREAK case 107: #line 370 "lexer.l" case 108: YY_RULE_SETUP #line 370 "lexer.l" {yylval.numval = REINSTATE; return(GERUND);} YY_BREAK case 109: /* rule 109 can match eol */ #line 372 "lexer.l" case 110: /* rule 110 can match eol */ YY_RULE_SETUP #line 372 "lexer.l" {return(READ_OUT);} YY_BREAK case 111: #line 374 "lexer.l" case 112: /* rule 112 can match eol */ YY_RULE_SETUP #line 374 "lexer.l" {yylval.numval = READ_OUT; return(GERUND);} YY_BREAK case 113: /* rule 113 can match eol */ #line 376 "lexer.l" case 114: /* rule 114 can match eol */ YY_RULE_SETUP #line 376 "lexer.l" {return(WRITE_IN);} YY_BREAK case 115: #line 378 "lexer.l" case 116: /* rule 116 can match eol */ YY_RULE_SETUP #line 378 "lexer.l" {yylval.numval = WRITE_IN; return(GERUND);} YY_BREAK case 117: #line 380 "lexer.l" case 118: #line 381 "lexer.l" case 119: #line 382 "lexer.l" case 120: YY_RULE_SETUP #line 382 "lexer.l" {yylval.numval = UNKNOWN; return(GERUND); /* AIS: An idea stolen from CLC-INTERCAL. The Latin means literally 'remind' or 'mention'. */} YY_BREAK case 121: YY_RULE_SETUP #line 385 "lexer.l" {/* By AIS. I can't find a Latin translation for this. */ return(PIN);} YY_BREAK case 122: YY_RULE_SETUP #line 387 "lexer.l" {/* By AIS */ yylval.numval = PIN; return(GERUND);} YY_BREAK case 123: /* rule 123 can match eol */ #line 389 "lexer.l" case 124: /* rule 124 can match eol */ YY_RULE_SETUP #line 389 "lexer.l" {/* AIS */ yylval.numval = myatoi(yytext); return(NEXTFROMLABEL);} YY_BREAK case 125: /* rule 125 can match eol */ #line 392 "lexer.l" case 126: /* rule 126 can match eol */ YY_RULE_SETUP #line 392 "lexer.l" {/* AIS: 'next' is not a verb, so the Latin is invented */ return(NEXTFROMEXPR);} YY_BREAK case 127: #line 395 "lexer.l" case 128: /* rule 128 can match eol */ YY_RULE_SETUP #line 395 "lexer.l" {/* AIS */ yylval.numval = NEXTFROMLABEL; return(GERUND);} YY_BREAK case 129: /* rule 129 can match eol */ #line 397 "lexer.l" case 130: /* rule 130 can match eol */ YY_RULE_SETUP #line 397 "lexer.l" {/* AIS */ yylval.numval = myatoi(yytext); return(COME_FROM);} YY_BREAK case 131: /* rule 131 can match eol */ #line 400 "lexer.l" case 132: /* rule 132 can match eol */ YY_RULE_SETUP #line 400 "lexer.l" {/* AIS */ return(COMPUCOME);} YY_BREAK case 133: #line 402 "lexer.l" case 134: /* rule 134 can match eol */ YY_RULE_SETUP #line 402 "lexer.l" {yylval.numval = COME_FROM; return(GERUND);} YY_BREAK case 135: #line 404 "lexer.l" case 136: YY_RULE_SETUP #line 404 "lexer.l" {stbeginline = 0; return(NEXT);} YY_BREAK case 137: #line 406 "lexer.l" case 138: YY_RULE_SETUP #line 406 "lexer.l" {yylval.numval = NEXT; return(GERUND);} YY_BREAK case 139: YY_RULE_SETUP #line 407 "lexer.l" {return(FROM); /* AIS: Latin is 'A', which confuses the rest of the parser */} YY_BREAK case 140: #line 410 "lexer.l" case 141: #line 411 "lexer.l" case 142: /* rule 142 can match eol */ YY_RULE_SETUP #line 411 "lexer.l" {return(GIVE_UP);} YY_BREAK case 143: /* rule 143 can match eol */ #line 413 "lexer.l" case 144: /* rule 144 can match eol */ YY_RULE_SETUP #line 413 "lexer.l" {return(TRY_AGAIN);} YY_BREAK case 145: YY_RULE_SETUP #line 414 "lexer.l" {return(WHILE); /* AIS. Latin for this is needed. */} YY_BREAK case 146: #line 416 "lexer.l" case 147: YY_RULE_SETUP #line 416 "lexer.l" {yylval.numval = WHILE; return(GERUND);} YY_BREAK case 148: /* rule 148 can match eol */ YY_RULE_SETUP #line 417 "lexer.l" {yylval.numval = TRY_AGAIN; return(GERUND);} YY_BREAK case 149: /* rule 149 can match eol */ #line 419 "lexer.l" case 150: /* rule 150 can match eol */ YY_RULE_SETUP #line 419 "lexer.l" {return(GO_BACK);} YY_BREAK case 151: /* rule 151 can match eol */ #line 421 "lexer.l" case 152: /* rule 152 can match eol */ YY_RULE_SETUP #line 421 "lexer.l" {yylval.numval = GO_BACK; return(GERUND);} YY_BREAK case 153: /* rule 153 can match eol */ #line 423 "lexer.l" case 154: /* rule 154 can match eol */ YY_RULE_SETUP #line 423 "lexer.l" {return(GO_AHEAD);} YY_BREAK case 155: /* rule 155 can match eol */ YY_RULE_SETUP #line 424 "lexer.l" {yylval.numval = GO_AHEAD; return(GERUND); /* AIS: I'm having a few deponent troubles with the Latin, so there are no Latin gerunds around here. Besides, the Latin 'gerunds' look somewhat like gerundives to me, but that's purely based on memory so I may be wrong. */} YY_BREAK case 156: /* rule 156 can match eol */ #line 430 "lexer.l" case 157: /* rule 157 can match eol */ YY_RULE_SETUP #line 430 "lexer.l" {yylval.numval = myatoi(yytext); return(CREATE);} YY_BREAK case 158: #line 432 "lexer.l" case 159: YY_RULE_SETUP #line 432 "lexer.l" {return(COMPUCREATE);} YY_BREAK case 160: #line 434 "lexer.l" case 161: #line 435 "lexer.l" case 162: YY_RULE_SETUP #line 435 "lexer.l" {yylval.numval = CREATE; return(GERUND);} YY_BREAK case 163: YY_RULE_SETUP #line 437 "lexer.l" {return(INTERSECTION);} YY_BREAK case 164: /* rule 164 can match eol */ YY_RULE_SETUP #line 439 "lexer.l" ; YY_BREAK case 165: YY_RULE_SETUP #line 440 "lexer.l" {/* AIS */ yylval.numval = *yytext; return(UNKNOWNID);} YY_BREAK case 166: YY_RULE_SETUP #line 441 "lexer.l" {/* AIS */ yylval.numval = yytext[0]*256 + yytext[3]; if(yytext[0] > yytext[3]) yylval.numval = yytext[0] + yytext[3]*256; return(BADCHAR);} YY_BREAK case 167: YY_RULE_SETUP #line 445 "lexer.l" {yylval.numval = yytext[0]; /* AIS: The line below for debug */ if(yydebug) fprintf(stdout, "yylex: bad char %#x\n",(unsigned char)yytext[0]); return(BADCHAR);} YY_BREAK case 168: YY_RULE_SETUP #line 450 "lexer.l" ECHO; YY_BREAK #line 2096 "lexer.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 646 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 646 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 645); return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { int num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 450 "lexer.l" int lexer(void) { static int tok = BADCHAR; if (re_send_token) re_send_token = false; else { tok = yylex(); #ifdef YYDEBUG if (yydebug) (void) fprintf(stdout, "yylex: returning token %d\n", tok); #endif /* YYDEBUG */ } #ifdef YYDEBUG if (yydebug) (void) fprintf(stdout, "lexer: returning token %d\n", tok); #endif /* YYDEBUG */ return(tok); } static int myatoi(const char *text) /* AIS */ { #define MAXTEXT 100 static char buf[MAXTEXT]; static char thinbuf[MAXTEXT]; char* bp; char* tp; register int i; for(buf[i = 0] = '\0';*text && i < MAXTEXT;text++) { if(isdigit(*text)) { buf[i++] = *text; } } buf[i] = '\0'; bp=buf; tp=thinbuf; while(((*tp++=*bp++))); /* thinbuf code added by an AIS in case we want to work with wchar_t; the extra brackets tell GCC that this is intended and not a mistaken assignment */ return atoi(thinbuf); } void yyerror(const char *errtype) { #ifdef MAIN (void) printf("lextest: lexer error: %s.\n", errtype); #else /* MAIN */ (void) errtype; #endif /* MAIN */ } #ifdef MAIN int ick_main(void) { int t; while ((t = yylex()) > 0) { (void) printf("%03d %09d\n", t, yylval.numval); yylval.numval = 0; } return 0; } #endif /* MAIN */ intercal-0.30/prebuilt/PaxHeaders.27456/oil-oil.c0000644000000000000000000000007411441412205016336 xustar0030 atime=1417959270.313165627 30 ctime=1427992237.746939686 intercal-0.30/prebuilt/oil-oil.c0000644000175000017500000024723611441412205016247 0ustar00esresr00000000000000 /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ /* Line 189 of yacc.c */ #line 25 "oil.y" #include "config.h" #include #include #include #include #include "ick_bool.h" /* Define strdup if it isn't available */ #ifndef HAVE_STRDUP char* strdup(const char* s) { char* t=malloc(strlen(s)+1); if(t) strcpy(t,s); return t; } #endif /* #define YYDEBUG 1 int yydebug=1; */ /* Each semantic value represents either a constraint on a node that needs to be true for the optimization template to match, or part of the replacement for the optimization template. */ struct ickstype { unsigned depth; /* The number of child nodes this is from the root */ unsigned long path; /* Bits from the end of this number represent the sequence of lvals (=0) or rvals (=1) this is from the root; depth bits from the end are relevant, and the bit nearest the root is least significant */ const char* condition; /* Points to a constant string; the condition to generate on that node. Could also point to something the lexer mallocs, but then the lexer has to keep track of being able to free it again. If this is NULL, it means that there isn't a condition other than maybe mustbemesh */ const char* nodetypename; /* The name of the type of node this condition matches, or NULL for a LEXERLEAF */ bool usec; /* Whether to append the value of c to the condition */ bool mustbemesh; /* Must this node be a mesh or mesh32? */ bool cxneeded; /* True means calculate c and x for the node and the condition is on those; false means append 'condition' to the node itself to form the condition and c and x aren't needed */ bool width32; /* Generate a 32-bit node? */ bool ublo; /* Is this a UBLO (if set, generate conditions to check width)? */ unsigned long c; /* The value to append to the condition */ int replnum; /* Number of this group for replacements */ struct ickstype *n1;/* n1 and n2 are pointers to other conditions that */ struct ickstype *n2;/* also have to be satisified */ }; #define YYSTYPE YYSTYPE #define MAXOPTNAMELEN 64 char optname[MAXOPTNAMELEN]="undefined"; int optnumber = 0; typedef struct ickstype *YYSTYPE; void splitend(void); void splitstart(void); void treedepthup(YYSTYPE, bool); void treefree(YYSTYPE); void gennodepath(unsigned, unsigned long); bool treeshapecond(YYSTYPE, bool); YYSTYPE treenscheck(YYSTYPE, YYSTYPE, int); void treecxcond(YYSTYPE); void treerepcount(YYSTYPE, int*); void treerepgen(YYSTYPE, YYSTYPE*, int*); int countgetchar(void); int countungetc(int, FILE*); int cgccol; int cgcrow; /* #defines for chaining together template expressions; here, s is the type of expression (e.g. select, bitwise and, unary and) that's chaining the expressions together and n is the nonterminal that's the rval */ #define BINARYEXPR(s,m,l,r,w) do{ \ m=malloc(sizeof(struct ickstype)); \ m->n1=l; \ m->n2=r; \ m->usec=0; \ m->condition="->opcode==" s; \ m->nodetypename=s; \ m->mustbemesh=0; \ m->cxneeded=0; \ m->depth=0; \ m->path=0; \ m->replnum=0; \ m->width32=w; \ m->ublo=0; \ treedepthup(m->n1,0); \ treedepthup(m->n2,1); \ } while(0) #define UNARYEXPR(s,m,r,w,u) do{ \ m=malloc(sizeof(struct ickstype)); \ m->n1=0; \ m->n2=r; \ m->usec=0; \ m->condition="->opcode==" s; \ m->nodetypename=s; \ m->mustbemesh=0; \ m->cxneeded=0; \ m->depth=0; \ m->path=0; \ m->replnum=0; \ m->width32=w; \ m->ublo=u; \ treedepthup(m->n2,1); \ } while(0) /* Error handling and lexing */ int yylex(void); int yyerror(char const *); /* Split the output file */ #define SPLITMAX 20 int splitcount=SPLITMAX; int filenumber=0; bool inloop=0; /* Line 189 of yacc.c */ #line 204 "oil-oil.c" /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { LEXERLEAF = 258 }; #endif /* Tokens. */ #define LEXERLEAF 258 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ #line 252 "oil-oil.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int yyi) #else static int YYID (yyi) int yyi; #endif { return yyi; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 345 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 31 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 8 /* YYNRULES -- Number of rules. */ #define YYNRULES 89 /* YYNRULES -- Number of states. */ #define YYNSTATES 244 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 258 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 29, 9, 2, 11, 28, 17, 10, 7, 8, 26, 25, 2, 4, 2, 27, 2, 13, 16, 15, 22, 23, 14, 2, 2, 2, 2, 2, 6, 30, 5, 19, 21, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, 2, 2, 2, 2, 2, 2, 2, 20, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 24, 2, 12, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 4, 7, 12, 17, 19, 21, 25, 29, 33, 35, 37, 41, 45, 51, 57, 62, 67, 72, 77, 82, 87, 92, 97, 102, 108, 114, 120, 126, 131, 137, 143, 149, 155, 159, 165, 171, 175, 181, 187, 191, 197, 203, 207, 213, 219, 223, 229, 235, 239, 245, 251, 255, 261, 267, 271, 277, 283, 287, 293, 299, 303, 309, 315, 320, 325, 330, 337, 344, 349, 356, 363, 368, 375, 382, 387, 394, 401, 406, 413, 420, 425, 432, 439, 442, 447, 452, 454 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 32, 0, -1, -1, 32, 33, -1, 34, 4, 5, 38, -1, 6, 3, 4, 3, -1, 5, -1, 35, -1, 7, 37, 8, -1, 9, 37, 9, -1, 10, 37, 10, -1, 35, -1, 3, -1, 36, 11, 36, -1, 36, 12, 36, -1, 36, 12, 13, 14, 36, -1, 36, 12, 15, 16, 36, -1, 17, 13, 14, 36, -1, 17, 15, 16, 36, -1, 18, 13, 14, 36, -1, 18, 15, 16, 36, -1, 19, 13, 14, 36, -1, 19, 15, 16, 36, -1, 20, 13, 14, 36, -1, 20, 15, 16, 36, -1, 21, 13, 14, 36, -1, 21, 16, 13, 14, 36, -1, 21, 15, 13, 14, 36, -1, 21, 22, 13, 14, 36, -1, 21, 23, 13, 14, 36, -1, 21, 15, 16, 36, -1, 21, 16, 15, 16, 36, -1, 21, 15, 15, 16, 36, -1, 21, 22, 15, 16, 36, -1, 21, 23, 15, 16, 36, -1, 36, 17, 36, -1, 36, 17, 13, 14, 36, -1, 36, 17, 15, 16, 36, -1, 36, 24, 36, -1, 36, 24, 13, 14, 36, -1, 36, 24, 15, 16, 36, -1, 36, 20, 36, -1, 36, 20, 13, 14, 36, -1, 36, 20, 15, 16, 36, -1, 36, 25, 36, -1, 36, 25, 13, 14, 36, -1, 36, 25, 15, 16, 36, -1, 36, 4, 36, -1, 36, 4, 13, 14, 36, -1, 36, 4, 15, 16, 36, -1, 36, 26, 36, -1, 36, 26, 13, 14, 36, -1, 36, 26, 15, 16, 36, -1, 36, 27, 36, -1, 36, 27, 13, 14, 36, -1, 36, 27, 15, 16, 36, -1, 36, 28, 36, -1, 36, 28, 13, 14, 36, -1, 36, 28, 15, 16, 36, -1, 36, 5, 36, -1, 36, 5, 13, 14, 36, -1, 36, 5, 15, 16, 36, -1, 36, 6, 36, -1, 36, 6, 13, 14, 36, -1, 36, 6, 15, 16, 36, -1, 12, 13, 14, 36, -1, 12, 15, 16, 36, -1, 36, 29, 30, 36, -1, 36, 29, 30, 13, 14, 36, -1, 36, 29, 30, 15, 16, 36, -1, 36, 30, 30, 36, -1, 36, 30, 30, 13, 14, 36, -1, 36, 30, 30, 15, 16, 36, -1, 36, 17, 17, 36, -1, 36, 17, 17, 13, 14, 36, -1, 36, 17, 17, 15, 16, 36, -1, 36, 24, 24, 36, -1, 36, 24, 24, 13, 14, 36, -1, 36, 24, 24, 15, 16, 36, -1, 36, 5, 5, 36, -1, 36, 5, 5, 13, 14, 36, -1, 36, 5, 5, 15, 16, 36, -1, 36, 6, 6, 36, -1, 36, 6, 6, 13, 14, 36, -1, 36, 6, 6, 15, 16, 36, -1, 29, 36, -1, 29, 13, 14, 36, -1, 29, 15, 16, 36, -1, 36, -1, 35, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 186, 186, 186, 188, 249, 261, 263, 265, 266, 267, 269, 270, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "LEXERLEAF", "'-'", "'>'", "'<'", "'('", "')'", "'\"'", "'\\''", "'$'", "'~'", "'1'", "'6'", "'3'", "'2'", "'&'", "'V'", "'?'", "'^'", "'@'", "'4'", "'5'", "'|'", "'+'", "'*'", "'/'", "'%'", "'!'", "'='", "$accept", "input", "optimization", "template", "expr3", "expr", "expr2", "replacement", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 45, 62, 60, 40, 41, 34, 39, 36, 126, 49, 54, 51, 50, 38, 86, 63, 94, 64, 52, 53, 124, 43, 42, 47, 37, 33, 61 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 31, 32, 32, 33, 33, 33, 34, 35, 35, 35, 36, 36, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 38 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 4, 4, 1, 1, 3, 3, 3, 1, 1, 3, 3, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 4, 5, 5, 5, 5, 3, 5, 5, 3, 5, 5, 3, 5, 5, 3, 5, 5, 3, 5, 5, 3, 5, 5, 3, 5, 5, 3, 5, 5, 3, 5, 5, 3, 5, 5, 4, 4, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 2, 4, 4, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 0, 1, 6, 0, 0, 0, 0, 3, 0, 7, 0, 12, 0, 0, 0, 0, 0, 0, 0, 11, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 59, 0, 0, 0, 62, 13, 0, 0, 14, 0, 0, 0, 35, 0, 0, 41, 0, 0, 0, 38, 0, 0, 44, 0, 0, 50, 0, 0, 53, 0, 0, 56, 0, 0, 89, 4, 65, 66, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 30, 0, 0, 0, 0, 0, 0, 86, 87, 0, 0, 0, 0, 79, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 70, 27, 32, 26, 31, 28, 33, 29, 34, 48, 49, 0, 0, 60, 61, 0, 0, 63, 64, 15, 16, 36, 37, 0, 0, 42, 43, 39, 40, 0, 0, 45, 46, 51, 52, 54, 55, 57, 58, 0, 0, 0, 0, 80, 81, 83, 84, 74, 75, 77, 78, 68, 69, 71, 72 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 1, 8, 9, 20, 21, 22, 127 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -20 static const yytype_int16 yypact[] = { -20, 10, -20, -20, 1, 210, 210, 210, -20, 3, -20, 17, -20, -10, -2, 29, 63, 120, 192, 89, -20, 83, 31, 34, 46, 67, 65, 68, 74, 72, 77, 87, 81, 101, 102, 105, 106, 115, 25, 125, 134, 141, 116, 118, -20, 188, 70, 162, 15, 231, 54, 240, -1, 249, 258, 267, 276, 51, 109, -20, -20, -20, 107, -20, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 152, 132, 15, 153, 139, 156, 157, 160, 163, 15, 15, 164, 167, -20, 285, 166, 168, -20, 294, 173, 172, -20, -20, 175, 174, -20, 178, 180, 303, -20, 190, 186, -20, 202, 205, 312, -20, 204, 207, -20, 211, 208, -20, 212, 216, -20, 219, 220, -20, 321, 330, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, 15, 15, -20, 15, 15, 15, 15, 15, 15, -20, -20, 15, 15, 221, 226, -20, 15, 15, 223, 229, -20, 15, 15, 15, 15, 15, 15, 234, 235, -20, 15, 15, 15, 15, 243, 238, -20, 15, 15, 15, 15, 15, 15, 15, 15, 246, 247, -20, 252, 253, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, 15, 15, -20, -20, 15, 15, -20, -20, -20, -20, -20, -20, 15, 15, -20, -20, -20, -20, 15, 15, -20, -20, -20, -20, -20, -20, -20, -20, 15, 15, 15, 15, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -20, -20, -20, -20, 0, -19, 53, -20 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { 44, 10, 12, 27, 11, 28, 5, 25, 6, 7, 2, 29, 108, 30, 109, 3, 4, 5, 12, 6, 7, 26, 5, 110, 6, 7, 88, 92, 96, 97, 100, 104, 107, 111, 114, 117, 120, 123, 75, 59, 76, 77, 31, 60, 32, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 61, 12, 141, 23, 24, 5, 126, 6, 7, 148, 149, 101, 63, 102, 154, 103, 62, 12, 159, 89, 33, 5, 34, 6, 7, 124, 64, 90, 168, 91, 66, 45, 46, 47, 65, 175, 12, 67, 48, 49, 5, 69, 6, 7, 50, 68, 42, 51, 43, 186, 189, 52, 53, 54, 55, 56, 57, 58, 5, 70, 6, 7, 71, 72, 190, 191, 73, 192, 193, 194, 195, 196, 197, 74, 84, 198, 199, 35, 85, 36, 202, 203, 78, 125, 79, 206, 207, 208, 209, 210, 211, 80, 140, 81, 214, 215, 216, 217, 82, 143, 83, 220, 221, 222, 223, 224, 225, 226, 227, 12, 139, 142, 93, 5, 144, 6, 7, 145, 146, 94, 0, 95, 150, 147, 155, 232, 233, 151, 156, 234, 235, 160, 161, 162, 163, 12, 164, 236, 237, 5, 165, 6, 7, 238, 239, 86, 170, 87, 169, 37, 0, 38, 39, 240, 241, 242, 243, 12, 40, 41, 171, 5, 176, 6, 7, 172, 13, 177, 179, 178, 180, 14, 15, 16, 17, 18, 181, 182, 12, 200, 183, 204, 5, 19, 6, 7, 201, 12, 98, 205, 99, 5, 212, 6, 7, 213, 12, 105, 219, 106, 5, 218, 6, 7, 228, 12, 112, 229, 113, 5, 230, 6, 7, 231, 12, 115, 0, 116, 5, 0, 6, 7, 0, 12, 118, 0, 119, 5, 0, 6, 7, 0, 12, 121, 0, 122, 5, 0, 6, 7, 0, 12, 152, 0, 153, 5, 0, 6, 7, 0, 12, 157, 0, 158, 5, 0, 6, 7, 0, 12, 166, 0, 167, 5, 0, 6, 7, 0, 12, 173, 0, 174, 5, 0, 6, 7, 0, 12, 184, 0, 185, 5, 0, 6, 7, 0, 0, 187, 0, 188 }; static const yytype_int16 yycheck[] = { 19, 1, 3, 13, 3, 15, 7, 4, 9, 10, 0, 13, 13, 15, 15, 5, 6, 7, 3, 9, 10, 4, 7, 24, 9, 10, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 13, 8, 15, 16, 13, 9, 15, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 10, 3, 77, 6, 7, 7, 62, 9, 10, 84, 85, 13, 3, 15, 89, 17, 5, 3, 93, 5, 13, 7, 15, 9, 10, 30, 14, 13, 103, 15, 14, 4, 5, 6, 16, 110, 3, 16, 11, 12, 7, 16, 9, 10, 17, 14, 13, 20, 15, 124, 125, 24, 25, 26, 27, 28, 29, 30, 7, 14, 9, 10, 16, 14, 139, 140, 16, 142, 143, 144, 145, 146, 147, 14, 14, 150, 151, 13, 16, 15, 155, 156, 13, 30, 15, 160, 161, 162, 163, 164, 165, 13, 16, 15, 169, 170, 171, 172, 13, 16, 15, 176, 177, 178, 179, 180, 181, 182, 183, 3, 14, 14, 6, 7, 14, 9, 10, 16, 14, 13, -1, 15, 14, 16, 14, 200, 201, 16, 16, 204, 205, 14, 16, 14, 16, 3, 14, 212, 213, 7, 16, 9, 10, 218, 219, 13, 16, 15, 14, 13, -1, 15, 16, 228, 229, 230, 231, 3, 22, 23, 14, 7, 14, 9, 10, 16, 12, 16, 16, 14, 14, 17, 18, 19, 20, 21, 16, 14, 3, 14, 16, 14, 7, 29, 9, 10, 16, 3, 13, 16, 15, 7, 14, 9, 10, 16, 3, 13, 16, 15, 7, 14, 9, 10, 14, 3, 13, 16, 15, 7, 14, 9, 10, 16, 3, 13, -1, 15, 7, -1, 9, 10, -1, 3, 13, -1, 15, 7, -1, 9, 10, -1, 3, 13, -1, 15, 7, -1, 9, 10, -1, 3, 13, -1, 15, 7, -1, 9, 10, -1, 3, 13, -1, 15, 7, -1, 9, 10, -1, 3, 13, -1, 15, 7, -1, 9, 10, -1, 3, 13, -1, 15, 7, -1, 9, 10, -1, 3, 13, -1, 15, 7, -1, 9, 10, -1, -1, 13, -1, 15 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 32, 0, 5, 6, 7, 9, 10, 33, 34, 35, 3, 3, 12, 17, 18, 19, 20, 21, 29, 35, 36, 37, 37, 37, 4, 4, 13, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 15, 16, 22, 23, 13, 15, 36, 4, 5, 6, 11, 12, 17, 20, 24, 25, 26, 27, 28, 29, 30, 8, 9, 10, 5, 3, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 13, 15, 16, 13, 15, 13, 15, 13, 15, 14, 16, 13, 15, 36, 5, 13, 15, 36, 6, 13, 15, 36, 36, 13, 15, 36, 13, 15, 17, 36, 13, 15, 36, 13, 15, 24, 36, 13, 15, 36, 13, 15, 36, 13, 15, 36, 13, 15, 36, 30, 30, 35, 38, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 14, 16, 36, 14, 16, 14, 16, 14, 16, 36, 36, 14, 16, 13, 15, 36, 14, 16, 13, 15, 36, 14, 16, 14, 16, 14, 16, 13, 15, 36, 14, 16, 14, 16, 13, 15, 36, 14, 16, 14, 16, 14, 16, 14, 16, 13, 15, 36, 13, 15, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 14, 16, 36, 36, 14, 16, 36, 36, 36, 36, 36, 36, 14, 16, 36, 36, 36, 36, 14, 16, 36, 36, 36, 36, 36, 36, 36, 36, 14, 16, 14, 16, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void yy_stack_print (yybottom, yytop) yytype_int16 *yybottom; yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*-------------------------. | yyparse or yypush_parse. | `-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: `yyss': related to states. `yyvs': related to semantic values. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yytoken = 0; yyss = yyssa; yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 4: /* Line 1455 of yacc.c */ #line 189 "oil.y" { static YYSTYPE tempmem[10]; static int replcount[10]; /* Handle splitting the file. */ if(splitcount) splitcount--; if(!splitcount && !inloop) { splitcount=SPLITMAX; splitend(); ++filenumber; splitstart(); } /* This is where we actually generate the optimizer code. */ /* Tree-shape and is-constant conditions */ printf(" checknodeactbits(np);\n"); if(treeshapecond((yyvsp[(1) - (4)]),1)) printf(" if(1"); printf(")\n do\n {\n"); /* Nodesame and cxdata conditions */ { int i=10; YYSTYPE temp; while(--i) { temp=treenscheck((yyvsp[(1) - (4)]),0,i); if(temp) { printf(" x%d=np",i); gennodepath(temp->depth,temp->path); printf("->constant; c%d=np",i); gennodepath(temp->depth,temp->path); printf("->optdata;\n"); } tempmem[i]=temp; replcount[i]=0; /* we need to zero this somewhere, may as well be here */ } treecxcond((yyvsp[(1) - (4)])); } /* If we reach this point in the generated code, we have an optimizer template match. */ printf(" OPTING(%s_%d);\n",optname,++optnumber); /* We now need to replace np with its replacement. This is done by creating a new nodetree, copying across tempmem'd nodes where necessary, and then substituting one for the other. (This is an inefficient but general way to do this.) One special case is needed; because pointers into the root node need to continue pointing there, the temporary node tp is copied member-for-member and then freed again. The root width can change (this is a deviation from previous code), in order to prevent a bug where the new root happens to be a unary. (This means we can get a 16-bit unary applied to 32-bit data; but the optimiser is meant to ensure that this is not problematic.) */ printf(" tp=newnode();\n"); treerepcount((yyvsp[(4) - (4)]),replcount); treerepgen((yyvsp[(4) - (4)]),tempmem,replcount); printf(" nodefree(np->lval); nodefree(np->rval);\n"); printf(" *np=*tp; free(tp);\n"); printf(" } while(0);\n\n"); /* Free the template and replacement now they're finished being used. */ treefree((yyvsp[(1) - (4)])); treefree((yyvsp[(4) - (4)])); } break; case 5: /* Line 1455 of yacc.c */ #line 250 "oil.y" { if(!(yyvsp[(2) - (4)])->mustbemesh||!(yyvsp[(4) - (4)])->mustbemesh) { yyerror("syntax error in <#..#()->()> construct"); free((yyvsp[(2) - (4)])); free((yyvsp[(4) - (4)])); YYERROR; } printf(" r=%luLU; while(r<=%luLU) {\n",(yyvsp[(2) - (4)])->c,(yyvsp[(4) - (4)])->c); free((yyvsp[(2) - (4)])); free((yyvsp[(4) - (4)])); inloop=1; } break; case 6: /* Line 1455 of yacc.c */ #line 261 "oil.y" {printf(" r++;\n }\n"); inloop=0;} break; case 8: /* Line 1455 of yacc.c */ #line 265 "oil.y" {(yyval)=(yyvsp[(2) - (3)]);} break; case 9: /* Line 1455 of yacc.c */ #line 266 "oil.y" {(yyval)=(yyvsp[(2) - (3)]);} break; case 10: /* Line 1455 of yacc.c */ #line 267 "oil.y" {(yyval)=(yyvsp[(2) - (3)]);} break; case 13: /* Line 1455 of yacc.c */ #line 272 "oil.y" {BINARYEXPR("MINGLE",(yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),1);} break; case 14: /* Line 1455 of yacc.c */ #line 273 "oil.y" {BINARYEXPR("SELECT",(yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),1);} break; case 15: /* Line 1455 of yacc.c */ #line 274 "oil.y" {BINARYEXPR("SELECT",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),0);} break; case 16: /* Line 1455 of yacc.c */ #line 275 "oil.y" {BINARYEXPR("SELECT",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),1);} break; case 17: /* Line 1455 of yacc.c */ #line 276 "oil.y" {UNARYEXPR("AND",(yyval),(yyvsp[(4) - (4)]),0,1);} break; case 18: /* Line 1455 of yacc.c */ #line 277 "oil.y" {UNARYEXPR("AND",(yyval),(yyvsp[(4) - (4)]),1,1);} break; case 19: /* Line 1455 of yacc.c */ #line 278 "oil.y" {UNARYEXPR("OR",(yyval),(yyvsp[(4) - (4)]),0,1);} break; case 20: /* Line 1455 of yacc.c */ #line 279 "oil.y" {UNARYEXPR("OR",(yyval),(yyvsp[(4) - (4)]),1,1);} break; case 21: /* Line 1455 of yacc.c */ #line 280 "oil.y" {UNARYEXPR("XOR",(yyval),(yyvsp[(4) - (4)]),0,1);} break; case 22: /* Line 1455 of yacc.c */ #line 281 "oil.y" {UNARYEXPR("XOR",(yyval),(yyvsp[(4) - (4)]),1,1);} break; case 23: /* Line 1455 of yacc.c */ #line 282 "oil.y" {UNARYEXPR("FIN",(yyval),(yyvsp[(4) - (4)]),0,1);} break; case 24: /* Line 1455 of yacc.c */ #line 283 "oil.y" {UNARYEXPR("FIN",(yyval),(yyvsp[(4) - (4)]),1,1);} break; case 25: /* Line 1455 of yacc.c */ #line 284 "oil.y" {UNARYEXPR("WHIRL",(yyval),(yyvsp[(4) - (4)]),0,1);} break; case 26: /* Line 1455 of yacc.c */ #line 285 "oil.y" {UNARYEXPR("WHIRL2",(yyval),(yyvsp[(5) - (5)]),0,1);} break; case 27: /* Line 1455 of yacc.c */ #line 286 "oil.y" {UNARYEXPR("WHIRL3",(yyval),(yyvsp[(5) - (5)]),0,1);} break; case 28: /* Line 1455 of yacc.c */ #line 287 "oil.y" {UNARYEXPR("WHIRL4",(yyval),(yyvsp[(5) - (5)]),0,1);} break; case 29: /* Line 1455 of yacc.c */ #line 288 "oil.y" {UNARYEXPR("WHIRL5",(yyval),(yyvsp[(5) - (5)]),0,1);} break; case 30: /* Line 1455 of yacc.c */ #line 289 "oil.y" {UNARYEXPR("WHIRL",(yyval),(yyvsp[(4) - (4)]),1,1);} break; case 31: /* Line 1455 of yacc.c */ #line 290 "oil.y" {UNARYEXPR("WHIRL2",(yyval),(yyvsp[(5) - (5)]),1,1);} break; case 32: /* Line 1455 of yacc.c */ #line 291 "oil.y" {UNARYEXPR("WHIRL3",(yyval),(yyvsp[(5) - (5)]),1,1);} break; case 33: /* Line 1455 of yacc.c */ #line 292 "oil.y" {UNARYEXPR("WHIRL4",(yyval),(yyvsp[(5) - (5)]),1,1);} break; case 34: /* Line 1455 of yacc.c */ #line 293 "oil.y" {UNARYEXPR("WHIRL5",(yyval),(yyvsp[(5) - (5)]),1,1);} break; case 35: /* Line 1455 of yacc.c */ #line 294 "oil.y" {BINARYEXPR("C_AND",(yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),1);} break; case 36: /* Line 1455 of yacc.c */ #line 295 "oil.y" {BINARYEXPR("C_AND",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),0);} break; case 37: /* Line 1455 of yacc.c */ #line 296 "oil.y" {BINARYEXPR("C_AND",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),1);} break; case 38: /* Line 1455 of yacc.c */ #line 297 "oil.y" {BINARYEXPR("C_OR",(yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),1);} break; case 39: /* Line 1455 of yacc.c */ #line 298 "oil.y" {BINARYEXPR("C_OR",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),0);} break; case 40: /* Line 1455 of yacc.c */ #line 299 "oil.y" {BINARYEXPR("C_OR",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),1);} break; case 41: /* Line 1455 of yacc.c */ #line 300 "oil.y" {BINARYEXPR("C_XOR",(yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),1);} break; case 42: /* Line 1455 of yacc.c */ #line 301 "oil.y" {BINARYEXPR("C_XOR",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),0);} break; case 43: /* Line 1455 of yacc.c */ #line 302 "oil.y" {BINARYEXPR("C_XOR",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),1);} break; case 44: /* Line 1455 of yacc.c */ #line 303 "oil.y" {BINARYEXPR("C_PLUS",(yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),1);} break; case 45: /* Line 1455 of yacc.c */ #line 304 "oil.y" {BINARYEXPR("C_PLUS",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),0);} break; case 46: /* Line 1455 of yacc.c */ #line 305 "oil.y" {BINARYEXPR("C_PLUS",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),1);} break; case 47: /* Line 1455 of yacc.c */ #line 306 "oil.y" {BINARYEXPR("C_MINUS",(yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),1);} break; case 48: /* Line 1455 of yacc.c */ #line 307 "oil.y" {BINARYEXPR("C_MINUS",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),0);} break; case 49: /* Line 1455 of yacc.c */ #line 308 "oil.y" {BINARYEXPR("C_MINUS",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),1);} break; case 50: /* Line 1455 of yacc.c */ #line 309 "oil.y" {BINARYEXPR("C_TIMES",(yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),1);} break; case 51: /* Line 1455 of yacc.c */ #line 310 "oil.y" {BINARYEXPR("C_TIMES",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),0);} break; case 52: /* Line 1455 of yacc.c */ #line 311 "oil.y" {BINARYEXPR("C_TIMES",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),1);} break; case 53: /* Line 1455 of yacc.c */ #line 312 "oil.y" {BINARYEXPR("C_DIVIDEBY",(yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),1);} break; case 54: /* Line 1455 of yacc.c */ #line 313 "oil.y" {BINARYEXPR("C_DIVIDEBY",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),0);} break; case 55: /* Line 1455 of yacc.c */ #line 314 "oil.y" {BINARYEXPR("C_DIVIDEBY",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),1);} break; case 56: /* Line 1455 of yacc.c */ #line 315 "oil.y" {BINARYEXPR("C_MODULUS",(yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),1);} break; case 57: /* Line 1455 of yacc.c */ #line 316 "oil.y" {BINARYEXPR("C_MODULUS",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),0);} break; case 58: /* Line 1455 of yacc.c */ #line 317 "oil.y" {BINARYEXPR("C_MODULUS",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),1);} break; case 59: /* Line 1455 of yacc.c */ #line 318 "oil.y" {BINARYEXPR("C_GREATER",(yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),1);} break; case 60: /* Line 1455 of yacc.c */ #line 319 "oil.y" {BINARYEXPR("C_GREATER",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),0);} break; case 61: /* Line 1455 of yacc.c */ #line 320 "oil.y" {BINARYEXPR("C_GREATER",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),1);} break; case 62: /* Line 1455 of yacc.c */ #line 321 "oil.y" {BINARYEXPR("C_LESS",(yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),1);} break; case 63: /* Line 1455 of yacc.c */ #line 322 "oil.y" {BINARYEXPR("C_LESS",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),0);} break; case 64: /* Line 1455 of yacc.c */ #line 323 "oil.y" {BINARYEXPR("C_LESS",(yyval),(yyvsp[(1) - (5)]),(yyvsp[(5) - (5)]),1);} break; case 65: /* Line 1455 of yacc.c */ #line 324 "oil.y" {UNARYEXPR("C_NOT",(yyval),(yyvsp[(4) - (4)]),0,1);} break; case 66: /* Line 1455 of yacc.c */ #line 325 "oil.y" {UNARYEXPR("C_NOT",(yyval),(yyvsp[(4) - (4)]),1,1);} break; case 67: /* Line 1455 of yacc.c */ #line 326 "oil.y" {BINARYEXPR("C_NOTEQUAL",(yyval),(yyvsp[(1) - (4)]),(yyvsp[(4) - (4)]),0);} break; case 68: /* Line 1455 of yacc.c */ #line 327 "oil.y" {BINARYEXPR("C_NOTEQUAL",(yyval),(yyvsp[(1) - (6)]),(yyvsp[(6) - (6)]),0);} break; case 69: /* Line 1455 of yacc.c */ #line 328 "oil.y" {BINARYEXPR("C_NOTEQUAL",(yyval),(yyvsp[(1) - (6)]),(yyvsp[(6) - (6)]),1);} break; case 70: /* Line 1455 of yacc.c */ #line 329 "oil.y" {BINARYEXPR("C_ISEQUAL",(yyval),(yyvsp[(1) - (4)]),(yyvsp[(4) - (4)]),0);} break; case 71: /* Line 1455 of yacc.c */ #line 330 "oil.y" {BINARYEXPR("C_ISEQUAL",(yyval),(yyvsp[(1) - (6)]),(yyvsp[(6) - (6)]),0);} break; case 72: /* Line 1455 of yacc.c */ #line 331 "oil.y" {BINARYEXPR("C_ISEQUAL",(yyval),(yyvsp[(1) - (6)]),(yyvsp[(6) - (6)]),1);} break; case 73: /* Line 1455 of yacc.c */ #line 332 "oil.y" {BINARYEXPR("C_LOGICALAND",(yyval),(yyvsp[(1) - (4)]),(yyvsp[(4) - (4)]),0);} break; case 74: /* Line 1455 of yacc.c */ #line 333 "oil.y" {BINARYEXPR("C_LOGICALAND",(yyval),(yyvsp[(1) - (6)]),(yyvsp[(6) - (6)]),0);} break; case 75: /* Line 1455 of yacc.c */ #line 334 "oil.y" {BINARYEXPR("C_LOGICALAND",(yyval),(yyvsp[(1) - (6)]),(yyvsp[(6) - (6)]),1);} break; case 76: /* Line 1455 of yacc.c */ #line 335 "oil.y" {BINARYEXPR("C_LOGICALOR",(yyval),(yyvsp[(1) - (4)]),(yyvsp[(4) - (4)]),0);} break; case 77: /* Line 1455 of yacc.c */ #line 336 "oil.y" {BINARYEXPR("C_LOGICALOR",(yyval),(yyvsp[(1) - (6)]),(yyvsp[(6) - (6)]),0);} break; case 78: /* Line 1455 of yacc.c */ #line 337 "oil.y" {BINARYEXPR("C_LOGICALOR",(yyval),(yyvsp[(1) - (6)]),(yyvsp[(6) - (6)]),1);} break; case 79: /* Line 1455 of yacc.c */ #line 338 "oil.y" {BINARYEXPR("C_RSHIFTBY",(yyval),(yyvsp[(1) - (4)]),(yyvsp[(4) - (4)]),1);} break; case 80: /* Line 1455 of yacc.c */ #line 339 "oil.y" {BINARYEXPR("C_RSHIFTBY",(yyval),(yyvsp[(1) - (6)]),(yyvsp[(6) - (6)]),0);} break; case 81: /* Line 1455 of yacc.c */ #line 340 "oil.y" {BINARYEXPR("C_RSHIFTBY",(yyval),(yyvsp[(1) - (6)]),(yyvsp[(6) - (6)]),1);} break; case 82: /* Line 1455 of yacc.c */ #line 341 "oil.y" {BINARYEXPR("C_LSHIFTBY",(yyval),(yyvsp[(1) - (4)]),(yyvsp[(4) - (4)]),1);} break; case 83: /* Line 1455 of yacc.c */ #line 342 "oil.y" {BINARYEXPR("C_LSHIFTBY",(yyval),(yyvsp[(1) - (6)]),(yyvsp[(6) - (6)]),0);} break; case 84: /* Line 1455 of yacc.c */ #line 343 "oil.y" {BINARYEXPR("C_LSHIFTBY",(yyval),(yyvsp[(1) - (6)]),(yyvsp[(6) - (6)]),1);} break; case 85: /* Line 1455 of yacc.c */ #line 344 "oil.y" {UNARYEXPR("C_LOGICALNOT",(yyval),(yyvsp[(2) - (2)]),0,0);} break; case 86: /* Line 1455 of yacc.c */ #line 345 "oil.y" {UNARYEXPR("C_LOGICALNOT",(yyval),(yyvsp[(4) - (4)]),0,0);} break; case 87: /* Line 1455 of yacc.c */ #line 346 "oil.y" {UNARYEXPR("C_LOGICALNOT",(yyval),(yyvsp[(4) - (4)]),1,0);} break; /* Line 1455 of yacc.c */ #line 2288 "oil-oil.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } /* Line 1675 of yacc.c */ #line 351 "oil.y" #define MAXTOFREE 1000 char* tofree[MAXTOFREE]={0}; int tfi=0; int yylex(void) { int c; unsigned long acc; /* Whitespace is completely insignificant here, even inside && and other two-character operators. Just to be different, though, it /is/ significant inside constructs like .1 and #{1}2; in such cases, it isn't allowed. */ c=countgetchar(); while(isspace(c)) c=countgetchar(); while(c==';'||c=='[') { /* Comments go from a semicolon/hybrid to the end of the line. */ if(c==';') { c=countgetchar(); while(c!='\n') c=countgetchar(); while(isspace(c)) c=countgetchar(); } /* Square brackets set the name for optimizations. */ if(c=='[') { int i=0; c=countgetchar(); while(c!=']') { optname[i++]=c; c=countgetchar(); if(i==MAXOPTNAMELEN-1) {i=0; yyerror("optimization name too long");} } optnumber=0; optname[i]=0; c=countgetchar(); while(isspace(c)) c=countgetchar(); } } if(c==EOF) return 0; switch(c) { case '#': c=countgetchar(); if(c!='{') { acc=0; while(isdigit(c)) { acc*=10; acc+=(c-'0'); c=countgetchar(); } yylval=malloc(sizeof(struct ickstype)); yylval->depth=0; yylval->path=0; yylval->condition="->constant=="; yylval->nodetypename=0; yylval->usec=1; yylval->mustbemesh=1; yylval->cxneeded=0; yylval->c=acc; yylval->replnum=0; yylval->n1=0; yylval->n2=0; yylval->ublo=0; yylval->width32=1; /* generate MESH32 not MESH; we can still AND16 it, etc., if necessary */ countungetc(c, stdin); return LEXERLEAF; } countungetc(c, stdin); c='#'; /* fall through */ case '_': case ':': case '.': yylval=malloc(sizeof(struct ickstype)); yylval->depth=0; yylval->path=0; yylval->condition=0; /* _ or # */ yylval->width32=1; /* should never matter, but you never know... */ yylval->ublo=0; if(c==':') yylval->condition="->width==32"; if(c=='.') {yylval->condition="->width==16"; yylval->width32=0;} yylval->nodetypename=0; yylval->usec=0; yylval->mustbemesh=c=='#'; yylval->cxneeded=0; c=countgetchar(); if(c=='{') { /* Create a new node to hold the c/x condition */ yylval->n1=malloc(sizeof(struct ickstype)); yylval->n1->depth=0; yylval->n1->path=0; { static char buf[512]; int bi=0; c=countgetchar(); while(c!='}') { buf[bi++]=c; if(bi==511) {yyerror("{quoted} string too long"); bi=0;} c=countgetchar(); } buf[bi]=0; yylval->n1->condition=tofree[tfi++]=strdup(buf); if(tfi==MAXTOFREE) {yyerror("Too many {quoted} strings"); tfi--;} c=countgetchar(); } yylval->n1->nodetypename=0; yylval->n1->usec=0; yylval->n1->mustbemesh=0; yylval->n1->cxneeded=1; yylval->n1->n1=0; yylval->n1->n2=0; yylval->n1->width32=yylval->width32; yylval->n1->ublo=0; } else yylval->n1=0; yylval->replnum=0; if(yylval->n1) yylval->n1->replnum=c-'0'; else yylval->replnum=c-'0'; yylval->n2=0; return LEXERLEAF; default: return c; } } void treedepthup(YYSTYPE v, bool i) { if(!v) return; treedepthup(v->n1,i); treedepthup(v->n2,i); v->depth++; v->path<<=1; v->path|=i; if(v->depth>30) yyerror("Nesting too deep in template or replacement\n"); } void treefree(YYSTYPE v) { if(!v) return; treefree(v->n1); treefree(v->n2); free(v); } void gennodepath(unsigned depth, unsigned long path) { while(depth--) { if(path&1) printf("->rval"); else printf("->lval"); path>>=1; } } bool treeshapecond(YYSTYPE v, bool firstopt) { if(!v) return firstopt; /* To prevent possibly dereferencing a null pointer, check the root ick_first */ if(v->mustbemesh) /* it's a must-be-constant constraint */ { printf(firstopt?" if((np":" &&\n (np"); gennodepath(v->depth,v->path); printf("->opcode==MESH || np"); gennodepath(v->depth,v->path); printf("->opcode==MESH32)"); firstopt=0; } if(v->condition&&!v->cxneeded) /* it's a tree-shape constraint */ { printf(firstopt?" if(np":" &&\n np"); gennodepath(v->depth,v->path); printf("%s",v->condition); if(v->usec) printf("%luLU",v->c); firstopt=0; } if(v->ublo) /* generate a width check */ { printf(firstopt?" if(np":" &&\n np"); gennodepath(v->depth,v->path); printf("->width==%d",v->width32?32:16); firstopt=0; } firstopt=treeshapecond(v->n1,firstopt); return treeshapecond(v->n2,firstopt); } YYSTYPE treenscheck(YYSTYPE v, YYSTYPE prev, int replnum) { if(!v) return prev; prev=treenscheck(v->n1,prev,replnum); prev=treenscheck(v->n2,prev,replnum); if(v->replnum!=replnum) return prev; if(prev) { printf(" if(!nodessame(np"); gennodepath(prev->depth,prev->path); printf(",np"); gennodepath(v->depth,v->path); printf(")) break;\n"); } return v; } void treecxcond(YYSTYPE v) { if(!v) return; if(v->cxneeded&&strcmp(v->condition,"1")) { if(v->replnum) printf(" x=x%d; c=c%d; ",v->replnum,v->replnum); else { printf(" x=np"); gennodepath(v->depth,v->path); printf("->constant;\n c=np"); gennodepath(v->depth,v->path); printf("->optdata;\n "); } printf("if(!(%s)) break;\n",v->condition); } treecxcond(v->n1); treecxcond(v->n2); } void treerepcount(YYSTYPE v, int* rc) { if(!v) return; if(!(v->nodetypename)&&v->replnum&&!(v->cxneeded)) rc[v->replnum]++; treerepcount(v->n1, rc); treerepcount(v->n2, rc); } void treerepgen(YYSTYPE v, YYSTYPE* refs, int* rc) { if(!v) return; /* We absolutely have to generate the root node ick_first here, because otherwise the nodes in question won't exist. */ if(v->nodetypename) /* Generate an intermediate node */ { printf(" MAYBENEWNODE(tp"); gennodepath(v->depth,v->path); printf(");\n tp"); gennodepath(v->depth,v->path); printf("->opcode=%s;\n tp",v->nodetypename); gennodepath(v->depth,v->path); printf("->width=%d;\n",v->width32?32:16); /* optdata will be filled in by checknodeactbits before the ick_next idiom is tested; constant is irrelevant, lval and rval are NULL at present and will be filled in by later recursions of this function, and I seriously hope that nextslat is never filled in by an optimizer idiom. */ } else if(v->replnum&&!(v->cxneeded)) { /* Copy a node from the template. The node ought not to be allocated at this point, so we can safely just ick_assign to it with a new malloced node. */ if(refs[v->replnum]) { if(rc[v->replnum]>1||!refs[v->replnum]->depth) { /* The node actually has to be copied, either because another copy is needed or because it's np itself that's being copied over. */ rc[v->replnum]--; printf(" tp"); gennodepath(v->depth,v->path); printf("=nodecopy(np"); gennodepath(refs[v->replnum]->depth,refs[v->replnum]->path); printf(");\n"); } else { /* This can be optimized slightly by moving rather than copying, zeroing backlinks so that the node won't be freed. */ rc[v->replnum]--; printf(" tp"); gennodepath(v->depth,v->path); printf("=np"); gennodepath(refs[v->replnum]->depth,refs[v->replnum]->path); printf(";\n np"); gennodepath(refs[v->replnum]->depth,refs[v->replnum]->path); printf("=0;\n"); } } else yyerror("Replacement isn't in the template"); } else if(v->cxneeded) { /* Generate a constant node based on an expression (#{expr}0). */ printf(" MAYBENEWNODE(tp"); gennodepath(v->depth,v->path); printf(");\n tp"); gennodepath(v->depth,v->path); printf("->opcode=MESH32;\n tp"); gennodepath(v->depth,v->path); printf("->width=32;\n tp"); gennodepath(v->depth,v->path); printf("->constant=(%s);\n",v->condition); } else if(v->mustbemesh&&!v->n1) { /* Generate a constant node based on a constant (#65535). */ printf(" MAYBENEWNODE(tp"); gennodepath(v->depth,v->path); printf(");\n tp"); gennodepath(v->depth,v->path); printf("->opcode=MESH32;\n tp"); gennodepath(v->depth,v->path); printf("->width=32;\n tp"); gennodepath(v->depth,v->path); printf("->constant=(%luLU);\n",v->c); } else if(v->mustbemesh&&v->n1) /* let this node's n1 handle it */ ; else yyerror("can't figure out how to generate a replacement node\n"); treerepgen(v->n1,refs,rc); treerepgen(v->n2,refs,rc); } int yyerror(char const *s) { fprintf(stderr,"Error at (%d:%d): \"%s\"\n",cgcrow,cgccol,s); return 0; /* this return value is ignored anyway */ } static int cgcpushback=0; int countgetchar(void) { int c=getchar(); if(cgcpushback) {cgcpushback=0; return c;} cgccol++; if(c=='\n') {cgccol=0; cgcrow++;} return c; } int countungetc(int c, FILE* f) { ungetc(c,f); cgcpushback=1; return c; } void splitstart(void) { static char fname[]="oilout00.c"; FILE *dummy; /* GCC 4 un-suppressable warning suck */ if(filenumber>255) { filenumber=255; fprintf(stdout,"Input file too long.\n"); } sprintf(fname,"oilout%02x.c",filenumber); dummy = freopen(fname,"w",stdout); puts("/* Automatically generated output, edit source and recompile to " "change */"); printf("#include \"oil.h\"\n" "int optimize_pass1_%x(node *np)\n" "{" " int opted=0;\n" " unsigned long c,c1,c2,c3,c4,c5,c6,c7,c8,c9;\n" " unsigned long x,x1,x2,x3,x4,x5,x6,x7,x8,x9,r;\n" " int tempw;\n" " node *tp;\n", filenumber); } void splitend(void) { /* Disabling warnings about unused variables. gcc will optimize this right out, and in any case the raise(SIGSEGV) will be unreachable (but will cause a pretty recognizable error because it'll be caught by the handler for SIGSEGV and output an internal error, with an obvious debug backtrace if -U is used). */ printf(" c=c1=c2=c3=c4=c5=c6=c7=c8=c9=0;\n" " x=x1=x2=x3=x4=x5=x6=x7=x8=x9=r=0;\n" " if(c+c1+c2+c3+c4+c5+c6+c7+c8+c9+r+\n" " x+x1+x2+x3+x4+x5+x6+x7+x8+x9) raise(SIGSEGV);\n"); printf(" return opted;\n}\n"); /* do not close stdout; freopen implicitly closes it anyway, and explicitly closing it breaks on DOS */ } int main(void) { int e,i; FILE *dummy; /* GCC 4 un-suppressible warnings suck */ /* " if(!np) return 0;\n" " if(np->lval) opted|=optimize_pass1(np->lval);\n" " if(np->rval) opted|=optimize_pass1(np->rval);\n" */ splitstart(); cgccol=0; cgcrow=1; e=yyparse(); while(tfi--) free(tofree[tfi]); splitend(); dummy = freopen("oilout-m.c","w",stdout); puts("/* Automatically generated output, edit source and recompile to " "change */"); puts("#include \"config.h\""); puts("#include \"ick.h\""); i=filenumber+1; while(i--) printf("extern int optimize_pass1_%x(node*);\n",i); puts("int optimize_pass1(node* np)\n" "{\n" " int opted=0;\n" " if(!np) return 0;\n" " if(np->lval) opted|=optimize_pass1(np->lval);\n" " if(np->rval) opted|=optimize_pass1(np->rval);"); i=filenumber+1; while(i--) printf(" opted|=optimize_pass1_%x(np);\n",i); puts(" return opted;\n" "}"); return e; } intercal-0.30/prebuilt/PaxHeaders.27456/parser.h0000644000000000000000000000007411437552042016304 xustar0030 atime=1417959270.477167309 30 ctime=1427992237.738939708 intercal-0.30/prebuilt/parser.h0000644000175000017500000001512511437552042016203 0ustar00esresr00000000000000 /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { UNKNOWN = 258, GETS = 259, RESIZE = 260, NEXT = 261, GO_AHEAD = 262, GO_BACK = 263, FORGET = 264, RESUME = 265, STASH = 266, RETRIEVE = 267, IGNORE = 268, REMEMBER = 269, ABSTAIN = 270, REINSTATE = 271, DISABLE = 272, ENABLE = 273, MANYFROM = 274, GIVE_UP = 275, READ_OUT = 276, WRITE_IN = 277, PIN = 278, COME_FROM = 279, NEXTFROMLABEL = 280, NEXTFROMEXPR = 281, NEXTFROMGERUND = 282, COMPUCOME = 283, GERUCOME = 284, PREPROC = 285, WHILE = 286, TRY_AGAIN = 287, CREATE = 288, COMPUCREATE = 289, FROM = 290, MAYBE = 291, DO = 292, PLEASE = 293, NOT = 294, ONCE = 295, AGAIN = 296, MESH = 297, NOSPOT = 298, ick_ONESPOT = 299, ick_TWOSPOT = 300, ick_TAIL = 301, ick_HYBRID = 302, MINGLE = 303, SELECT = 304, UNKNOWNOP = 305, SUB = 306, BY = 307, SLAT = 308, BACKSLAT = 309, NUMBER = 310, UNARY = 311, OHOHSEVEN = 312, GERUND = 313, LABEL = 314, BADCHAR = 315, INTERSECTION = 316, SPLATTERED = 317, MESH32 = 318, C_AND = 319, C_OR = 320, C_XOR = 321, C_NOT = 322, C_LOGICALNOT = 323, C_LSHIFTBY = 324, C_RSHIFTBY = 325, C_NOTEQUAL = 326, C_A = 327, C_PLUS = 328, C_MINUS = 329, C_TIMES = 330, C_DIVIDEBY = 331, C_MODULUS = 332, C_GREATER = 333, C_LESS = 334, C_ISEQUAL = 335, C_LOGICALAND = 336, C_LOGICALOR = 337, AND = 338, OR = 339, XOR = 340, FIN = 341, WHIRL = 342, WHIRL2 = 343, WHIRL3 = 344, WHIRL4 = 345, WHIRL5 = 346, REV_AND = 347, REV_OR = 348, REV_XOR = 349, REV_FIN = 350, REV_WHIRL = 351, REV_WHIRL2 = 352, REV_WHIRL3 = 353, REV_WHIRL4 = 354, REV_WHIRL5 = 355, UNKNOWNID = 356, US_ID = 357, US_SCALAR = 358, US_ARRVAR = 359, US_ELEM = 360, US_EXPR = 361, CLOSESPARK = 362, CLOSEEARS = 363, OPENSPARK = 364, OPENEARS = 365, HIGHPREC = 366, UNARYPREC = 367, LOWPREC = 368 }; #endif /* Tokens. */ #define UNKNOWN 258 #define GETS 259 #define RESIZE 260 #define NEXT 261 #define GO_AHEAD 262 #define GO_BACK 263 #define FORGET 264 #define RESUME 265 #define STASH 266 #define RETRIEVE 267 #define IGNORE 268 #define REMEMBER 269 #define ABSTAIN 270 #define REINSTATE 271 #define DISABLE 272 #define ENABLE 273 #define MANYFROM 274 #define GIVE_UP 275 #define READ_OUT 276 #define WRITE_IN 277 #define PIN 278 #define COME_FROM 279 #define NEXTFROMLABEL 280 #define NEXTFROMEXPR 281 #define NEXTFROMGERUND 282 #define COMPUCOME 283 #define GERUCOME 284 #define PREPROC 285 #define WHILE 286 #define TRY_AGAIN 287 #define CREATE 288 #define COMPUCREATE 289 #define FROM 290 #define MAYBE 291 #define DO 292 #define PLEASE 293 #define NOT 294 #define ONCE 295 #define AGAIN 296 #define MESH 297 #define NOSPOT 298 #define ick_ONESPOT 299 #define ick_TWOSPOT 300 #define ick_TAIL 301 #define ick_HYBRID 302 #define MINGLE 303 #define SELECT 304 #define UNKNOWNOP 305 #define SUB 306 #define BY 307 #define SLAT 308 #define BACKSLAT 309 #define NUMBER 310 #define UNARY 311 #define OHOHSEVEN 312 #define GERUND 313 #define LABEL 314 #define BADCHAR 315 #define INTERSECTION 316 #define SPLATTERED 317 #define MESH32 318 #define C_AND 319 #define C_OR 320 #define C_XOR 321 #define C_NOT 322 #define C_LOGICALNOT 323 #define C_LSHIFTBY 324 #define C_RSHIFTBY 325 #define C_NOTEQUAL 326 #define C_A 327 #define C_PLUS 328 #define C_MINUS 329 #define C_TIMES 330 #define C_DIVIDEBY 331 #define C_MODULUS 332 #define C_GREATER 333 #define C_LESS 334 #define C_ISEQUAL 335 #define C_LOGICALAND 336 #define C_LOGICALOR 337 #define AND 338 #define OR 339 #define XOR 340 #define FIN 341 #define WHIRL 342 #define WHIRL2 343 #define WHIRL3 344 #define WHIRL4 345 #define WHIRL5 346 #define REV_AND 347 #define REV_OR 348 #define REV_XOR 349 #define REV_FIN 350 #define REV_WHIRL 351 #define REV_WHIRL2 352 #define REV_WHIRL3 353 #define REV_WHIRL4 354 #define REV_WHIRL5 355 #define UNKNOWNID 356 #define US_ID 357 #define US_SCALAR 358 #define US_ARRVAR 359 #define US_ELEM 360 #define US_EXPR 361 #define CLOSESPARK 362 #define CLOSEEARS 363 #define OPENSPARK 364 #define OPENEARS 365 #define HIGHPREC 366 #define UNARYPREC 367 #define LOWPREC 368 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 1676 of yacc.c */ #line 83 "parser.y" int numval; /* a numeric value */ tuple *tuple; /* a code tuple */ node *node; /* an expression-tree node */ /* Line 1676 of yacc.c */ #line 286 "parser.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; intercal-0.30/prebuilt/PaxHeaders.27456/parser.c0000644000000000000000000000007411437552042016277 xustar0030 atime=1417959270.477167309 30 ctime=1427992237.738939708 intercal-0.30/prebuilt/parser.c0000644000175000017500000030222111437552042016172 0ustar00esresr00000000000000 /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ /* Line 189 of yacc.c */ #line 30 "parser.y" #include "config.h" #include #include #include "sizes.h" #include "ick.h" #include "feh.h" #include "ick_lose.h" extern int yyerror(const char*); /* Intervene our ick_first-stage lexer. */ extern int lexer(void); #define yylex() lexer() static node *rlist; /* pointer to current right-hand node list */ /*static node *llist;*/ /* pointer to current left-hand node list */ static node *np; /* variable for building node lists */ extern int stbeginline; /* line number of last seen preamble */ static int thisline; /* line number of beginning of current statement */ extern int mark112; /* AIS: Mark the tuple for W112 when it's created. */ static int lineuid=65537; /* AIS: a line number not used anywhere else */ static int cacsofar=0; /* AIS: Number of args in a CREATE statement */ static tuple *splat(int); static tuple *prevtuple = NULL; #define GETLINENO \ {if (stbeginline < 0) thisline = -stbeginline; \ else {thisline = stbeginline; stbeginline = 0;}} #define ACTION(x, nt, nn) \ {x = newtuple(); x->type = nt; x->ick_lineno = thisline; x->u.node = nn;} #define TARGET(x, nt, nn) \ {x = newtuple(); x->type = nt; x->ick_lineno = thisline; x->u.target = nn;} #define ACTARGET(x, nt, nn, nn2)\ {x = newtuple(); x->type = nt; x->ick_lineno = thisline;\ x->u.node = nn; x->u.target = nn2;} /* AIS : The macro above was added for ABSTAIN expr FROM. */ #define NEWFANGLED mark112 = 1; /* AIS: Added the mention of mark112 */ \ if (ick_traditional) ick_lose(IE111,iyylineno,(char*)NULL); else #define DESTACKSE1 sparkearsstack[sparkearslev--/32] >>= 1 #define DESTACKSPARKEARS DESTACKSE1; DESTACKSE1 /* Line 189 of yacc.c */ #line 124 "parser.c" /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { UNKNOWN = 258, GETS = 259, RESIZE = 260, NEXT = 261, GO_AHEAD = 262, GO_BACK = 263, FORGET = 264, RESUME = 265, STASH = 266, RETRIEVE = 267, IGNORE = 268, REMEMBER = 269, ABSTAIN = 270, REINSTATE = 271, DISABLE = 272, ENABLE = 273, MANYFROM = 274, GIVE_UP = 275, READ_OUT = 276, WRITE_IN = 277, PIN = 278, COME_FROM = 279, NEXTFROMLABEL = 280, NEXTFROMEXPR = 281, NEXTFROMGERUND = 282, COMPUCOME = 283, GERUCOME = 284, PREPROC = 285, WHILE = 286, TRY_AGAIN = 287, CREATE = 288, COMPUCREATE = 289, FROM = 290, MAYBE = 291, DO = 292, PLEASE = 293, NOT = 294, ONCE = 295, AGAIN = 296, MESH = 297, NOSPOT = 298, ick_ONESPOT = 299, ick_TWOSPOT = 300, ick_TAIL = 301, ick_HYBRID = 302, MINGLE = 303, SELECT = 304, UNKNOWNOP = 305, SUB = 306, BY = 307, SLAT = 308, BACKSLAT = 309, NUMBER = 310, UNARY = 311, OHOHSEVEN = 312, GERUND = 313, LABEL = 314, BADCHAR = 315, INTERSECTION = 316, SPLATTERED = 317, MESH32 = 318, C_AND = 319, C_OR = 320, C_XOR = 321, C_NOT = 322, C_LOGICALNOT = 323, C_LSHIFTBY = 324, C_RSHIFTBY = 325, C_NOTEQUAL = 326, C_A = 327, C_PLUS = 328, C_MINUS = 329, C_TIMES = 330, C_DIVIDEBY = 331, C_MODULUS = 332, C_GREATER = 333, C_LESS = 334, C_ISEQUAL = 335, C_LOGICALAND = 336, C_LOGICALOR = 337, AND = 338, OR = 339, XOR = 340, FIN = 341, WHIRL = 342, WHIRL2 = 343, WHIRL3 = 344, WHIRL4 = 345, WHIRL5 = 346, REV_AND = 347, REV_OR = 348, REV_XOR = 349, REV_FIN = 350, REV_WHIRL = 351, REV_WHIRL2 = 352, REV_WHIRL3 = 353, REV_WHIRL4 = 354, REV_WHIRL5 = 355, UNKNOWNID = 356, US_ID = 357, US_SCALAR = 358, US_ARRVAR = 359, US_ELEM = 360, US_EXPR = 361, CLOSESPARK = 362, CLOSEEARS = 363, OPENSPARK = 364, OPENEARS = 365, HIGHPREC = 366, UNARYPREC = 367, LOWPREC = 368 }; #endif /* Tokens. */ #define UNKNOWN 258 #define GETS 259 #define RESIZE 260 #define NEXT 261 #define GO_AHEAD 262 #define GO_BACK 263 #define FORGET 264 #define RESUME 265 #define STASH 266 #define RETRIEVE 267 #define IGNORE 268 #define REMEMBER 269 #define ABSTAIN 270 #define REINSTATE 271 #define DISABLE 272 #define ENABLE 273 #define MANYFROM 274 #define GIVE_UP 275 #define READ_OUT 276 #define WRITE_IN 277 #define PIN 278 #define COME_FROM 279 #define NEXTFROMLABEL 280 #define NEXTFROMEXPR 281 #define NEXTFROMGERUND 282 #define COMPUCOME 283 #define GERUCOME 284 #define PREPROC 285 #define WHILE 286 #define TRY_AGAIN 287 #define CREATE 288 #define COMPUCREATE 289 #define FROM 290 #define MAYBE 291 #define DO 292 #define PLEASE 293 #define NOT 294 #define ONCE 295 #define AGAIN 296 #define MESH 297 #define NOSPOT 298 #define ick_ONESPOT 299 #define ick_TWOSPOT 300 #define ick_TAIL 301 #define ick_HYBRID 302 #define MINGLE 303 #define SELECT 304 #define UNKNOWNOP 305 #define SUB 306 #define BY 307 #define SLAT 308 #define BACKSLAT 309 #define NUMBER 310 #define UNARY 311 #define OHOHSEVEN 312 #define GERUND 313 #define LABEL 314 #define BADCHAR 315 #define INTERSECTION 316 #define SPLATTERED 317 #define MESH32 318 #define C_AND 319 #define C_OR 320 #define C_XOR 321 #define C_NOT 322 #define C_LOGICALNOT 323 #define C_LSHIFTBY 324 #define C_RSHIFTBY 325 #define C_NOTEQUAL 326 #define C_A 327 #define C_PLUS 328 #define C_MINUS 329 #define C_TIMES 330 #define C_DIVIDEBY 331 #define C_MODULUS 332 #define C_GREATER 333 #define C_LESS 334 #define C_ISEQUAL 335 #define C_LOGICALAND 336 #define C_LOGICALOR 337 #define AND 338 #define OR 339 #define XOR 340 #define FIN 341 #define WHIRL 342 #define WHIRL2 343 #define WHIRL3 344 #define WHIRL4 345 #define WHIRL5 346 #define REV_AND 347 #define REV_OR 348 #define REV_XOR 349 #define REV_FIN 350 #define REV_WHIRL 351 #define REV_WHIRL2 352 #define REV_WHIRL3 353 #define REV_WHIRL4 354 #define REV_WHIRL5 355 #define UNKNOWNID 356 #define US_ID 357 #define US_SCALAR 358 #define US_ARRVAR 359 #define US_ELEM 360 #define US_EXPR 361 #define CLOSESPARK 362 #define CLOSEEARS 363 #define OPENSPARK 364 #define OPENEARS 365 #define HIGHPREC 366 #define UNARYPREC 367 #define LOWPREC 368 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 214 of yacc.c */ #line 83 "parser.y" int numval; /* a numeric value */ tuple *tuple; /* a code tuple */ node *node; /* an expression-tree node */ /* Line 214 of yacc.c */ #line 394 "parser.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ #line 406 "parser.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int yyi) #else static int YYID (yyi) int yyi; #endif { return yyi; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 670 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 114 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 43 /* YYNRULES -- Number of rules. */ #define YYNRULES 145 /* YYNRULES -- Number of states. */ #define YYNSTATES 230 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 368 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 4, 7, 10, 14, 18, 23, 25, 27, 30, 33, 35, 39, 41, 44, 46, 49, 53, 57, 61, 64, 67, 70, 73, 76, 79, 82, 86, 90, 95, 100, 103, 106, 109, 112, 115, 117, 119, 121, 123, 125, 128, 131, 133, 136, 139, 142, 146, 149, 153, 155, 157, 159, 161, 164, 166, 168, 171, 173, 176, 178, 180, 182, 184, 186, 188, 192, 194, 196, 198, 200, 203, 206, 209, 212, 215, 219, 223, 226, 228, 232, 234, 236, 238, 242, 244, 246, 248, 250, 252, 256, 258, 262, 264, 266, 270, 274, 277, 280, 282, 284, 286, 288, 292, 296, 298, 300, 304, 308, 312, 316, 318, 320, 322, 324, 328, 332, 336, 340, 342, 346, 350, 354, 358, 360, 362, 364, 366, 368, 370, 374, 379, 384, 388, 392, 394, 396, 398, 401, 403, 406, 408, 410, 412 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { 115, 0, -1, -1, 115, 116, -1, 119, 117, -1, 119, 57, 117, -1, 59, 119, 117, -1, 59, 119, 57, 117, -1, 1, -1, 118, -1, 118, 40, -1, 118, 41, -1, 120, -1, 120, 31, 120, -1, 37, -1, 37, 39, -1, 36, -1, 36, 39, -1, 128, 4, 147, -1, 131, 4, 139, -1, 148, 4, 147, -1, 59, 6, -1, 9, 147, -1, 10, 147, -1, 11, 134, -1, 12, 134, -1, 13, 134, -1, 14, 134, -1, 15, 35, 59, -1, 15, 35, 126, -1, 15, 147, 35, 59, -1, 15, 147, 35, 126, -1, 16, 59, -1, 16, 126, -1, 22, 136, -1, 21, 138, -1, 23, 129, -1, 20, -1, 7, -1, 8, -1, 32, -1, 24, -1, 28, 126, -1, 28, 147, -1, 25, -1, 26, 126, -1, 26, 147, -1, 33, 121, -1, 34, 147, 122, -1, 33, 146, -1, 34, 154, 146, -1, 121, -1, 60, -1, 1, -1, 124, -1, 123, 124, -1, 123, -1, 125, -1, 125, 121, -1, 125, -1, 121, 125, -1, 140, -1, 130, -1, 148, -1, 131, -1, 101, -1, 58, -1, 126, 61, 58, -1, 130, -1, 131, -1, 130, -1, 140, -1, 45, 55, -1, 44, 55, -1, 45, 55, -1, 46, 55, -1, 47, 55, -1, 46, 56, 55, -1, 47, 56, 55, -1, 42, 55, -1, 127, -1, 134, 61, 127, -1, 130, -1, 140, -1, 131, -1, 135, 61, 136, -1, 135, -1, 130, -1, 140, -1, 133, -1, 131, -1, 137, 61, 138, -1, 137, -1, 147, 52, 139, -1, 147, -1, 141, -1, 131, 51, 142, -1, 131, 51, 143, -1, 154, 142, -1, 154, 143, -1, 141, -1, 145, -1, 154, -1, 145, -1, 132, 51, 142, -1, 132, 51, 143, -1, 60, -1, 154, -1, 154, 49, 147, -1, 154, 48, 147, -1, 154, 146, 147, -1, 130, 53, 147, -1, 140, -1, 144, -1, 153, -1, 144, -1, 154, 49, 147, -1, 154, 48, 147, -1, 154, 146, 147, -1, 130, 53, 147, -1, 152, -1, 152, 49, 147, -1, 152, 48, 147, -1, 152, 146, 147, -1, 130, 53, 147, -1, 140, -1, 144, -1, 42, -1, 44, -1, 45, -1, 133, -1, 150, 56, 55, -1, 155, 56, 147, 107, -1, 156, 56, 147, 108, -1, 155, 149, 107, -1, 156, 149, 108, -1, 151, -1, 130, -1, 151, -1, 56, 154, -1, 152, -1, 56, 154, -1, 109, -1, 107, -1, 110, -1, 108, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 168, 168, 169, 181, 183, 185, 187, 189, 204, 206, 209, 226, 227, 266, 267, 268, 269, 273, 274, 275, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 304, 307, 309, 312, 315, 316, 319, 321, 325, 327, 328, 333, 334, 336, 339, 340, 342, 343, 348, 355, 362, 369, 372, 376, 378, 387, 387, 389, 389, 391, 397, 403, 411, 417, 427, 435, 446, 461, 462, 468, 468, 468, 469, 470, 475, 475, 475, 475, 476, 477, 483, 484, 488, 489, 491, 493, 494, 496, 497, 498, 502, 503, 506, 511, 516, 519, 520, 521, 532, 537, 538, 542, 543, 544, 545, 546, 556, 564, 565, 566, 567, 577, 582, 583, 587, 587, 587, 592, 594, 616, 623, 632, 633, 636, 637, 640, 641, 651, 652, 656, 657, 660, 661 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "UNKNOWN", "GETS", "RESIZE", "NEXT", "GO_AHEAD", "GO_BACK", "FORGET", "RESUME", "STASH", "RETRIEVE", "IGNORE", "REMEMBER", "ABSTAIN", "REINSTATE", "DISABLE", "ENABLE", "MANYFROM", "GIVE_UP", "READ_OUT", "WRITE_IN", "PIN", "COME_FROM", "NEXTFROMLABEL", "NEXTFROMEXPR", "NEXTFROMGERUND", "COMPUCOME", "GERUCOME", "PREPROC", "WHILE", "TRY_AGAIN", "CREATE", "COMPUCREATE", "FROM", "MAYBE", "DO", "PLEASE", "NOT", "ONCE", "AGAIN", "MESH", "NOSPOT", "ick_ONESPOT", "ick_TWOSPOT", "ick_TAIL", "ick_HYBRID", "MINGLE", "SELECT", "UNKNOWNOP", "SUB", "BY", "SLAT", "BACKSLAT", "NUMBER", "UNARY", "OHOHSEVEN", "GERUND", "LABEL", "BADCHAR", "INTERSECTION", "SPLATTERED", "MESH32", "C_AND", "C_OR", "C_XOR", "C_NOT", "C_LOGICALNOT", "C_LSHIFTBY", "C_RSHIFTBY", "C_NOTEQUAL", "C_A", "C_PLUS", "C_MINUS", "C_TIMES", "C_DIVIDEBY", "C_MODULUS", "C_GREATER", "C_LESS", "C_ISEQUAL", "C_LOGICALAND", "C_LOGICALOR", "AND", "OR", "XOR", "FIN", "WHIRL", "WHIRL2", "WHIRL3", "WHIRL4", "WHIRL5", "REV_AND", "REV_OR", "REV_XOR", "REV_FIN", "REV_WHIRL", "REV_WHIRL2", "REV_WHIRL3", "REV_WHIRL4", "REV_WHIRL5", "UNKNOWNID", "US_ID", "US_SCALAR", "US_ARRVAR", "US_ELEM", "US_EXPR", "CLOSESPARK", "CLOSEEARS", "OPENSPARK", "OPENEARS", "HIGHPREC", "UNARYPREC", "LOWPREC", "$accept", "program", "command", "mtperform", "preproc", "please", "perform", "unknownstatement", "unknownsif", "unknownsin", "unknownatom", "unknownaid", "gerunds", "variable", "lvalue", "scalar2s", "scalar", "ick_array", "oparray", "constant", "varlist", "initem", "inlist", "outitem", "outlist", "byexpr", "subscr", "subscr1", "sublist", "sublist1", "osubscr", "osubscr1", "unop", "expr", "notanlvalue", "limexpr", "preftype", "lunambig", "limunambig", "nlunambig", "unambig", "eitherspark", "eitherears", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 114, 115, 115, 116, 116, 116, 116, 116, 117, 117, 117, 118, 118, 119, 119, 119, 119, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 121, 121, 121, 122, 122, 123, 123, 124, 124, 124, 124, 125, 126, 126, 127, 127, 128, 128, 129, 130, 130, 131, 131, 132, 132, 133, 134, 134, 135, 135, 135, 136, 136, 137, 137, 137, 137, 138, 138, 139, 139, 140, 140, 141, 142, 142, 143, 143, 143, 144, 144, 145, 146, 147, 147, 147, 147, 147, 147, 147, 148, 148, 148, 148, 148, 148, 149, 149, 149, 149, 149, 149, 149, 150, 150, 150, 151, 151, 151, 151, 151, 151, 152, 152, 153, 153, 154, 154, 155, 155, 156, 156 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 2, 3, 3, 4, 1, 1, 2, 2, 1, 3, 1, 2, 1, 2, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 2, 3, 2, 3, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 2, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 3, 3, 2, 2, 1, 1, 1, 1, 3, 3, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 3, 3, 3, 3, 1, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 3, 4, 4, 3, 3, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 0, 1, 8, 16, 14, 0, 3, 0, 17, 15, 0, 53, 38, 39, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 41, 44, 0, 0, 40, 0, 0, 127, 128, 129, 0, 0, 0, 0, 0, 52, 65, 143, 145, 142, 144, 4, 9, 12, 51, 56, 54, 59, 0, 62, 64, 0, 130, 61, 95, 115, 103, 63, 0, 138, 140, 114, 0, 0, 0, 0, 6, 0, 137, 0, 112, 113, 22, 136, 107, 23, 0, 0, 0, 0, 80, 68, 69, 24, 25, 26, 27, 0, 0, 66, 32, 33, 0, 87, 90, 89, 92, 35, 88, 82, 84, 86, 34, 83, 0, 36, 45, 46, 42, 43, 106, 47, 62, 64, 61, 49, 63, 0, 107, 79, 73, 74, 75, 0, 76, 0, 137, 139, 5, 21, 10, 11, 0, 60, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 125, 126, 0, 120, 0, 0, 7, 141, 0, 0, 0, 0, 0, 28, 29, 0, 0, 0, 0, 72, 48, 57, 50, 77, 78, 13, 18, 119, 19, 94, 0, 0, 100, 96, 97, 101, 102, 104, 105, 20, 131, 117, 116, 118, 0, 0, 134, 0, 0, 0, 0, 135, 111, 109, 108, 110, 81, 30, 31, 67, 91, 85, 58, 0, 0, 0, 98, 99, 132, 124, 122, 121, 123, 133, 93, 102 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 1, 7, 48, 49, 8, 50, 51, 174, 52, 53, 54, 98, 87, 55, 112, 75, 76, 58, 59, 90, 108, 109, 103, 104, 182, 77, 61, 187, 188, 78, 63, 122, 183, 64, 156, 65, 80, 67, 68, 81, 70, 71 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -140 static const yytype_int16 yypact[] = { -140, 129, -140, -140, -31, -25, 6, -140, 290, -140, -140, 362, -140, -140, -140, 438, 438, 248, 248, 248, 248, 152, 102, -140, 207, 248, -27, -140, -140, 457, 457, -140, 451, 438, -34, -32, -29, 84, 128, -17, 432, 24, -140, -140, -140, -140, -140, -140, -140, 149, 5, -51, 478, -140, -140, 48, 165, 9, 14, -140, 66, -140, -140, -140, 69, 33, 8, -140, -140, 74, 547, 553, 432, -140, -17, 41, 49, -140, -140, -140, -140, 94, -140, -32, -29, 43, 53, -140, -140, -140, 52, 52, 52, 52, 162, 83, -140, -140, 55, -34, -140, 49, -140, 59, -140, -140, -140, 49, 67, -140, -140, 77, -140, 55, -140, 55, -140, -140, -51, -15, 49, -140, -140, -140, -51, 94, -140, -140, -140, -140, 89, -140, 91, -140, 157, -140, -140, -140, -140, 432, -140, -140, 438, 438, 438, 438, 438, 438, 95, 438, 438, 438, 438, 71, -140, -140, 45, 167, 438, 28, -140, -140, 438, 438, 438, 438, 248, -140, 55, 176, 99, 207, 248, -140, -140, 472, 438, -140, -140, -140, -140, -140, -140, 110, 125, 130, -140, -140, -140, -140, 560, -140, -140, -140, -140, -140, -140, -140, 78, 438, -140, 438, 438, 438, 104, -140, -140, -140, -140, -140, -140, -140, 55, -140, -140, -140, -51, 438, 438, 438, -140, -140, -140, -140, -140, -140, -140, -140, -140, -140 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -140, -140, -140, -5, -140, 185, 64, -28, -140, -140, 155, -46, -10, 70, -140, -140, -8, 29, -63, -23, 57, -140, 37, -140, 85, 38, 101, -41, -139, -131, 218, -39, -40, 81, -30, 192, -140, 63, 171, -140, 47, -140, -140 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -142 static const yytype_int16 yytable[] = { 56, 102, 123, 56, 118, 140, 73, 191, 9, 88, 88, 88, 88, 144, 10, 192, 100, 106, 111, 113, 115, 126, 123, 127, 119, 34, 128, 35, 36, 151, 136, 133, 56, -137, -137, 135, 139, 57, 143, 74, 57, 165, 4, 5, 119, -137, 89, 89, 89, 89, 43, 220, 142, 101, 107, 69, -136, -136, 69, 221, 145, 120, 153, 153, 56, 146, 133, 160, -136, 57, -71, 66, 140, 147, 66, 91, 92, 93, 175, 69, 125, 120, 185, 185, 168, 176, 134, 69, 192, 148, 44, 45, 46, 47, 162, 66, 79, 82, 129, 69, 145, 57, 95, 66, 186, 186, 189, 189, 131, 60, 114, 116, 60, 166, 124, 66, 170, 203, 169, 69, 171, 161, 149, 150, 199, 105, 110, 185, 172, 2, 3, 56, 173, 121, 117, 66, 205, 133, 133, 129, 130, 60, 163, 164, 177, 123, 178, 216, 102, 186, 194, 189, 200, 121, 117, 185, 185, 213, 88, 212, 96, 97, 217, 100, 106, 4, 5, 119, 57, -70, 140, 154, 154, 60, 184, 184, 218, 186, 186, 189, 189, 219, 133, 131, 132, 222, 69, 94, 6, 137, 138, 11, 190, 190, 34, 89, 35, 36, 37, 38, 101, 107, 66, 179, 120, -141, -141, 141, 74, 215, 133, 133, 227, -137, -137, 201, 202, -141, 143, 184, 96, 167, 69, 180, 181, -137, 62, 117, 193, 62, 195, 196, 197, 198, 96, 211, 210, 190, 66, 204, 60, 157, 157, 206, 207, 208, 209, 184, 184, 99, 62, 83, 84, 85, 86, 228, 214, 209, 62, 44, 45, 46, 47, 159, 0, 229, 229, 0, 0, 0, 62, 0, 105, 110, 0, 0, 121, 0, 0, 0, 223, 0, 224, 225, 226, 0, 0, 0, 155, 155, 62, 12, 83, 84, 85, 86, 0, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, 0, 0, 23, 24, 25, 26, 27, 28, 29, 0, 30, 0, 0, 0, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, 34, 0, 35, 36, 37, 38, 0, 0, 0, 0, 0, 0, 0, 0, 39, 40, 0, 41, 42, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, 0, 0, 23, 24, 25, 26, 27, 28, 29, 0, 30, 43, 0, 62, 31, 32, 33, 44, 45, 46, 47, 0, 0, 0, 34, 0, 35, 36, 37, 38, 0, 0, 0, 0, 0, 0, 0, 0, 39, 72, 0, 41, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, 0, 0, 23, 24, 25, 26, 27, 28, 29, 0, 30, 0, 0, 43, 31, 32, 33, 0, 0, 44, 45, 46, 47, 0, 34, 0, 35, 36, 37, 38, 34, 0, 35, 36, 37, 38, 0, 0, 39, 0, 0, 41, 42, 34, 74, 35, 36, 37, 38, 34, 0, 35, 36, 37, 38, 0, 0, 39, 0, 0, 0, 117, 0, 74, 34, 96, 35, 36, 37, 38, 34, 0, 35, 36, 37, 38, 0, 0, 39, 0, 0, 0, 0, 43, 39, 0, 0, 0, 0, 44, 45, 46, 47, 0, 0, 44, 45, 46, 47, 0, 0, 0, 43, 0, 0, 0, 0, 0, 44, 45, 46, 47, 0, 0, 44, 45, 46, 47, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 44, 45, 46, 47, 0, 0, 44, 45, 46, 47, 34, 0, 35, 36, 37, 38, 34, 0, 35, 36, 37, 38, 0, 34, 152, 35, 36, 37, 38, 0, 158, 0, 0, 0, 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 45, 46, 47, 0, 0, 44, 45, 46, 47, 0, 0, 0, 0, 0, 46, 47 }; static const yytype_int16 yycheck[] = { 8, 24, 32, 11, 32, 51, 11, 146, 39, 17, 18, 19, 20, 4, 39, 146, 24, 25, 45, 29, 30, 55, 52, 55, 32, 42, 55, 44, 45, 69, 6, 39, 40, 48, 49, 40, 31, 8, 53, 56, 11, 81, 36, 37, 52, 60, 17, 18, 19, 20, 101, 190, 4, 24, 25, 8, 48, 49, 11, 190, 51, 32, 70, 71, 72, 51, 74, 72, 60, 40, 4, 8, 118, 4, 11, 18, 19, 20, 124, 32, 33, 52, 145, 146, 94, 125, 39, 40, 219, 56, 107, 108, 109, 110, 53, 32, 15, 16, 55, 52, 51, 72, 21, 40, 145, 146, 145, 146, 55, 8, 29, 30, 11, 61, 33, 52, 61, 157, 35, 72, 61, 74, 48, 49, 53, 24, 25, 190, 61, 0, 1, 139, 55, 32, 60, 72, 108, 145, 146, 55, 56, 40, 48, 49, 55, 175, 55, 175, 171, 190, 55, 190, 107, 52, 60, 218, 219, 58, 166, 169, 58, 59, 52, 171, 172, 36, 37, 175, 139, 4, 216, 70, 71, 72, 145, 146, 51, 218, 219, 218, 219, 51, 190, 55, 56, 107, 139, 35, 59, 40, 41, 6, 145, 146, 42, 166, 44, 45, 46, 47, 171, 172, 139, 139, 175, 48, 49, 52, 56, 172, 218, 219, 108, 48, 49, 48, 49, 60, 53, 190, 58, 59, 175, 142, 143, 60, 8, 60, 147, 11, 149, 150, 151, 152, 58, 59, 166, 190, 175, 158, 139, 70, 71, 162, 163, 164, 165, 218, 219, 42, 32, 44, 45, 46, 47, 217, 171, 176, 40, 107, 108, 109, 110, 71, -1, 218, 219, -1, -1, -1, 52, -1, 171, 172, -1, -1, 175, -1, -1, -1, 199, -1, 201, 202, 203, -1, -1, -1, 70, 71, 72, 1, 44, 45, 46, 47, -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, -1, 28, -1, -1, -1, 32, 33, 34, -1, -1, -1, -1, -1, -1, -1, 42, -1, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, 56, 57, -1, 59, 60, -1, -1, -1, -1, -1, -1, 139, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, -1, 28, 101, -1, 175, 32, 33, 34, 107, 108, 109, 110, -1, -1, -1, 42, -1, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, 56, 57, -1, 59, 60, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, -1, 28, -1, -1, 101, 32, 33, 34, -1, -1, 107, 108, 109, 110, -1, 42, -1, 44, 45, 46, 47, 42, -1, 44, 45, 46, 47, -1, -1, 56, -1, -1, 59, 60, 42, 56, 44, 45, 46, 47, 42, -1, 44, 45, 46, 47, -1, -1, 56, -1, -1, -1, 60, -1, 56, 42, 58, 44, 45, 46, 47, 42, -1, 44, 45, 46, 47, -1, -1, 56, -1, -1, -1, -1, 101, 56, -1, -1, -1, -1, 107, 108, 109, 110, -1, -1, 107, 108, 109, 110, -1, -1, -1, 101, -1, -1, -1, -1, -1, 107, 108, 109, 110, -1, -1, 107, 108, 109, 110, -1, -1, -1, -1, -1, 101, -1, -1, -1, -1, -1, 107, 108, 109, 110, -1, -1, 107, 108, 109, 110, 42, -1, 44, 45, 46, 47, 42, -1, 44, 45, 46, 47, -1, 42, 56, 44, 45, 46, 47, -1, 56, -1, -1, -1, -1, -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 107, 108, 109, 110, -1, -1, 107, 108, 109, 110, -1, -1, -1, -1, -1, 109, 110 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 115, 0, 1, 36, 37, 59, 116, 119, 39, 39, 119, 1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 28, 32, 33, 34, 42, 44, 45, 46, 47, 56, 57, 59, 60, 101, 107, 108, 109, 110, 117, 118, 120, 121, 123, 124, 125, 128, 130, 131, 132, 133, 140, 141, 144, 145, 148, 150, 151, 152, 153, 154, 155, 156, 57, 117, 56, 130, 131, 140, 144, 147, 151, 154, 147, 44, 45, 46, 47, 127, 130, 131, 134, 134, 134, 134, 35, 147, 58, 59, 126, 42, 130, 131, 133, 137, 138, 140, 130, 131, 135, 136, 140, 45, 129, 126, 147, 126, 147, 60, 121, 130, 131, 140, 146, 148, 147, 154, 55, 55, 55, 55, 56, 55, 56, 130, 154, 117, 6, 40, 41, 31, 125, 124, 4, 53, 4, 51, 51, 4, 56, 48, 49, 146, 56, 130, 140, 144, 149, 152, 56, 149, 117, 154, 53, 48, 49, 146, 61, 59, 126, 35, 61, 61, 61, 55, 122, 125, 146, 55, 55, 120, 147, 147, 139, 147, 131, 132, 141, 142, 143, 145, 154, 142, 143, 147, 55, 147, 147, 147, 147, 53, 107, 48, 49, 146, 147, 108, 147, 147, 147, 147, 127, 59, 126, 58, 138, 136, 121, 52, 51, 51, 142, 143, 107, 147, 147, 147, 147, 108, 139, 154 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void yy_stack_print (yybottom, yytop) yytype_int16 *yybottom; yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*-------------------------. | yyparse or yypush_parse. | `-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: `yyss': related to states. `yyvs': related to semantic values. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yytoken = 0; yyss = yyssa; yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 4: /* Line 1455 of yacc.c */ #line 182 "parser.y" {(yyvsp[(2) - (2)].tuple)->label = 0; (yyvsp[(2) - (2)].tuple)->exechance = (yyvsp[(1) - (2)].numval) * 100;} break; case 5: /* Line 1455 of yacc.c */ #line 184 "parser.y" {(yyvsp[(3) - (3)].tuple)->label = 0; (yyvsp[(3) - (3)].tuple)->exechance = (yyvsp[(1) - (3)].numval) * (yyvsp[(2) - (3)].numval);} break; case 6: /* Line 1455 of yacc.c */ #line 186 "parser.y" {checklabel((yyvsp[(1) - (3)].numval)); (yyvsp[(3) - (3)].tuple)->label = (yyvsp[(1) - (3)].numval); (yyvsp[(3) - (3)].tuple)->exechance = (yyvsp[(2) - (3)].numval) * 100;} break; case 7: /* Line 1455 of yacc.c */ #line 188 "parser.y" {checklabel((yyvsp[(1) - (4)].numval)); (yyvsp[(4) - (4)].tuple)->label = (yyvsp[(1) - (4)].numval); (yyvsp[(4) - (4)].tuple)->exechance = (yyvsp[(2) - (4)].numval) * (yyvsp[(3) - (4)].numval);} break; case 8: /* Line 1455 of yacc.c */ #line 190 "parser.y" {/* AIS: catch errors which occur after the end of a statement (highly likely when comments are being written, as the start of them will be parsed as an UNKNOWN) */ yyerrok; yyclearin; cacsofar=0; if(prevtuple) {prevtuple->type=SPLATTERED; splat(0);} else splat(1); /* this is the first statement */ } break; case 9: /* Line 1455 of yacc.c */ #line 205 "parser.y" {(yyvsp[(1) - (1)].tuple)->onceagainflag = onceagain_NORMAL; prevtuple = (yyval.tuple) = (yyvsp[(1) - (1)].tuple);} break; case 10: /* Line 1455 of yacc.c */ #line 207 "parser.y" {NEWFANGLED {(yyvsp[(1) - (2)].tuple)->onceagainflag = onceagain_ONCE; prevtuple = (yyval.tuple) = (yyvsp[(1) - (2)].tuple);}} break; case 11: /* Line 1455 of yacc.c */ #line 210 "parser.y" {NEWFANGLED {(yyvsp[(1) - (2)].tuple)->onceagainflag = onceagain_AGAIN; prevtuple = (yyval.tuple) = (yyvsp[(1) - (2)].tuple);}} break; case 12: /* Line 1455 of yacc.c */ #line 226 "parser.y" {(yyval.tuple) = (yyvsp[(1) - (1)].tuple);} break; case 13: /* Line 1455 of yacc.c */ #line 228 "parser.y" { if(!multithread) ick_lose(IE405, iyylineno, (char*)NULL); NEWFANGLED{ /* (x) DO a WHILE b is equivalent to #11 (l0) DO REINSTATE (l3) #10 (l1) DO COME FROM (l2) AGAIN #9 DO b #8 DO COME FROM (l0) #7 DO NOTHING #6 DO NOTHING #5 (l2) DO NOTHING #4 DO GIVE UP #3 DO COME FROM (l0) #2 (x) DO a #1 (l3) DON'T ABSTAIN FROM (l1) AGAIN */ tuple* temptuple; TARGET(temptuple, COME_FROM, lineuid+2); temptuple->label=lineuid+1; temptuple->preproc=1; /* #10 */ TARGET(temptuple, COME_FROM, lineuid+0); temptuple->preproc=1; /* #8 */ ACTION(temptuple, PREPROC, 0); temptuple->preproc=1; /* #7 */ ACTION(temptuple, PREPROC, 0); temptuple->preproc=1; /* #6 */ ACTION(temptuple, PREPROC, 0); temptuple->label=lineuid+2; temptuple->preproc=1; /* #5 */ ACTION(temptuple, GIVE_UP, 0); temptuple->preproc=1; /* #4 */ TARGET(temptuple, COME_FROM, lineuid+0); temptuple->preproc=1; /* #3 */ TARGET(temptuple, REINSTATE, lineuid+3); temptuple->setweave=1; temptuple->label=lineuid+0; temptuple->preproc=1; /* #11 */ TARGET(temptuple, ABSTAIN, lineuid+1); temptuple->label=lineuid+3; /* #1 */ temptuple->preproc=1; temptuple->setweave=-1; temptuple->exechance=-100; politesse += 3; /* Keep the politeness checker happy */ ppinit(11); tupleswap(10,9); tupleswap(11,2); lineuid+=4; /* #2, #9 */ tuples[ick_lineno-10].onceagainflag=onceagain_AGAIN; tuples[ick_lineno-1].onceagainflag=onceagain_AGAIN; (yyval.tuple)=&(tuples[ick_lineno-2]); }} break; case 14: /* Line 1455 of yacc.c */ #line 266 "parser.y" {GETLINENO; (yyval.numval) = 1;} break; case 15: /* Line 1455 of yacc.c */ #line 267 "parser.y" {GETLINENO; (yyval.numval) = -1;} break; case 16: /* Line 1455 of yacc.c */ #line 268 "parser.y" {NEWFANGLED {GETLINENO; (yyval.numval) = 101;}} break; case 17: /* Line 1455 of yacc.c */ #line 269 "parser.y" {NEWFANGLED {GETLINENO; (yyval.numval) = -101;}} break; case 18: /* Line 1455 of yacc.c */ #line 273 "parser.y" {ACTION((yyval.tuple), GETS, cons(GETS,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node)));} break; case 19: /* Line 1455 of yacc.c */ #line 274 "parser.y" {ACTION((yyval.tuple), RESIZE, cons(RESIZE,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node)));} break; case 20: /* Line 1455 of yacc.c */ #line 276 "parser.y" {/* AIS: This is for variableconstants, and an error otherwise.*/ if(variableconstants) ACTION((yyval.tuple), GETS, cons(GETS,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node))) else {yyerrok; yyclearin; (yyval.tuple)=splat(1);}} break; case 21: /* Line 1455 of yacc.c */ #line 279 "parser.y" {TARGET((yyval.tuple), NEXT, (yyvsp[(1) - (2)].numval));} break; case 22: /* Line 1455 of yacc.c */ #line 280 "parser.y" {ACTION((yyval.tuple), FORGET, (yyvsp[(2) - (2)].node));} break; case 23: /* Line 1455 of yacc.c */ #line 281 "parser.y" {ACTION((yyval.tuple), RESUME, (yyvsp[(2) - (2)].node));} break; case 24: /* Line 1455 of yacc.c */ #line 282 "parser.y" {ACTION((yyval.tuple), STASH, rlist);} break; case 25: /* Line 1455 of yacc.c */ #line 283 "parser.y" {ACTION((yyval.tuple), RETRIEVE, rlist);} break; case 26: /* Line 1455 of yacc.c */ #line 284 "parser.y" {ACTION((yyval.tuple), IGNORE, rlist);} break; case 27: /* Line 1455 of yacc.c */ #line 285 "parser.y" {ACTION((yyval.tuple), REMEMBER, rlist);} break; case 28: /* Line 1455 of yacc.c */ #line 286 "parser.y" {stbeginline=0; TARGET((yyval.tuple), ABSTAIN, (yyvsp[(3) - (3)].numval));} break; case 29: /* Line 1455 of yacc.c */ #line 287 "parser.y" {ACTION((yyval.tuple), DISABLE, rlist);} break; case 30: /* Line 1455 of yacc.c */ #line 288 "parser.y" {/* AIS */ NEWFANGLED {stbeginline=0; ACTARGET((yyval.tuple), FROM, (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].numval));}} break; case 31: /* Line 1455 of yacc.c */ #line 289 "parser.y" {/* AIS */ NEWFANGLED {(yyval.tuple) = newtuple(); (yyval.tuple)->type = MANYFROM; (yyval.tuple)->ick_lineno = thisline; \ {node* tempnode=newnode(); (yyval.tuple)->u.node = tempnode; tempnode->lval=(yyvsp[(2) - (4)].node); tempnode->rval=rlist; tempnode->opcode=MANYFROM;}}} break; case 32: /* Line 1455 of yacc.c */ #line 291 "parser.y" {stbeginline=0; TARGET((yyval.tuple), REINSTATE, (yyvsp[(2) - (2)].numval));} break; case 33: /* Line 1455 of yacc.c */ #line 292 "parser.y" {ACTION((yyval.tuple), ENABLE, rlist);} break; case 34: /* Line 1455 of yacc.c */ #line 293 "parser.y" {ACTION((yyval.tuple), WRITE_IN, (yyvsp[(2) - (2)].node));} break; case 35: /* Line 1455 of yacc.c */ #line 294 "parser.y" {ACTION((yyval.tuple), READ_OUT, (yyvsp[(2) - (2)].node));} break; case 36: /* Line 1455 of yacc.c */ #line 295 "parser.y" {ACTION((yyval.tuple), PIN, (yyvsp[(2) - (2)].node));} break; case 37: /* Line 1455 of yacc.c */ #line 296 "parser.y" {ACTION((yyval.tuple), GIVE_UP, 0);} break; case 38: /* Line 1455 of yacc.c */ #line 297 "parser.y" {/* AIS */ NEWFANGLED {ACTION((yyval.tuple), GO_AHEAD, 0);}} break; case 39: /* Line 1455 of yacc.c */ #line 298 "parser.y" {/* AIS */ NEWFANGLED {ACTION((yyval.tuple), GO_BACK, 0);}} break; case 40: /* Line 1455 of yacc.c */ #line 299 "parser.y" {/* AIS */ NEWFANGLED {ACTION((yyval.tuple),TRY_AGAIN,0);}} break; case 41: /* Line 1455 of yacc.c */ #line 300 "parser.y" {/* AIS: Modified */ NEWFANGLED {TARGET((yyval.tuple),COME_FROM,(yyvsp[(1) - (1)].numval));}} break; case 42: /* Line 1455 of yacc.c */ #line 301 "parser.y" {/* AIS: COME FROM gerund */ NEWFANGLED{ACTION((yyval.tuple),GERUCOME,rlist); compucomesused=1; gerucomesused=1;}} break; case 43: /* Line 1455 of yacc.c */ #line 304 "parser.y" {/* AIS */NEWFANGLED {ACTION((yyval.tuple),COMPUCOME,(yyvsp[(2) - (2)].node)); compucomesused=1;}} break; case 44: /* Line 1455 of yacc.c */ #line 307 "parser.y" {NEWFANGLED {TARGET((yyval.tuple),NEXTFROMLABEL,(yyvsp[(1) - (1)].numval));} nextfromsused=1;} break; case 45: /* Line 1455 of yacc.c */ #line 309 "parser.y" {NEWFANGLED{ACTION((yyval.tuple),NEXTFROMGERUND,rlist); compucomesused=1; gerucomesused=1;} nextfromsused=1;} break; case 46: /* Line 1455 of yacc.c */ #line 312 "parser.y" {NEWFANGLED {ACTION((yyval.tuple),NEXTFROMEXPR,(yyvsp[(2) - (2)].node)); compucomesused=1; nextfromsused=1;}} break; case 47: /* Line 1455 of yacc.c */ #line 315 "parser.y" {NEWFANGLED{ACTARGET((yyval.tuple),CREATE,(yyvsp[(2) - (2)].node),(yyvsp[(1) - (2)].numval)); cacsofar=0;}} break; case 48: /* Line 1455 of yacc.c */ #line 316 "parser.y" {NEWFANGLED{ACTION((yyval.tuple),COMPUCREATE, cons(INTERSECTION,(yyvsp[(2) - (3)].node),(yyvsp[(3) - (3)].node))); cacsofar=0;}} break; case 49: /* Line 1455 of yacc.c */ #line 319 "parser.y" {NEWFANGLED{ACTARGET((yyval.tuple),CREATE,(yyvsp[(2) - (2)].node),(yyvsp[(1) - (2)].numval)); cacsofar=0;}} break; case 50: /* Line 1455 of yacc.c */ #line 322 "parser.y" {NEWFANGLED{ACTION((yyval.tuple),COMPUCREATE, cons(INTERSECTION,(yyvsp[(2) - (3)].node),(yyvsp[(3) - (3)].node))); cacsofar=0;}} break; case 51: /* Line 1455 of yacc.c */ #line 325 "parser.y" {NEWFANGLED {ACTION((yyval.tuple),UNKNOWN,(yyvsp[(1) - (1)].node)); cacsofar=0;}} break; case 52: /* Line 1455 of yacc.c */ #line 327 "parser.y" {yyclearin; yyerrok; (yyval.tuple) = splat(1); cacsofar=0;} break; case 53: /* Line 1455 of yacc.c */ #line 328 "parser.y" {yyclearin; yyerrok; (yyval.tuple) = splat(1); cacsofar=0;} break; case 54: /* Line 1455 of yacc.c */ #line 333 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node); intern(ick_TWOSPOT,cacsofar+++1601);} break; case 55: /* Line 1455 of yacc.c */ #line 334 "parser.y" {(yyval.node)=cons(INTERSECTION,(yyvsp[(1) - (2)].node),(yyvsp[(2) - (2)].node)); intern(ick_TWOSPOT,cacsofar+++1601);} break; case 56: /* Line 1455 of yacc.c */ #line 336 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 57: /* Line 1455 of yacc.c */ #line 339 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 58: /* Line 1455 of yacc.c */ #line 340 "parser.y" {(yyval.node)=cons(INTERSECTION,(yyvsp[(1) - (2)].node),(yyvsp[(2) - (2)].node));} break; case 59: /* Line 1455 of yacc.c */ #line 342 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 60: /* Line 1455 of yacc.c */ #line 343 "parser.y" {(yyval.node)=cons(INTERSECTION,(yyvsp[(1) - (2)].node),(yyvsp[(2) - (2)].node));} break; case 61: /* Line 1455 of yacc.c */ #line 348 "parser.y" {(yyval.node)=cons(US_ELEM,0,(yyvsp[(1) - (1)].node)); if(createsused){ opoverused=1; if(!firstslat) firstslat=(yyvsp[(1) - (1)].node); else prevslat->nextslat=(yyvsp[(1) - (1)].node); prevslat=(yyvsp[(1) - (1)].node); (yyvsp[(1) - (1)].node)->nextslat=0;}} break; case 62: /* Line 1455 of yacc.c */ #line 355 "parser.y" {(yyval.node)=cons(US_SCALAR,0,(yyvsp[(1) - (1)].node)); if(createsused){ opoverused=1; if(!firstslat) firstslat=(yyvsp[(1) - (1)].node); else prevslat->nextslat=(yyvsp[(1) - (1)].node); prevslat=(yyvsp[(1) - (1)].node); (yyvsp[(1) - (1)].node)->nextslat=0;}} break; case 63: /* Line 1455 of yacc.c */ #line 362 "parser.y" {(yyval.node)=cons(US_EXPR,0,(yyvsp[(1) - (1)].node)); if(createsused){ opoverused=1; if(!firstslat) firstslat=(yyvsp[(1) - (1)].node); else prevslat->nextslat=(yyvsp[(1) - (1)].node); prevslat=(yyvsp[(1) - (1)].node); (yyvsp[(1) - (1)].node)->nextslat=0;}} break; case 64: /* Line 1455 of yacc.c */ #line 369 "parser.y" {(yyval.node)=cons(US_ARRVAR,0,(yyvsp[(1) - (1)].node));} break; case 65: /* Line 1455 of yacc.c */ #line 372 "parser.y" {(yyval.node)=newnode(); (yyval.node)->opcode=US_ID; (yyval.node)->constant=(yyvsp[(1) - (1)].numval);} break; case 66: /* Line 1455 of yacc.c */ #line 377 "parser.y" {rlist = np = newnode(); np->constant = (yyvsp[(1) - (1)].numval);} break; case 67: /* Line 1455 of yacc.c */ #line 379 "parser.y" { np->rval = newnode(); np = np->rval; np->constant = (yyvsp[(3) - (3)].numval); } break; case 72: /* Line 1455 of yacc.c */ #line 392 "parser.y" { (yyval.node) = newnode(); (yyval.node)->opcode = ick_TWOSPOT; (yyval.node)->constant = intern(ick_TWOSPOT, (yyvsp[(2) - (2)].numval)); } break; case 73: /* Line 1455 of yacc.c */ #line 398 "parser.y" { (yyval.node) = newnode(); (yyval.node)->opcode = ick_ONESPOT; (yyval.node)->constant = intern(ick_ONESPOT, (yyvsp[(2) - (2)].numval)); } break; case 74: /* Line 1455 of yacc.c */ #line 404 "parser.y" { (yyval.node) = newnode(); (yyval.node)->opcode = ick_TWOSPOT; (yyval.node)->constant = intern(ick_TWOSPOT, (yyvsp[(2) - (2)].numval)); } break; case 75: /* Line 1455 of yacc.c */ #line 412 "parser.y" { (yyval.node) = newnode(); (yyval.node)->opcode = ick_TAIL; (yyval.node)->constant = intern(ick_TAIL, (yyvsp[(2) - (2)].numval)); } break; case 76: /* Line 1455 of yacc.c */ #line 418 "parser.y" { (yyval.node) = newnode(); (yyval.node)->opcode = ick_HYBRID; (yyval.node)->constant = intern(ick_HYBRID, (yyvsp[(2) - (2)].numval)); } break; case 77: /* Line 1455 of yacc.c */ #line 428 "parser.y" { (yyval.node) = newnode(); (yyval.node)->opcode = (yyvsp[(2) - (3)].numval); (yyval.node)->rval = newnode(); (yyval.node)->rval->opcode = ick_TAIL; (yyval.node)->rval->constant = intern(ick_TAIL, (yyvsp[(3) - (3)].numval)); } break; case 78: /* Line 1455 of yacc.c */ #line 436 "parser.y" { (yyval.node) = newnode(); (yyval.node)->opcode = (yyvsp[(2) - (3)].numval); (yyval.node)->rval = newnode(); (yyval.node)->rval->opcode = ick_HYBRID; (yyval.node)->rval->constant = intern(ick_HYBRID, (yyvsp[(3) - (3)].numval)); } break; case 79: /* Line 1455 of yacc.c */ #line 447 "parser.y" { /* enforce the 16-bit constant constraint */ if ((unsigned int)(yyvsp[(2) - (2)].numval) > ick_Max_small) ick_lose(IE017, iyylineno, (char *)NULL); (yyval.node) = newnode(); (yyval.node)->opcode = MESH; if(variableconstants) /* AIS */ (yyval.node)->constant = intern(MESH, (yyvsp[(2) - (2)].numval)); else (yyval.node)->constant = (yyvsp[(2) - (2)].numval); } break; case 80: /* Line 1455 of yacc.c */ #line 461 "parser.y" {rlist = np = (yyvsp[(1) - (1)].node);} break; case 81: /* Line 1455 of yacc.c */ #line 462 "parser.y" {np = np->rval = (yyvsp[(3) - (3)].node); /* newnode(); */ } break; case 85: /* Line 1455 of yacc.c */ #line 469 "parser.y" {(yyval.node)=cons(INTERSECTION,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} break; case 86: /* Line 1455 of yacc.c */ #line 470 "parser.y" {(yyval.node)=cons(INTERSECTION,(yyvsp[(1) - (1)].node),0);} break; case 91: /* Line 1455 of yacc.c */ #line 476 "parser.y" {(yyval.node)=cons(INTERSECTION,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} break; case 92: /* Line 1455 of yacc.c */ #line 477 "parser.y" {(yyval.node)=cons(INTERSECTION,(yyvsp[(1) - (1)].node),0);} break; case 93: /* Line 1455 of yacc.c */ #line 483 "parser.y" {(yyval.node) = cons(BY, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} break; case 94: /* Line 1455 of yacc.c */ #line 484 "parser.y" {(yyval.node) = cons(BY, (yyvsp[(1) - (1)].node), 0);} break; case 95: /* Line 1455 of yacc.c */ #line 488 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 96: /* Line 1455 of yacc.c */ #line 489 "parser.y" {(yyval.node) = cons(SUB, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} break; case 97: /* Line 1455 of yacc.c */ #line 491 "parser.y" {(yyval.node) = cons(SUB, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} break; case 98: /* Line 1455 of yacc.c */ #line 493 "parser.y" {(yyval.node) = cons(INTERSECTION, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node));} break; case 99: /* Line 1455 of yacc.c */ #line 494 "parser.y" {(yyval.node) = cons(INTERSECTION, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node));} break; case 100: /* Line 1455 of yacc.c */ #line 496 "parser.y" {(yyval.node) = cons(INTERSECTION, (yyvsp[(1) - (1)].node), 0);} break; case 101: /* Line 1455 of yacc.c */ #line 497 "parser.y" {(yyval.node) = cons(INTERSECTION, (yyvsp[(1) - (1)].node), 0);} break; case 102: /* Line 1455 of yacc.c */ #line 498 "parser.y" {(yyval.node) = cons(INTERSECTION, (yyvsp[(1) - (1)].node), 0);} break; case 103: /* Line 1455 of yacc.c */ #line 502 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 104: /* Line 1455 of yacc.c */ #line 504 "parser.y" {(yyval.node) = (yyvsp[(1) - (3)].node); (yyval.node)->rval = cons(SUB, (yyval.node)->rval, (yyvsp[(3) - (3)].node));} break; case 105: /* Line 1455 of yacc.c */ #line 507 "parser.y" {(yyval.node) = (yyvsp[(1) - (3)].node); (yyval.node)->rval = cons(SUB, (yyval.node)->rval, (yyvsp[(3) - (3)].node));} break; case 106: /* Line 1455 of yacc.c */ #line 511 "parser.y" {(yyval.node) = newnode(); (yyval.node)->opcode = BADCHAR; (yyval.node)->constant = (yyvsp[(1) - (1)].numval);} break; case 107: /* Line 1455 of yacc.c */ #line 516 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 108: /* Line 1455 of yacc.c */ #line 519 "parser.y" {(yyval.node) = cons(SELECT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} break; case 109: /* Line 1455 of yacc.c */ #line 520 "parser.y" {(yyval.node) = cons(MINGLE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} break; case 110: /* Line 1455 of yacc.c */ #line 521 "parser.y" {(yyval.node) = cons(UNKNOWNOP, (yyvsp[(2) - (3)].node), cons(INTERSECTION, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node))); if(useickec && createsused) { if(!firstslat) firstslat=(yyvsp[(1) - (3)].node); else prevslat->nextslat=(yyvsp[(1) - (3)].node); (yyvsp[(1) - (3)].node)->nextslat=(yyvsp[(3) - (3)].node); prevslat=(yyvsp[(3) - (3)].node); (yyvsp[(3) - (3)].node)->nextslat=0; opoverused=1; intern(ick_TWOSPOT, 1601); intern(ick_TWOSPOT, 1602); intern(ick_TWOSPOT, 1603);}} break; case 111: /* Line 1455 of yacc.c */ #line 532 "parser.y" {NEWFANGLED{(yyval.node) = cons(SLAT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); opoverused=1; if(!firstslat) firstslat=(yyvsp[(3) - (3)].node); else prevslat->nextslat=(yyvsp[(3) - (3)].node); prevslat=(yyvsp[(3) - (3)].node); (yyvsp[(3) - (3)].node)->nextslat=0;}} break; case 112: /* Line 1455 of yacc.c */ #line 537 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 113: /* Line 1455 of yacc.c */ #line 538 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 114: /* Line 1455 of yacc.c */ #line 542 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 115: /* Line 1455 of yacc.c */ #line 543 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 116: /* Line 1455 of yacc.c */ #line 544 "parser.y" {(yyval.node) = cons(SELECT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} break; case 117: /* Line 1455 of yacc.c */ #line 545 "parser.y" {(yyval.node) = cons(MINGLE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} break; case 118: /* Line 1455 of yacc.c */ #line 546 "parser.y" {(yyval.node) = cons(UNKNOWNOP, (yyvsp[(2) - (3)].node), cons(INTERSECTION, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node))); if(useickec && createsused) { if(!firstslat) firstslat=(yyvsp[(1) - (3)].node); else prevslat->nextslat=(yyvsp[(1) - (3)].node); (yyvsp[(1) - (3)].node)->nextslat=(yyvsp[(3) - (3)].node); prevslat=(yyvsp[(3) - (3)].node); (yyvsp[(3) - (3)].node)->nextslat=0; opoverused=1; intern(ick_TWOSPOT, 1601); intern(ick_TWOSPOT, 1602); intern(ick_TWOSPOT, 1603);}} break; case 119: /* Line 1455 of yacc.c */ #line 556 "parser.y" {NEWFANGLED{(yyval.node) = cons(SLAT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); opoverused=1; if(!firstslat) firstslat=(yyvsp[(3) - (3)].node); else prevslat->nextslat=(yyvsp[(3) - (3)].node); prevslat=(yyvsp[(3) - (3)].node); (yyvsp[(3) - (3)].node)->nextslat=0;}} break; case 120: /* Line 1455 of yacc.c */ #line 564 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 121: /* Line 1455 of yacc.c */ #line 565 "parser.y" {(yyval.node) = cons(SELECT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} break; case 122: /* Line 1455 of yacc.c */ #line 566 "parser.y" {(yyval.node) = cons(MINGLE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} break; case 123: /* Line 1455 of yacc.c */ #line 567 "parser.y" {(yyval.node) = cons(UNKNOWNOP, (yyvsp[(2) - (3)].node), cons(INTERSECTION, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node))); if(useickec && createsused) { if(!firstslat) firstslat=(yyvsp[(1) - (3)].node); else prevslat->nextslat=(yyvsp[(1) - (3)].node); (yyvsp[(1) - (3)].node)->nextslat=(yyvsp[(3) - (3)].node); prevslat=(yyvsp[(3) - (3)].node); (yyvsp[(3) - (3)].node)->nextslat=0; opoverused=1; intern(ick_TWOSPOT, 1601); intern(ick_TWOSPOT, 1602); intern(ick_TWOSPOT, 1603);}} break; case 124: /* Line 1455 of yacc.c */ #line 577 "parser.y" {NEWFANGLED{(yyval.node) = cons(SLAT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); opoverused=1; if(!firstslat) firstslat=(yyvsp[(3) - (3)].node); else prevslat->nextslat=(yyvsp[(3) - (3)].node); prevslat=(yyvsp[(3) - (3)].node); (yyvsp[(3) - (3)].node)->nextslat=0;}} break; case 125: /* Line 1455 of yacc.c */ #line 582 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 126: /* Line 1455 of yacc.c */ #line 583 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 127: /* Line 1455 of yacc.c */ #line 587 "parser.y" {(yyval.numval)=MESH; } break; case 128: /* Line 1455 of yacc.c */ #line 587 "parser.y" {(yyval.numval)=ick_ONESPOT;} break; case 129: /* Line 1455 of yacc.c */ #line 587 "parser.y" {(yyval.numval)=ick_TWOSPOT;} break; case 130: /* Line 1455 of yacc.c */ #line 592 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 131: /* Line 1455 of yacc.c */ #line 595 "parser.y" { (yyval.node) = newnode(); (yyval.node)->opcode = (yyvsp[(2) - (3)].numval); (yyval.node)->rval = newnode(); (yyval.node)->rval->opcode = (yyvsp[(1) - (3)].numval); if((yyvsp[(1) - (3)].numval) == MESH) { /* enforce the 16-bit constant constraint */ if ((unsigned int)(yyvsp[(3) - (3)].numval) > ick_Max_small) ick_lose(IE017, iyylineno, (char *)NULL); if(variableconstants) /* AIS, patched by JH */ (yyval.node)->rval->constant = intern(MESH, (yyvsp[(3) - (3)].numval)); else (yyval.node)->rval->constant = (yyvsp[(3) - (3)].numval); } else { (yyval.node)->rval->constant = intern((yyvsp[(1) - (3)].numval), (yyvsp[(3) - (3)].numval)); } } break; case 132: /* Line 1455 of yacc.c */ #line 617 "parser.y" { (yyval.node) = newnode(); (yyval.node)->opcode = (yyvsp[(2) - (4)].numval); (yyval.node)->rval = (yyvsp[(3) - (4)].node); DESTACKSPARKEARS; } break; case 133: /* Line 1455 of yacc.c */ #line 624 "parser.y" { (yyval.node) = newnode(); (yyval.node)->opcode = (yyvsp[(2) - (4)].numval); (yyval.node)->rval = (yyvsp[(3) - (4)].node); DESTACKSPARKEARS; } break; case 134: /* Line 1455 of yacc.c */ #line 632 "parser.y" {(yyval.node) = (yyvsp[(2) - (3)].node); DESTACKSPARKEARS;} break; case 135: /* Line 1455 of yacc.c */ #line 633 "parser.y" {(yyval.node) = (yyvsp[(2) - (3)].node); DESTACKSPARKEARS;} break; case 136: /* Line 1455 of yacc.c */ #line 636 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 137: /* Line 1455 of yacc.c */ #line 637 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 138: /* Line 1455 of yacc.c */ #line 640 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 139: /* Line 1455 of yacc.c */ #line 642 "parser.y" {(yyval.node)=newnode(); (yyval.node)->opcode = (yyvsp[(1) - (2)].numval); (yyval.node)->rval = (yyvsp[(2) - (2)].node);} break; case 140: /* Line 1455 of yacc.c */ #line 651 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} break; case 141: /* Line 1455 of yacc.c */ #line 653 "parser.y" {(yyval.node)=newnode(); (yyval.node)->opcode = (yyvsp[(1) - (2)].numval); (yyval.node)->rval = (yyvsp[(2) - (2)].node);} break; /* Line 1455 of yacc.c */ #line 3013 "parser.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } /* Line 1675 of yacc.c */ #line 664 "parser.y" static tuple *splat(int gentuple) /* try to recover from an invalid statement. */ { tuple *sp; int tok, i; extern bool re_send_token; /* * The idea * here is to skip to the ick_next DO, PLEASE or label, then unget that token. * which we can do with a tricky flag on the lexer (re_send_token). */ if(re_send_token == true) /* By AIS */ { /* We're still cleaning up from the previous error. */ return prevtuple; } /* fprintf(stderr,"attempting to splat at line %d....\n",iyylineno); */ /* AIS: Set the flag to true the first time round, false for subsequent iterations. That way, if the error was triggered on a DO or label, we use that token as the start of the next statement. */ for(i = 0,re_send_token = true;;i++,re_send_token = false) { tok = lexer(); if (!tok) { re_send_token = true; tok = ' '; /* scanner must not see a NUL */ break; } else if (tok == DO || tok == PLEASE || tok == LABEL /* AIS */ || tok == MAYBE) { re_send_token = true; break; } } /* fprintf(stderr,"found %d on line %d after %d other tokens.\n", tok,iyylineno,i); */ /* generate a placeholder tuple for the text line */ if(gentuple /* AIS */) {TARGET(sp, SPLATTERED, 0); prevtuple=sp;} else sp=NULL; return(sp); } /* parser.y ends here */ intercal-0.30/PaxHeaders.27456/configure0000644000000000000000000000013212507267225014715 xustar0030 mtime=1427992213.515007083 30 atime=1427992213.555006973 30 ctime=1427992235.518945889 intercal-0.30/configure0000775000175000017500000062170112507267225014631 0ustar00esresr00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for C-INTERCAL 0.30. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and [ais523(with a $0: (comment))@nethack4.org] about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script $0: under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='C-INTERCAL' PACKAGE_TARNAME='intercal' PACKAGE_VERSION='0.30' PACKAGE_STRING='C-INTERCAL 0.30' PACKAGE_BUGREPORT='ais523(with a (comment))@nethack4.org' PACKAGE_URL='' ac_unique_file="src/perpet.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS INCLUDE_HIDDEN_FROM_AUTOMAKE HAVE__BOOL HAVE_STDBOOL_H HAVE_STDINT_H EGREP GREP CPP LN_S RANLIB LEXLIB LEX_OUTPUT_ROOT LEX ac_ct_AR AR am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC YFLAGS YACC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking ' ac_precious_vars='build_alias host_alias target_alias YACC YFLAGS CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures C-INTERCAL 0.30 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/intercal] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of C-INTERCAL 0.30:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors Some influential environment variables: YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF C-INTERCAL configure 0.30 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------------------------- ## ## Report this to ais523(with a (comment))@nethack4.org ## ## ---------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by C-INTERCAL $as_me 0.30, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h:buildaux/configh.in" ac_aux_dir= for ac_dir in buildaux "$srcdir"/buildaux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in buildaux \"$srcdir\"/buildaux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='intercal' VERSION='0.30' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5 $as_echo_n "checking how to create a pax tar archive... " >&6; } # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' _am_tools=${am_cv_prog_tar_pax-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=posix -chf - "'"$$tardir"' am__tar_="$_am_tar --format=posix -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x pax -w "$$tardir"' am__tar_='pax -L -x pax -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H pax -L' am__tar_='find "$tardir" -print | cpio -o -H pax -L' am__untar='cpio -i -H pax -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_pax}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if ${am_cv_prog_tar_pax+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_pax=$_am_tool fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5 $as_echo "$am_cv_prog_tar_pax" >&6; } PACKAGE_VERSION=0.29 for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" if test "x$YACC" == "xyacc"; then YACC= # Extract the first word of "yacc", so it can be a program name with args. set dummy yacc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} { $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 $as_echo "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi if test "x$ac_cv_header_stdbool_h" == "xyes" then HAVE_STDBOOL_H=1 fi for ac_header in sys/time.h unistd.h stdarg.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdint.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" if test "x$ac_cv_header_stdint_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H 1 _ACEOF HAVE_STDINT_H=1 fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } if ${ac_cv_c_volatile+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_volatile=yes else ac_cv_c_volatile=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 $as_echo "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then $as_echo "#define volatile /**/" >>confdefs.h fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5 $as_echo_n "checking size of long long int... " >&6; } if ${ac_cv_sizeof_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int" "$ac_includes_default"; then : else if test "$ac_cv_type_long_long_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long_int" >&5 $as_echo "$ac_cv_sizeof_long_long_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of sig_atomic_t" >&5 $as_echo_n "checking size of sig_atomic_t... " >&6; } if ${ac_cv_sizeof_sig_atomic_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (sig_atomic_t))" "ac_cv_sizeof_sig_atomic_t" "#include "; then : else if test "$ac_cv_type_sig_atomic_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (sig_atomic_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_sig_atomic_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_sig_atomic_t" >&5 $as_echo "$ac_cv_sizeof_sig_atomic_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SIG_ATOMIC_T $ac_cv_sizeof_sig_atomic_t _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether #! works in shell scripts" >&5 $as_echo_n "checking whether #! works in shell scripts... " >&6; } if ${ac_cv_sys_interpreter+:} false; then : $as_echo_n "(cached) " >&6 else echo '#! /bin/cat exit 69 ' >conftest chmod u+x conftest (SHELL=/bin/sh; export SHELL; ./conftest >/dev/null 2>&1) if test $? -ne 69; then ac_cv_sys_interpreter=yes else ac_cv_sys_interpreter=no fi rm -f conftest fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_interpreter" >&5 $as_echo "$ac_cv_sys_interpreter" >&6; } interpval=$ac_cv_sys_interpreter ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac # Some compilers (correctly according to the standard, but dubiously for # actual use in code) dislike mixing _Bool and varargs. if test "x$ac_cv_type__Bool" == "xyes" then HAVE__BOOL=1 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether booleans can be passed via varargs" >&5 $as_echo_n "checking whether booleans can be passed via varargs... " >&6; } if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown in a cross-compile, assuming no" >&5 $as_echo "unknown in a cross-compile, assuming no" >&6; } $as_echo "#define BOOL_VARARGS_BROKEN 1" >>confdefs.h else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef HAVE_STDARG_H #include void test(int x, ...) #else #include void test(va_alist) va_dcl #endif { int y,z; _Bool b; va_list ap; #ifdef HAVE_STDARG_H va_start(ap, x); y = x; #else va_start(ap); y = va_arg(ap, int); #endif b = va_arg(ap, _Bool); z = va_arg(ap, int); if(b && x != z) exit(2); if(!b && x == z) exit(3); } int main () { _Bool match = (_Bool)1; _Bool nomatch = (_Bool) 0; test(12345,match,12345); test(23456,nomatch,1234); exit(0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define BOOL_VARARGS_BROKEN 1" >>confdefs.h fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yyrestart() is needed" >&5 $as_echo_n "checking whether yyrestart() is needed... " >&6; } # Write a lex program that will cause an error if yyrestart exists. echo '%% %% float yyrestart(int, ...);' | $LEX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "${LEX_OUTPUT_ROOT}.c" int main () { exit(0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else $as_echo "#define NEED_YYRESTART 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f ${LEX_OUTPUT_ROOT}.c if test "$interpval" != "no"; then $as_echo "#define HAVE_SYS_INTERPRETER 1" >>confdefs.h fi cat >>confdefs.h <<_ACEOF #define EXEEXT "$EXEEXT" _ACEOF for ac_func in gettimeofday gethrtime strdup strtol strtoul snprintf vsnprintf isatty do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ICK_SAVECFLAGS=$CFLAGS CFLAGS="$CFLAGS -lrt" for ac_func in clock_gettime do : ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" if test "x$ac_cv_func_clock_gettime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CLOCK_GETTIME 1 _ACEOF fi done CFLAGS=$ICK_SAVECFLAGS INCLUDE_HIDDEN_FROM_AUTOMAKE="include" ac_config_files="$ac_config_files Makefile:buildaux/Makefile.in coopt.sh:src/cooptsh.in host.mak:buildaux/hostmak.in abcess.h:src/abcessh.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by C-INTERCAL $as_me 0.30, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ C-INTERCAL config.status 0.30 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:buildaux/configh.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:buildaux/Makefile.in" ;; "coopt.sh") CONFIG_FILES="$CONFIG_FILES coopt.sh:src/cooptsh.in" ;; "host.mak") CONFIG_FILES="$CONFIG_FILES host.mak:buildaux/hostmak.in" ;; "abcess.h") CONFIG_FILES="$CONFIG_FILES abcess.h:src/abcessh.in" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi # After the output, chmod coopt.sh to be executable. chmod a+x coopt.sh # Use prebuilt files if necessary, after config.h is generated. # Automake is capable of handling the files in question, but they need to # be in the directory configure was run in. if test ! -n "$LEX" || echo "$LEX" | grep missing > /dev/null 2>&1; then cp $srcdir/prebuilt/lexer.c $ac_pwd/src/lexer.c { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No version of lex was found; using prebuilt lexer." >&5 $as_echo "$as_me: WARNING: No version of lex was found; using prebuilt lexer." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Changes to src/lexer.l will be ignored." >&5 $as_echo "$as_me: WARNING: Changes to src/lexer.l will be ignored." >&2;} fi if test ! -n "$YACC" || echo "$YACC" | grep missing > /dev/null 2>&1; then cp $srcdir/prebuilt/parser.c $ac_pwd/src/parser.c cp $srcdir/prebuilt/parser.h $ac_pwd/src/parser.h cp $srcdir/prebuilt/oil-oil.c $ac_pwd/src/oil-oil.c { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No version of yacc was found; using prebuilt parser." >&5 $as_echo "$as_me: WARNING: No version of yacc was found; using prebuilt parser." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Changes to src/parser.y and src/oil.y will be ingored." >&5 $as_echo "$as_me: WARNING: Changes to src/parser.y and src/oil.y will be ingored." >&2;} fi # Configure again, for the build system, if necessary. # It's simpler the second time round as we don't care about things like # installation dirs, just about how to do things like run the compiler. if test "$cross_compiling" != yes; then cp config.h bconfig.h exit 0 fi cd $ac_pwd; # This trick for unsetting variables comes from the autoconf manual # "|| exit" suppresses any "Segmentation fault" message. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then unset=unset else unset=false fi BUILD_CC_ARG="FOO=BAR" if test ! "x$CC_FOR_BUILD" == x; then BUILD_CC_ARG="CC=$CC_FOR_BUILD"; fi CC=foo $unset CC || CC='' BUILD_CFLAGS_ARG="FOO=BAR" if test ! "x$CFLAGS_FOR_BUILD" == x; then BUILD_CFLAGS_ARG="CFLAGS=$CFLAGS_FOR_BUILD"; fi CFLAGS=foo $unset CFLAGS || CFLAGS='' BUILD_LDFLAGS_ARG="FOO=BAR" if test ! "x$LDFLAGS_FOR_BUILD" == x; then BUILD_LDFLAGS_ARG="LDFLAGS=$LDFLAGS_FOR_BUILD"; fi LDFLAGS=foo $unset LDFLAGS || LDFLAGS='' BUILD_LIBS_ARG="FOO=BAR" if test ! "x$LIBS_FOR_BUILD" == x; then BUILD_LIBS_ARG="LIBS=$LIBS_FOR_BUILD"; fi LIBS=foo $unset LIBS || LIBS='' BUILD_CPPFLAGS_ARG="FOO=BAR" if test ! "x$CPPFLAGS_FOR_BUILD" == x; then BUILD_CPPFLAGS_ARG="CPPFLAGS=$CPPFLAGS_FOR_BUILD"; fi CPPFLAGS=foo $unset CPPFLAGS || CPPFLAGS='' BUILD_CPP_ARG="FOO=BAR" if test ! "x$CPP_FOR_BUILD" == x; then BUILD_CPP_ARG="CPP=$CPP_FOR_BUILD"; fi CPP=foo $unset CPP || CPP='' BUILD_MACHINE_ARG="FOO=BAR" if test ! "x$build_alias" == x; then BUILD_MACHINE_ARG="--build=$build_alias" fi # Run the new configure script. mv config.status config.status.save (env -i "PATH=$PATH" $srcdir/buildaux/buildconfig "$BUILD_MACHINE_ARG" "$BUILD_CC_ARG" "$BUILD_CFLAGS_ARG" "$BUILD_LDFLAGS_ARG" "$BUILD_LIBS_ARG" "$BUILD_CPPFLAGS_ARG" "$BUILD_CPP_ARG") mv config.status config.status.build mv config.status.save config.status intercal-0.30/PaxHeaders.27456/buildaux0000644000000000000000000000012612507267253014555 xustar0028 mtime=1427992235.6589455 30 atime=1427992237.754939663 28 ctime=1427992235.6589455 intercal-0.30/buildaux/0000775000175000017500000000000012507267253014531 5ustar00esresr00000000000000intercal-0.30/buildaux/PaxHeaders.27456/buildconfig0000644000000000000000000000013212507242131017023 xustar0030 mtime=1427981401.583961212 30 atime=1417959275.625219841 30 ctime=1427992235.646945528 intercal-0.30/buildaux/buildconfig0000755000175000017500000053652112507242131016742 0ustar00esresr00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for C-INTERCAL 0.29. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and [ais523(with a $0: (comment))@nethack4.org] about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script $0: under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='C-INTERCAL' PACKAGE_TARNAME='intercal' PACKAGE_VERSION='0.29' PACKAGE_STRING='C-INTERCAL 0.29' PACKAGE_BUGREPORT='ais523(with a (comment))@nethack4.org' PACKAGE_URL='' ac_unique_file="../src/oil.h" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS HAVE_STDINT_H EGREP GREP CPP LN_S RANLIB LEXLIB LEX_OUTPUT_ROOT LEX YFLAGS YACC OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC ac_ct_AR AR target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS YACC YFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures C-INTERCAL 0.29 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/intercal] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of C-INTERCAL 0.29:";; esac cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF C-INTERCAL configure 0.29 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------------------------- ## ## Report this to ais523(with a (comment))@nethack4.org ## ## ---------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by C-INTERCAL $as_me 0.29, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers bconfig.h:../buildaux/bconfigh.in" ac_aux_dir= for ac_dir in . "$srcdir"/.; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} { $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 $as_echo "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/time.h unistd.h stdarg.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdint.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" if test "x$ac_cv_header_stdint_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H 1 _ACEOF HAVE_STDINT_H=1 fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } if ${ac_cv_c_volatile+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_volatile=yes else ac_cv_c_volatile=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 $as_echo "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then $as_echo "#define volatile /**/" >>confdefs.h fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5 $as_echo_n "checking size of long long int... " >&6; } if ${ac_cv_sizeof_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int" "$ac_includes_default"; then : else if test "$ac_cv_type_long_long_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long_int" >&5 $as_echo "$ac_cv_sizeof_long_long_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of _Bool" >&5 $as_echo_n "checking size of _Bool... " >&6; } if ${ac_cv_sizeof__Bool+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (_Bool))" "ac_cv_sizeof__Bool" "$ac_includes_default"; then : else if test "$ac_cv_type__Bool" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (_Bool) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof__Bool=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof__Bool" >&5 $as_echo "$ac_cv_sizeof__Bool" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF__BOOL $ac_cv_sizeof__Bool _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether #! works in shell scripts" >&5 $as_echo_n "checking whether #! works in shell scripts... " >&6; } if ${ac_cv_sys_interpreter+:} false; then : $as_echo_n "(cached) " >&6 else echo '#! /bin/cat exit 69 ' >conftest chmod u+x conftest (SHELL=/bin/sh; export SHELL; ./conftest >/dev/null 2>&1) if test $? -ne 69; then ac_cv_sys_interpreter=yes else ac_cv_sys_interpreter=no fi rm -f conftest fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_interpreter" >&5 $as_echo "$ac_cv_sys_interpreter" >&6; } interpval=$ac_cv_sys_interpreter ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yyrestart() is needed" >&5 $as_echo_n "checking whether yyrestart() is needed... " >&6; } # Write a lex program that will cause an error if yyrestart exists. echo '%% %% float yyrestart(int, ...);' | $LEX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "${LEX_OUTPUT_ROOT}.c" int main () { exit(0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else $as_echo "#define NEED_YYRESTART /**/" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f ${LEX_OUTPUT_ROOT}.c for ac_func in gettimeofday gethrtime strdup strtol strtoul snprintf isatty do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "$interpval" != "no"; then $as_echo "#define HAVE_SYS_INTERPRETER /**/" >>confdefs.h fi cat >>confdefs.h <<_ACEOF #define EXEEXT "$EXEEXT" _ACEOF ac_config_files="$ac_config_files host.mak:hostmak.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by C-INTERCAL $as_me 0.29, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ C-INTERCAL config.status 0.29 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "bconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS bconfig.h:../buildaux/bconfigh.in" ;; "host.mak") CONFIG_FILES="$CONFIG_FILES host.mak:hostmak.in" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi intercal-0.30/buildaux/PaxHeaders.27456/bconfigh.in0000644000000000000000000000013012507242131016720 xustar0030 mtime=1427981401.191962531 30 atime=1427981401.191962531 28 ctime=1427992235.6589455 intercal-0.30/buildaux/bconfigh.in0000664000175000017500000000652212507242131016631 0ustar00esresr00000000000000/* ../buildaux/bconfigh.in. Generated from buildconfig.ac by autoheader. */ /* Extension to use on executable files. */ #undef EXEEXT /* Define to 1 if you have the `gethrtime' function. */ #undef HAVE_GETHRTIME /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `isatty' function. */ #undef HAVE_ISATTY /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define if #! works on your system. */ #undef HAVE_SYS_INTERPRETER /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define if yyrestart() is necessary to yyparse a new file. */ #undef NEED_YYRESTART /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `long long int', as computed by sizeof. */ #undef SIZEOF_LONG_LONG_INT /* The size of `_Bool', as computed by sizeof. */ #undef SIZEOF__BOOL /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ #undef volatile intercal-0.30/buildaux/PaxHeaders.27456/buildconfig.ac0000644000000000000000000000013212507155722017416 xustar0030 mtime=1427954642.770849026 30 atime=1427954642.862848705 30 ctime=1427992235.650945522 intercal-0.30/buildaux/buildconfig.ac0000664000175000017500000000352712507155722017327 0ustar00esresr00000000000000dnl -*- autoconf -*- dnl Process this file with autoconf to produce a configure script. dnl Yes, that is a valid email address. If your mailer doesn't support nested dnl comments, then get a better mailer. AC_INIT([C-INTERCAL],[0.29],[[ais523(with a (comment))@nethack4.org]],[intercal]) AC_CONFIG_SRCDIR([../src/oil.h]) AC_CONFIG_HEADERS([bconfig.h:../buildaux/bconfigh.in]) AC_CONFIG_AUX_DIR([.]) dnl Checks for programs. AM_PROG_AR AC_PROG_YACC AC_PROG_CC AM_PROG_LEX AC_PROG_RANLIB AC_PROG_LN_S dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([sys/time.h unistd.h stdarg.h]) AC_CHECK_HEADERS([stdint.h],[HAVE_STDINT_H=1]) AC_SUBST(HAVE_STDINT_H) dnl Checks for typedefs, structures, and compiler characteristics. dnl This Autoconf input is compatible with pre-C99 Autoconf, so to dnl check for long long AC_CHECK_SIZEOF is used to test for a nonzero result, dnl likewise for _Bool. AC_C_CONST AC_C_VOLATILE AC_CHECK_SIZEOF([long long int],[0]) AC_CHECK_SIZEOF([_Bool],[0]) AC_HEADER_TIME AC_SYS_INTERPRETER AC_TYPE_SIZE_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_MSG_CHECKING([[whether yyrestart() is needed]]) # Write a lex program that will cause an error if yyrestart exists. echo '%% %% float yyrestart(int, ...);' | $LEX AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "${LEX_OUTPUT_ROOT}.c" ]], [[exit(0);]])],[AC_MSG_RESULT(no)],[AC_DEFINE([NEED_YYRESTART],dnl [],[Define if yyrestart() is necessary to yyparse a new file.]) AC_MSG_RESULT(yes)]) rm -f ${LEX_OUTPUT_ROOT}.c dnl Checks for library functions. AC_CHECK_FUNCS(gettimeofday gethrtime strdup strtol strtoul snprintf isatty) if test "$interpval" != "no"; then AC_DEFINE([HAVE_SYS_INTERPRETER], [], [Define if #! works on your system.]) fi AC_DEFINE_UNQUOTED([EXEEXT],"$EXEEXT",[Extension to use on executable files.]) AC_CONFIG_FILES([host.mak:hostmak.in]) AC_OUTPUT intercal-0.30/buildaux/PaxHeaders.27456/missing0000644000000000000000000000007411437552002016216 xustar0030 atime=1427981394.675984442 30 ctime=1427992235.654945506 intercal-0.30/buildaux/missing0000755000175000017500000002623311437552002016122 0ustar00esresr00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: intercal-0.30/buildaux/PaxHeaders.27456/Makefile.am0000644000000000000000000000013212507156035016656 xustar0030 mtime=1427954717.158591883 30 atime=1427954717.162591875 30 ctime=1427992235.510945911 intercal-0.30/buildaux/Makefile.am0000664000175000017500000003105112507156035016560 0ustar00esresr00000000000000ICK_SPECIFIC_SUBDIR = ick-@PACKAGE_VERSION@ ickincludedir = $(includedir)/$(ICK_SPECIFIC_SUBDIR) ickdatadir = $(datadir)/$(ICK_SPECIFIC_SUBDIR) AM_CFLAGS = '-DICKINCLUDEDIR="$(ickincludedir)"' \ '-DICKDATADIR="$(ickdatadir)"' \ '-DICKBINDIR="$(bindir)"' '-DICKLIBDIR="$(libdir)"' \ -DYYDEBUG -DICK_HAVE_STDINT_H=@HAVE_STDINT_H@ AM_CPPFLAGS = -I$(srcdir)/src bin_PROGRAMS = ick convickt ick_SOURCES = src/feh2.c src/dekludge.c src/ick_lose.c \ src/fiddle.c src/perpet.c src/uncommon.c nodist_ick_SOURCES = parser.y lexer.l parser.y : src/parser.y $(LN_S) -f `test -f 'src/parser.y' || echo '$(srcdir)/'`src/parser.y parser.y lexer.l : src/lexer.l $(LN_S) -f `test -f 'src/lexer.l' || echo '$(srcdir)/'`src/lexer.l lexer.l ick-wrap.c : src/ick-wrap.c $(LN_S) -f `test -f 'src/ick-wrap.c' || echo '$(srcdir)/'`src/ick-wrap.c ick-wrap.c pickwrap.c : src/pickwrap.c $(LN_S) -f `test -f 'src/pickwrap.c' || echo '$(srcdir)/'`src/pickwrap.c pickwrap.c syslib.i : pit/lib/syslib.i $(LN_S) -f `test -f 'pit/lib/syslib.i' || echo '$(srcdir)/'`pit/lib/syslib.i syslib.i syslib3.3i : pit/lib/syslib3.3i $(LN_S) -f `test -f 'pit/lib/syslib.3i' || echo '$(srcdir)/'`pit/lib/syslib3.3i syslib3.3i syslib4.4i : pit/lib/syslib4.4i $(LN_S) -f `test -f 'pit/lib/syslib.4i' || echo '$(srcdir)/'`pit/lib/syslib4.4i syslib4.4i syslib5.5i : pit/lib/syslib5.5i $(LN_S) -f `test -f 'pit/lib/syslib.5i' || echo '$(srcdir)/'`pit/lib/syslib5.5i syslib5.5i syslib6.6i : pit/lib/syslib6.6i $(LN_S) -f `test -f 'pit/lib/syslib.6i' || echo '$(srcdir)/'`pit/lib/syslib6.6i syslib6.6i syslib7.7i : pit/lib/syslib7.7i $(LN_S) -f `test -f 'pit/lib/syslib.7i' || echo '$(srcdir)/'`pit/lib/syslib7.7i syslib7.7i floatlib.i : pit/lib/floatlib.i $(LN_S) -f `test -f 'pit/lib/floatlib.i' || echo '$(srcdir)/'`pit/lib/floatlib.i floatlib.i ecto_b98.c : pit/explib/ecto_b98.c $(LN_S) -f `test -f 'pit/explib/ecto_b98.c' || echo '$(srcdir)/'`pit/explib/ecto_b98.c ecto_b98.c ick_ec.h : src/ick_ec.h $(LN_S) -f `test -f 'src/ick_ec.h' || echo '$(srcdir)/'`src/ick_ec.h ick_ec.h ick_lose.h : src/ick_lose.h $(LN_S) -f `test -f 'src/ick_lose.h' || echo '$(srcdir)/'`src/ick_lose.h ick_lose.h fiddle.h : src/fiddle.h $(LN_S) -f `test -f 'src/fiddle.h' || echo '$(srcdir)/'`src/fiddle.h fiddle.h ick_bool.h : src/ick_bool.h $(LN_S) -f `test -f 'src/ick_bool.h' || echo '$(srcdir)/'`src/ick_bool.h ick_bool.h yuk.h : src/yuk.h $(LN_S) -f `test -f 'src/ick-ec.h' || echo '$(srcdir)/'`src/yuk.h yuk.h ick_LDADD = libidiot.a AM_YFLAGS = -d # BUILT_SOURCES is used both to make sure parser.h is built early, and to # create symlinks used by ick to find files if it's run without first being # installed. BUILT_SOURCES = parser.h ick-wrap.c pickwrap.c syslib.i syslib3.3i \ syslib4.4i syslib5.5i syslib6.6i syslib7.7i floatlib.i \ ecto_b98.c ick_ec.h fiddle.h ick_bool.h ick_lose.h yuk.h noinst_LIBRARIES = libidiot.a libidiot_a_SOURCES = src/idiotism.oil libidiot.a: src/idiotism.oil oil$(EXEEXT) src/oil.h src/sizes.h src/ick.h \ parser.h src/fiddle.h src/ick_lose.h src/feh.h ./oil$(EXEEXT) < `test -f 'src/idiotism.oil' || echo '$(srcdir)/'`src/idiotism.oil for oo in oilout*.c; do echo $$oo; $(COMPILE) -c $$oo; done $(AR) $(ARFLAGS) libidiot.a oilout*.o $(RANLIB) libidiot.a convickt_SOURCES = src/convickt.c src/clc-cset.c src/uncommon.c @INCLUDE_HIDDEN_FROM_AUTOMAKE@ ./host.mak noinst_PROGRAMS = oil bin2c oil_SOURCES = src/oil.y oil_YFLAGS = bin2c_SOURCES = src/bin2c.c oil$(EXEEXT_FOR_BUILD): src/oil-oil.c bconfig.h $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o oil$(EXEEXT_FOR_BUILD) src/oil-oil.c $(LIBS_FOR_BUILD) bin2c$(EXEEXT_FOR_BUILD): src/bin2c.c bconfig.h $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o bin2c$(EXEEXT_FOR_BUILD) `test -f 'src/bin2c.c' || echo '$(srcdir)/'`src/bin2c.c $(LIBS_FOR_BUILD) oil$(EXEEXT): bin2c$(EXEEXT): # Optional libraries are in lib_LIBRARIES, but with a null build rule. lib_LIBRARIES = libick.a libickmt.a libickec.a libyuk.a libick_ecto_b98.a libick_ecto_b98_a_SOURCES = libick_ecto_b98.a: etc/libick_ecto_b98.a -(test -f etc/libick_ecto_b98.a || test -f $(srcdir)/etc/libick_ecto_b98.a) && $(LN_S) -f `test -f 'etc/libick_ecto_b98.a' || echo '$(srcdir)/'`etc/libick_ecto_b98.a libick_ecto_b98.a etc/libick_ecto_b98.a: libick_a_SOURCES = src/cesspool.c src/numerals.c src/ick_lose.c src/fiddle.c \ src/arrgghh.c src/clc-cset.c src/uncommon.c libick_a_LIBADD = atari.o baudot.o ebcdic.o latin1.o libickmt_a_SOURCES = src/cesspool.c src/numerals.c src/ick_lose.c src/fiddle.c \ src/arrgghh.c src/clc-cset.c src/uncommon.c src/unravel.c libickmt_a_LIBADD = atari.o baudot.o ebcdic.o latin1.o libickec_a_SOURCES = src/cesspool.c src/numerals.c src/ick_lose.c src/fiddle.c \ src/arrgghh.c src/clc-cset.c src/uncommon.c src/ick_ec.c libickec_a_LIBADD = atari.o baudot.o ebcdic.o latin1.o libyuk_a_SOURCES = src/yuk.c atari.o: bin2c$(EXEEXT_FOR_BUILD) src/atari.bin ./bin2c$(EXEEXT_FOR_BUILD) ick_clc_cset_atari < `test -f 'src/atari.bin' || echo '$(srcdir)/'`src/atari.bin > atari.c $(COMPILE) -c atari.c baudot.o: bin2c$(EXEEXT_FOR_BUILD) src/baudot.bin ./bin2c$(EXEEXT_FOR_BUILD) ick_clc_cset_baudot < `test -f 'src/baudot.bin' || echo '$(srcdir)/'`src/baudot.bin > baudot.c $(COMPILE) -c baudot.c ebcdic.o: bin2c$(EXEEXT_FOR_BUILD) src/ebcdic.bin ./bin2c$(EXEEXT_FOR_BUILD) ick_clc_cset_ebcdic < `test -f 'src/ebcdic.bin' || echo '$(srcdir)/'`src/ebcdic.bin > ebcdic.c $(COMPILE) -c ebcdic.c latin1.o: bin2c$(EXEEXT_FOR_BUILD) src/latin1.bin ./bin2c$(EXEEXT_FOR_BUILD) ick_clc_cset_latin1 < `test -f 'src/latin1.bin' || echo '$(srcdir)/'`src/latin1.bin > latin1.c $(COMPILE) -c latin1.c ickinclude_HEADERS = src/ick_ec.h src/fiddle.h src/ick_lose.h src/yuk.h \ src/ick_bool.h nodist_ickinclude_HEADERS = config.h abcess.h dist_ickdata_DATA = src/atari.bin src/baudot.bin src/ebcdic.bin src/latin1.bin \ src/ick-wrap.c src/pickwrap.c COPYING # These necessary pit files are in nodist_ here because they're in EXTRA_DIST # later along with the rest of the pit. nodist_ickdata_DATA = pit/lib/syslib.i pit/lib/syslib3.3i pit/lib/syslib4.4i \ pit/lib/syslib5.5i pit/lib/syslib6.6i pit/lib/syslib7.7i \ pit/lib/floatlib.i coopt.sh pit/explib/syslibc.c \ pit/explib/compunex.c pit/explib/ecto_b98.c dist_man1_MANS = doc/ick.1 doc/convickt.1 info_TEXINFOS = doc/ick.txi # How to run splint on this code SPLINTOPTS = -I. -I$(top_srcdir)/src +quiet -warnposix -boolops -predboolint splint: $(ick_SOURCES) src/parser.h @echo "Running splint on ick..." -(for x in $(ick_SOURCES); do echo $(top_srcdir)/$$x; done) | xargs splint $(SPLINTOPTS) -exportlocal -redef EXTRA_DIST = pit etc BUGS src/abcessh.in src/feh.h src/fiddle.h src/ick_ec.h \ src/ick.h src/ick_lose.h src/oil.h src/pick1.h src/pick2.h \ src/sizes.h src/uncommon.h src/yuk.h src/parser.y src/lexer.l \ doc/Makefile doc/fdl-1-2.txi doc/fix83.pl doc/fixtoc.pl \ doc/ickstyle.css doc/ick.txt doc/intercal.mm doc/READ.ME \ doc/THEORY.txt doc/tidy.cfg src/parser.c src/parser.h \ src/lexer.c control doc/ick.txi doc/ick.txt doc/chipspec.txt \ HISTORY NEWS README buildaux/buildconfig buildaux/buildconfig.ac \ buildaux/depcomp buildaux/hostmak.in buildaux/install-sh \ buildaux/missing buildaux/ylwrap buildaux/bconfigh.in # It's ugly to distribute the prebuilt files in the root of the # distribution. configure will move these files back again into the # root of the /build tree/, which makes a lot more sense than putting # them in the root of the source tree. Also, make sure not to # distribute executables lying around in the pit from previous tests. dist-hook: $(MKDIR_P) $(distdir)/prebuilt mv $(distdir)/src/parser.c $(distdir)/prebuilt mv $(distdir)/src/parser.h $(distdir)/prebuilt mv $(distdir)/src/lexer.c $(distdir)/prebuilt mv $(distdir)/src/oil-oil.c $(distdir)/prebuilt -find $(distdir)/pit -perm -u+x -type f -and -not -name regresscheck | xargs rm touch $(distdir)/MANIFEST (cd $(distdir); find . | sort > MANIFEST) # N.B. the parser.y, lexer.l, libraries, headers and skeletons are the # links made to simplify the build, not the originals CLEANFILES = oilout*.c parser.y lexer.l ick-wrap.c pickwrap.c \ atari.c baudot.c ebcdic.c latin1.c ick.dvi \ syslib.i syslib3.3i syslib4.4i syslib5.5i \ syslib6.6i syslib7.7i ick_ec.h fiddle.h \ ick_lose.h yuk.h floatlib.i ecto_b98.c ick_bool.h # Distclean deletes the Makefile and thus requires reconfiguring, # and therefore this is a safe moment to delete the build tree # versions of the prebuilt files. (The source tree versions will # be safe in the prebuilt dir, which Automake doesn't even know # about.) DISTCLEANFILES = src/parser.c src/parser.h src/lexer.c src/oil-oil.c host.mak bconfig.h config.status.build distclean-local: mkdir -p src rm -rf src/.deps -rmdir src # this should be empty iff out-of-tree # A veryclean is a distclean that removes /all/ generated files, # even the ones that are part of the distributed system veryclean: distclean rm -f $(top_srcdir)/buildaux/buildconfig rm -f $(top_srcdir)/buildaux/depcomp rm -f $(top_srcdir)/buildaux/install-sh rm -f $(top_srcdir)/buildaux/missing rm -f $(top_srcdir)/buildaux/ylwrap rm -f $(top_srcdir)/buildaux/ar-lib rm -f $(top_srcdir)/buildaux/compile rm -f $(top_srcdir)/buildaux/Makefile.in rm -f $(top_srcdir)/buildaux/bconfigh.in rm -f $(top_srcdir)/buildaux/configh.in rm -f $(top_srcdir)/aclocal.m4 rm -f $(top_srcdir)/configure rm -rf $(top_srcdir)/autom4te.cache rm -rf $(top_srcdir)/buildaux/autom4te.cache # Clean the pit test binaries on toplevel make clean clean-local: if [ -d pit ]; then cd pit; make clean; fi # A subtle yet potentially common issue: ick favours the install location over # the build-directory or current-directory locations for its data files; this # means that we can easily test against the wrong version of libick. # It would be nice to compare the file contents, but this doesn't work in # practice; it's possible that the installed version is stripped and the # non-installed version is unstripped (yet they match). Instead, we use the # crude heuristic of comparing modification times; an old installed version # will be older than an uninstalled version, whereas a version installed from # the current sources can be no older (and typically is newer) verify-libick-version: $(lib_LIBRARIES) @list='$(lib_LIBRARIES)'; \ for p in $$list; do \ test ! -f $(DESTDIR)$(libdir)/$$p || test ! $(DESTDIR)$(libdir)/$$p -ot $$p || \ ( \ echo "Error: You have an old installed version of $$p."; \ echo "This makes it impossible to test ick, as it will look at the"; \ echo "installed version, not the version that was just built."; \ echo "Run make install or make uninstall."; \ false; \ ) || \ exit 1; \ done # Make self-tests available in the standard way # The pit has to be writable for the tests to work, unfortunately... check-am: ick$(EXEEXT) verify-libick-version chmod u+w $(top_srcdir)/pit chmod u+w $(top_srcdir)/pit/lib chmod u+w $(top_srcdir)/pit/tests make -f $(top_srcdir)/pit/Makefile ICKENV="" ICK="./ick$(EXEEXT)" ICKOPTS="-b" PIT=$(top_srcdir)/pit test # Run the fuzztest fuzz: ick$(EXEEXT) src/idiotism.oil $(top_srcdir)/etc/interfuzz.pl verify-libick-version ICK="./ick$(EXEEXT)" IDIOTISM="$(top_srcdir)/src/idiotism.oil" perl $(top_srcdir)/etc/interfuzz.pl # Run regression tests, fuzz tests and build tests test: fuzz distcheck # If a documentation file is needed but not available, invoke the doc # makefile to build it. doc/ick.txt: doc/ick.txi cd $(top_srcdir)/doc && make ick.txt echo-version: @echo @PACKAGE_VERSION@ # The build system itself is included in the makefile; tell Automake # about the buildaux tweaking. $(top_srcdir)/buildaux/buildconfig: $(top_srcdir)/buildaux/buildconfig.ac $(top_srcdir)/buildaux/bconfigh.in cd $(top_srcdir) && $(AUTOCONF) buildaux/buildconfig.ac > buildaux/buildconfig chmod a+x $(top_srcdir)/buildaux/buildconfig $(top_srcdir)/buildaux/bconfigh.in: $(top_srcdir)/buildaux/buildconfig.ac cd $(top_srcdir)/buildaux && $(AUTOHEADER) buildconfig.ac rm -f stamp-h1 touch $@ CONFIG_STATUS_DEPENDENCIES=$(top_srcdir)/buildaux/buildconfig $(top_srcdir)/buildaux/bconfigh.in $(top_srcdir)/src/abcessh.in # Ship a release release: intercal-$(VERSION).tar.gz shipper version=$(VERSION) | sh -e -x cd website; upload intercal-0.30/buildaux/PaxHeaders.27456/ylwrap0000644000000000000000000000007411437552002016063 xustar0030 atime=1417959275.749221096 30 ctime=1427992235.654945506 intercal-0.30/buildaux/ylwrap0000755000175000017500000001404311437552002015763 0ustar00esresr00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, # 2007, 2009 Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: intercal-0.30/buildaux/PaxHeaders.27456/install-sh0000644000000000000000000000007411437552002016623 xustar0030 atime=1417959275.749221096 30 ctime=1427992235.654945506 intercal-0.30/buildaux/install-sh0000755000175000017500000003253711437552002016533 0ustar00esresr00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: intercal-0.30/buildaux/PaxHeaders.27456/hostmak.in0000644000000000000000000000007411437550756016636 xustar0030 atime=1427954558.343140896 30 ctime=1427992235.514945894 intercal-0.30/buildaux/hostmak.in0000644000175000017500000000024211437550756016527 0ustar00esresr00000000000000CC_FOR_BUILD = @CC@ CFLAGS_FOR_BUILD = @CFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS@ EXEEXT_FOR_BUILD = @EXEEXT@ LDFLAGS_FOR_BUILD = @LDFLAGS@ LIBS_FOR_BUILD = @LIBS@ intercal-0.30/buildaux/PaxHeaders.27456/configh.in0000644000000000000000000000013012507267251016570 xustar0029 mtime=1427992233.25895217 29 atime=1427992233.25895217 30 ctime=1427992235.514945894 intercal-0.30/buildaux/configh.in0000664000175000017500000000770012507267251016500 0ustar00esresr00000000000000/* buildaux/configh.in. Generated from configure.ac by autoheader. */ /* Define to 1 if _Bool works but cannot be passed via varargs. */ #undef BOOL_VARARGS_BROKEN /* Extension to use on executable files. */ #undef EXEEXT /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the `gethrtime' function. */ #undef HAVE_GETHRTIME /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `isatty' function. */ #undef HAVE_ISATTY /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if #! works on your system. */ #undef HAVE_SYS_INTERPRETER /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define to 1 if yyrestart() is necessary to yyparse a new file. */ #undef NEED_YYRESTART /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `long long int', as computed by sizeof. */ #undef SIZEOF_LONG_LONG_INT /* The size of `sig_atomic_t', as computed by sizeof. */ #undef SIZEOF_SIG_ATOMIC_T /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ #undef volatile intercal-0.30/buildaux/PaxHeaders.27456/Makefile.in0000644000000000000000000000013112507267232016670 xustar0029 mtime=1427992218.58299299 30 atime=1427992218.646992812 30 ctime=1427992235.510945911 intercal-0.30/buildaux/Makefile.in0000664000175000017500000024105012507267232016575 0ustar00esresr00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = ick$(EXEEXT) convickt$(EXEEXT) noinst_PROGRAMS = oil$(EXEEXT) bin2c$(EXEEXT) subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_ickdata_DATA) \ $(dist_man1_MANS) $(ickinclude_HEADERS) \ $(top_srcdir)/buildaux/Makefile.am \ $(top_srcdir)/buildaux/Makefile.in \ $(top_srcdir)/buildaux/configh.in \ $(top_srcdir)/buildaux/hostmak.in $(top_srcdir)/configure \ $(top_srcdir)/src/abcessh.in $(top_srcdir)/src/cooptsh.in \ COPYING NEWS oil-oil.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = coopt.sh host.mak abcess.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(ickdatadir)" "$(DESTDIR)$(ickdatadir)" \ "$(DESTDIR)$(ickincludedir)" "$(DESTDIR)$(ickincludedir)" LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES) ARFLAGS = cru libick_a_AR = $(AR) $(ARFLAGS) libick_a_DEPENDENCIES = atari.o baudot.o ebcdic.o latin1.o am_libick_a_OBJECTS = cesspool.$(OBJEXT) numerals.$(OBJEXT) \ ick_lose.$(OBJEXT) fiddle.$(OBJEXT) arrgghh.$(OBJEXT) \ clc-cset.$(OBJEXT) uncommon.$(OBJEXT) libick_a_OBJECTS = $(am_libick_a_OBJECTS) libick_ecto_b98_a_AR = $(AR) $(ARFLAGS) libick_ecto_b98_a_LIBADD = am_libick_ecto_b98_a_OBJECTS = libick_ecto_b98_a_OBJECTS = $(am_libick_ecto_b98_a_OBJECTS) libickec_a_AR = $(AR) $(ARFLAGS) libickec_a_DEPENDENCIES = atari.o baudot.o ebcdic.o latin1.o am_libickec_a_OBJECTS = cesspool.$(OBJEXT) numerals.$(OBJEXT) \ ick_lose.$(OBJEXT) fiddle.$(OBJEXT) arrgghh.$(OBJEXT) \ clc-cset.$(OBJEXT) uncommon.$(OBJEXT) ick_ec.$(OBJEXT) libickec_a_OBJECTS = $(am_libickec_a_OBJECTS) libickmt_a_AR = $(AR) $(ARFLAGS) libickmt_a_DEPENDENCIES = atari.o baudot.o ebcdic.o latin1.o am_libickmt_a_OBJECTS = cesspool.$(OBJEXT) numerals.$(OBJEXT) \ ick_lose.$(OBJEXT) fiddle.$(OBJEXT) arrgghh.$(OBJEXT) \ clc-cset.$(OBJEXT) uncommon.$(OBJEXT) unravel.$(OBJEXT) libickmt_a_OBJECTS = $(am_libickmt_a_OBJECTS) libidiot_a_AR = $(AR) $(ARFLAGS) libidiot_a_LIBADD = am_libidiot_a_OBJECTS = libidiot_a_OBJECTS = $(am_libidiot_a_OBJECTS) libyuk_a_AR = $(AR) $(ARFLAGS) libyuk_a_LIBADD = am_libyuk_a_OBJECTS = yuk.$(OBJEXT) libyuk_a_OBJECTS = $(am_libyuk_a_OBJECTS) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_bin2c_OBJECTS = bin2c.$(OBJEXT) bin2c_OBJECTS = $(am_bin2c_OBJECTS) bin2c_LDADD = $(LDADD) am_convickt_OBJECTS = convickt.$(OBJEXT) clc-cset.$(OBJEXT) \ uncommon.$(OBJEXT) convickt_OBJECTS = $(am_convickt_OBJECTS) convickt_LDADD = $(LDADD) am_ick_OBJECTS = feh2.$(OBJEXT) dekludge.$(OBJEXT) ick_lose.$(OBJEXT) \ fiddle.$(OBJEXT) perpet.$(OBJEXT) uncommon.$(OBJEXT) nodist_ick_OBJECTS = parser.$(OBJEXT) lexer.$(OBJEXT) ick_OBJECTS = $(am_ick_OBJECTS) $(nodist_ick_OBJECTS) ick_DEPENDENCIES = libidiot.a am_oil_OBJECTS = oil-oil.$(OBJEXT) oil_OBJECTS = $(am_oil_OBJECTS) oil_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/buildaux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) YLWRAP = $(top_srcdir)/buildaux/ylwrap YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) SOURCES = $(libick_a_SOURCES) $(libick_ecto_b98_a_SOURCES) \ $(libickec_a_SOURCES) $(libickmt_a_SOURCES) \ $(libidiot_a_SOURCES) $(libyuk_a_SOURCES) $(bin2c_SOURCES) \ $(convickt_SOURCES) $(ick_SOURCES) $(nodist_ick_SOURCES) \ $(oil_SOURCES) DIST_SOURCES = $(libick_a_SOURCES) $(libick_ecto_b98_a_SOURCES) \ $(libickec_a_SOURCES) $(libickmt_a_SOURCES) \ $(libidiot_a_SOURCES) $(libyuk_a_SOURCES) $(bin2c_SOURCES) \ $(convickt_SOURCES) $(ick_SOURCES) $(oil_SOURCES) am__dirstamp = $(am__leading_dot)dirstamp INFO_DEPS = $(srcdir)/doc/ick.info TEXINFO_TEX = $(top_srcdir)/buildaux/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/buildaux DVIS = doc/ick.dvi PDFS = doc/ick.pdf PSS = doc/ick.ps HTMLS = doc/ick.html TEXINFOS = doc/ick.txi TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man1_MANS) DATA = $(dist_ickdata_DATA) $(nodist_ickdata_DATA) HEADERS = $(ickinclude_HEADERS) $(nodist_ickinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).tar.xz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ HAVE_STDBOOL_H = @HAVE_STDBOOL_H@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_HIDDEN_FROM_AUTOMAKE = @INCLUDE_HIDDEN_FROM_AUTOMAKE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ICK_SPECIFIC_SUBDIR = ick-@PACKAGE_VERSION@ ickincludedir = $(includedir)/$(ICK_SPECIFIC_SUBDIR) ickdatadir = $(datadir)/$(ICK_SPECIFIC_SUBDIR) AM_CFLAGS = -DICKINCLUDEDIR=\"$(ickincludedir)\" \ -DICKDATADIR=\"$(ickdatadir)\" \ -DICKBINDIR=\"$(bindir)\" -DICKLIBDIR=\"$(libdir)\" \ -DYYDEBUG -DICK_HAVE_STDINT_H=@HAVE_STDINT_H@ AM_CPPFLAGS = -I$(srcdir)/src ick_SOURCES = src/feh2.c src/dekludge.c src/ick_lose.c \ src/fiddle.c src/perpet.c src/uncommon.c nodist_ick_SOURCES = parser.y lexer.l ick_LDADD = libidiot.a AM_YFLAGS = -d # BUILT_SOURCES is used both to make sure parser.h is built early, and to # create symlinks used by ick to find files if it's run without first being # installed. BUILT_SOURCES = parser.h ick-wrap.c pickwrap.c syslib.i syslib3.3i syslib4.4i \ syslib5.5i syslib6.6i syslib7.7i floatlib.i ecto_b98.c \ ick_ec.h fiddle.h ick_bool.h ick_lose.h yuk.h noinst_LIBRARIES = libidiot.a libidiot_a_SOURCES = src/idiotism.oil convickt_SOURCES = src/convickt.c src/clc-cset.c src/uncommon.c oil_SOURCES = src/oil.y oil_YFLAGS = bin2c_SOURCES = src/bin2c.c # Optional libraries are in lib_LIBRARIES, but with a null build rule. lib_LIBRARIES = libick.a libickmt.a libickec.a libyuk.a libick_ecto_b98.a libick_ecto_b98_a_SOURCES = libick_a_SOURCES = src/cesspool.c src/numerals.c src/ick_lose.c src/fiddle.c \ src/arrgghh.c src/clc-cset.c src/uncommon.c libick_a_LIBADD = atari.o baudot.o ebcdic.o latin1.o libickmt_a_SOURCES = src/cesspool.c src/numerals.c src/ick_lose.c src/fiddle.c \ src/arrgghh.c src/clc-cset.c src/uncommon.c src/unravel.c libickmt_a_LIBADD = atari.o baudot.o ebcdic.o latin1.o libickec_a_SOURCES = src/cesspool.c src/numerals.c src/ick_lose.c src/fiddle.c \ src/arrgghh.c src/clc-cset.c src/uncommon.c src/ick_ec.c libickec_a_LIBADD = atari.o baudot.o ebcdic.o latin1.o libyuk_a_SOURCES = src/yuk.c ickinclude_HEADERS = src/ick_ec.h src/fiddle.h src/ick_lose.h src/yuk.h \ src/ick_bool.h nodist_ickinclude_HEADERS = config.h abcess.h dist_ickdata_DATA = src/atari.bin src/baudot.bin src/ebcdic.bin src/latin1.bin \ src/ick-wrap.c src/pickwrap.c COPYING # These necessary pit files are in nodist_ here because they're in EXTRA_DIST # later along with the rest of the pit. nodist_ickdata_DATA = pit/lib/syslib.i pit/lib/syslib3.3i pit/lib/syslib4.4i \ pit/lib/syslib5.5i pit/lib/syslib6.6i pit/lib/syslib7.7i \ pit/lib/floatlib.i coopt.sh pit/explib/syslibc.c \ pit/explib/compunex.c pit/explib/ecto_b98.c dist_man1_MANS = doc/ick.1 doc/convickt.1 info_TEXINFOS = doc/ick.txi # How to run splint on this code SPLINTOPTS = -I. -I$(top_srcdir)/src +quiet -warnposix -boolops -predboolint EXTRA_DIST = pit etc BUGS src/abcessh.in src/feh.h src/fiddle.h src/ick_ec.h \ src/ick.h src/ick_lose.h src/oil.h src/pick1.h src/pick2.h \ src/sizes.h src/uncommon.h src/yuk.h src/parser.y src/lexer.l \ doc/Makefile doc/fdl-1-2.txi doc/fix83.pl doc/fixtoc.pl \ doc/ickstyle.css doc/ick.txt doc/intercal.mm doc/READ.ME \ doc/THEORY.txt doc/tidy.cfg parser.c parser.h lexer.c control \ doc/ick.txi doc/ick.txt doc/chipspec.txt HISTORY NEWS README \ buildaux/buildconfig buildaux/buildconfig.ac \ buildaux/depcomp buildaux/hostmak.in buildaux/install-sh \ buildaux/missing buildaux/ylwrap buildaux/bconfigh.in # N.B. the parser.y, lexer.l, libraries, headers and skeletons are the # links made to simplify the build, not the originals CLEANFILES = oilout*.c parser.y lexer.l ick-wrap.c pickwrap.c \ atari.c baudot.c ebcdic.c latin1.c ick.dvi \ syslib.i syslib3.3i syslib4.4i syslib5.5i \ syslib6.6i syslib7.7i ick_ec.h fiddle.h \ ick_lose.h yuk.h floatlib.i ecto_b98.c ick_bool.h # Distclean deletes the Makefile and thus requires reconfiguring, # and therefore this is a safe moment to delete the build tree # versions of the prebuilt files. (The source tree versions will # be safe in the prebuilt dir, which Automake doesn't even know # about.) DISTCLEANFILES = parser.c parser.h lexer.c oil-oil.c host.mak bconfig.h config.status.build CONFIG_STATUS_DEPENDENCIES = $(top_srcdir)/buildaux/buildconfig $(top_srcdir)/buildaux/bconfigh.in $(top_srcdir)/src/abcessh.in all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .dvi .l .o .obj .ps .y am--refresh: Makefile @: $(top_srcdir)/buildaux/Makefile.in: $(top_srcdir)/buildaux/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile:buildaux/Makefile.in'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile:buildaux/Makefile.in .PRECIOUS: Makefile Makefile: $(top_srcdir)/buildaux/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(top_srcdir)/buildaux/configh.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(top_srcdir)/buildaux/configh.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 coopt.sh: $(top_builddir)/config.status $(top_srcdir)/src/cooptsh.in cd $(top_builddir) && $(SHELL) ./config.status $@ host.mak: $(top_builddir)/config.status $(top_srcdir)/buildaux/hostmak.in cd $(top_builddir) && $(SHELL) ./config.status $@ abcess.h: $(top_builddir)/config.status $(top_srcdir)/src/abcessh.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLIBRARIES: $(lib_LIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \ $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; } @$(POST_INSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ if test -f $$p; then \ $(am__strip_dir) \ echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \ ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \ else :; fi; \ done uninstall-libLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir) clean-libLIBRARIES: -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libick.a: $(libick_a_OBJECTS) $(libick_a_DEPENDENCIES) $(EXTRA_libick_a_DEPENDENCIES) -rm -f libick.a $(libick_a_AR) libick.a $(libick_a_OBJECTS) $(libick_a_LIBADD) $(RANLIB) libick.a libickec.a: $(libickec_a_OBJECTS) $(libickec_a_DEPENDENCIES) $(EXTRA_libickec_a_DEPENDENCIES) -rm -f libickec.a $(libickec_a_AR) libickec.a $(libickec_a_OBJECTS) $(libickec_a_LIBADD) $(RANLIB) libickec.a libickmt.a: $(libickmt_a_OBJECTS) $(libickmt_a_DEPENDENCIES) $(EXTRA_libickmt_a_DEPENDENCIES) -rm -f libickmt.a $(libickmt_a_AR) libickmt.a $(libickmt_a_OBJECTS) $(libickmt_a_LIBADD) $(RANLIB) libickmt.a libyuk.a: $(libyuk_a_OBJECTS) $(libyuk_a_DEPENDENCIES) $(EXTRA_libyuk_a_DEPENDENCIES) -rm -f libyuk.a $(libyuk_a_AR) libyuk.a $(libyuk_a_OBJECTS) $(libyuk_a_LIBADD) $(RANLIB) libyuk.a install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) convickt$(EXEEXT): $(convickt_OBJECTS) $(convickt_DEPENDENCIES) $(EXTRA_convickt_DEPENDENCIES) @rm -f convickt$(EXEEXT) $(LINK) $(convickt_OBJECTS) $(convickt_LDADD) $(LIBS) parser.h: parser.c @if test ! -f $@; then rm -f parser.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) parser.c; else :; fi ick$(EXEEXT): $(ick_OBJECTS) $(ick_DEPENDENCIES) $(EXTRA_ick_DEPENDENCIES) @rm -f ick$(EXEEXT) $(LINK) $(ick_OBJECTS) $(ick_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arrgghh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bin2c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cesspool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clc-cset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convickt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dekludge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/feh2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fiddle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ick_ec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ick_lose.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lexer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numerals.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oil-oil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perpet.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uncommon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unravel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yuk.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` cesspool.o: src/cesspool.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cesspool.o -MD -MP -MF $(DEPDIR)/cesspool.Tpo -c -o cesspool.o `test -f 'src/cesspool.c' || echo '$(srcdir)/'`src/cesspool.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cesspool.Tpo $(DEPDIR)/cesspool.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/cesspool.c' object='cesspool.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cesspool.o `test -f 'src/cesspool.c' || echo '$(srcdir)/'`src/cesspool.c cesspool.obj: src/cesspool.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cesspool.obj -MD -MP -MF $(DEPDIR)/cesspool.Tpo -c -o cesspool.obj `if test -f 'src/cesspool.c'; then $(CYGPATH_W) 'src/cesspool.c'; else $(CYGPATH_W) '$(srcdir)/src/cesspool.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cesspool.Tpo $(DEPDIR)/cesspool.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/cesspool.c' object='cesspool.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cesspool.obj `if test -f 'src/cesspool.c'; then $(CYGPATH_W) 'src/cesspool.c'; else $(CYGPATH_W) '$(srcdir)/src/cesspool.c'; fi` numerals.o: src/numerals.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT numerals.o -MD -MP -MF $(DEPDIR)/numerals.Tpo -c -o numerals.o `test -f 'src/numerals.c' || echo '$(srcdir)/'`src/numerals.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/numerals.Tpo $(DEPDIR)/numerals.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/numerals.c' object='numerals.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o numerals.o `test -f 'src/numerals.c' || echo '$(srcdir)/'`src/numerals.c numerals.obj: src/numerals.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT numerals.obj -MD -MP -MF $(DEPDIR)/numerals.Tpo -c -o numerals.obj `if test -f 'src/numerals.c'; then $(CYGPATH_W) 'src/numerals.c'; else $(CYGPATH_W) '$(srcdir)/src/numerals.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/numerals.Tpo $(DEPDIR)/numerals.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/numerals.c' object='numerals.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o numerals.obj `if test -f 'src/numerals.c'; then $(CYGPATH_W) 'src/numerals.c'; else $(CYGPATH_W) '$(srcdir)/src/numerals.c'; fi` ick_lose.o: src/ick_lose.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ick_lose.o -MD -MP -MF $(DEPDIR)/ick_lose.Tpo -c -o ick_lose.o `test -f 'src/ick_lose.c' || echo '$(srcdir)/'`src/ick_lose.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ick_lose.Tpo $(DEPDIR)/ick_lose.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/ick_lose.c' object='ick_lose.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ick_lose.o `test -f 'src/ick_lose.c' || echo '$(srcdir)/'`src/ick_lose.c ick_lose.obj: src/ick_lose.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ick_lose.obj -MD -MP -MF $(DEPDIR)/ick_lose.Tpo -c -o ick_lose.obj `if test -f 'src/ick_lose.c'; then $(CYGPATH_W) 'src/ick_lose.c'; else $(CYGPATH_W) '$(srcdir)/src/ick_lose.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ick_lose.Tpo $(DEPDIR)/ick_lose.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/ick_lose.c' object='ick_lose.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ick_lose.obj `if test -f 'src/ick_lose.c'; then $(CYGPATH_W) 'src/ick_lose.c'; else $(CYGPATH_W) '$(srcdir)/src/ick_lose.c'; fi` fiddle.o: src/fiddle.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fiddle.o -MD -MP -MF $(DEPDIR)/fiddle.Tpo -c -o fiddle.o `test -f 'src/fiddle.c' || echo '$(srcdir)/'`src/fiddle.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fiddle.Tpo $(DEPDIR)/fiddle.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/fiddle.c' object='fiddle.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fiddle.o `test -f 'src/fiddle.c' || echo '$(srcdir)/'`src/fiddle.c fiddle.obj: src/fiddle.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fiddle.obj -MD -MP -MF $(DEPDIR)/fiddle.Tpo -c -o fiddle.obj `if test -f 'src/fiddle.c'; then $(CYGPATH_W) 'src/fiddle.c'; else $(CYGPATH_W) '$(srcdir)/src/fiddle.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fiddle.Tpo $(DEPDIR)/fiddle.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/fiddle.c' object='fiddle.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fiddle.obj `if test -f 'src/fiddle.c'; then $(CYGPATH_W) 'src/fiddle.c'; else $(CYGPATH_W) '$(srcdir)/src/fiddle.c'; fi` arrgghh.o: src/arrgghh.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT arrgghh.o -MD -MP -MF $(DEPDIR)/arrgghh.Tpo -c -o arrgghh.o `test -f 'src/arrgghh.c' || echo '$(srcdir)/'`src/arrgghh.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/arrgghh.Tpo $(DEPDIR)/arrgghh.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/arrgghh.c' object='arrgghh.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o arrgghh.o `test -f 'src/arrgghh.c' || echo '$(srcdir)/'`src/arrgghh.c arrgghh.obj: src/arrgghh.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT arrgghh.obj -MD -MP -MF $(DEPDIR)/arrgghh.Tpo -c -o arrgghh.obj `if test -f 'src/arrgghh.c'; then $(CYGPATH_W) 'src/arrgghh.c'; else $(CYGPATH_W) '$(srcdir)/src/arrgghh.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/arrgghh.Tpo $(DEPDIR)/arrgghh.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/arrgghh.c' object='arrgghh.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o arrgghh.obj `if test -f 'src/arrgghh.c'; then $(CYGPATH_W) 'src/arrgghh.c'; else $(CYGPATH_W) '$(srcdir)/src/arrgghh.c'; fi` clc-cset.o: src/clc-cset.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT clc-cset.o -MD -MP -MF $(DEPDIR)/clc-cset.Tpo -c -o clc-cset.o `test -f 'src/clc-cset.c' || echo '$(srcdir)/'`src/clc-cset.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/clc-cset.Tpo $(DEPDIR)/clc-cset.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/clc-cset.c' object='clc-cset.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o clc-cset.o `test -f 'src/clc-cset.c' || echo '$(srcdir)/'`src/clc-cset.c clc-cset.obj: src/clc-cset.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT clc-cset.obj -MD -MP -MF $(DEPDIR)/clc-cset.Tpo -c -o clc-cset.obj `if test -f 'src/clc-cset.c'; then $(CYGPATH_W) 'src/clc-cset.c'; else $(CYGPATH_W) '$(srcdir)/src/clc-cset.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/clc-cset.Tpo $(DEPDIR)/clc-cset.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/clc-cset.c' object='clc-cset.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o clc-cset.obj `if test -f 'src/clc-cset.c'; then $(CYGPATH_W) 'src/clc-cset.c'; else $(CYGPATH_W) '$(srcdir)/src/clc-cset.c'; fi` uncommon.o: src/uncommon.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uncommon.o -MD -MP -MF $(DEPDIR)/uncommon.Tpo -c -o uncommon.o `test -f 'src/uncommon.c' || echo '$(srcdir)/'`src/uncommon.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/uncommon.Tpo $(DEPDIR)/uncommon.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/uncommon.c' object='uncommon.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uncommon.o `test -f 'src/uncommon.c' || echo '$(srcdir)/'`src/uncommon.c uncommon.obj: src/uncommon.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uncommon.obj -MD -MP -MF $(DEPDIR)/uncommon.Tpo -c -o uncommon.obj `if test -f 'src/uncommon.c'; then $(CYGPATH_W) 'src/uncommon.c'; else $(CYGPATH_W) '$(srcdir)/src/uncommon.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/uncommon.Tpo $(DEPDIR)/uncommon.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/uncommon.c' object='uncommon.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uncommon.obj `if test -f 'src/uncommon.c'; then $(CYGPATH_W) 'src/uncommon.c'; else $(CYGPATH_W) '$(srcdir)/src/uncommon.c'; fi` ick_ec.o: src/ick_ec.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ick_ec.o -MD -MP -MF $(DEPDIR)/ick_ec.Tpo -c -o ick_ec.o `test -f 'src/ick_ec.c' || echo '$(srcdir)/'`src/ick_ec.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ick_ec.Tpo $(DEPDIR)/ick_ec.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/ick_ec.c' object='ick_ec.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ick_ec.o `test -f 'src/ick_ec.c' || echo '$(srcdir)/'`src/ick_ec.c ick_ec.obj: src/ick_ec.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ick_ec.obj -MD -MP -MF $(DEPDIR)/ick_ec.Tpo -c -o ick_ec.obj `if test -f 'src/ick_ec.c'; then $(CYGPATH_W) 'src/ick_ec.c'; else $(CYGPATH_W) '$(srcdir)/src/ick_ec.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ick_ec.Tpo $(DEPDIR)/ick_ec.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/ick_ec.c' object='ick_ec.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ick_ec.obj `if test -f 'src/ick_ec.c'; then $(CYGPATH_W) 'src/ick_ec.c'; else $(CYGPATH_W) '$(srcdir)/src/ick_ec.c'; fi` unravel.o: src/unravel.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unravel.o -MD -MP -MF $(DEPDIR)/unravel.Tpo -c -o unravel.o `test -f 'src/unravel.c' || echo '$(srcdir)/'`src/unravel.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/unravel.Tpo $(DEPDIR)/unravel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/unravel.c' object='unravel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unravel.o `test -f 'src/unravel.c' || echo '$(srcdir)/'`src/unravel.c unravel.obj: src/unravel.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unravel.obj -MD -MP -MF $(DEPDIR)/unravel.Tpo -c -o unravel.obj `if test -f 'src/unravel.c'; then $(CYGPATH_W) 'src/unravel.c'; else $(CYGPATH_W) '$(srcdir)/src/unravel.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/unravel.Tpo $(DEPDIR)/unravel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/unravel.c' object='unravel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unravel.obj `if test -f 'src/unravel.c'; then $(CYGPATH_W) 'src/unravel.c'; else $(CYGPATH_W) '$(srcdir)/src/unravel.c'; fi` yuk.o: src/yuk.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT yuk.o -MD -MP -MF $(DEPDIR)/yuk.Tpo -c -o yuk.o `test -f 'src/yuk.c' || echo '$(srcdir)/'`src/yuk.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/yuk.Tpo $(DEPDIR)/yuk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/yuk.c' object='yuk.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o yuk.o `test -f 'src/yuk.c' || echo '$(srcdir)/'`src/yuk.c yuk.obj: src/yuk.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT yuk.obj -MD -MP -MF $(DEPDIR)/yuk.Tpo -c -o yuk.obj `if test -f 'src/yuk.c'; then $(CYGPATH_W) 'src/yuk.c'; else $(CYGPATH_W) '$(srcdir)/src/yuk.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/yuk.Tpo $(DEPDIR)/yuk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/yuk.c' object='yuk.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o yuk.obj `if test -f 'src/yuk.c'; then $(CYGPATH_W) 'src/yuk.c'; else $(CYGPATH_W) '$(srcdir)/src/yuk.c'; fi` bin2c.o: src/bin2c.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bin2c.o -MD -MP -MF $(DEPDIR)/bin2c.Tpo -c -o bin2c.o `test -f 'src/bin2c.c' || echo '$(srcdir)/'`src/bin2c.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/bin2c.Tpo $(DEPDIR)/bin2c.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/bin2c.c' object='bin2c.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bin2c.o `test -f 'src/bin2c.c' || echo '$(srcdir)/'`src/bin2c.c bin2c.obj: src/bin2c.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bin2c.obj -MD -MP -MF $(DEPDIR)/bin2c.Tpo -c -o bin2c.obj `if test -f 'src/bin2c.c'; then $(CYGPATH_W) 'src/bin2c.c'; else $(CYGPATH_W) '$(srcdir)/src/bin2c.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/bin2c.Tpo $(DEPDIR)/bin2c.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/bin2c.c' object='bin2c.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bin2c.obj `if test -f 'src/bin2c.c'; then $(CYGPATH_W) 'src/bin2c.c'; else $(CYGPATH_W) '$(srcdir)/src/bin2c.c'; fi` convickt.o: src/convickt.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT convickt.o -MD -MP -MF $(DEPDIR)/convickt.Tpo -c -o convickt.o `test -f 'src/convickt.c' || echo '$(srcdir)/'`src/convickt.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/convickt.Tpo $(DEPDIR)/convickt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/convickt.c' object='convickt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o convickt.o `test -f 'src/convickt.c' || echo '$(srcdir)/'`src/convickt.c convickt.obj: src/convickt.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT convickt.obj -MD -MP -MF $(DEPDIR)/convickt.Tpo -c -o convickt.obj `if test -f 'src/convickt.c'; then $(CYGPATH_W) 'src/convickt.c'; else $(CYGPATH_W) '$(srcdir)/src/convickt.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/convickt.Tpo $(DEPDIR)/convickt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/convickt.c' object='convickt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o convickt.obj `if test -f 'src/convickt.c'; then $(CYGPATH_W) 'src/convickt.c'; else $(CYGPATH_W) '$(srcdir)/src/convickt.c'; fi` feh2.o: src/feh2.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT feh2.o -MD -MP -MF $(DEPDIR)/feh2.Tpo -c -o feh2.o `test -f 'src/feh2.c' || echo '$(srcdir)/'`src/feh2.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/feh2.Tpo $(DEPDIR)/feh2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/feh2.c' object='feh2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o feh2.o `test -f 'src/feh2.c' || echo '$(srcdir)/'`src/feh2.c feh2.obj: src/feh2.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT feh2.obj -MD -MP -MF $(DEPDIR)/feh2.Tpo -c -o feh2.obj `if test -f 'src/feh2.c'; then $(CYGPATH_W) 'src/feh2.c'; else $(CYGPATH_W) '$(srcdir)/src/feh2.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/feh2.Tpo $(DEPDIR)/feh2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/feh2.c' object='feh2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o feh2.obj `if test -f 'src/feh2.c'; then $(CYGPATH_W) 'src/feh2.c'; else $(CYGPATH_W) '$(srcdir)/src/feh2.c'; fi` dekludge.o: src/dekludge.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dekludge.o -MD -MP -MF $(DEPDIR)/dekludge.Tpo -c -o dekludge.o `test -f 'src/dekludge.c' || echo '$(srcdir)/'`src/dekludge.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dekludge.Tpo $(DEPDIR)/dekludge.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/dekludge.c' object='dekludge.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dekludge.o `test -f 'src/dekludge.c' || echo '$(srcdir)/'`src/dekludge.c dekludge.obj: src/dekludge.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dekludge.obj -MD -MP -MF $(DEPDIR)/dekludge.Tpo -c -o dekludge.obj `if test -f 'src/dekludge.c'; then $(CYGPATH_W) 'src/dekludge.c'; else $(CYGPATH_W) '$(srcdir)/src/dekludge.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dekludge.Tpo $(DEPDIR)/dekludge.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/dekludge.c' object='dekludge.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dekludge.obj `if test -f 'src/dekludge.c'; then $(CYGPATH_W) 'src/dekludge.c'; else $(CYGPATH_W) '$(srcdir)/src/dekludge.c'; fi` perpet.o: src/perpet.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT perpet.o -MD -MP -MF $(DEPDIR)/perpet.Tpo -c -o perpet.o `test -f 'src/perpet.c' || echo '$(srcdir)/'`src/perpet.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/perpet.Tpo $(DEPDIR)/perpet.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/perpet.c' object='perpet.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o perpet.o `test -f 'src/perpet.c' || echo '$(srcdir)/'`src/perpet.c perpet.obj: src/perpet.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT perpet.obj -MD -MP -MF $(DEPDIR)/perpet.Tpo -c -o perpet.obj `if test -f 'src/perpet.c'; then $(CYGPATH_W) 'src/perpet.c'; else $(CYGPATH_W) '$(srcdir)/src/perpet.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/perpet.Tpo $(DEPDIR)/perpet.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/perpet.c' object='perpet.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o perpet.obj `if test -f 'src/perpet.c'; then $(CYGPATH_W) 'src/perpet.c'; else $(CYGPATH_W) '$(srcdir)/src/perpet.c'; fi` .l.c: $(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) lexer.c: lexer.l \ $(SHELL) $(YLWRAP) `test -f 'lexer.l' || echo '$(srcdir)/'`lexer.l $(LEX_OUTPUT_ROOT).c lexer.c -- $(LEX) $(AM_LFLAGS) $(LFLAGS) .y.c: $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) parser.c: parser.y \ $(SHELL) $(YLWRAP) `test -f 'parser.y' || echo '$(srcdir)/'`parser.y y.tab.c parser.c y.tab.h parser.h y.output parser.output -- $(YACC) $(AM_YFLAGS) $(YFLAGS) oil-oil.c: src/oil.y \ $(am__skipyacc) \ $(SHELL) $(YLWRAP) `test -f 'src/oil.y' || echo '$(srcdir)/'`src/oil.y y.tab.c oil-oil.c y.tab.h oil-oil.h y.output oil-oil.output -- $(YACC) $(oil_YFLAGS) $(YFLAGS) doc/$(am__dirstamp): @$(MKDIR_P) doc @: > doc/$(am__dirstamp) $(srcdir)/doc/ick.info: doc/ick.txi restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \ -o $@ $(srcdir)/doc/ick.txi; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc doc/ick.dvi: doc/ick.txi doc/$(am__dirstamp) TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \ $(TEXI2DVI) -o $@ `test -f 'doc/ick.txi' || echo '$(srcdir)/'`doc/ick.txi doc/ick.pdf: doc/ick.txi doc/$(am__dirstamp) TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \ $(TEXI2PDF) -o $@ `test -f 'doc/ick.txi' || echo '$(srcdir)/'`doc/ick.txi doc/ick.html: doc/ick.txi doc/$(am__dirstamp) rm -rf $(@:.html=.htp) if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \ -o $(@:.html=.htp) `test -f 'doc/ick.txi' || echo '$(srcdir)/'`doc/ick.txi; \ then \ rm -rf $@; \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ else \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ exit 1; \ fi .dvi.ps: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< uninstall-dvi-am: @$(NORMAL_UNINSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done uninstall-info-am: @$(PRE_UNINSTALL) @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done uninstall-pdf-am: @$(NORMAL_UNINSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f "$(distdir)/$$relfile" || \ cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done mostlyclean-aminfo: -rm -rf ick.aux ick.cp ick.cps ick.er ick.fn ick.ky ick.kys ick.log ick.op \ ick.pg ick.pgs ick.tmp ick.toc ick.tp ick.tps ick.vr ick.vrs clean-aminfo: -test -z "doc/ick.dvi doc/ick.pdf doc/ick.ps doc/ick.html" \ || rm -rf doc/ick.dvi doc/ick.pdf doc/ick.ps doc/ick.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done install-man1: $(dist_man1_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-dist_ickdataDATA: $(dist_ickdata_DATA) @$(NORMAL_INSTALL) @list='$(dist_ickdata_DATA)'; test -n "$(ickdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ickdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ickdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ickdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ickdatadir)" || exit $$?; \ done uninstall-dist_ickdataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_ickdata_DATA)'; test -n "$(ickdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ickdatadir)'; $(am__uninstall_files_from_dir) install-nodist_ickdataDATA: $(nodist_ickdata_DATA) @$(NORMAL_INSTALL) @list='$(nodist_ickdata_DATA)'; test -n "$(ickdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ickdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ickdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ickdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ickdatadir)" || exit $$?; \ done uninstall-nodist_ickdataDATA: @$(NORMAL_UNINSTALL) @list='$(nodist_ickdata_DATA)'; test -n "$(ickdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ickdatadir)'; $(am__uninstall_files_from_dir) install-ickincludeHEADERS: $(ickinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(ickinclude_HEADERS)'; test -n "$(ickincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ickincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ickincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(ickincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(ickincludedir)" || exit $$?; \ done uninstall-ickincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(ickinclude_HEADERS)'; test -n "$(ickincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ickincludedir)'; $(am__uninstall_files_from_dir) install-nodist_ickincludeHEADERS: $(nodist_ickinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_ickinclude_HEADERS)'; test -n "$(ickincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ickincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ickincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(ickincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(ickincludedir)" || exit $$?; \ done uninstall-nodist_ickincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_ickinclude_HEADERS)'; test -n "$(ickincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ickincludedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @case `sed 15q $(srcdir)/NEWS` in \ *"$(VERSION)"*) : ;; \ *) \ echo "NEWS not updated; not releasing" 1>&2; \ exit 1;; \ esac @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(INFO_DEPS) $(LIBRARIES) $(PROGRAMS) $(MANS) $(DATA) \ $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(ickdatadir)" "$(DESTDIR)$(ickdatadir)" "$(DESTDIR)$(ickincludedir)" "$(DESTDIR)$(ickincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f doc/$(am__dirstamp) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f lexer.c -rm -f oil-oil.c -rm -f parser.c -rm -f parser.h -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-aminfo clean-binPROGRAMS clean-generic \ clean-libLIBRARIES clean-local clean-noinstLIBRARIES \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: $(DVIS) html: html-am html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-dist_ickdataDATA install-ickincludeHEADERS \ install-info-am install-man install-nodist_ickdataDATA \ install-nodist_ickincludeHEADERS install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ done install-exec-am: install-binPROGRAMS install-libLIBRARIES install-html: install-html-am install-html-am: $(HTMLS) @$(NORMAL_INSTALL) @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ d2=$$d$$p; \ if test -d "$$d2"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ list2="$$list2 $$d2"; \ fi; \ done; \ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ done; } install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ fi; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ echo "$$ifile"; \ else : ; fi; \ done; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) @if $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \ mostlyclean-generic pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-binPROGRAMS uninstall-dist_ickdataDATA \ uninstall-dvi-am uninstall-html-am uninstall-ickincludeHEADERS \ uninstall-info-am uninstall-libLIBRARIES uninstall-man \ uninstall-nodist_ickdataDATA \ uninstall-nodist_ickincludeHEADERS uninstall-pdf-am \ uninstall-ps-am uninstall-man: uninstall-man1 .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-aminfo clean-binPROGRAMS clean-generic \ clean-libLIBRARIES clean-local clean-noinstLIBRARIES \ clean-noinstPROGRAMS ctags dist dist-all dist-bzip2 dist-gzip \ dist-hook dist-info dist-lzip dist-lzma dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-binPROGRAMS install-data \ install-data-am install-dist_ickdataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-ickincludeHEADERS install-info \ install-info-am install-libLIBRARIES install-man install-man1 \ install-nodist_ickdataDATA install-nodist_ickincludeHEADERS \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-aminfo \ maintainer-clean-generic mostlyclean mostlyclean-aminfo \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-dist_ickdataDATA uninstall-dvi-am uninstall-html-am \ uninstall-ickincludeHEADERS uninstall-info-am \ uninstall-libLIBRARIES uninstall-man uninstall-man1 \ uninstall-nodist_ickdataDATA \ uninstall-nodist_ickincludeHEADERS uninstall-pdf-am \ uninstall-ps-am parser.y : src/parser.y $(LN_S) -f `test -f 'src/parser.y' || echo '$(srcdir)/'`src/parser.y parser.y lexer.l : src/lexer.l $(LN_S) -f `test -f 'src/lexer.l' || echo '$(srcdir)/'`src/lexer.l lexer.l ick-wrap.c : src/ick-wrap.c $(LN_S) -f `test -f 'src/ick-wrap.c' || echo '$(srcdir)/'`src/ick-wrap.c ick-wrap.c pickwrap.c : src/pickwrap.c $(LN_S) -f `test -f 'src/pickwrap.c' || echo '$(srcdir)/'`src/pickwrap.c pickwrap.c syslib.i : pit/lib/syslib.i $(LN_S) -f `test -f 'pit/lib/syslib.i' || echo '$(srcdir)/'`pit/lib/syslib.i syslib.i syslib3.3i : pit/lib/syslib3.3i $(LN_S) -f `test -f 'pit/lib/syslib.3i' || echo '$(srcdir)/'`pit/lib/syslib3.3i syslib3.3i syslib4.4i : pit/lib/syslib4.4i $(LN_S) -f `test -f 'pit/lib/syslib.4i' || echo '$(srcdir)/'`pit/lib/syslib4.4i syslib4.4i syslib5.5i : pit/lib/syslib5.5i $(LN_S) -f `test -f 'pit/lib/syslib.5i' || echo '$(srcdir)/'`pit/lib/syslib5.5i syslib5.5i syslib6.6i : pit/lib/syslib6.6i $(LN_S) -f `test -f 'pit/lib/syslib.6i' || echo '$(srcdir)/'`pit/lib/syslib6.6i syslib6.6i syslib7.7i : pit/lib/syslib7.7i $(LN_S) -f `test -f 'pit/lib/syslib.7i' || echo '$(srcdir)/'`pit/lib/syslib7.7i syslib7.7i floatlib.i : pit/lib/floatlib.i $(LN_S) -f `test -f 'pit/lib/floatlib.i' || echo '$(srcdir)/'`pit/lib/floatlib.i floatlib.i ecto_b98.c : pit/explib/ecto_b98.c $(LN_S) -f `test -f 'pit/explib/ecto_b98.c' || echo '$(srcdir)/'`pit/explib/ecto_b98.c ecto_b98.c ick_ec.h : src/ick_ec.h $(LN_S) -f `test -f 'src/ick_ec.h' || echo '$(srcdir)/'`src/ick_ec.h ick_ec.h ick_lose.h : src/ick_lose.h $(LN_S) -f `test -f 'src/ick_lose.h' || echo '$(srcdir)/'`src/ick_lose.h ick_lose.h fiddle.h : src/fiddle.h $(LN_S) -f `test -f 'src/fiddle.h' || echo '$(srcdir)/'`src/fiddle.h fiddle.h ick_bool.h : src/ick_bool.h $(LN_S) -f `test -f 'src/ick_bool.h' || echo '$(srcdir)/'`src/ick_bool.h ick_bool.h yuk.h : src/yuk.h $(LN_S) -f `test -f 'src/ick-ec.h' || echo '$(srcdir)/'`src/yuk.h yuk.h libidiot.a: src/idiotism.oil oil$(EXEEXT) src/oil.h src/sizes.h src/ick.h \ parser.h src/fiddle.h src/ick_lose.h src/feh.h ./oil$(EXEEXT) < `test -f 'src/idiotism.oil' || echo '$(srcdir)/'`src/idiotism.oil for oo in oilout*.c; do echo $$oo; $(COMPILE) -c $$oo; done $(AR) $(ARFLAGS) libidiot.a oilout*.o $(RANLIB) libidiot.a @INCLUDE_HIDDEN_FROM_AUTOMAKE@ ./host.mak oil$(EXEEXT_FOR_BUILD): oil-oil.c bconfig.h $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o oil$(EXEEXT_FOR_BUILD) oil-oil.c $(LIBS_FOR_BUILD) bin2c$(EXEEXT_FOR_BUILD): src/bin2c.c bconfig.h $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o bin2c$(EXEEXT_FOR_BUILD) `test -f 'src/bin2c.c' || echo '$(srcdir)/'`src/bin2c.c $(LIBS_FOR_BUILD) oil$(EXEEXT): bin2c$(EXEEXT): libick_ecto_b98.a: etc/libick_ecto_b98.a -(test -f etc/libick_ecto_b98.a || test -f $(srcdir)/etc/libick_ecto_b98.a) && $(LN_S) -f `test -f 'etc/libick_ecto_b98.a' || echo '$(srcdir)/'`etc/libick_ecto_b98.a libick_ecto_b98.a etc/libick_ecto_b98.a: atari.o: bin2c$(EXEEXT_FOR_BUILD) src/atari.bin ./bin2c$(EXEEXT_FOR_BUILD) ick_clc_cset_atari < `test -f 'src/atari.bin' || echo '$(srcdir)/'`src/atari.bin > atari.c $(COMPILE) -c atari.c baudot.o: bin2c$(EXEEXT_FOR_BUILD) src/baudot.bin ./bin2c$(EXEEXT_FOR_BUILD) ick_clc_cset_baudot < `test -f 'src/baudot.bin' || echo '$(srcdir)/'`src/baudot.bin > baudot.c $(COMPILE) -c baudot.c ebcdic.o: bin2c$(EXEEXT_FOR_BUILD) src/ebcdic.bin ./bin2c$(EXEEXT_FOR_BUILD) ick_clc_cset_ebcdic < `test -f 'src/ebcdic.bin' || echo '$(srcdir)/'`src/ebcdic.bin > ebcdic.c $(COMPILE) -c ebcdic.c latin1.o: bin2c$(EXEEXT_FOR_BUILD) src/latin1.bin ./bin2c$(EXEEXT_FOR_BUILD) ick_clc_cset_latin1 < `test -f 'src/latin1.bin' || echo '$(srcdir)/'`src/latin1.bin > latin1.c $(COMPILE) -c latin1.c splint: $(ick_SOURCES) parser.h @echo "Running splint on ick..." -(for x in $(ick_SOURCES); do echo $(top_srcdir)/$$x; done) | xargs splint $(SPLINTOPTS) -exportlocal -redef # It's ugly to distribute the prebuilt files in the root of the # distribution. configure will move these files back again into the # root of the /build tree/, which makes a lot more sense than putting # them in the root of the source tree. Also, make sure not to # distribute executables lying around in the pit from previous tests. dist-hook: $(MKDIR_P) $(distdir)/prebuilt mv $(distdir)/parser.c $(distdir)/prebuilt mv $(distdir)/parser.h $(distdir)/prebuilt mv $(distdir)/lexer.c $(distdir)/prebuilt mv $(distdir)/oil-oil.c $(distdir)/prebuilt -find $(distdir)/pit -perm -u+x -type f -and -not -name regresscheck | xargs rm touch $(distdir)/MANIFEST (cd $(distdir); find . | sort > MANIFEST) # A veryclean is a distclean that removes /all/ generated files, # even the ones that are part of the distributed system veryclean: distclean rm -f $(top_srcdir)/buildaux/buildconfig rm -f $(top_srcdir)/buildaux/depcomp rm -f $(top_srcdir)/buildaux/install-sh rm -f $(top_srcdir)/buildaux/missing rm -f $(top_srcdir)/buildaux/ylwrap rm -f $(top_srcdir)/buildaux/Makefile.in rm -f $(top_srcdir)/buildaux/bconfigh.in rm -f $(top_srcdir)/buildaux/configh.in rm -f $(top_srcdir)/aclocal.m4 rm -f $(top_srcdir)/configure rm -rf $(top_srcdir)/autom4te.cache rm -rf $(top_srcdir)/buildaux/autom4te.cache # Clean the pit test binaries on toplevel make clean clean-local: if [ -d pit ]; then cd pit; make clean; fi # Make self-tests available in the standard way # The pit has to be writable for the tests to work, unfortunately... check-am: ick$(EXEEXT) chmod u+w $(top_srcdir)/pit chmod u+w $(top_srcdir)/pit/lib chmod u+w $(top_srcdir)/pit/tests make -f $(top_srcdir)/pit/Makefile ICK="./ick$(EXEEXT) -b" PIT=$(top_srcdir)/pit test # Run the fuzztest fuzz: ick$(EXEEXT) src/idiotism.oil $(top_srcdir)/etc/interfuzz.pl ICK="./ick$(EXEEXT)" IDIOTISM="$(top_srcdir)/src/idiotism.oil" perl $(top_srcdir)/etc/interfuzz.pl # Run regression tests, fuzz tests and build tests test: fuzz distcheck # If a documentation file is needed but not available, invoke the doc # makefile to build it. doc/ick.txt: doc/ick.txi cd $(top_srcdir)/doc && make ick.txt echo-version: @echo @PACKAGE_VERSION@ # The build system itself is included in the makefile; tell Automake # about the buildaux tweaking. $(top_srcdir)/buildaux/buildconfig: $(top_srcdir)/buildaux/buildconfig.ac $(top_srcdir)/buildaux/bconfigh.in cd $(top_srcdir) && $(AUTOCONF) buildaux/buildconfig.ac > buildaux/buildconfig chmod a+x $(top_srcdir)/buildaux/buildconfig $(top_srcdir)/buildaux/bconfigh.in: $(top_srcdir)/buildaux/buildconfig.ac cd $(top_srcdir)/buildaux && $(AUTOHEADER) buildconfig.ac rm -f stamp-h1 touch $@ # Ship a release release: intercal-$(VERSION).tar.gz shipper -u -t; rm -f *.tar.gz *.tar.bz2 *.lzma SHIPPER.* cd website; upload # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: intercal-0.30/buildaux/PaxHeaders.27456/depcomp0000644000000000000000000000007411437552002016174 xustar0030 atime=1427981395.103983005 30 ctime=1427992235.650945522 intercal-0.30/buildaux/depcomp0000755000175000017500000004426711437552002016107 0ustar00esresr00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: intercal-0.30/PaxHeaders.27456/pit0000644000000000000000000000013012507267255013531 xustar0029 mtime=1427992237.75093968 30 atime=1427992237.754939663 29 ctime=1427992237.75093968 intercal-0.30/pit/0000755000175000017500000000000012507267255013510 5ustar00esresr00000000000000intercal-0.30/pit/PaxHeaders.27456/blinkers0000644000000000000000000000007411437550756015353 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.554945791 intercal-0.30/pit/blinkers0000644000175000017500000000013011437550756015240 0ustar00esresr00000000000000NINE FIVE THREE TWO THREE THREE THREE FOUR THREE SIX THREE SEVEN THREE EIGHT THREE ZERO intercal-0.30/pit/PaxHeaders.27456/rot13.i0000644000000000000000000000007411437550756014741 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/rot13.i0000644000175000017500000000435011437550756014636 0ustar00esresr00000000000000(10) PLEASE DON'T GIVE UP (1) DO .2 <- '?.1$#64'~'#0$#65535' DO .2 <- '&"'.1~.2'~'"?'?.2~.2'$#32768"~"#0$#65535"'"$".2~.2"'~#1 DO .3 <- '?#91$.1'~'#0$#65535' DO .3 <- '&"'#91~.3'~'"?'?.3~.3'$#32768"~"#0$#65535"'"$".3~.3"'~#1 DO (11) NEXT DO (2) NEXT DO (12) NEXT (11) DO (13) NEXT PLEASE FORGET #1 DO (12) NEXT (13) DO (14) NEXT PLEASE FORGET #2 DO (12) NEXT (14) DO STASH .1 DO .1 <- .3 DO (1000) NEXT DO .1 <- .3 DO .2 <- #1 PLEASE DO (1000) NEXT DO RETRIEVE .1 PLEASE RESUME .3 (12) PLEASE FORGET #1 DO .2 <- '?.1$#96'~'#0$#65535' DO .2 <- '&"'.1~.2'~'"?'?.2~.2'$#32768"~"#0$#65535"'"$".2~.2"'~#1 DO .3 <- '?#123$.1'~'#0$#65535' DO .3 <- '&"'#123~.3'~'"?'?.3~.3'$#32768"~"#0$#65535"'"$".3~.3"'~#1 PLEASE DO (15) NEXT PLEASE DO (3) NEXT DO (16) NEXT (15) DO (17) NEXT PLEASE FORGET #1 DO (16) NEXT (17) DO (18) NEXT PLEASE FORGET #2 DO (16) NEXT (18) PLEASE STASH .1 DO .1 <- .3 DO (1000) NEXT DO .1 <- .3 DO .2 <- #1 DO (1000) NEXT PLEASE RETRIEVE .1 PLEASE RESUME .3 (16) PLEASE FORGET #1 DO RESUME #1 (2) DO .2 <- #65 DO (1010) NEXT PLEASE .1 <- .3 PLEASE .2 <- #13 DO (1000) NEXT PLEASE STASH .3 DO .1 <- .3 DO .2 <- #26 DO (1040) NEXT DO .1 <- .3 DO (1030) NEXT DO .2 <- .3 PLEASE RETRIEVE .3 DO .1 <- .3 DO (1010) NEXT DO .1 <- .3 DO .2 <- #65 DO (1000) NEXT DO .1 <- .3 DO RESUME #1 (3) DO .2 <- #97 DO (1010) NEXT DO .1 <- .3 DO .2 <- #13 DO (1000) NEXT DO STASH .3 DO .1 <- .3 DO .2 <- #26 DO (1040) NEXT DO .1 <- .3 DO (1030) NEXT DO .2 <- .3 DO RETRIEVE .3 DO .1 <- .3 DO (1010) NEXT DO .1 <- .3 DO .2 <- #97 DO (1000) NEXT DO .1 <- .3 PLEASE RESUME #1 DO COME FROM (10) DO .4 <- #0 DO .5 <- #0 DO STASH .4 + .5 DO ,1 <- #1 DO COME FROM (33) DO WRITE IN ,1 DO .1 <- ,1 SUB #1 DO (31) NEXT PLEASE DO .6 <- #1 PLEASE DO (34) NEXT (32) PLEASE RESUME '?.1$#256'~'#256$#256' (31) DO (32) NEXT DO FORGET #1 DO .6 <- #0 PLEASE DO (34) NEXT (33) DON'T GIVE UP (34) DO .6 <- "?!6'$#1"~#3 DO (40) NEXT DO GIVE UP (40) DO (41) NEXT PLEASE FORGET #1 DO (42) NEXT (41) DO RESUME .6 (42) DO FORGET #1 DO RETRIEVE .4 DO .2 <- .4 DO (1000) NEXT DO .4 <- .3~#255 DO .3 <- .4 DO STASH .4 DO .1 <- .3 DO (1) NEXT DO .3 <- !1~#15'$!1~#240' DO .3 <- !3~#15'$!3~#240' DO .2 <- !3~#15'$!3~#240' DO .1 <- .5 DO (1010) NEXT DO .5 <- .2 DO ,1 SUB #1 <- .3 PLEASE READ OUT ,1 PLEASE RESUME #1 intercal-0.30/pit/PaxHeaders.27456/yapp.tst0000644000000000000000000000007411437550756015324 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.574945729 intercal-0.30/pit/yapp.tst0000644000175000017500000000005611437550756015220 0ustar00esresr00000000000000THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG. intercal-0.30/pit/PaxHeaders.27456/life.doc0000644000000000000000000000007411437550756015225 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.566945757 intercal-0.30/pit/life.doc0000644000175000017500000001444211437550756015125 0ustar00esresr00000000000000 As documentation for the program life.i, I am including below the original posting message, with the program itself deleted. The present program life.i is nearly identical to the one that was posted. The only two changes are that I have fixed a bug where a 32-bit number was assigned to a 16-bit variable, and I have streamlined the decrement routine--- entry points (2000) and (2010)---by eliminating a temporary variable. The old versions of these code fragments are included at the end of the file. Louis Howell November 24, 1991 ----------------------------------------------------------------------------- Subject: Life with Intercal (long) Newsgroups: alt.lang.intercal From: Louis Howell Date: Mon, 28 Jan 91 09:17:36 PST I suppose some of you are wondering if anyone ever actually writes anything in Intercal, or if we all just sit around beating on the compiler and talking about how wonderful this crock would be if XXX feature were added to it. I submit the following beast as a demonstration that a vaguely interesting program can be written in the language. Of course, none of you can actually RUN this program, since the 0.6 compiler doesn't handle arrays. Take my word for it that it works, and I promise to finish up a couple of remaining details in the array implementation and send it off to Steve Real Soon Now (sometime this week, with luck). The program first takes three numbers as input: The dimensions of the grid and the desired number of time steps. It then accepts pairs of numbers indicating which cells are live in the initial state; this list of pairs is terminated by a ZERO or OH. Then it plays Life. When the final timestep is reached, or when the system overflows the grid, the program prints out pairs of numbers indicating which cells were live in the last state reached, followed by the number of time steps that were actually executed. The implementation is not as efficient as it could be by a long shot--- I just wanted to get something that worked. I use two arrays, ,1 and ,2, both with dimensions .11 BY .12. At each time step the next position based on data in ,1 is computed and stored in ,2 for all cells in the interior of the grid. Then this portion of the grid is copied back into ,1. (The cells on the edge of the grid are never changed, they just hold zeroes that are seen by the neighborhood calculations of interior cells.) Then the current time step is incremented, and if equal to the desired final time step the program jumps to the output routine. If not, it checks the ring of cells next in from the edge cells. If it finds three live cells in a row on one of the interior edges it jumps to the output routine, since on the next timestep the configuration would overflow into the boundary ring. Note that this boundary check is not done until after the first time step, so the user is responsible for providing an input state that is not about to overflow. An overflow recovery procedure that actually increased the size of the grid might be interesting, but wouldn't be terribly practical since any configuration that throws off gliders would quickly push it to the limit. The following configuration has four live cells and grows into traffic lights. To see the blinkers in the other position, change the final time step from ONE OH to NINE or ONE ONE. ONE ONE ONE ONE ONE OH FIVE SIX SIX SIX SEVEN SIX SIX SEVEN OH This is a glider aimed up the main diagonal. Specifying ZERO for the final timestep tells the program to run until overflow, since the first test is at step one. In this case it halts at step XVI with the glider translated four cells up the diagonal. You can make it run longer by increasing the dimensions of the array. NINE NINE ZERO TWO FOUR THREE FOUR FOUR FOUR FOUR THREE THREE TWO OH Here are a few of the features of the program which may be of interest to Intercal programmers. One obvious one not mentioned in the manual is the test for equality: XOR the two numbers and test if the result is zero. There are many examples of indexed loops. The loops over array indices fall into two different classes, decrement and branch on zero, and decrement and branch on equal. The time step loop uses increment and branch on equal. The nested loop computing the next state has three indices for each dimension, since it is easier to keep i-1, i and i+1 around than to recompute them on the fly. This also allows me to use the simpler branch on zero test at the base of these loops since i-1 was already available. Three new subroutines may be of general interest. Line (2000) is the entry point for a decrement routine setting .1 <- .1 minus #1. This is very similar to the increment routine (1020) in the system library, which I also use. Line (2010) is the decrement and branch on zero operation. It decrements .1, then if .1 is not zero returns to the calling point, but if .1 is zero pops an additional entry off the RESUME stack and returns to that point instead. Line (2020) is an alternative entry point to the (1020) routine which performs an add bit operation. It sets .1 <- .1 plus .2, where .2 is already known to be either #0 or #1. The need for some kind of string I/O is painfully obvious. It would be so much nicer to be able to show the final state using a grid of O's and .'s instead of having to print out all the coordinates. I have some more ideas about string I/O which I will post later. Enough talk, on with the program: [Program deleted, see life.i for the current version.] This is where the original program had an assignment type error: DO .2 <- #0$#65535 DO .1 <- "?'"V.1$,1SUB.7.8"~.2'$#3"~.2 DO ,2 SUB .7.8 <- "?!1~.1'$#1"~#1 This is the old, less efficient version of the decrement routine: (2010) PLEASE ABSTAIN FROM (2004) (2000) PLEASE STASH .2 + .3 DO .2 <- #1 DO (2001) NEXT (2001) PLEASE FORGET #1 DO .1 <- '?.1$.2'~'#0$#65535' DO .3 <- "?!1~.2'$#1"~#3 DO (2002) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (2001) NEXT (2003) PLEASE RESUME .3 (2002) DO (2003) NEXT PLEASE RETRIEVE .2 + .3 (2004) PLEASE RESUME #2 PLEASE DO REINSTATE (2004) PLEASE RESUME '?"!1~.1'~#1"$#2'~#6 -- Louis Howell "But when we got into the street I viddied that thinking is for the gloopy ones and that the oomny ones use like inspiration and what Bog sends." intercal-0.30/pit/PaxHeaders.27456/unlambda.tst0000644000000000000000000000007411437550756016136 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.574945729 intercal-0.30/pit/unlambda.tst0000644000175000017500000000004511437550756016030 0ustar00esresr00000000000000`r```````````.H.e.l.l.o. .w.o.r.l.di intercal-0.30/pit/PaxHeaders.27456/beer.chk0000644000000000000000000000007411437550756015223 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.554945791 intercal-0.30/pit/beer.chk0000644000175000017500000002633511437550756015127 0ustar00esresr00000000000000 99 bottles of beer on the wall, 99 bottles of beer. Take one down, pass it around, 98 bottles of beer on the wall. 98 bottles of beer on the wall, 98 bottles of beer. Take one down, pass it around, 97 bottles of beer on the wall. 97 bottles of beer on the wall, 97 bottles of beer. Take one down, pass it around, 96 bottles of beer on the wall. 96 bottles of beer on the wall, 96 bottles of beer. Take one down, pass it around, 95 bottles of beer on the wall. 95 bottles of beer on the wall, 95 bottles of beer. Take one down, pass it around, 94 bottles of beer on the wall. 94 bottles of beer on the wall, 94 bottles of beer. Take one down, pass it around, 93 bottles of beer on the wall. 93 bottles of beer on the wall, 93 bottles of beer. Take one down, pass it around, 92 bottles of beer on the wall. 92 bottles of beer on the wall, 92 bottles of beer. Take one down, pass it around, 91 bottles of beer on the wall. 91 bottles of beer on the wall, 91 bottles of beer. Take one down, pass it around, 90 bottles of beer on the wall. 90 bottles of beer on the wall, 90 bottles of beer. Take one down, pass it around, 89 bottles of beer on the wall. 89 bottles of beer on the wall, 89 bottles of beer. Take one down, pass it around, 88 bottles of beer on the wall. 88 bottles of beer on the wall, 88 bottles of beer. Take one down, pass it around, 87 bottles of beer on the wall. 87 bottles of beer on the wall, 87 bottles of beer. Take one down, pass it around, 86 bottles of beer on the wall. 86 bottles of beer on the wall, 86 bottles of beer. Take one down, pass it around, 85 bottles of beer on the wall. 85 bottles of beer on the wall, 85 bottles of beer. Take one down, pass it around, 84 bottles of beer on the wall. 84 bottles of beer on the wall, 84 bottles of beer. Take one down, pass it around, 83 bottles of beer on the wall. 83 bottles of beer on the wall, 83 bottles of beer. Take one down, pass it around, 82 bottles of beer on the wall. 82 bottles of beer on the wall, 82 bottles of beer. Take one down, pass it around, 81 bottles of beer on the wall. 81 bottles of beer on the wall, 81 bottles of beer. Take one down, pass it around, 80 bottles of beer on the wall. 80 bottles of beer on the wall, 80 bottles of beer. Take one down, pass it around, 79 bottles of beer on the wall. 79 bottles of beer on the wall, 79 bottles of beer. Take one down, pass it around, 78 bottles of beer on the wall. 78 bottles of beer on the wall, 78 bottles of beer. Take one down, pass it around, 77 bottles of beer on the wall. 77 bottles of beer on the wall, 77 bottles of beer. Take one down, pass it around, 76 bottles of beer on the wall. 76 bottles of beer on the wall, 76 bottles of beer. Take one down, pass it around, 75 bottles of beer on the wall. 75 bottles of beer on the wall, 75 bottles of beer. Take one down, pass it around, 74 bottles of beer on the wall. 74 bottles of beer on the wall, 74 bottles of beer. Take one down, pass it around, 73 bottles of beer on the wall. 73 bottles of beer on the wall, 73 bottles of beer. Take one down, pass it around, 72 bottles of beer on the wall. 72 bottles of beer on the wall, 72 bottles of beer. Take one down, pass it around, 71 bottles of beer on the wall. 71 bottles of beer on the wall, 71 bottles of beer. Take one down, pass it around, 70 bottles of beer on the wall. 70 bottles of beer on the wall, 70 bottles of beer. Take one down, pass it around, 69 bottles of beer on the wall. 69 bottles of beer on the wall, 69 bottles of beer. Take one down, pass it around, 68 bottles of beer on the wall. 68 bottles of beer on the wall, 68 bottles of beer. Take one down, pass it around, 67 bottles of beer on the wall. 67 bottles of beer on the wall, 67 bottles of beer. Take one down, pass it around, 66 bottles of beer on the wall. 66 bottles of beer on the wall, 66 bottles of beer. Take one down, pass it around, 65 bottles of beer on the wall. 65 bottles of beer on the wall, 65 bottles of beer. Take one down, pass it around, 64 bottles of beer on the wall. 64 bottles of beer on the wall, 64 bottles of beer. Take one down, pass it around, 63 bottles of beer on the wall. 63 bottles of beer on the wall, 63 bottles of beer. Take one down, pass it around, 62 bottles of beer on the wall. 62 bottles of beer on the wall, 62 bottles of beer. Take one down, pass it around, 61 bottles of beer on the wall. 61 bottles of beer on the wall, 61 bottles of beer. Take one down, pass it around, 60 bottles of beer on the wall. 60 bottles of beer on the wall, 60 bottles of beer. Take one down, pass it around, 59 bottles of beer on the wall. 59 bottles of beer on the wall, 59 bottles of beer. Take one down, pass it around, 58 bottles of beer on the wall. 58 bottles of beer on the wall, 58 bottles of beer. Take one down, pass it around, 57 bottles of beer on the wall. 57 bottles of beer on the wall, 57 bottles of beer. Take one down, pass it around, 56 bottles of beer on the wall. 56 bottles of beer on the wall, 56 bottles of beer. Take one down, pass it around, 55 bottles of beer on the wall. 55 bottles of beer on the wall, 55 bottles of beer. Take one down, pass it around, 54 bottles of beer on the wall. 54 bottles of beer on the wall, 54 bottles of beer. Take one down, pass it around, 53 bottles of beer on the wall. 53 bottles of beer on the wall, 53 bottles of beer. Take one down, pass it around, 52 bottles of beer on the wall. 52 bottles of beer on the wall, 52 bottles of beer. Take one down, pass it around, 51 bottles of beer on the wall. 51 bottles of beer on the wall, 51 bottles of beer. Take one down, pass it around, 50 bottles of beer on the wall. 50 bottles of beer on the wall, 50 bottles of beer. Take one down, pass it around, 49 bottles of beer on the wall. 49 bottles of beer on the wall, 49 bottles of beer. Take one down, pass it around, 48 bottles of beer on the wall. 48 bottles of beer on the wall, 48 bottles of beer. Take one down, pass it around, 47 bottles of beer on the wall. 47 bottles of beer on the wall, 47 bottles of beer. Take one down, pass it around, 46 bottles of beer on the wall. 46 bottles of beer on the wall, 46 bottles of beer. Take one down, pass it around, 45 bottles of beer on the wall. 45 bottles of beer on the wall, 45 bottles of beer. Take one down, pass it around, 44 bottles of beer on the wall. 44 bottles of beer on the wall, 44 bottles of beer. Take one down, pass it around, 43 bottles of beer on the wall. 43 bottles of beer on the wall, 43 bottles of beer. Take one down, pass it around, 42 bottles of beer on the wall. 42 bottles of beer on the wall, 42 bottles of beer. Take one down, pass it around, 41 bottles of beer on the wall. 41 bottles of beer on the wall, 41 bottles of beer. Take one down, pass it around, 40 bottles of beer on the wall. 40 bottles of beer on the wall, 40 bottles of beer. Take one down, pass it around, 39 bottles of beer on the wall. 39 bottles of beer on the wall, 39 bottles of beer. Take one down, pass it around, 38 bottles of beer on the wall. 38 bottles of beer on the wall, 38 bottles of beer. Take one down, pass it around, 37 bottles of beer on the wall. 37 bottles of beer on the wall, 37 bottles of beer. Take one down, pass it around, 36 bottles of beer on the wall. 36 bottles of beer on the wall, 36 bottles of beer. Take one down, pass it around, 35 bottles of beer on the wall. 35 bottles of beer on the wall, 35 bottles of beer. Take one down, pass it around, 34 bottles of beer on the wall. 34 bottles of beer on the wall, 34 bottles of beer. Take one down, pass it around, 33 bottles of beer on the wall. 33 bottles of beer on the wall, 33 bottles of beer. Take one down, pass it around, 32 bottles of beer on the wall. 32 bottles of beer on the wall, 32 bottles of beer. Take one down, pass it around, 31 bottles of beer on the wall. 31 bottles of beer on the wall, 31 bottles of beer. Take one down, pass it around, 30 bottles of beer on the wall. 30 bottles of beer on the wall, 30 bottles of beer. Take one down, pass it around, 29 bottles of beer on the wall. 29 bottles of beer on the wall, 29 bottles of beer. Take one down, pass it around, 28 bottles of beer on the wall. 28 bottles of beer on the wall, 28 bottles of beer. Take one down, pass it around, 27 bottles of beer on the wall. 27 bottles of beer on the wall, 27 bottles of beer. Take one down, pass it around, 26 bottles of beer on the wall. 26 bottles of beer on the wall, 26 bottles of beer. Take one down, pass it around, 25 bottles of beer on the wall. 25 bottles of beer on the wall, 25 bottles of beer. Take one down, pass it around, 24 bottles of beer on the wall. 24 bottles of beer on the wall, 24 bottles of beer. Take one down, pass it around, 23 bottles of beer on the wall. 23 bottles of beer on the wall, 23 bottles of beer. Take one down, pass it around, 22 bottles of beer on the wall. 22 bottles of beer on the wall, 22 bottles of beer. Take one down, pass it around, 21 bottles of beer on the wall. 21 bottles of beer on the wall, 21 bottles of beer. Take one down, pass it around, 20 bottles of beer on the wall. 20 bottles of beer on the wall, 20 bottles of beer. Take one down, pass it around, 19 bottles of beer on the wall. 19 bottles of beer on the wall, 19 bottles of beer. Take one down, pass it around, 18 bottles of beer on the wall. 18 bottles of beer on the wall, 18 bottles of beer. Take one down, pass it around, 17 bottles of beer on the wall. 17 bottles of beer on the wall, 17 bottles of beer. Take one down, pass it around, 16 bottles of beer on the wall. 16 bottles of beer on the wall, 16 bottles of beer. Take one down, pass it around, 15 bottles of beer on the wall. 15 bottles of beer on the wall, 15 bottles of beer. Take one down, pass it around, 14 bottles of beer on the wall. 14 bottles of beer on the wall, 14 bottles of beer. Take one down, pass it around, 13 bottles of beer on the wall. 13 bottles of beer on the wall, 13 bottles of beer. Take one down, pass it around, 12 bottles of beer on the wall. 12 bottles of beer on the wall, 12 bottles of beer. Take one down, pass it around, 11 bottles of beer on the wall. 11 bottles of beer on the wall, 11 bottles of beer. Take one down, pass it around, 10 bottles of beer on the wall. 10 bottles of beer on the wall, 10 bottles of beer. Take one down, pass it around, 9 bottles of beer on the wall. 9 bottles of beer on the wall, 9 bottles of beer. Take one down, pass it around, 8 bottles of beer on the wall. 8 bottles of beer on the wall, 8 bottles of beer. Take one down, pass it around, 7 bottles of beer on the wall. 7 bottles of beer on the wall, 7 bottles of beer. Take one down, pass it around, 6 bottles of beer on the wall. 6 bottles of beer on the wall, 6 bottles of beer. Take one down, pass it around, 5 bottles of beer on the wall. 5 bottles of beer on the wall, 5 bottles of beer. Take one down, pass it around, 4 bottles of beer on the wall. 4 bottles of beer on the wall, 4 bottles of beer. Take one down, pass it around, 3 bottles of beer on the wall. 3 bottles of beer on the wall, 3 bottles of beer. Take one down, pass it around, 2 bottles of beer on the wall. 2 bottles of beer on the wall, 2 bottles of beer. Take one down, pass it around, 1 bottles of beer on the wall. 1 bottles of beer on the wall, 1 bottles of beer. Take one down, pass it around, 0 bottles of beer on the wall. intercal-0.30/pit/PaxHeaders.27456/pi.chk0000644000000000000000000000007411437550756014716 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.566945757 intercal-0.30/pit/pi.chk0000644000175000017500000000004011437550756014603 0ustar00esresr00000000000000 III I IV I V IX intercal-0.30/pit/PaxHeaders.27456/CATALOG0000644000000000000000000000007411441323355014600 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.554945791 intercal-0.30/pit/CATALOG0000644000175000017500000001624711441323355014505 0ustar00esresr00000000000000This is the directory of programs written in INTERCAL. Most of these are no doubt full of bugs. Don't complain, you're lucky if anything written in INTERCAL works at all. Some of these programs are explicitly licenced under the GNU GPL, just like the C-INTERCAL compiler is; therefore, remember to include COPYING.txt from the main installation directory if you want to redistribute these separately from that compiler. The subdirectory lib contains code fragments that are not complete programs; the programs in explib are expansion libraries written in C, which serve as examples of the C-INTERCAL to C interface as well as potentially being useful. Programs marked with + have associated .chk files (and, if they take input, corresponding .tst files) and are part of the regression-test suite. Contents: from original manual: sample.i Returns absolute value of a 16-bit 2s-complement number lib/syslib-orig.i Standard library (original buggy version) by Jon Blow tests/sink.i + Simple test program, should sink into the Black Lagoon random.i Random number program lib/plus.i Increment .1 by Hans Olsson lib/1910.doc Listing of a random number routine. Hans said he wrote this because he couldn't find (1910) in the system library, but it's there in our lib/syslib.i. We keep this around as an example. (What? Throw away INTERCAL code? Perish the thought!) by Louis Howell life.i Conway's game of Life, standard INTERCAL version life2.i This version uses COME FROM and character output blinkers t_tet glider gun Input files for both Life programs bubble.i + Bubble sort. List of numbers to be sorted must be preceded with the length of the list. icat.i + Sends input to output lib/lib2.i New library routines: decrement, decrement and branch on 0, add bit, 16-bit division with remainder, exponentiation pi.i + Calculate pi to a specified number of digits primes.i Find prime numbers pow.i + Prints a list of nth powers using old exponentiation routine. Expect this to fail with overflow. lib/syslib.i Corrected version of system library iching1.i Generates I Ching hexagrams iching2.i This version uses a lookup table to find the sequence number iching.doc Description of the two I Ching programs change.i Count up different ways to make change change.doc Description of change.i tests/testsplat.i + Tests behavior of comments and things resembling comments. by Matt Dimeo beer.i + Print out lyrics to "99 Bottles of Beer On The Wall" by Stinglai Ka'abi : random2.i Another random-number generator by Jacob Mandelson rot13.i + Prints ROT-13 of its input by Jan-Pieter Cornet hail_mary.3i + Print 1,000,000 Hail Marys tests/count.3i + Count from 1 to 10 in TriINTERCAL tests/iogerunds.i Demonstrate gerund abstention by Clemens Meier rot13b.i + Another ROT-13 program By Brian Raiter lib/numio.i I/O routines lib/numio.doc Description of the I/O routines lib/syslib3.3i lib/syslib4.4i lib/syslib5.5i lib/syslib6.6i Translations of the standard library to lib/syslib7.7i C-INTERCAL's other bases. lib/syslib3-7.doc Documentation for same tests/hello.i + The traditional hello world program ins.i Intersections & Splats, a Mastermind-style game ins.doc Documentation for I&S yapp.i + Prints an INTERCAL program that prints yapp.doc Description of yapp.i quine.i + Prints itself lib/floatlib.i Floating-point routines lib/floatlib.doc Documentation for the floating-point routines flonck.i + An RPN calculator flonck.doc Documentation for flonck.i (requires floatlib) fft.i + Fast Fourier Transform (requires syslib and floatlib) fft.doc Description of fft.i by Donald Knuth tpk.i + Don Knuth's implementation of the TPK algorithm tpk.doc Don's note about the algorithm by Oerjan Johansen unlambda.i + An Unlambda interpreter in INTERCAL unlambda.doc Better-commented version of the above by Jeffrey Lee interfunge.i + A Befunge-93 interpreter in INTERCAL by Brendan Gregg guess.i Guessing game implementation in INTERCAL The subdirectory tests contains some programs written only to test the compiler. by David Moews tests/test1.i + Prints DO THIS TEST HAS BEEN SUCCESSFULLY COMPLETED tests/test2.i + Reads in two numbers and reports their product by Alex Smith tests/ais1.i + Reads in numbers terminated with zero and writes them back out, testing COME FROM/NEXT interaction. tests/ais2.i + A demonstration of computed ABSTAIN's power. Computes the Fibinacci sequence; in the innput file, ONE means compute the nextvterm and ZERO means stop. tests/compucome.i A program to test computed COME FROM tests/onceagain.i + A single-threaded program testing ONCE and AGAIN. Output just tracks the program control flow. tests/arrtest.i A program to test some changes I made to the grammar. No output expected as it's just a parser test. tests/arrtest.doc The history behind those changes tests/permute.i + A permutation-printing program to test backtracking tests/permute.doc Information about the permutation-printer tests/whileadd.i + Adds two input numbers with a single WHILE statement tests/ignorret.i + Testing interactions of IGNORE and RETRIEVE tests/ignorearray.i + Checking that IGNORE works correctly on arrays tests/ignorret.doc What ignorret does on several compilers tests/normaldist.i Checking the standard deviation of (1910) tests/testcreate.i + A test for the CREATE statement tests/iffit1.i The INTERCAL side of the INTERCAL/Funge-98 test tests/iffit2.b98 The Funge side of the INTERCAL/Funge-98 test tests/iffit.doc Documentation for the INTERCAL/Funge-98 test explib/syslibc.c The INTERCAL base 2 syslib, optimised version in C explib/compunex.c An example flow-control routine (computed NEXT) explib/ecto_b98.c A library that links INTERCAL and Funge-98 code sort.i + An insertion-sort program testing computed ABSTAIN continuation.i A continuation library and example program continuation.doc About usage and internals of the continuation library by Malcom Ryan tests/testonce.i + A single-threaded program that tests all permutations of the ONCE modifier; the output is simply to verify that the program flow follows the sequence expected. pass.i + A multithread program illustrating communications between threads. Simply reads in a list of numbers (terminated by ZERO) and writes them out. The programs test16bit.i, testarray.i, testcf.i, testlib2.i, limits.*, testops*i, were all written by Louis Howell. Of these, testcf.i might be considered an interesting puzzle---try to figure out what it's doing. The others are pretty boring, but are included as diagnostics and because so few other example programs exist. Not all of these even produce interesting diagnostic output; it may be necessary to look at the degenerated C code to determine if the compiler is doing the right thing. End of file CATALOG ------------------- intercal-0.30/pit/PaxHeaders.27456/pi.doc0000644000000000000000000000007411437550756014716 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.566945757 intercal-0.30/pit/pi.doc0000644000175000017500000000557411437550756014624 0ustar00esresr00000000000000 pi.i is easily the most twisted and obscure INTERCAL program I've yet written. I say that because even I don't fully understand why it works. The program writes in one number from the input, then prints out that many digits of pi. There are no fancy INTERCAL tricks here; all it does is simple integer arithmetic. The algorithm used comes from an old TECO macro that was recently discussed on alt.lang.teco. Mark Henderson posted a translation into C, which at least made it easier to read, if not much easier to understand. I played around with that program a bit, fixed a couple of minor bugs which may or may not have existed in the original TECO, and modified it a bit to put in into a form that would be easy to translate into INTERCAL. That modified program, which corresponds closely to the algorithm in pi.i, is reproduced at the end of this file. The INTERCAL version has only been tested up to a hundred digits, which took almost 30 minutes on a Sparc 1. The C version below, with variables declared unsigned short to correspond to the INTERCAL, gives up to 535 accurate digits and then starts printing garbage, presumably because of an overflow. If the declarations are changed to short only the first 262 digits are accurate, while using int yields thousands of accurate digits. Though I don't understand what the inner loop is doing, it looks like the largest numbers encountered are O(n), where n is the number of digits requested. If, as I expect, the present INTERCAL version does fail after about 535 digits, it could easily be converted to a 32-bit form which would run as long as almost anyone would desire. The only feature likely to be of utility in other INTERCAL programs is the new (2030) routine, which performs a 16-bit division with remainder. It is faster than the (1040) routine for two reasons: First, it is a true 16-bit version, whereas the (1040) routine just shifts over its operands and then calls the 32-bit division routine (1550). Second, the (1550) routine generates a remainder as part of the computation, but then simply throws it away. I needed the remainder, so I have my (2030) routine return it in .4 and the quotient in .3. In other respects this is just a 16-bit translation of the (1550) routine. Louis Howell December 30, 1991 #include unsigned short line[10000]; main(argc,argv) int argc; char *argv[]; { unsigned short n, a, i, q, v, dummy, h=0, w=0; if (argc==2) n=atoi(argv[1]); else n=20; n+=2; for (i=(n*10)/3 ; i > 0 ; i--) { line[i-1] = 2; } for (dummy=0; dummy < n; dummy++) { q=0; for (i=(n*10)/3 ; i > 0 ; i--) { a = line[i-1] * 10 + (q*i); q=a/(i*2-1); line[i-1] = a%(i*2-1); } v = w; w = h+(q/10); h = q%10; if (w==10) { w=0; v++; } if (dummy!=0) printf("%d", v); } printf("\n"); } intercal-0.30/pit/PaxHeaders.27456/ins.i0000644000000000000000000000007411437550756014562 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/ins.i0000644000175000017500000002322511437550756014461 0ustar00esresr00000000000000 PLEASE NOTE THE STARTUP BANNER PLEASE DO ,1 <- #43 DO ,1SUB#1 <- #176 DO ,1SUB#2 <- #190 DO ,1SUB#3 <- #142 DO ,1SUB#4 <- #146 DO ,1SUB#5 <- #110 DO ,1SUB#6 <- #218 DO ,1SUB#7 <- #38 DO ,1SUB#8 <- #98 DO ,1SUB#9 <- #158 DO ,1SUB#10 <- #186 DO ,1SUB#11 <- #70 DO ,1SUB#12 <- #58 DO ,1SUB#13 <- #198 DO ,1SUB#14 <- #98 DO ,1SUB#15 <- #158 DO ,1SUB#16 <- #66 DO ,1SUB#17 <- #190 DO ,1SUB#18 <- #218 DO ,1SUB#19 <- #38 DO ,1SUB#20 <- #114 DO ,1SUB#21 <- #142 DO ,1SUB#22 <- #18 DO ,1SUB#23 <- #238 DO ,1SUB#24 <- #146 DO ,1SUB#25 <- #110 DO ,1SUB#26 <- #58 DO ,1SUB#27 <- #198 DO ,1SUB#28 <- #0 DO ,1SUB#29 <- #160 DO ,1SUB#30 <- #96 DO ,1SUB#31 <- #0 DO ,1SUB#32 <- #58 DO ,1SUB#33 <- #198 DO ,1SUB#34 <- #250 DO ,1SUB#35 <- #6 DO ,1SUB#36 <- #210 DO ,1SUB#37 <- #46 DO ,1SUB#38 <- #130 DO ,1SUB#39 <- #126 DO ,1SUB#40 <- #218 DO ,1SUB#41 <- #38 DO ,1SUB#42 <- #58 DO ,1SUB#43 <- #122 PLEASE READ OUT ,1 PLEASE NOTE THE INITIALIZATION OF GLOBAL VALUES PLEASE DO ,5 <- #1 DO ,5SUB#1 <- #0 PLEASE DO ,6 <- #1 DO ,6SUB#1 <- #76 PLEASE DO ,7 <- #1 DO ,7SUB#1 <- #180 PLEASE DO ,11 <- #1 PLEASE DO ,12 <- #2 PLEASE DO ,15 <- #5 PLEASE DO ,16 <- #6 DO ,15SUB#1 <- #240 DO ,15SUB#4 <- #144 DO ,15SUB#5 <- #0 DO (3990) NEXT DO .11 <- #10 DO .12 <- #4 DO .13 <- #6 PLEASE COME FROM (64) DO (100) NEXT PLEASE NOTE THE GAME BEGINNING AND THE COMPUTER CHOOSING A CODE PLEASE COME FROM (40) DO .6 <- #1 PLEASE COME FROM (12) DO (1900) NEXT DO .1 <- .1~#4095 DO .2 <- .13 DO (1039) NEXT DO .1 <- .3~#61440 DO (1020) NEXT DO ,23SUB.6 <- .1 DO .5 <- '?"'#65535~"'?.6$.12'~#21845"'~#1"$#1'~#3 DO (13) NEXT DO .1 <- .6 DO (1020) NEXT (12) DO .6 <- .1 (13) DO (1001) NEXT PLEASE FORGET #1 PLEASE NOTE THE OPENING OF THE GREAT LOOP DO .10 <- #1 PLEASE COME FROM (42) PLEASE NOTE THE BOARD BEING DRAWN AND INPUT BEING GATHERED PLEASE COME FROM (62) DO .4 <- #1 DO (130) NEXT DO ,16SUB#1 <- #158 DO ,16SUB#2 <- #192 DO ,16SUB#3 <- #136 DO ,16SUB#4 <- #200 DO ,16SUB#5 <- #70 DO ,16SUB#6 <- #88 PLEASE COME FROM (22) PLEASE READ OUT ,16 DO .1 <- .12 DO .2 <- .13 DO (3020) NEXT DO .5 <- .4 DO (23) NEXT DO .5 <- '?"'#65535~"'?.3$#1'~'#0$#65535'"'~#1"$#1'~#3 PLEASE COME FROM (28) (26) DO (27) NEXT (27) DO (1001) NEXT PLEASE FORGET #1 DO .1 <- ,1SUB#1 DO (50) NEXT (28) DO ,1SUB#1 <- #82 (23) DO (1001) NEXT PLEASE FORGET #1 DO .5 <- '?"'#65535~"'?.3$.12'~#21845"'~#1"$#1'~#3 (25) DO (24) NEXT PLEASE COME FROM (26) DO ,12SUB#1 <- #8 DO ,12SUB#2 <- #172 (22) PLEASE READ OUT ,12 (24) DO (1001) NEXT PLEASE FORGET #1 PLEASE READ OUT ,7 DO .1 <- #1 PLEASE COME FROM (20) DO ,22SUB.10.1 <- ,1SUB.1 DO .5 <- '?"'#65535~"'?.1$.12'~#21845"'~#1"$#1'~#3 DO (21) NEXT (20) DO (1020) NEXT (21) DO (1001) NEXT PLEASE FORGET #1 PLEASE NOTE THE SCORING OF THE GUESS DO .6 <- #32768 DO .7 <- #0 DO .8 <- #0 DO .2 <- #1 PLEASE COME FROM (30) DO .9 <- ,23SUB.2 DO .5 <- '?"'#65535~"'?",22SUB.10.2"$.9'~#21845"'~#1"$#2'~#3 DO (31) NEXT (32) DO .7 <- 'V.7$.6'~'#0$#65535' (31) DO (1001) NEXT PLEASE FORGET #1 DO .1 <- #1 PLEASE COME FROM (33) DO .5 <- '?"'#65535~"'?",22SUB.10.1"$.9'~#21845"'~#1"$#2'~#3 DO (34) NEXT PLEASE COME FROM (32) (35) DO .8 <- 'V.8$.6'~'#0$#65535' (34) DO (1001) NEXT PLEASE FORGET #1 DO .5 <- '?"'#65535~"'?.1$.12'~#21845"'~#1"$#1'~#3 DO (36) NEXT (33) DO (1020) NEXT (36) DO (1001) NEXT PLEASE FORGET #1 PLEASE COME FROM (35) DO .6 <- .6~#65534 DO .5 <- '?"'#65535~"'?.2$.12'~#21845"'~#1"$#1'~#3 DO (37) NEXT DO .1 <- .2 DO (1020) NEXT (30) DO .2 <- .1 (37) DO (1001) NEXT PLEASE FORGET #1 DO ,21SUB.10#1 <- .7~.7 DO ,21SUB.10#2 <- .8~.8 DO .6 <- ',21SUB.10#1'~.20 PLEASE NOTE THE CLOSING OF THE GREAT LOOP DO .5 <- '?.6$#2'~#3 DO (41) NEXT DO .5 <- '?"'#65535~"'?.10$.11'~#21845"'~#1"$#1'~#3 DO (41) NEXT DO .1 <- .10 DO (1020) NEXT (42) DO .10 <- .1 (41) DO (1001) NEXT PLEASE FORGET #1 DO .1 <- .10 DO (1020) NEXT DO .10 <- .1 DO .4 <- #2 DO (130) NEXT PLEASE NOTE THE GAME'S DENOUEMENT DO ,16SUB#1 <- #118 DO ,16SUB#2 <- #24 DO ,16SUB#3 <- #80 DO ,16SUB#4 <- #232 DO ,16SUB#5 <- #208 DO ,16SUB#6 <- #182 PLEASE READ OUT ,16 DO .1 <- #1 DO .2 <- #0 DO (3020) NEXT DO .5 <- '?"'#65535~"'?.3$#1'~'#0$#65535'"'~#1"$#2'~#3 DO (43) NEXT DO .1 <- ,1SUB#1 DO (59) NEXT DO (44) NEXT (43) DO (1001) NEXT (44) PLEASE FORGET #1 PLEASE COME FROM (63) (40) PLEASE READ OUT ,7 PLEASE NOTE THE HANDLING OF USER COMMANDS (50) DO .5 <- '?"'#65535~"'?.1$#82'~#21845"'~#1"$#1'~#3 DO (52) NEXT DO .5 <- '?"'#65535~"'?.1$#78'~#21845"'~#1"$#1'~#3 DO (53) NEXT (59) DO .5 <- '?"'#65535~"'?.1$#67'~#21845"'~#1"$#1'~#3 DO (54) NEXT DO .5 <- '?"'#65535~"'?.1$#81'~#21845"'~#1"$#1'~#3 DO (55) NEXT DO RESUME #1 (52) DO (1001) NEXT PLEASE FORGET #2 (62) PLEASE READ OUT ,7 (53) DO (1001) NEXT (63) PLEASE FORGET #2 (54) DO (1001) NEXT DO ,11SUB#1 <- #88 DO ,12SUB#1 <- #54 DO ,12SUB#2 <- #190 PLEASE READ OUT ,7 + ,12 + ,11 PLEASE WRITE IN .1 DO .5 <- '?"'.1~.1'~#1"$#1'~#3 DO (51) NEXT DO ,12SUB#1 <- #106 DO ,12SUB#2 <- #62 PLEASE READ OUT ,12 + ,11 PLEASE WRITE IN .2 DO .5 <- '?"'.2~.2'~#1"$#1'~#3 DO (51) NEXT DO ,12SUB#1 <- #146 DO ,12SUB#2 <- #22 PLEASE READ OUT ,12 + ,11 PLEASE WRITE IN .3 DO .5 <- '?"'.3~.3'~#1"$#1'~#3 DO (51) NEXT DO .11 <- .1~#15 DO .12 <- .2~#15 DO .13 <- .3~#15 PLEASE FORGET #2 (64) PLEASE READ OUT ,7 (51) DO (1001) NEXT PLEASE RESUME #3 (55) DO (1001) NEXT PLEASE FORGET #2 PLEASE READ OUT ,7 PLEASE GIVE UP PLEASE NOTE THE SUBROUTINE TO INITIALIZE GLOBAL VARIABLES (100) DO ,21 <- .11 BY #2 DO ,22 <- .11 BY .12 DO ,23 <- .12 DO .20 <- #1 DO .1 <- #1 PLEASE COME FROM (104) DO .5 <- '?"'#65535~"'?.1$.12'~#21845"'~#1"$#1'~#3 DO (105) NEXT DO .20 <- !20$#0'~'#32767$#1' (104) DO (1020) NEXT (105) DO (1001) NEXT PLEASE FORGET #1 DO ,1 <- .12 DO ,2 <- .13 DO ,10 <- .13 BY #2 DO .1 <- #1 PLEASE COME FROM (102) DO .2 <- 'V.1$#48'~#21845 DO ,2SUB.1 <- .2 DO .2 <- !2~#15'$!2~#240' DO .2 <- !2~#15'$!2~#240' DO .2 <- !2~#15'$!2~#240' DO .4 <- .1 DO .1 <- #20 DO (1010) NEXT DO .1 <- .4 DO ,10SUB.1#1 <- .3~#255 DO ,10SUB.1#2 <- '?.3$#112'~#21845 DO .5 <- '?"'#65535~"'?.1$.13'~#21845"'~#1"$#1'~#3 DO (103) NEXT (102) DO (1020) NEXT (103) DO (1001) NEXT PLEASE RESUME #2 PLEASE NOTE THE SUBROUTINE TO DISPLAY THE BOARD (130) PLEASE STASH .1 + .2 + .3 + .4 + .5 DO .4 <- .20 DO .5 <- '?".12~#1"$#1'~#3 DO (131) NEXT DO .4 <- !4$#0'~'#32767$#1' DO (132) NEXT (131) DO (1001) NEXT (132) PLEASE FORGET #1 DO .2 <- .4 PLEASE COME FROM (140) PLEASE READ OUT ,6 DO .1 <- #1 PLEASE COME FROM (134) DO .5 <- '?"'#65535~"'?.1$.10'~#21845"'~#1"$#1'~#3 DO (133) NEXT DO .3 <- .2~#65534 PLEASE COME FROM (135) DO .5 <- '?"',21SUB.1#1'~.3"$#1'~#3 DO (139) NEXT DO ,12SUB#1 <- #176 DO ,12SUB#2 <- #80 DO (137) NEXT (139) DO (1001) NEXT PLEASE FORGET #1 DO .5 <- '?"',21SUB.1#2'~.3"$#1'~#3 DO (138) NEXT DO ,12SUB#1 <- #48 DO ,12SUB#2 <- #208 DO (137) NEXT (138) DO (1001) NEXT DO ,12SUB#1 <- #0 DO ,12SUB#2 <- #0 (137) PLEASE FORGET #1 PLEASE READ OUT ,12 DO .5 <- '?".3~.2"$#2'~#3 DO (136) NEXT (135) DO .3 <- .2 (136) DO (1001) NEXT PLEASE FORGET #1 PLEASE READ OUT ,5 (134) DO (1020) NEXT (133) DO (1001) NEXT PLEASE FORGET #1 PLEASE READ OUT ,7 DO .2 <- .2~#65532 DO .5 <- '?".2~.2"$#1'~#3 (140) DO (141) NEXT (141) DO (1001) NEXT PLEASE FORGET #1 PLEASE RETRIEVE .4 DO ,16SUB#1 <- #0 DO ,16SUB#2 <- #0 DO ,16SUB#3 <- #240 DO ,16SUB#6 <- #68 DO .2 <- #0 PLEASE COME FROM (150) DO .1 <- .2 DO (1020) NEXT DO .2 <- .1 PLEASE READ OUT ,6 DO .1 <- #1 DO .3 <- #0 PLEASE COME FROM (142) DO .5 <- '?"'#65535~"'?.1$.10'~#21845"'~#1"$#1'~#3 DO (149) NEXT DO .5 <- ,22SUB.1.2 DO ,15SUB#2 <- ,10SUB.5#1 DO ,15SUB#3 <- ,10SUB.5#2 PLEASE READ OUT ,15 DO .3 <- .1 (142) DO (1020) NEXT (149) DO (1001) NEXT DO ,15SUB#2 <- #16 DO ,15SUB#3 <- #112 (148) DO .1 <- .3 PLEASE COME FROM (144) PLEASE READ OUT ,15 DO (1020) NEXT PLEASE COME FROM (148) DO .5 <- '?"'#65535~"'?.1$.11'~#21845"'~#1"$#1'~#3 (144) DO (143) NEXT (143) DO (1001) NEXT PLEASE FORGET #2 DO .5 <- .4 DO (145) NEXT DO .5 <- ,23SUB.2 DO ,16SUB#4 <- ,10SUB.5#1 DO ,16SUB#5 <- ,10SUB.5#2 DO (146) NEXT (145) DO (1001) NEXT DO ,16SUB#4 <- #24 DO ,16SUB#5 <- #104 (146) PLEASE FORGET #1 PLEASE READ OUT ,16 DO .5 <- '?"'#65535~"'?.2$.12'~#21845"'~#1"$#1'~#3 (150) DO (147) NEXT (147) DO (1001) NEXT PLEASE FORGET #1 PLEASE READ OUT ,5 PLEASE RETRIEVE .1 + .2 + .3 + .5 PLEASE RESUME #1 PLEASE USE THE AUTHORIZED CHANNELS (3000) DO STASH .2 + .3 DO .1 <- ,3000SUB#1 PLEASE WRITE IN ,3000 DO .2 <- ,3000SUB#1 DO (1000) NEXT DO .1 <- .3~#255 DO ,3000SUB#1 <- .1 DO RETRIEVE .2 + .3 PLEASE RESUME #1 (3020) PLEASE STASH .1 + .5 + .6 + .7 DO (1020) NEXT DO .3 <- #0 DO .4 <- #6 DO .6 <- .1 DO (3022) NEXT (3021) DO (1001) NEXT (3022) PLEASE FORGET #1 DO (3000) NEXT DO .5 <- '?"?.1~#256"$#2'~#3 DO (3023) NEXT DO .5 <- '?"'#65535~"'?.1$#10'~#21845"'~#1"$#1'~#3 DO (3023) NEXT DO .7 <- .1 DO .1 <- .3 PLEASE DO (1020) NEXT DO .3 <- .1 DO .5 <- .4~#3 DO (3021) NEXT DO .5 <- '?"'#65535~"'?.3$.6'~'#0$#65535'"'~#1"$#1'~#3 DO .4 <- !4$.5'~#37 DO (3021) NEXT (3027) DO .1 <- #0 PLEASE COME FROM (3024) PLEASE DO (1020) NEXT DO .5 <- '?"'#65535~"'?.7$",2SUB.1"'~#21845"'~#1"$#1'~#3 DO (3025) NEXT PLEASE COME FROM (3027) DO .5 <- '?"'#65535~"'?.1$.2'~'#0$#65535'"'~#1"$#1'~#3 (3024) DO (3026) NEXT (3026) DO (1001) NEXT PLEASE FORGET #1 PLEASE DO ,1SUB.3 <- .7 DO .4 <- .4~#3 DO (3022) NEXT (3025) DO (1001) NEXT PLEASE FORGET #1 PLEASE DO ,1SUB.3 <- .1 DO (3022) NEXT (3023) DO (1001) NEXT PLEASE RETRIEVE .1 + .5 + .6 + .7 DO .4 <- '?#2$.&4'~#6 PLEASE RESUME #2 (3990) DO ,3000 <- #1 DO ,3000SUB#1 <- #0 DO ,3001 <- #1 DO ,3001SUB#1 <- #0 PLEASE RESUME #1 intercal-0.30/pit/PaxHeaders.27456/sort.i0000644000000000000000000000007411437550756014760 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.574945729 intercal-0.30/pit/sort.i0000644000175000017500000001674711437550756014672 0ustar00esresr00000000000000 PLEASE NOTE THAT THIS PROGRAM SORTS AN ENTERED LIST OF NUMBERS NUMBERS ARE ENTERED UNTIL A ZERO IS RECEIVED, THEN THE SORTED LIST IS OUTPUT, USING INSERTION SORT ALGORITHM PLEASE NOTE THAT THIS PROGRAM USES COMPUTED ABSTAIN, TRY AGAIN, BUT NO NEXTING, COMING FROM, OR ARRAYS PLEASE NOTE .5 .6 .7 .8 ARE ALL TEMPORARIES PLEASE NOTE .1 AND .4 ARE STASHED TO ACT LIKE ARRAYS (8) DO .1 <- #0 (9) DO STASH .1 (10) DO .2 <- #0 (13) DO .4 <- #0 (14) DO STASH .4 PLEASE NOTE .2 HOLDS CURRENT STATE OF PROGRAM; .2 IS #0 DURING INPUT, #1 WHEN INSERTING A VALUE, #3 WHEN RESETTING THE STASH, #7 WHEN OUTPUTTING THE SORTED VALUES DO REINSTATE (10) DO REINSTATE (13) DO REINSTATE (14) DO REINSTATE (10) DO REINSTATE (13) DO REINSTATE (14) DO ABSTAIN FROM (8) DO ABSTAIN FROM (9) DO ABSTAIN FROM (10) PLEASE DO ABSTAIN FROM (13) DO ABSTAIN FROM (14) PLEASE NOTE THE ABOVE LINES ENSURE 10+13+14 ARE ABSTAINED FROM EXACTLY ONCE PLEASE NOTE WRITING IN AN ELEMENT IFF .2 IS #0 DO ABSTAIN FROM (15) DO ABSTAIN "!2~.2'~#1"$#1 FROM (15) PLEASE NOTE LINE 15 ABSTAINED FROM 2 OR 4 TIMES DO REINSTATE (15) DO REINSTATE (15) (15) DO WRITE IN .3 DO REINSTATE (15) DO REINSTATE (15) PLEASE NOTE SETTING LSB OF .2 DO .2 <- 'V.2$#1'~"#0$#65535" PLEASE NOTE INSERTING .3 INTO OUR STASH IF .2 IS #1 DO .8 <- '?.2$#1'~"#0$#65535" DO .8 <- !8~.8'~#1 DO .8 <- '?.8$#1'~"#0$#65535" DO ABSTAIN FROM (33) DO ABSTAIN .8$#1 FROM (33) DO REINSTATE (33) DO REINSTATE (33) (33) DO ABSTAIN #1 FROM STASHING + RETRIEVING + CALCULATING + ABSTAINING + READING OUT DO REINSTATE (33) DO REINSTATE (33) DO RETRIEVE .1 PLEASE NOTE IF .1 IS LESS THAN OR EQUAL TO .3, WE STASH .3 ON STASH .4 AND SET .2 TO #3 PLEASE NOTE IF .1 IS GREATER THAN .3, WE STASH .1 ON STASH .4 AND LEAVE .2 AS IT IS PLEASE NOTE IF .1 IS #0, THIS NEEDS THE SAME ACTIONS AS IF .1 WAS LOWER PLEASE NOTE ADDING .1 TO THE COMPLEMENT OF .3, STORING THE RESULT IN .8, OVERFLOW IN .7 DO .8 <- '?.3$#65535'~"#0$#65535" DO .5 <- .1 DO .7 <- #0 PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE DO .6<-"&!8$.5'"~'#0$#65535' DO .8<-"?!8$.5'"~'#0$#65535' DO .5<-!6$#0'~"#32767$#1" DO .7<-'V.7$".6~#32768"'~"#0$#65535" PLEASE NOTE THAT IF .1 IS GREATER THAN .3, .7 WILL BE 1; OTHERWISE .7 WILL BE 0 PLEASE NOTE .4 MUST BECOME .1 IF .7 IS 1 OR .3 IF .7 IS 0 DO .7 <- '.7$.7'$".7$.7" DO .7 <- '.7$.7'$".7$.7" PLEASE NOTE .7 IS NOW 65535 OR 0, SO WE WANT .4 <- (.1 & .7)|(.3 & ~.7) DO .5 <- '&.1$.7'~"#0$#65535" PLEASE DO .6 <- '?.7$#65535'~"#0$#65535" DO .6 <- '&.3$.6'~"#0$#65535" DO .4 <- 'V.5$.6'~"#0$#65535" DO STASH .4 PLEASE NOTE SETTING BIT 1 OF .2 IFF .7 IS #0 PLEASE DO .7 <- '?.7$#65535'~"#0$#65535" DO .7 <- '&.7$#2'~"#0$#65535" PLEASE DO .2 <- 'V.2$.7'~"#0$#65535" DO ABSTAIN FROM (1) (1) DO REINSTATE STASHING + RETRIEVING + CALCULATING + ABSTAINING + READING OUT DO REINSTATE (1) PLEASE NOTE END OF CODE FOR .2 = #1 PLEASE NOTE .9 KEEPS TRACK OF WHAT .2 WAS DO .9 <- .2 PLEASE NOTE THAT IF .3 IS #0 AND .2 IS #3 THEN .2 SHOULD BECOME #7 DO .8 <- '?.2$#3'~"#0$#65535" DO .8 <- 'V.3$.8'~"#0$#65535" DO .8 <- ".8~.8"~#1 DO .8 <- '?.8$#1'~"#0$#65535" DO .8 <- .8$!8$.8' DO .2 <- 'V.2$.8'~"#0$#65535" PLEASE NOTE THAT IF .9 != .2 WE MUST POP A #0 OFF .4'S STASH DO .8 <- '?.2$.9'~"#0$#65535" DO .8 <- !8~.8'~#1 DO .8 <- '?.8$#1'~"#0$#65535" DO ABSTAIN FROM (113) DO ABSTAIN .8$#1 FROM (113) DO REINSTATE (113) DO REINSTATE (113) (113) DO RETRIEVE .4 DO REINSTATE (113) DO REINSTATE (113) PLEASE NOTE OUTPUTTING SORTED LIST IF .2 IS #7 DO ABSTAIN FROM (125) DO .8 <- '?.2$#7'~"#0$#65535" DO .8 <- !8~.8'~#1 DO .8 <- '?.8$#1'~"#0$#65535" DO ABSTAIN FROM (54) DO ABSTAIN .8$#1 FROM (54) DO REINSTATE (54) DO REINSTATE (54) (54) DO ABSTAIN #1 FROM CALCULATING + ABSTAINING + READING OUT + RETRIEVING DO REINSTATE (54) DO REINSTATE (54) DO ABSTAIN FROM (60) DO ABSTAIN FROM (133) DO RETRIEVE .4 PLEASE NOTE IF .4 IS #0 THEN END PROGRAM DO .8 <- !4~.4'~#1 DO .8 <- '?.8$#1'~"#0$#65535" DO ABSTAIN .8$#1 FROM (125) (60) PLEASE DO REINSTATE CALCULATING + ABSTAINING + RETRIEVING DO REINSTATE (60) DO REINSTATE (125) DO REINSTATE (125) (125) DO ABSTAIN FROM (999) DO REINSTATE (125) DO REINSTATE (125) (999) DO ABSTAIN FROM RETRIEVING + CALCULATING + ABSTAINING + REINSTATING + TRYING AGAIN + READING OUT DO REINSTATE (999) DO READ OUT .4 (133) DO REINSTATE READING OUT DO REINSTATE (133) PLEASE NOTE END OF CODE FOR .2 = #7 PLEASE NOTE MOVING STASH .4 BACK TO STASH .1 IF .2 IS #3 DO .8 <- '?.2$#3'~"#0$#65535" DO .8 <- !8~.8'~#1 DO .8 <- '?.8$#1'~"#0$#65535" DO ABSTAIN FROM (34) DO ABSTAIN .8$#1 FROM (34) DO REINSTATE (34) DO REINSTATE (34) (34) DO ABSTAIN #1 FROM STASHING + RETRIEVING + CALCULATING + ABSTAINING DO REINSTATE (34) DO REINSTATE (34) PLEASE DO RETRIEVE .4 DO STASH .1 DO .1 <- .4 PLEASE NOTE THAT IF .1 IS NOW #0, WE NEED TO SET .2 BACK TO #0 AND STASH A #0 BACK IN STASH .4 THIS IS ACCOMPLISHED BY ABSTAINING ONCE OR THREE TIMES FROM 10+13+14 PLEASE DO .7 <- !1~.1'~#1 DO ABSTAIN .7$#1 FROM (10) PLEASE DO ABSTAIN .7$#1 FROM (13) DO ABSTAIN .7$#1 FROM (14) DO ABSTAIN FROM (104) PLEASE DO ABSTAIN FROM (110) PLEASE DO ABSTAIN FROM (111) DO ABSTAIN FROM (112) (104) DO REINSTATE STASHING + RETRIEVING + CALCULATING + ABSTAINING DO REINSTATE (104) PLEASE NOTE ABSTAINING #3 FROM 10+13+14 IF .2 != #3 (110) DO ABSTAIN #3 FROM (10) (111) DO ABSTAIN #3 FROM (13) (112) PLEASE DO ABSTAIN #3 FROM (14) DO REINSTATE (110) DO REINSTATE (111) DO REINSTATE (112) PLEASE DO REINSTATE (10) PLEASE DO REINSTATE (13) DO REINSTATE (14) DO REINSTATE (10) DO REINSTATE (13) DO REINSTATE (14) PLEASE NOTE END OF CODE FOR .2 = #3 PLEASE TRY AGAIN intercal-0.30/pit/PaxHeaders.27456/primes.i0000644000000000000000000000007411437550756015270 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/primes.i0000644000175000017500000000372111437550756015166 0ustar00esresr00000000000000 DO READ OUT #2 DO .10 <- #1 PLEASE COME FROM (23) DO .11 <- !10$#1'~'#32767$#1' DO .12 <- #1 PLEASE COME FROM (16) DO .13 <- !12$#1'~'#32767$#1' DO .1 <- .11 DO .2 <- .13 DO (2030) NEXT DO (11) NEXT (15) DO (13) NEXT (13) DO .3 <- "?!4~.4'$#2"~#3 DO (14) NEXT PLEASE FORGET #1 DO .1 <- .12 DO (1020) NEXT (16) DO .12 <- .1 (12) DO .3 <- '?.2$.3'~'#0$#65535' DO .3 <- '?"'&"!2~.3'~'"?'?.3~.3'$#32768"~"#0$#65535"'"$ ".3~.3"'~#1"$#2'~#3 (14) PLEASE RESUME .3 (11) DO (12) NEXT DO FORGET #1 PLEASE READ OUT .11 DO COME FROM (15) DO .1 <- .10 DO (1020) NEXT DO .10 <- .1 (23) DO (21) NEXT (22) PLEASE RESUME "?!10~#32768'$#2"~#3 (21) DO (22) NEXT DO FORGET #1 PLEASE GIVE UP (2010) PLEASE ABSTAIN FROM (2004) (2000) PLEASE STASH .2 DO .2 <- #1 DO (2001) NEXT (2001) PLEASE FORGET #1 DO .1 <- '?.1$.2'~'#0$#65535' DO (2002) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (2001) NEXT (2003) PLEASE RESUME "?!1~.2'$#1"~#3 (2002) DO (2003) NEXT PLEASE RETRIEVE .2 (2004) PLEASE RESUME #2 PLEASE DO REINSTATE (2004) PLEASE RESUME '?"!1~.1'~#1"$#2'~#6 (2020) PLEASE STASH .2 + .3 DO (1021) NEXT (2030) DO STASH .1 + .5 DO .3 <- #0 DO .5 <- '?"!2~.2'~#1"$#1'~#3 PLEASE DO (2031) NEXT DO .4 <- #1 PLEASE DO (2033) NEXT (2033) DO FORGET #1 DO .5 <- '?".2~#32768"$#2'~#3 DO (2032) NEXT DO .2 <- !2$#0'~'#32767$#1' PLEASE DO .4 <- !4$#0'~'#32767$#1' DO (2033) NEXT (2032) DO (1001) NEXT (2036) PLEASE FORGET #1 DO .5 <- '?.1$.2'~'#0$#65535' DO .5 <- '?"'&"!2~.5'~'"?'?.5~.5'$#32768"~"#0$#65535"'"$ ".5~.5"'~#1"$#2'~#3 DO (2034) NEXT DO .5 <- .3 DO (1010) NEXT PLEASE DO .1 <- .3 DO .3 <- 'V.4$.5'~'#0$#65535' DO (2035) NEXT (2034) PLEASE DO (1001) NEXT (2035) DO FORGET #1 DO .5 <- "?'.4~#1'$#2"~#3 DO (2031) NEXT DO .2 <- .2~#65534 DO .4 <- .4~#65534 PLEASE DO (2036) NEXT (2031) DO (1001) NEXT PLEASE DO .4 <- .1 PLEASE RETRIEVE .1 + .5 PLEASE RESUME #2 intercal-0.30/pit/PaxHeaders.27456/life2.i0000644000000000000000000000007411437550756014772 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.566945757 intercal-0.30/pit/life2.i0000644000175000017500000001200011437550756014656 0ustar00esresr00000000000000 PLEASE NOTE BEGINNING OF BEGINNING DO WRITE IN .11 DO WRITE IN .12 DO ,1 <- .11 BY .12 DO ,2 <- .11 BY .12 DO WRITE IN .13 DO .14 <- #0 DO .1 <- .11 DO (1020) NEXT DO .4 <- .1 DO ,3 <- .4 DO .2 <- #0 PLEASE STASH .2 PLEASE NOTE INITIALIZING ,1 TO ZEROES DO .1 <- .11 PLEASE COME FROM (116) DO .2 <- .1 DO .1 <- .12 PLEASE COME FROM (113) DO ,1 SUB .2.1 <- #0 DO (111) NEXT (112) DO (2010) NEXT (113) PLEASE FORGET #2 (111) DO (112) NEXT DO (114) NEXT (115) DO .1 <- .2 DO (2010) NEXT (116) PLEASE FORGET #3 (114) DO (115) NEXT PLEASE FORGET #2 PLEASE NOTE INITIAL POSITION INPUT PLEASE COME FROM (123) DO WRITE IN .1 DO (121) NEXT DO WRITE IN .2 (123) DO ,1 SUB .1.2 <- #1 (122) DO RESUME "?!1~.1'$#1"~#3 (121) DO (122) NEXT PLEASE FORGET #1 PLEASE NOTE END OF BEGINNING, BEGINNING OF MIDDLE DO COME FROM (298) PLEASE NOTE PRINTING CURRENT POSITION DO (300) NEXT PLEASE NOTE PUTTING NEXT POSITION IN ,2 DO .1 <- .11 DO .9 <- .1 DO (2000) NEXT DO .7 <- .1 DO (2000) NEXT PLEASE COME FROM (216) DO .5 <- .1 DO .1 <- .12 DO .10 <- .1 DO (2000) NEXT DO .8 <- .1 DO (2000) NEXT PLEASE COME FROM (213) DO .6 <- .1 DO .1 <- #0 DO .2 <- ,1 SUB .5.6 DO (2020) NEXT DO .2 <- ,1 SUB .5.8 DO (2020) NEXT DO .2 <- ,1 SUB .5.10 DO (2020) NEXT DO .2 <- ,1 SUB .7.6 DO (2020) NEXT DO .2 <- ,1 SUB .7.10 DO (2020) NEXT DO .2 <- ,1 SUB .9.6 DO (2020) NEXT DO .2 <- ,1 SUB .9.8 DO (2020) NEXT DO .2 <- ,1 SUB .9.10 DO (2020) NEXT DO :2 <- #0$#65535 DO .1 <- "?'"V.1$,1SUB.7.8"~:2'$#3"~:2 DO ,2 SUB .7.8 <- "?!1~.1'$#1"~#1 DO (211) NEXT (212) DO .10 <- .8 DO .8 <- .6 DO .1 <- .6 DO (2010) NEXT (213) PLEASE FORGET #2 (211) DO (212) NEXT DO (214) NEXT (215) DO .9 <- .7 DO .7 <- .5 DO .1 <- .5 DO (2010) NEXT (216) PLEASE FORGET #3 (214) DO (215) NEXT PLEASE FORGET #2 PLEASE NOTE COPYING ,2 BACK INTO ,1 DO .1 <- .11 DO (2000) NEXT PLEASE COME FROM (226) DO .2 <- .1 DO .1 <- .12 DO (2000) NEXT PLEASE COME FROM (223) DO ,1 SUB .2.1 <- ,2 SUB .2.1 (223) DO (221) NEXT (222) DO (2000) NEXT DO .3 <- "?.1$#1"~"#0$#65535" PLEASE RESUME '?"!3~.3'~#1"$#1'~#3 (221) DO (222) NEXT PLEASE FORGET #1 (226) DO (224) NEXT (225) DO .1 <- .2 DO (2000) NEXT DO .3 <- "?.1$#1"~"#0$#65535" PLEASE RESUME '?"!3~.3'~#1"$#1'~#3 (224) DO (225) NEXT PLEASE FORGET #1 PLEASE NOTE INCREMENT TIMESTEP AND TEST DO .1 <- .14 DO (1020) NEXT DO .14 <- .1 DO (231) NEXT DO (299) NEXT (232) DO .3 <- "?.14$.13"~"#0$#65535" PLEASE RESUME '?"!3~.3'~#1"$#2'~#3 (231) DO (232) NEXT DO FORGET #1 PLEASE NOTE OVERFLOW TESTING DO .7 <- #0 DO .8 <- #0 DO .1 <- .11 DO (2000) NEXT DO .5 <- .1 DO .1 <- .12 DO (2000) NEXT DO COME FROM (243) DO .6 <- .1 DO .2 <- ,1 SUB #2.6 DO .1 <- .7 DO (500) NEXT DO .7 <- .1 DO .2 <- ,1 SUB .5.6 DO .1 <- .8 DO (500) NEXT DO .8 <- .1 (243) DO (241) NEXT (242) DO .1 <- .6 DO (2000) NEXT DO .3 <- "?.1$#1"~"#0$#65535" PLEASE RESUME '?"!3~.3'~#1"$#1'~#3 (241) DO (242) NEXT PLEASE FORGET #1 DO .7 <- #0 DO .8 <- #0 DO .1 <- .12 DO (2000) NEXT DO .6 <- .1 DO .1 <- .11 DO (2000) NEXT DO COME FROM (253) DO .5 <- .1 DO .2 <- ,1 SUB .5#2 DO .1 <- .7 DO (500) NEXT DO .7 <- .1 DO .2 <- ,1 SUB .5.6 DO .1 <- .8 DO (500) NEXT DO .8 <- .1 (253) DO (251) NEXT (252) DO .1 <- .5 DO (2000) NEXT DO .3 <- "?.1$#1"~"#0$#65535" PLEASE RESUME '?"!3~.3'~#1"$#1'~#3 (251) DO (252) NEXT (298) PLEASE FORGET #1 (299) DO FORGET #1 PLEASE NOTE END OF MIDDLE, BEGINNING OF END PLEASE NOTE PRINTING FINAL POSITION DO (300) NEXT PLEASE NOTE END OF END PLEASE GIVE UP (300) PLEASE NOTE POSITION OUTPUT ROUTINE DO READ OUT .14 PLEASE RETRIEVE .2 DO .6 <- .12 PLEASE COME FROM (316) DO .5 <- #1 PLEASE COME FROM (313) DO .1 <- .2 DO (301) NEXT DO .2 <- #242 DO (303) NEXT (302) PLEASE RESUME "?',1 SUB .5.6'$#1"~#3 (301) DO (302) NEXT DO .2 <- #116 (303) PLEASE FORGET #1 DO (1010) NEXT DO ,3 SUB .5 <- .3 (313) DO (311) NEXT (312) DO .1 <- .5 DO (1020) NEXT DO .5 <- .1 DO .3 <- "?.5$.4"~"#0$#65535" PLEASE RESUME '?"!3~.3'~#1"$#1'~#3 (311) DO (312) NEXT DO .1 <- .2 DO .2 <- #80 DO (1010) NEXT DO ,3 SUB .4 <- .3 PLEASE READ OUT ,3 DO (314) NEXT (315) DO .1 <- .6 DO (2010) NEXT PLEASE FORGET #3 (316) DO .6 <- .1 (314) DO (315) NEXT PLEASE DO STASH .2 PLEASE RESUME #3 (500) DO (501) NEXT DO .1 <- #0 PLEASE RESUME #1 (502) PLEASE RESUME '?.2$#2'~#3 (501) DO (502) NEXT DO (2020) NEXT DO (503) NEXT PLEASE RESUME #2 (504) DO .2 <- "?.1$#3"~"#0$#65535" PLEASE RESUME '?"!2~.2'~#1"$#1'~#3 (503) DO (504) NEXT PLEASE FORGET #3 DO (299) NEXT (2010) PLEASE ABSTAIN FROM (2004) (2000) PLEASE STASH .2 DO .2 <- #1 DO (2001) NEXT (2001) PLEASE FORGET #1 DO .1 <- '?.1$.2'~'#0$#65535' DO (2002) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (2001) NEXT (2003) PLEASE RESUME "?!1~.2'$#1"~#3 (2002) DO (2003) NEXT PLEASE RETRIEVE .2 (2004) PLEASE RESUME #2 PLEASE DO REINSTATE (2004) PLEASE RESUME '?"!1~.1'~#1"$#2'~#6 (2020) PLEASE STASH .2 + .3 DO (1021) NEXT intercal-0.30/pit/PaxHeaders.27456/flonck.doc0000644000000000000000000000007411437550756015562 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.558945776 intercal-0.30/pit/flonck.doc0000644000175000017500000000663011437550756015462 0ustar00esresr00000000000000Flonck, short for FLOating-point Numerical Calculator, is an INTERCAL version of the classic reverse-polish calculator. All values are entered and displayed as floating-point numbers. Entering a number adds it to the top of the stack. The various operations are indicated by integer number, and take their argument(s) off the top of the stack and replace it/them with the result. Besides the main stack, flonck also includes two separate "registers". Note that this program requires the floating-point library in lib/floatlib.i. C-INTERCAL will detect this and include it. Here is the quick-reference chart of available operations: ONE OH change sign TWO OH store in M ONE add ONE ONE invert TWO ONE add to M TWO subtract ONE TWO square root TWO TWO push M THREE multiply ONE THREE ln TWO THREE exchange M FOUR divide ONE FOUR exp TWO FOUR print M FIVE remainder ONE FIVE x^y TWO FIVE store in N SIX print ONE SIX pop TWO SIX add to N SEVEN print all ONE SEVEN clear all TWO SEVEN push N EIGHT duplicate ONE EIGHT int TWO EIGHT exchange N NINE twiddle ONE NINE random TWO NINE print N THREE OH quit Functions ONE through FIVE should be self-explanatory. SIX displays the topmost number on the stack without removing it. SEVEN displays the entire stack, from top to bottom, again without changing anything. EIGHT duplicates the topmost number, pushing an extra copy of it. NINE causes the top two numbers on the stack to switch places. The next few functions should be familiar to anyone who's used a pocket calculator in recent memory. ONE OH multiplies the topmost number by -1. ONE ONE divides the topmost number into 1. ONE TWO is the square root function, ONE THREE is the natural logarithm function, and ONE FOUR is the exponential function. ONE FIVE raises the topmost number to the power of the next-topmost number. ONE SIX throws away the topmost number, never to be seen again. ONE SEVEN wipes out the entire stack and starts afresh. ONE EIGHT chops off the fractional part of the topmost number. ONE NINE causes a randomly chosen number between 0 and 1 to be added to the top of the stack. The twenties are the functions that manipulate the two registers, named M and N. (Both registers start out initialized to zero.) TWO OH takes the topmost number off of the stack and stores it in M. TWO ONE takes the topmost number off of the stack and adds it to whatever is already in M. TWO TWO makes a copy of whatever is in M and adds it to the top of the stack. TWO THREE swaps the contents of M with the topmost number on the stack. TWO FOUR displays the contents of M without changing it. Functions TWO FIVE through TWO NINE repeat the above five functionalities for the register N. And finally, as you might have guessed, writing (in) THREE OH causes flonck to come to an end. If an input does not correspond to a floating-point number or an instruction, or if a function is input that requires more numbers on the stack than currently exist, or if a function overflows or returns an error, flonck prints out an error message, namely "XXX", and continues. Note that in the latter case, the values used as function arguments will still be removed from the stack. intercal-0.30/pit/PaxHeaders.27456/pow.tst0000644000000000000000000000007411437550756015160 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.566945757 intercal-0.30/pit/pow.tst0000644000175000017500000000000511437550756015046 0ustar00esresr00000000000000FIVE intercal-0.30/pit/PaxHeaders.27456/beer.doc0000644000000000000000000000007411437550756015223 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.554945791 intercal-0.30/pit/beer.doc0000644000175000017500000002450711437550756015126 0ustar00esresr00000000000000// This is beer.doc. Strip out all comments to have a valid INTERCAL // program beer.i that prints out the complete lyrics to 99 Bottles of Beer // on the Wall. The string arrays were computed by a 115 line perl // program. // It cops out and relies on the standard library routines for // addition and subtraction to do the x++ operation. // -Matt DiMeo // -mdimeo@brooktree.com // ,10 is a bare newline from scratch. PLEASE DO ,10 <- #1 PLEASE DO ,10SUB#1 <- #176 // ,11 is bottles of beer on the wall, PLEASE DO ,11 <- #30 PLEASE DO ,11SUB#1 <- #76 DO ,11SUB#2 <- #190 DO ,11SUB#3 <- #80 DO ,11SUB#4 <- #200 PLEASE DO ,11SUB#5 <- #256 DO ,11SUB#6 <- #248 DO ,11SUB#7 <- #144 DO ,11SUB#8 <- #216 PLEASE DO ,11SUB#9 <- #202 DO ,11SUB#10 <- #14 DO ,11SUB#11 <- #144 DO ,11SUB#12 <- #98 PLEASE DO ,11SUB#13 <- #190 DO ,11SUB#14 <- #160 DO ,11SUB#15 <- #256 DO ,11SUB#16 <- #88 PLEASE DO ,11SUB#17 <- #74 DO ,11SUB#18 <- #14 DO ,11SUB#19 <- #128 DO ,11SUB#20 <- #114 PLEASE DO ,11SUB#21 <- #214 DO ,11SUB#22 <- #24 DO ,11SUB#23 <- #112 DO ,11SUB#24 <- #162 PLEASE DO ,11SUB#25 <- #22 DO ,11SUB#26 <- #104 DO ,11SUB#27 <- #80 DO ,11SUB#28 <- #256 PLEASE DO ,11SUB#29 <- #2 DO ,11SUB#30 <- #228 // ,12 is bottles of beer.\nTake one down, pass it around, PLEASE DO ,12 <- #49 PLEASE DO ,12SUB#1 <- #76 DO ,12SUB#2 <- #190 DO ,12SUB#3 <- #80 DO ,12SUB#4 <- #200 PLEASE DO ,12SUB#5 <- #256 DO ,12SUB#6 <- #248 DO ,12SUB#7 <- #144 DO ,12SUB#8 <- #216 PLEASE DO ,12SUB#9 <- #202 DO ,12SUB#10 <- #14 DO ,12SUB#11 <- #144 DO ,12SUB#12 <- #98 PLEASE DO ,12SUB#13 <- #190 DO ,12SUB#14 <- #160 DO ,12SUB#15 <- #256 DO ,12SUB#16 <- #88 PLEASE DO ,12SUB#17 <- #218 DO ,12SUB#18 <- #36 DO ,12SUB#19 <- #38 DO ,12SUB#20 <- #164 PLEASE DO ,12SUB#21 <- #176 DO ,12SUB#22 <- #48 DO ,12SUB#23 <- #162 DO ,12SUB#24 <- #14 PLEASE DO ,12SUB#25 <- #128 DO ,12SUB#26 <- #208 DO ,12SUB#27 <- #162 DO ,12SUB#28 <- #222 PLEASE DO ,12SUB#29 <- #48 DO ,12SUB#30 <- #8 DO ,12SUB#31 <- #120 DO ,12SUB#32 <- #66 PLEASE DO ,12SUB#33 <- #48 DO ,12SUB#34 <- #246 DO ,12SUB#35 <- #136 DO ,12SUB#36 <- #184 PLEASE DO ,12SUB#37 <- #256 DO ,12SUB#38 <- #202 DO ,12SUB#39 <- #110 DO ,12SUB#40 <- #104 PLEASE DO ,12SUB#41 <- #42 DO ,12SUB#42 <- #126 DO ,12SUB#43 <- #56 DO ,12SUB#44 <- #88 PLEASE DO ,12SUB#45 <- #72 DO ,12SUB#46 <- #56 DO ,12SUB#47 <- #80 DO ,12SUB#48 <- #242 PLEASE DO ,12SUB#49 <- #228 // ,13 is bottles of beer on the wall. PLEASE DO ,13 <- #31 PLEASE DO ,13SUB#1 <- #76 DO ,13SUB#2 <- #190 DO ,13SUB#3 <- #80 DO ,13SUB#4 <- #200 PLEASE DO ,13SUB#5 <- #256 DO ,13SUB#6 <- #248 DO ,13SUB#7 <- #144 DO ,13SUB#8 <- #216 PLEASE DO ,13SUB#9 <- #202 DO ,13SUB#10 <- #14 DO ,13SUB#11 <- #144 DO ,13SUB#12 <- #98 PLEASE DO ,13SUB#13 <- #190 DO ,13SUB#14 <- #160 DO ,13SUB#15 <- #256 DO ,13SUB#16 <- #88 PLEASE DO ,13SUB#17 <- #74 DO ,13SUB#18 <- #14 DO ,13SUB#19 <- #128 DO ,13SUB#20 <- #114 PLEASE DO ,13SUB#21 <- #214 DO ,13SUB#22 <- #24 DO ,13SUB#23 <- #112 DO ,13SUB#24 <- #162 PLEASE DO ,13SUB#25 <- #22 DO ,13SUB#26 <- #104 DO ,13SUB#27 <- #80 DO ,13SUB#28 <- #256 PLEASE DO ,13SUB#29 <- #194 DO ,13SUB#30 <- #36 DO ,13SUB#31 <- #256 // ,20 MAPS NEWLINES TO DIGITS PLEASE DO ,20 <- #10 PLEASE DO ,20 SUB #1 <- #76 DO ,20 SUB #2 <- #196 DO ,20 SUB #3 <- #4 DO ,20 SUB #4 <- #132 PLEASE DO ,20 SUB #5 <- #36 DO ,20 SUB #6 <- #164 DO ,20 SUB #7 <- #228 DO ,20 SUB #8 <- #100 PLEASE DO ,20 SUB #9 <- #52 DO ,20 SUB #10 <- #180 // ,21 MAPS DIGITS TO DIGITS PLEASE DO ,21 <- #10 BY #10 PLEASE DO ,21SUB#1#1 <- #248 PLEASE DO ,21SUB#1#2 <- #120 PLEASE DO ,21SUB#1#3 <- #184 PLEASE DO ,21SUB#1#4 <- #56 PLEASE DO ,21SUB#1#5 <- #216 PLEASE DO ,21SUB#1#6 <- #88 PLEASE DO ,21SUB#1#7 <- #152 PLEASE DO ,21SUB#1#8 <- #24 PLEASE DO ,21SUB#1#9 <- #232 PLEASE DO ,21SUB#1#10 <- #104 DO ,21SUB#2#1 <- #128 DO ,21SUB#2#2 <- #256 DO ,21SUB#2#3 <- #64 DO ,21SUB#2#4 <- #192 DO ,21SUB#2#5 <- #96 DO ,21SUB#2#6 <- #224 DO ,21SUB#2#7 <- #32 DO ,21SUB#2#8 <- #160 DO ,21SUB#2#9 <- #112 DO ,21SUB#2#10 <- #240 DO ,21SUB#3#1 <- #64 DO ,21SUB#3#2 <- #192 DO ,21SUB#3#3 <- #256 DO ,21SUB#3#4 <- #128 DO ,21SUB#3#5 <- #32 DO ,21SUB#3#6 <- #160 DO ,21SUB#3#7 <- #224 DO ,21SUB#3#8 <- #96 DO ,21SUB#3#9 <- #48 DO ,21SUB#3#10 <- #176 DO ,21SUB#4#1 <- #192 DO ,21SUB#4#2 <- #64 DO ,21SUB#4#3 <- #128 DO ,21SUB#4#4 <- #256 DO ,21SUB#4#5 <- #160 DO ,21SUB#4#6 <- #32 DO ,21SUB#4#7 <- #96 DO ,21SUB#4#8 <- #224 DO ,21SUB#4#9 <- #176 DO ,21SUB#4#10 <- #48 PLEASE DO ,21SUB#5#1 <- #32 PLEASE DO ,21SUB#5#2 <- #160 PLEASE DO ,21SUB#5#3 <- #224 PLEASE DO ,21SUB#5#4 <- #96 PLEASE DO ,21SUB#5#5 <- #256 PLEASE DO ,21SUB#5#6 <- #128 PLEASE DO ,21SUB#5#7 <- #192 PLEASE DO ,21SUB#5#8 <- #64 PLEASE DO ,21SUB#5#9 <- #16 PLEASE DO ,21SUB#5#10 <- #144 DO ,21SUB#6#1 <- #160 DO ,21SUB#6#2 <- #32 DO ,21SUB#6#3 <- #96 DO ,21SUB#6#4 <- #224 DO ,21SUB#6#5 <- #128 DO ,21SUB#6#6 <- #256 DO ,21SUB#6#7 <- #64 DO ,21SUB#6#8 <- #192 DO ,21SUB#6#9 <- #144 DO ,21SUB#6#10 <- #16 DO ,21SUB#7#1 <- #96 DO ,21SUB#7#2 <- #224 DO ,21SUB#7#3 <- #32 DO ,21SUB#7#4 <- #160 DO ,21SUB#7#5 <- #64 DO ,21SUB#7#6 <- #192 DO ,21SUB#7#7 <- #256 DO ,21SUB#7#8 <- #128 DO ,21SUB#7#9 <- #80 DO ,21SUB#7#10 <- #208 DO ,21SUB#8#1 <- #224 DO ,21SUB#8#2 <- #96 DO ,21SUB#8#3 <- #160 DO ,21SUB#8#4 <- #32 DO ,21SUB#8#5 <- #192 DO ,21SUB#8#6 <- #64 DO ,21SUB#8#7 <- #128 DO ,21SUB#8#8 <- #256 DO ,21SUB#8#9 <- #208 DO ,21SUB#8#10 <- #80 PLEASE DO ,21SUB#9#1 <- #16 PLEASE DO ,21SUB#9#2 <- #144 PLEASE DO ,21SUB#9#3 <- #208 PLEASE DO ,21SUB#9#4 <- #80 PLEASE DO ,21SUB#9#5 <- #240 PLEASE DO ,21SUB#9#6 <- #112 PLEASE DO ,21SUB#9#7 <- #176 PLEASE DO ,21SUB#9#8 <- #48 PLEASE DO ,21SUB#9#9 <- #256 PLEASE DO ,21SUB#9#10 <- #128 DO ,21SUB#10#1 <- #144 DO ,21SUB#10#2 <- #16 DO ,21SUB#10#3 <- #80 DO ,21SUB#10#4 <- #208 DO ,21SUB#10#5 <- #112 DO ,21SUB#10#6 <- #240 DO ,21SUB#10#7 <- #48 DO ,21SUB#10#8 <- #176 DO ,21SUB#10#9 <- #128 DO ,21SUB#10#10 <- #256 // ,22 MAPS DIGITS TO SPACES PLEASE DO ,22 <- #10 PLEASE DO ,22 SUB #1 <- #8 DO ,22 SUB #2 <- #136 DO ,22 SUB #3 <- #72 DO ,22 SUB #4 <- #200 PLEASE DO ,22 SUB #5 <- #40 DO ,22 SUB #6 <- #168 DO ,22 SUB #7 <- #104 DO ,22 SUB #8 <- #232 PLEASE DO ,22 SUB #9 <- #24 DO ,22 SUB #10 <- #152 // ,10 ,11 ,12 ,20 ,21 and ,22 are defined by the makestrings script // .10 contains first digit, .11 contains second. DO .10 <- #9 DO .11 <- #9 // ,10 prints a newline from scratch PLEASE DO ,10 <- #1 PLEASE DO ,10SUB#1 <- #176 DO READ OUT ,10 // print a bare newline. DO COME FROM (999) // main loop. DO (500) NEXT // print the two digit number .10 .11 // returning the offset to get to a space // in .5. PLEASE DO ,11SUB#1 <- .5 // bottles of beer on the wall DO READ OUT ,11 DO (500) NEXT // print the two digit number .10 .11 DO ,12SUB#1 <- .5 // bottles of beer. Take...around, PLEASE DO READ OUT ,12 // .6 = (.10 == 0 ? 1 : 2) snagged from line 54 of library. PLEASE DO .6 <- '?"!10~.10'~#1"$#1'~#3 // this line, line 50, and line 51 form a conditional. DO (50) NEXT // end up here if .10 != 0 // conditional on .11==0? PLEASE DO .7 <- '?"!11~.11'~#1"$#1'~#3 // same for .7 DO (70) NEXT // .11 != 0 // subtract 1 from .11 (second digit). DO .2 <- #1 DO .1 <- .11 PLEASE DO (1010) NEXT // .3 = .1 - .2 = .11 - 1 DO .11 <- .3 DO (600) NEXT // print last verse line DO (101) NEXT // jump out of loop. (70) DO (71) NEXT // .11 == 0 DO .11 <- #9 // roll over second digit // subtract 1 from first digit DO .2 <- #1 PLEASE DO .1 <- .10 DO (1010) NEXT // .3 = .1 - .2 = .10 - 1 DO .10 <- .3 DO (600) NEXT // print last verse line DO (101) NEXT // jump out of loop. (71) DO RESUME .7 // end if .11 == 0 (50) DO (51) NEXT PLEASE DO FORGET #1 // end up here if .10 == 0. // subtract 1 from .11 (second digit). DO .2 <- #1 DO .1 <- .11 PLEASE DO (1010) NEXT // .3 = .1 - .2 = .11 - 1 DO .11 <- .3 DO (600) NEXT // print last verse line PLEASE DO .7 <- '?"!11~.11'~#1"$#1'~#3 // same for .7 DO (80) NEXT // .10 == 0, .11 != 0 DO (101) NEXT (80) DO (81) NEXT // .10 == 0, .11 == 0 DO GIVE UP (81) DO RESUME .7 (51) DO RESUME .6 // end if .10 == 0 (101) DO FORGET #1 (999) DO FORGET #1 // dummy statement // subroutine to print last line of a verse. (600) DO (500) NEXT // print the two digit number .10 .11 DO ,13SUB#1 <- .5 // bottles of beer on the wall. DO READ OUT ,13 DO RESUME #1 // subroutine to print a two digit number. The first digit is in .10, // the second is in .11. Returns the index to be READ OUT to get to a // space in .5. (500) DO ,30 <- #1 // 1 elt array for printing. DO .1 <- .10 // .1 gets first digit. DO (1020) NEXT // .1++ PLEASE DO ,30SUB#1 <- ,20SUB.1 // map from newline to digit DO READ OUT ,30 // print the digit. // now we map from the first digit to the second digit. DO .3 <- .1 // stash array index away. DO .1 <- .11 // .1 gets second digit. DO (1020) NEXT // .1++ PLEASE DO ,30SUB#1 <- ,21SUB .3 .1 // map from first digit to second digit DO READ OUT ,30 // print the digit. DO .5 <- ,22SUB.1 // map to space and return that value. PLEASE DO RESUME #1 // return from (500) subrtn. intercal-0.30/pit/PaxHeaders.27456/.gitignore0000644000000000000000000000007411474540071015575 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.554945791 intercal-0.30/pit/.gitignore0000644000175000017500000000122211474540071015465 0ustar00esresr00000000000000# Test binaries in the pit beer bubble change fft flonck guess hail_mary icat iching1 iching2 ins interfunge lib/lib2 lib/numio lib/plus lib/syslib lib/syslib3 lib/syslib4 lib/syslib5 lib/syslib6 lib/syslib7 life life2 pass pi pow primes quine random random2 rot13 rot13b sample sort tests/ais1 tests/ais2 tests/compucome tests/count tests/hello tests/ignorret tests/ignorearray tests/iogerunds tests/limits tests/limits3 tests/onceagain tests/permute tests/sink tests/test1 tests/test16bit tests/test2 tests/testarray tests/testcf tests/testcreate tests/testlib2 tests/testonce tests/testops3 tests/testops5 tests/testsplat tests/whileadd tpk unlambda yapp intercal-0.30/pit/PaxHeaders.27456/Makefile0000644000000000000000000000013212507155722015243 xustar0030 mtime=1427954642.778848997 30 atime=1427954642.862848705 30 ctime=1427992235.554945791 intercal-0.30/pit/Makefile0000664000175000017500000001263712507155722015156 0ustar00esresr00000000000000# # Torture-tester for the INTERCAL compiler # # Type 'make' to test-compile the pit programs and run a regression check ICKENV = ICKINCLUDEDIR=../src ICKCSKELDIR=../src ICKSYSDIR=lib ICKLIBDIR=.. ICK = ../ick ICKOPTS = -b PIT = . BASE2SOURCES = \ $(PIT)/beer.i \ $(PIT)/bubble.i \ $(PIT)/change.i \ $(PIT)/flonck.i \ $(PIT)/fft.i \ $(PIT)/guess.i \ $(PIT)/icat.i \ $(PIT)/iching1.i \ $(PIT)/iching2.i \ $(PIT)/ins.i \ $(PIT)/interfunge \ $(PIT)/lib/lib2.i \ $(PIT)/lib/numio.i \ $(PIT)/lib/plus.i \ $(PIT)/lib/syslib.i \ $(PIT)/lib/syslib3.i \ $(PIT)/lib/syslib4.i \ $(PIT)/lib/syslib5.i \ $(PIT)/lib/syslib6.i \ $(PIT)/lib/syslib7.i \ $(PIT)/life.i \ $(PIT)/life2.i \ $(PIT)/pi.i \ $(PIT)/pow.i \ $(PIT)/quine \ $(PIT)/pass.i \ $(PIT)/primes.i \ $(PIT)/random.i \ $(PIT)/random2.i \ $(PIT)/rot13.i \ $(PIT)/rot13b.i \ $(PIT)/sample.i \ $(PIT)/sort.i \ $(PIT)/tests/ais1.i \ $(PIT)/tests/ais2.i \ $(PIT)/tests/compucome.i \ $(PIT)/tests/hello.i \ $(PIT)/tests/ignorret.i \ $(PIT)/tests/ignorearray.i \ $(PIT)/tests/iogerunds.i \ $(PIT)/tests/limits.i \ $(PIT)/tests/permute.i \ $(PIT)/tests/sink.i \ $(PIT)/tests/onceagain.i \ $(PIT)/tests/test1.i \ $(PIT)/tests/test16bit.i \ $(PIT)/tests/test2.i \ $(PIT)/tests/testarray.i \ $(PIT)/tests/testcf.i \ $(PIT)/tests/testcreate .i \ $(PIT)/tests/testlib2.i \ $(PIT)/tests/testonce.i \ $(PIT)/tests/testsplat.i \ $(PIT)/tests/whileadd.i \ $(PIT)/tpk.i \ $(PIT)/unlambda.i \ $(PIT)/yapp.i BASENSOURCES = \ $(PIT)/hail_mary.3i \ $(PIT)/tests/count.3i \ $(PIT)/tests/limits3.3i \ $(PIT)/tests/testops3.3i \ $(PIT)/tests/testops5.5i SOURCES = $(BASE2SOURCES) $(BASENSOURCES) TARGETS = $(BASE2SOURCES:.i=) \ $(PIT)/hail_mary \ $(PIT)/tests/count \ $(PIT)/tests/limits3 \ $(PIT)/tests/testops3 \ $(PIT)/tests/testops5 .SUFFIXES: .i .3i .4i .5i .6i .7i %: %.i $(ICK) $(ICKENV) $(ICK) $(ICKOPTS) $< %: %.3i $(ICK) $(ICKENV) $(ICK) $(ICKOPTS) $< %: %.4i $(ICK) $(ICKENV) $(ICK) $(ICKOPTS) $< %: %.5i $(ICK) $(ICKENV) $(ICK) $(ICKOPTS) $< %: %.6i $(ICK) $(ICKENV) $(ICK) $(ICKOPTS) $< %: %.7i $(ICK) $(ICKENV) $(ICK) $(ICKOPTS) $< # For instructions on test conventions, see the header comment of regresscheck test: $(TARGETS) @$(PIT)/beer | $(PIT)/regresscheck $(PIT)/beer @file $(PIT)/beer | grep -q 'shell script' || echo "Regression test of -F (using beer) FAILED." @cat $(PIT)/bubble.tst | $(PIT)/bubble | $(PIT)/regresscheck $(PIT)/bubble @cat $(PIT)/fft-delta.tst | $(PIT)/fft | $(PIT)/regresscheck $(PIT)/fft-delta @cat $(PIT)/fft-tophat.tst | $(PIT)/fft | $(PIT)/regresscheck $(PIT)/fft-tophat @cat $(PIT)/flonck.tst | $(PIT)/flonck | $(PIT)/regresscheck $(PIT)/flonck @echo 'Hello, sailor!' | $(PIT)/regresscheck $(PIT)/icat @cat $(PIT)/interfunge.tst | $(PIT)/interfunge | $(PIT)/regresscheck $(PIT)/interfunge @echo 'A man, a plan, a canal, Panama.' | $(PIT)/rot13 | $(PIT)/regresscheck $(PIT)/rot13 @echo 'A man, a plan, a canal, Panama.' | $(PIT)/rot13b | $(PIT)/regresscheck $(PIT)/rot13b @echo "FIVE" | $(PIT)/pi | $(PIT)/regresscheck $(PIT)/pi @cat $(PIT)/pow.tst | $(PIT)/pow 2>&1 | $(PIT)/regresscheck $(PIT)/pow @cat $(PIT)/pass.tst | $(PIT)/pass | $(PIT)/regresscheck $(PIT)/pass @cp $(PIT)/quine.i $(PIT)/quine.chk; $(PIT)/quine | $(PIT)/regresscheck $(PIT)/quine; rm -f $(PIT)/quine.chk @cat $(PIT)/sort.tst | $(PIT)/sort | $(PIT)/regresscheck $(PIT)/sort @cat $(PIT)/tpk.tst | $(PIT)/tpk | $(PIT)/regresscheck $(PIT)/tpk @cat $(PIT)/unlambda.tst | $(PIT)/unlambda | $(PIT)/regresscheck $(PIT)/unlambda @cat $(PIT)/yapp.tst | $(PIT)/yapp >$(PIT)/yapptest.i && $(ICKENV) $(ICK) $(ICKOPTS) $(PIT)/yapptest.i && $(PIT)/yapptest | $(PIT)/regresscheck -c $(PIT)/yapp.tst $(PIT)/yapp; rm -f $(PIT)/yapptest.i $(PIT)/yapptest @cat $(PIT)/tests/ais1.tst | $(PIT)/tests/ais1 | $(PIT)/regresscheck $(PIT)/tests/ais1 @cat $(PIT)/tests/ais2.tst | $(PIT)/tests/ais2 | $(PIT)/regresscheck $(PIT)/tests/ais2 @$(PIT)/tests/count | $(PIT)/regresscheck $(PIT)/tests/count @$(PIT)/tests/hello | $(PIT)/regresscheck $(PIT)/tests/hello @$(PIT)/tests/ignorearray | $(PIT)/regresscheck $(PIT)/tests/ignorearray @$(PIT)/tests/ignorret | $(PIT)/regresscheck $(PIT)/tests/ignorret @$(PIT)/tests/permute | $(PIT)/regresscheck $(PIT)/tests/permute @$(PIT)/tests/sink 2>&1 | $(PIT)/regresscheck $(PIT)/tests/sink @$(PIT)/tests/test1 2>&1 | $(PIT)/regresscheck $(PIT)/tests/test1 @cat $(PIT)/tests/test2.tst | $(PIT)/tests/test2 | $(PIT)/regresscheck $(PIT)/tests/test2 @$(PIT)/tests/testonce | $(PIT)/regresscheck $(PIT)/tests/testonce @$(PIT)/tests/testsplat 2>&1 | $(PIT)/regresscheck $(PIT)/tests/testsplat @cat $(PIT)/tests/whileadd.tst | $(PIT)/tests/whileadd | $(PIT)/regresscheck $(PIT)/tests/whileadd @echo "Tests complete." # Some tests need options to compile extensions; some test extensions. $(PIT)/beer: $(PIT)/beer.i $(ICK) $(ICKENV) $(ICK) -F $(ICKOPTS) $(PIT)/beer.i $(PIT)/pass: $(PIT)/pass.i $(ICK) $(ICKENV) $(ICK) -m $(ICKOPTS) $(PIT)/pass.i $(PIT)/tests/compucome: $(PIT)/tests/compucome.i $(ICK) $(ICKENV) $(ICK) -m $(ICKOPTS) $(PIT)/tests/compucome.i $(PIT)/tests/permute: $(PIT)/tests/permute.i $(ICK) $(ICKENV) $(ICK) -m $(ICKOPTS) $(PIT)/tests/permute.i $(PIT)/tests/testcreate: $(PIT)/tests/testcreate.i $(ICK) $(ICKENV) $(ICK) -a $(ICKOPTS) $(PIT)/tests/testcreate.i $(PIT)/tests/whileadd: $(PIT)/tests/whileadd.i $(ICK) $(ICKENV) $(ICK) -m $(ICKOPTS) $(PIT)/tests/whileadd.i lines: wc -l $(SOURCES) clean: rm -f $(TARGETS) *.c *.o *~ intercal-0.30/pit/PaxHeaders.27456/ins.doc0000644000000000000000000000007411437550756015077 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/ins.doc0000644000175000017500000001370011437550756014773 0ustar00esresr00000000000000"Intersections & Splats" is an INTERCAL implementation of one of my favorite games, "Cows & Bulls," now more commonly known by the commercial version, "Mastermind." Rules of the Game The idea of the game is that one person selects a "code" in the form of a short string of digits, typically four. ("Mastermind" used colors in place of numbers.) The other person has a limited number of chances to guess what the code is. Every move consists of submitting a guess, and the first player replying with a score. Each scoring reveals a little more information about the code. A guess is scored by giving a certain number of cows and a certain number of bulls. These correspond to Mastermind's white pegs and black pegs, respectively - and, in this program, intersections (+) and splats (*). This game is perfect for a computer because the person who makes the code has nothing to do but score the other player's guesses - a mechanical task. Here's how the scoring works. For every number in the code that is matched by the same number in the same position in the guess, a splat is scored. And for every number in the code that is matched by the same number in the guess, but in the wrong position, an intersection, is scored. For example: with a code of "3451" and a guess of "2465", one splat and one intersection would be earned. The splat is for the 4, and the intersection is for the 5. Of course, the player making the guesses isn't told which numbers earned what - that's what they have to deduce. A guess of "6152" gets exactly the same score, even though the intersection and splat correspond to completely different digits. The game continues until the code is discovered or the player runs out of guesses. Note that there can be some confusion about how the scoring works with repeated digits. In absence of a better standards body, I have stuck with the version described in the Mastermind rules, which is that a digit in the guess can match up with more than one digit in the code. Another example is in order. Say the code is "2412". A guess of "2544" would earn one splat and two intersections. The splat is for having a 2 in the guess in the right position, and one of the intersections is also for having a 2 in the guess, but now in the wrong position. The final intersection is earned by having a 4 in the guess, again in the wrong position. The second 4 in the guess, however, does not affect the scoring. Here is an algorithmic description of how scoring is done. The player looks at each digit in the code in turn. If the digit under consideration is matched by the same digit in the same place, a splat is earned. Otherwise, if any other digit in the guess is the same, an intersection is earned. For those conversant in C, here is an even more algorithmic description: for (i = 0 ; i < digits ; ++i) if (guess[i] == code[i]) ++splats; else for (j = 0 ; j < digits ; ++j) if (guess[j] == code[i]) { ++intersections; break; } For those conversant in INTERCAL, consult the source code. Anyway, enough of this. Play the game a few times; you'll get the idea. How To Play At each move the board is displayed, which shows you all of your previous guesses. Above each guess are the intersections and splats that they earned. Here is an example of a game in progress: + * + + * * (1) (5) (2) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (?) (2) (4) (4) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (?) (4) (4) (3) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (?) (2) (6) (5) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (?) The first guess "1242" earned one splat and one intersection. The third guess "2435" earned two splats and one intersection. The player has seven more guesses left. Guesses are typed in at the "MOVE:" prompt. At the end of the game, the questions marks at the right are replaced with the code. You are then prompted with "[CNQ]". Enter N to start a new game, Q to quit playing, or C to configure the game (see below). N is the default, so if you just hit enter, or type anything except C or Q, it has the same effect. You can also use any of these commands at the "MOVE:" prompt, if you wish to abandon the current game. In addition, R can be entered during a game to redraw the board. Configuring the Game The game is set up originally to have ten guesses in a game, four digits in the code, and to use the digits 1 through 6. (This matches the setup of the "Mastermind" game.) The C command can be used to modify these settings, so as to change the difficulty of the game. When you enter the C command, you are first prompted for the X setting, the number of guesses allowed; then the Y setting, which is the number of digits in the code; and finally the N setting, the number of digits used in the game. Each number is entered using standard INTERCAL numeric entry. (Yes, I could have used my own numio routines here, but the program is big enough as it is. Besides, I didn't want you to completely forget that you were using an INTERCAL program.) You can enter ZERO at any three prompts to abort the configuration and return to the current game. If any values are higher than ONE FIVE, the value modulo 16 will be used instead. Note that while you can enter a value higher than NINE for the number of digits, you may need to have an ASCII chart handy. (By the way, if anyone wants an EBCDIC version, drop me a line.) Other Versions I enjoyed writing this program so much, that I created two others based on it. First, there is a colorized version, which requires a VT100/ANSI color terminal, or something compatible. And second, there is a CGI script version that plays this game. A package containing all three versions is available at ftp.muppetlabs.com under /pub/intercal/ins.tar.gz. In addition, you can play the CGI script at http://www.muppetlabs.com/~breadbox/intercal/ins/insstart.html. Coda That's it. Have fun. Questions, comments, and concerns for my mental health can be directed to breadbox@muppetlabs.com. intercal-0.30/pit/PaxHeaders.27456/explib0000644000000000000000000000013212507155722015011 xustar0030 mtime=1427954642.778848997 30 atime=1427992237.746939686 30 ctime=1427992235.574945729 intercal-0.30/pit/explib/0000755000175000017500000000000012507155722014766 5ustar00esresr00000000000000intercal-0.30/pit/explib/PaxHeaders.27456/ecto_b98.doc0000644000000000000000000000013212507155722017171 xustar0030 mtime=1427954642.778848997 30 atime=1427954642.862848705 30 ctime=1427992235.574945729 intercal-0.30/pit/explib/ecto_b98.doc0000664000175000017500000000374712507155722017106 0ustar00esresr00000000000000The ecto_b98 expansion library is used to link .b98 files with .i files to form combined programs which allow communication between Befunge-98 and INTERCAL. It is written specifically to link to the cfunge Funge-98 interpreter, which can be compiled as a library. This library is included automatically by the compiler when needed, but to use it manually, compile the .b98 file to a .cio by hand (for a .b98 file, the resulting .cio file is reusable) and invoke the compiler like this: ick -options intercalfile.i befungefile.cio ecto_b98 libick_ecto_b98.a libm.a (This corresponds to ick -options intercalfile.i befungefile.b98. Note that at least the -e option is needed because expansion libraries are being used; most likely, you want to use other options too.) libick_ecto_b98.a is actually the cfunge interpreter, built a slightly different way, with a Funge fingerprint added so that Befunge programs can communicate with the INTERCAL program in a way that fits within the syntax of that language. This library implements no commands accessible from the INTERCAL program; instead, the Befunge program that must be linked in at the same time (you'll get a link error if you don't) becomes accessible from the INTERCAL program, with its COME FROMs and NEXT FROMs able to access the INTERCAL program and with the INTERCAL program's NEXTs able to affect it (and vice versa). Likewise, some other INTERCAL control structures are programmed, and they stretch across both the INTERCAL program and the Befunge program, as do things like the NEXT stack. (They will also stretch to any C programs that may be implemented, but note that libick_ecto_b98.a has not been name-mangled, so care is needed to prevent collisions of identifiers when linking INTERCAL, Befunge and C simultaneously.) libick_ecto_b98.a does not ship with C-INTERCAL, but can be created using the script provided in the /etc directory if you have a source code distribution for cfunge available. See the provided cftoec.sh script in that directory. intercal-0.30/pit/explib/PaxHeaders.27456/syslibc.c0000644000000000000000000000013212507155722016702 xustar0030 mtime=1427954642.778848997 30 atime=1427954642.862848705 30 ctime=1427992235.574945729 intercal-0.30/pit/explib/syslibc.c0000664000175000017500000001213212507155722016603 0ustar00esresr00000000000000/* * The INTERCAL system library, optimised version in C. * * This is provided as an example of how to write a C program * that links to INTERCAL programs, to demonstrate the external * call code. * * Written originally by Alex Smith, and released to the public * domain. This library comes with NO WARRANTY. */ #include #include #include #include static void errout(int routine, const char* msg) { fprintf(stderr,"C-INTERCAL system library: (%d): %s\n", routine, msg); exit(EXIT_FAILURE); } /* This identifier name breaches the namespace rule that ick_ must be avoided, but this library has to work with both other people's INTERCAL programs and other people's C programs. So I changed the rules so that the ick_my_ prefix is legal in (and only in) expansion libraries. */ ICK_EC_FUNC_START(ick_my_custom_syslib) { register uint16_t os1, os2; register uint32_t ts1, ts2; static int seededyet = 0; ick_linelabel(1000); os1=ick_getonespot(1); os2=ick_getonespot(2); if(0xffff-os10xffffLU) errout(1050, "onespot overflow"); ick_setonespot(2,(uint16_t)ts1); ick_resume(1); return; ick_linelabel(1500); ts1=ick_gettwospot(1); ts2=ick_gettwospot(2); if(0xffffffffLU-ts1 /* This name starts ick_, but isn't used; in general, the prefix ick_my_ is reserved for expansion libraries (as are the line numbers 1600-1699) because it doesn't conflict either with the compiler or with any linked-in C programs. */ ICK_EC_FUNC_START(ick_my_compunex) { ick_startup( { ick_create(".COMPUNEX",1600); ick_create(";COMPUNEX",1600); ick_create("~COMPUNEX",1600); }); ick_linelabel(1600); ick_next(ick_c_value(0)); ick_resume(1); } ICK_EC_FUNC_END intercal-0.30/pit/explib/PaxHeaders.27456/ecto_b98.c0000644000000000000000000000007411437550756016662 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.574945729 intercal-0.30/pit/explib/ecto_b98.c0000644000175000017500000002371411437550756016564 0ustar00esresr00000000000000/*************************************************************************** NAME ecto_b98.c - glue code for linking .b98 files with .i files LICENSE TERMS Copyright (C) 2008 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Note that this code is designed to be linked against a GPLv3 library (producing a GPLv3 output), and therefore it is recommended that modifications to this code are compatible with GPLv3, although this is not a legal requirement. ***************************************************************************/ /* This is an expansion library designed to link with the Funge-98 interpreter cfunge (when compiled as a library); this is glue code which hooks into the INTERCAL control structure, and uses functions in glue code which hooks into the Funge control structure in cfunge. The Befunge program itself that is interpreted is stored in yet another .cio file, and accessed via the extern variables ick_iffi_befungeString, ick_iffi_markerposns, and ick_iffi_markercount. The name ecto_b98 is magical, and causes this library to be included when a .b98 files is encountered on the command line (as well as the cfunge library itself, which has the magical name libick_ecto_b98.a). The library itself works by using label names that have a special meaning to ick, along with ICK_EC_FUNCs, to cause a compiled C-INTERCAL program to also search in the Befunge program for line labels, COME FROMs, and NEXT FROMs, as well as in the INTERCAL program itself. It also allows the Befunge program to use INTERCAL control flow structures (even to itself), by monitoring flags set in a Funge-98 fingerprint (IFFI, which accounts for most of the variable names) and simulating the required structure (such as FORGET or NEXT) somewhere where cfunge itself will be unaffected and unaware of what is going on. In general, INTERCAL control flow structures affect only the position and delta of the IP in the Befunge program, not anything else. (In particular, the Befunge stack is unaffected.) */ #include #include #include extern int ick_printflow; struct ick_ipposdeltatype { long long ix, iy, dx, dy; }; /* This is called from IFFI. Remember to keep matching extern over there in sync. */ void ick_interpreter_main_loop(void); /* This is just a forward decl. */ void ick_iffi_handle_control(void); /* These are implemented in IFFI. */ extern void ick_interpreter_run(void); extern void ick_iffi_interpreter_one_iteration(void); extern void ick_save_ip_pos_delta(struct ick_ipposdeltatype*); extern void ick_restore_ip_pos_delta(const struct ick_ipposdeltatype*); unsigned short ick_iffi_forgetcount=0; int ick_iffi_nexting=0; int ick_iffi_comingfrom=0; int ick_iffi_nextingfrom=0; int ick_iffi_sucking=0; int ick_iffi_resuming=0; uint32_t ick_iffi_linelabel=0; int ick_iffi_breakloop=0; /* becomes 1 when IFFI's loaded or mark-mode ends */ int ick_iffi_inmarkmode=0; extern const unsigned char* ick_iffi_befungeString; extern long long ick_iffi_markerposns[][2]; extern int ick_iffi_markercount; ICK_EC_FUNC_START(ick_interpreter_main_loop) { ick_startup( {ick_interpreter_run();} ); /* could be put anywhere, is put here for convenience */ /* we enter here when running at startup code and continue until IFFI is loaded */ if(0) { ick_l2_ICK_EC_PP_2: /* this will be automatically replaced with a valid label, as will the next occurence of it, by ick when it does linking (i.e. this is not an infinite loop). */ if(ick_global_linelabel != 0x70001ff1 && ick_global_linelabel != 0x70001ff2) goto ick_l2_ICK_EC_PP_2; /* If control reaches this point, a COME FROM or NEXT has just completed, and the IP already in the correct place. Continue, outside markmode. */ ick_iffi_nexting = 0; ick_iffi_comingfrom = 0; ick_iffi_nextingfrom = 0; ick_iffi_sucking = 0; ick_iffi_inmarkmode = 0; ick_global_checkmode = 0; /* If a NEXT has just completed, do a suckpoint-check on that line label (in case someone COMEs FROM the target of the NEXT). */ if(ick_global_linelabel == 0x70001ff2) { auto struct ick_ipposdeltatype ippd; ick_save_ip_pos_delta(&ippd); ick_iffi_sucking = 0; ick_checksuckpoint(ick_iffi_linelabel); /* may not return */ ick_restore_ip_pos_delta(&ippd); } } ick_iffi_iml_rerun: ick_iffi_breakloop=0; while(!ick_iffi_breakloop) { ick_iffi_interpreter_one_iteration(); if (ick_iffi_forgetcount && !ick_iffi_breakloop) { ick_forget(ick_iffi_forgetcount); ick_iffi_forgetcount = 0; } } /* There are several reasons why we could reach this point. Most of them, we just fall off the end of the function and whatever called us handles the program flow from there. However, if the loop broke due to a RESUME, line label or NEXT, we need to handle it. */ if(ick_iffi_resuming) { unsigned short iifctemp = ick_iffi_forgetcount; ick_iffi_resuming = 0; ick_iffi_forgetcount = 0; ick_resume(iifctemp); /* never returns */ } if(ick_iffi_nexting) { /* To handle a NEXT, we need to save the relevant IP information (position and delta, which are the only things saved/restored on the NEXT stack) onto the C stack. This is done in a struct ick_ipposdatatype, using the functions available for such save/restore. */ auto struct ick_ipposdeltatype ippd; ick_save_ip_pos_delta(&ippd); ick_iffi_nexting = 0; ick_next(ick_iffi_linelabel); /* may not return */ ick_restore_ip_pos_delta(&ippd); goto ick_iffi_iml_rerun; /* continue the main loop if we got here */ } if(ick_iffi_sucking && ! ick_iffi_inmarkmode) { /* Handle a line-label encountered in normal execution. */ auto struct ick_ipposdeltatype ippd; ick_save_ip_pos_delta(&ippd); ick_iffi_sucking = 0; ick_checksuckpoint(ick_iffi_linelabel); /* may not return */ ick_restore_ip_pos_delta(&ippd); goto ick_iffi_iml_rerun; /* continue the main loop if we got here */ } } ICK_EC_FUNC_END ICK_EC_FUNC_START(ick_iffi_handle_control) { static int recursing=0; int markerno, dirno, nextcheck; struct ick_ipposdeltatype ippd; /* The label names here are magical internal identifiers. That means that this is not in fact an infinite loop, but is instead a handler for sucking in from line labels. The 0x70001ff1 is a magic number used specifically by this code. */ if(0) { ick_l1_ICK_EC_PP_1: if(ick_global_linelabel > 65535) goto skipsearch; /* there can't be a match, don't check to avoid recursion */ nextcheck = 0; if(ick_printflow) fprintf(stderr,"[cfcheck:%d]\n",(int)ick_global_linelabel); } if(0) { ick_l2_ICK_EC_PP_2: if(ick_global_linelabel > 65535) goto skipsearch; /* there can't be a match, don't check to avoid recursion */ nextcheck = 1; if(ick_printflow) fprintf(stderr,"[llcheck:%d]\n",(int)ick_global_linelabel); } assert(!recursing); recursing=1; ick_save_ip_pos_delta(&ippd); markerno=ick_iffi_markercount; while(markerno--) { dirno=4; while(dirno--) { struct ick_ipposdeltatype tippd; tippd.ix=ick_iffi_markerposns[markerno][0]; tippd.iy=ick_iffi_markerposns[markerno][1]; tippd.dx=(dirno == 3 ? -1 : dirno == 1 ? 1 : 0); tippd.dy=(dirno == 0 ? -1 : dirno == 2 ? 1 : 0); if(ick_printflow) fprintf(stderr, "Checking for %s at (%lld, %lld) going %c...\n", nextcheck ? "line label" : "COME FROM/NEXT FROM", tippd.ix, tippd.iy, dirno["^>v<"]); tippd.ix += tippd.dx; tippd.iy += tippd.dy; ick_restore_ip_pos_delta(&tippd); ick_iffi_inmarkmode = 1; ick_local_checkmode = ick_global_checkmode; ick_global_checkmode = 0; ick_interpreter_main_loop(); ick_global_checkmode = ick_local_checkmode; ick_iffi_inmarkmode = 0; if((ick_iffi_nextingfrom||ick_iffi_comingfrom) && ick_iffi_linelabel == ick_global_linelabel && !nextcheck) { if(ick_printflow) fprintf(stderr,"%s FROM found!\n",ick_iffi_comingfrom?"COME":"NEXT"); /* Error out on multiple COME FROM/NEXT FROM with the same target. */ if(ick_global_goto) ick_lose(ICK_IE555, -1, (char*)0); ick_global_goto=0x70001FF1; /* we found a suckpoint */ if(ick_iffi_nextingfrom) ick_global_checkmode = 3; /* do a next from */ /* if it's a come-from, the checkmode is already correct */ ick_save_ip_pos_delta(&ippd); } if(ick_iffi_sucking && ick_iffi_linelabel == ick_global_linelabel && nextcheck) { if(ick_printflow) fprintf(stderr,"Line label found!\n"); /* Another part of the code is NEXTing to this line label. */ ick_save_ip_pos_delta(&ippd); nextcheck = 2; /* when this loop ends, goto the main loop */ } ick_iffi_nextingfrom = 0; ick_iffi_comingfrom = 0; ick_iffi_sucking = 0; } } if(ick_printflow) fprintf(stderr,"Checks finished.\n"); /* Set the IP to what we want it to be on resume, or otherwise return it to its original value. (Returning it to its original value is unneccesary but harmless.) */ ick_restore_ip_pos_delta(&ippd); recursing=0; ick_iffi_linelabel = ick_global_linelabel; if(nextcheck == 2) ick_dogoto(0x70001FF2,-1,0); skipsearch: if(nextcheck) goto ick_l2_ICK_EC_PP_2; else goto ick_l1_ICK_EC_PP_1; } ICK_EC_FUNC_END intercal-0.30/pit/PaxHeaders.27456/guess.i0000644000000000000000000000007411437550756015117 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.558945776 intercal-0.30/pit/guess.i0000644000175000017500000001062211437550756015013 0ustar00esresr00000000000000PLEASE NOTE guess.i - guessing game in INTERCAL NOTE NOTE This is written to demonstrate this language versus the same program NOTE written in other languages. NOTE PLEASE NOTE A highscores file is not currently updated, first step is to NOTE write the File I/O library... NOTE PLEASE NOTE COMPILE: C-INTERCAL, NOTE ick guess.i NOTE PLEASE NOTE COMPILE: J-INTERCAL, NOTE jick guess.i NOTE NOTE 20-Oct-2004 Brendan Gregg Created this. NOTE NOTE Original is at http://users.tpg.com.au/adsln4yb/guessinggame.html NOTE nexxt to many implementations in other languages. DO .11 <- #0 PLEASE ABSTAIN FROM FORGETTING DO ,1 <- #43 PLEASE DO ,1SUB#1 <- #26 DO ,1SUB#2 <- #56 DO ,1SUB#3 <- #8 DO ,1SUB#4 <- #216 DO ,1SUB#5 <- #0 DO ,1SUB#6 <- #90 DO ,1SUB#7 <- #222 PLEASE DO ,1SUB#8 <- #146 DO ,1SUB#9 <- #80 PLEASE DO ,1SUB#10 <- #176 DO ,1SUB#11 <- #34 DO ,1SUB#12 <- #52 DO ,1SUB#13 <- #8 DO ,1SUB#14 <- #216 DO ,1SUB#15 <- #0 PLEASE DO ,1SUB#16 <- #202 DO ,1SUB#17 <- #126 PLEASE DO ,1SUB#18 <- #130 DO ,1SUB#19 <- #142 DO ,1SUB#20 <- #200 DO ,1SUB#21 <- #248 DO ,1SUB#22 <- #112 DO ,1SUB#23 <- #160 DO ,1SUB#24 <- #88 PLEASE DO ,1SUB#25 <- #74 DO ,1SUB#26 <- #190 DO ,1SUB#27 <- #160 DO ,1SUB#28 <- #120 DO ,1SUB#29 <- #64 DO ,1SUB#30 <- #72 DO ,1SUB#31 <- #0 DO ,1SUB#32 <- #48 PLEASE DO ,1SUB#33 <- #114 DO ,1SUB#34 <- #120 PLEASE DO ,1SUB#35 <- #136 DO ,1SUB#36 <- #126 DO ,1SUB#37 <- #16 DO ,1SUB#38 <- #80 PLEASE DO ,1SUB#39 <- #34 DO ,1SUB#40 <- #120 DO ,1SUB#41 <- #128 DO ,1SUB#42 <- #0 DO ,1SUB#43 <- #188 PLEASE READ OUT ,1 DO ,1 <- #1 PLEASE DO ,1SUB#1 <- #0 PLEASE READ OUT ,1 PLEASE ABSTAIN FROM STASHING DO ,2 <- #10 PLEASE DO ,2SUB#1 <- #62 DO ,2SUB#2 <- #124 DO ,2SUB#3 <- #176 DO ,2SUB#4 <- #208 DO ,2SUB#5 <- #112 DO ,2SUB#6 <- #88 DO ,2SUB#7 <- #218 DO ,2SUB#8 <- #0 DO ,2SUB#9 <- #0 DO ,2SUB#10 <- #36 PLEASE ABSTAIN FROM IGNORING DO ,3 <- #9 PLEASE DO ,3SUB#1 <- #30 DO ,3SUB#2 <- #60 DO ,3SUB#3 <- #8 DO ,3SUB#4 <- #72 DO ,3SUB#5 <- #88 DO ,3SUB#6 <- #218 DO ,3SUB#7 <- #0 DO ,3SUB#8 <- #0 DO ,3SUB#9 <- #36 PLEASE REINSTATE FORGETTING DO ,4 <- #13 PLEASE DO ,4SUB#1 <- #110 DO ,4SUB#2 <- #52 DO ,4SUB#3 <- #8 DO ,4SUB#4 <- #216 DO ,4SUB#5 <- #0 PLEASE DO ,4SUB#6 <- #202 DO ,4SUB#7 <- #142 DO ,4SUB#8 <- #200 DO ,4SUB#9 <- #248 DO ,4SUB#10 <- #112 DO ,4SUB#11 <- #160 DO ,4SUB#12 <- #88 DO ,4SUB#13 <- #26 PLEASE REINSTATE FORGETTING DO ,5 <- #13 PLEASE DO ,5SUB#1 <- #146 DO ,5SUB#2 <- #44 DO ,5SUB#3 <- #72 DO ,5SUB#4 <- #136 DO ,5SUB#5 <- #88 PLEASE DO ,5SUB#6 <- #74 DO ,5SUB#7 <- #30 DO ,5SUB#8 <- #56 DO ,5SUB#9 <- #8 DO ,5SUB#10 <- #216 DO ,5SUB#11 <- #0 DO ,5SUB#12 <- #154 DO ,5SUB#13 <- #228 PLEASE REINSTATE STASHING DO ,6 <- #19 PLEASE DO ,6SUB#1 <- #142 DO ,6SUB#2 <- #204 DO ,6SUB#3 <- #168 DO ,6SUB#4 <- #0 DO ,6SUB#5 <- #168 DO ,6SUB#6 <- #224 DO ,6SUB#7 <- #152 DO ,6SUB#8 <- #170 PLEASE DO ,6SUB#9 <- #128 DO ,6SUB#10 <- #214 DO ,6SUB#11 <- #24 DO ,6SUB#12 <- #144 DO ,6SUB#13 <- #88 PLEASE DO ,6SUB#14 <- #42 DO ,6SUB#15 <- #214 DO ,6SUB#16 <- #56 DO ,6SUB#17 <- #0 DO ,6SUB#18 <- #32 DO ,6SUB#19 <- #162 PLEASE REINSTATE IGNORING DO ,7 <- #9 PLEASE DO ,7SUB#1 <- #78 DO ,7SUB#2 <- #56 DO ,7SUB#3 <- #8 DO ,7SUB#4 <- #216 DO ,7SUB#5 <- #0 DO ,7SUB#6 <- #40 DO ,7SUB#7 <- #216 DO ,7SUB#8 <- #90 DO ,7SUB#9 <- #36 PLEASE NOTE GENERATE RAND0M NUMBER DO (1900) NEXT DO .2 <- #662 DO (1040) NEXT DO .1 <- .3 DO (1020) NEXT DO .12 <- .1 PLEASE NOTE PLAY GAME (210) DO FORGET #1 DO .1 <- .11 DO (1020) NEXT DO .11 <- .1 DO READ OUT ,4 DO READ OUT .11 DO READ OUT ,5 PLEASE WRITE IN .13 DO READ OUT ,1 DO .1 <- .13 DO .2 <- .12 PLEASE DO (2000) NEXT DO (230) NEXT DO (242) NEXT (230) DO (240) NEXT DO (300) NEXT (240) DO FORGET .3 DO RESUME #1 (242) DO .1 <- .13 DO .2 <- .12 DO (2010) NEXT DO (250) NEXT PLEASE READ OUT ,2 DO READ OUT ,1 DO (210) NEXT (250) DO (260) NEXT PLEASE READ OUT ,3 DO READ OUT ,1 DO (210) NEXT (260) DO FORGET .3 DO RESUME #1 (300) DO READ OUT ,6 DO READ OUT .11 (301) DO READ OUT ,7 (550) DO .9 <- #8 DO .9 <- #1 (2000) DO (1010) NEXT DO .1 <- .3 DO .2 <- #64173 PLEASE DO (1039) NEXT DO .1 <- .3 PLEASE DO (1039) NEXT DO .1 <- .4 DO .2 <- #1 PLEASE DO (1010) NEXT PLEASE RESUME #1 (2010) DO (1010) NEXT DO .1 <- .3 DO .2 <- .3 PLEASE DO (1009) NEXT DO .1 <- .4 DO .2 <- #1 DO (1010) NEXT PLEASE RESUME #1 (909) DO COME FROM (301) PLEASE GIVE UP intercal-0.30/pit/PaxHeaders.27456/regresscheck0000644000000000000000000000007411437550756016212 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/regresscheck0000755000175000017500000000264711437550756016121 0ustar00esresr00000000000000#!/bin/sh # # regresscheck - test driver for the INTERCAL regression-test suite # # This script expects to get output from an INTERCAL program to be checked # on its standard input. Its job is to compare that output against # a check file, which is presumably correct. # # If the program takes input, set up a pipeline with a cat at the beginning , # the INTERCAL executable in the middle, and this script at the end. # The convention used by the INTERCAL test suite is that the input load for # a program foo is named foo.tst and the check file foo.chk. # # In normal use this script takes one argument, which is the location of the # check file with the trailing .chk extension omitted. The extension is # omitted so that the basename can be used as the name of the program for # purposes of reporting success or failure. # # This pattern doesn't handle well the case where one program has multiple # tests, so options are provided to override the test file name while getopts c:p: opt do case $opt in c) checkfile=$OPTARG ;; # Override the location of the checkfile p) progname=$OPTARG ;; # Override the name used in reporting esac done shift $(($OPTIND - 1)) arg=$1 if [ -z "$progname" ] then progname=`basename ${arg}` fi if [ -z "$checkfile" ] then checkfile=${arg}.chk fi if diff - ${checkfile} then echo "Regression test of $progname succeeded."; else echo "Regression test of $progname FAILED."; fi intercal-0.30/pit/PaxHeaders.27456/hail_mary.3i0000644000000000000000000000007411437550756016021 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/hail_mary.3i0000644000175000017500000000152211437550756015714 0ustar00esresr00000000000000 DO ,1 <- #10 DO ,1 SUB #1 <- #238 PLEASE ABSTAIN FROM (11) DO ,1 SUB #2 <- #140 PLEASE DO ,1 SUB #3 <- #240 DO ,1 SUB #4 <- #96 DO ,1 SUB #5 <- #132 DO ,1 SUB #6 <- #44 DO ,1 SUB #7 <- #56 DO ,1 SUB #8 <- #176 DO ,1 SUB #9 <- #238 DO ,1 SUB #10 <- #96 DO .1 <- #400 DO (19) NEXT DO GIVE UP (19) DO COME FROM (55) PLEASE DO STASH .1 DO .1 <- #2500 PLEASE (31) NEXT DO RETRIEVE .1 DO (123) NEXT (55) PLEASE DO (15) NEXT (31) DO COME FROM (69) PLEASE DON'T FORGET TO INSERT A BETTER HAIL-MARY ROUTINE (11) DO ,1 SUB #1 <- #62 PLEASE REINSTATE CALCULATING DO READ OUT ,1 PLEASE DO (123) NEXT (69) DO (15) NEXT (42) DO RESUME .9 (123) PLEASE .8 <- #1 PLEASE COME FROM (81) DO .1 <- "?.1$.8"~"#0$#29524" DO .9 <- '?"V!1~.8'$#1"~#1'~#1 PLEASE DO (42) NEXT (81) DO .8 <- !8$#0'~"#9841$#1" (15) PLEASE RESUME '?"!1~.1'~#2"$#1'~#1 intercal-0.30/pit/PaxHeaders.27456/unlambda.chk0000644000000000000000000000007411437550756016071 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.574945729 intercal-0.30/pit/unlambda.chk0000644000175000017500000000001411437550756015757 0ustar00esresr00000000000000Hello world intercal-0.30/pit/PaxHeaders.27456/rot13b.chk0000644000000000000000000000007411437550756015420 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/rot13b.chk0000644000175000017500000000004011437550756015305 0ustar00esresr00000000000000N zna, n cyna, n pnany, Cnanzn. intercal-0.30/pit/PaxHeaders.27456/fft.doc0000644000000000000000000000007411437550756015065 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.558945776 intercal-0.30/pit/fft.doc0000644000175000017500000000542311437550756014764 0ustar00esresr00000000000000The program fft.i provides a basic complex Fast Fourier Transform, along with a simple write-in-read-out wrapper. This program requires the floating-point library in lib/floatlib.i; C-INTERCAL will detect this and include it. The first number to enter specifies the direction of the transform. Enter ONE to transform from time to frequency, or TWO for the inverse transform. The second number to enter is the number of complex pairs. This number must be a power of two, between TWO and THREE TWO SEVEN SIX EIGHT inclusive. After this comes the actual data. Each entry must consist of two floating-point numbers, the real value followed by the imaginary value. After the data has been entered, the FFT is performed on it. When it is completed, the resulting data will be output. The data is preceded by I or II to indicate time or frequency data (i.e., the opposite of the number input at the start), and a second integer giving the number of pairs being output. Included are two files that produce simple curves when transformed. delta.fft, the sum of two delta functions, transforms into a cosine wave, and tophat.fft's output traces the sinc function. INTERCAL brings new meaning to the "fast" in Fast Fourier Transform. On Muppetlabs' Pentium, 133MHz, a transform of 2048 data points takes over 5 minutes of CPU time. The actual FFT routine is at line label (100), and is self-contained other than its dependence on the standard and floating-point libraries, and a small subroutine described below. Its three arguments are .9, .10, and ;1. .9 must contain #1 or #2 to select the forward or inverse transform, respectively. .10 must contain the length of the input data, and ;1 the data itself. ;1 must have the dimensions .10 BY #2. No error checking is done on the parameters within the routine. (The wrapper routine sanity-checks the user's input.) On exit, .9 will contain #2 if it was #1 originally and vice versa, and ;1 will contain the transformed data. The FFT algorithm was taken from "Numerical Recipes" (Press, et al; Cambridge University Press, 1994 edition). For data centered on the y-axis, it is usually best to cut the data in half at the axis and switch their positions (i.e., enter the data for 0 to N/2 - 1 first, followed by the data for -N/2 to -1) and then do the same with the output. The FFT routine uses a subroutine, labelled (153), as a wrapper around the multiplication routine (5030). This subroutine is an example of how to handle errors as indicated by the .5 variable. Another noteworthy point is in the first part of the routine, where the positions of the data are swapped with the bit-reversals of their indices. Amazingly, bit-reversal is one of the few things that INTERCAL can do more tersely than most other languages. It is nice to see it actually finding a real-world application. intercal-0.30/pit/PaxHeaders.27456/glider0000644000000000000000000000007411437550756015010 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.558945776 intercal-0.30/pit/glider0000644000175000017500000000010511437550756014677 0ustar00esresr00000000000000NINE NINE ZERO TWO FOUR THREE FOUR FOUR FOUR FOUR THREE THREE TWO OH intercal-0.30/pit/PaxHeaders.27456/pass.chk0000644000000000000000000000007411437550756015254 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.566945757 intercal-0.30/pit/pass.chk0000644000175000017500000000003011437550756015140 0ustar00esresr00000000000000 I II III IV intercal-0.30/pit/PaxHeaders.27456/flonck.tst0000644000000000000000000000007411437550756015627 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.558945776 intercal-0.30/pit/flonck.tst0000644000175000017500000000015511437550756015523 0ustar00esresr00000000000000TWO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO THREE ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ONE SIX THREE ZERO intercal-0.30/pit/PaxHeaders.27456/rot13b.i0000644000000000000000000000007411437550756015103 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/rot13b.i0000644000175000017500000000311011437550756014771 0ustar00esresr00000000000000 DO ,1 <- #1 DO .4 <- #0 DO .5 <- #0 DO COME FROM (30) DO WRITE IN ,1 DO .1 <- ,1SUB#1 DO (10) NEXT PLEASE GIVE UP (20) PLEASE RESUME '?.1$#256'~'#256$#256' (10) DO (20) NEXT DO FORGET #1 DO .2 <- .4 DO (1000) NEXT DO .4 <- .3~#255 DO (50) NEXT DO .3 <- !3~#15'$!3~#240' DO .3 <- !3~#15'$!3~#240' DO .2 <- !3~#15'$!3~#240' DO .1 <- .5 DO (1010) NEXT DO .5 <- .2 PLEASE DO ,1SUB#1 <- .3 (30) PLEASE READ OUT ,1 (50) PLEASE STASH .1 + .2 + .4 + .5 + .11+.12+.13+.14+.15+.16+.17+.18 PLEASE DO .5 <- .4 PLEASE DO .1 <- .5 DO .2 <- #65 DO (500) NEXT DO .11 <- .3~#2 DO .2 <- #78 DO (500) NEXT DO .12 <- .3~#2 DO .2 <- #97 DO (500) NEXT DO .13 <- .3~#2 DO .2 <- #110 DO (500) NEXT DO .14 <- .3~#2 PLEASE DO .2 <- .5 DO .1 <- #77 DO (500) NEXT DO .15 <- .3~#2 DO .1 <- #90 DO (500) NEXT DO .16 <- .3~#2 DO .1 <- #109 DO (500) NEXT DO .17 <- .3~#2 DO .1 <- #122 DO (500) NEXT DO .18 <- .3~#2 PLEASE DO .1 <- ' "'"!12$.11'~#3"$"!14$.13'~#3"'~#15" $"'"!16$.15'~#3"$"!18$.17'~#3"'~#15" '~#255 PLEASE DO .1 <- 'V"!&1'~#85"'~#5 DO .2 <- "!1~#2'$!1~#2'"~#3 DO .1 <- !2$.1'~#15 DO .2 <- !2$.2'~#15 DO .2 <- "!1$.2'$!1$"'"V!2$.1'"~#15'"'"~#65535 DO .1 <- .5 PLEASE DO (1009) NEXT PLEASE RETRIEVE .1 + .2 + .4 + .5 + .11+.12+.13+.14+.15+.16+.17+.18 PLEASE RESUME #1 (500) PLEASE STASH .4 DO .3 <- "?!1$.2'"~"#0$#65535" DO .4 <- .3~.3 DO .4 <- '&"!?4'$.4"'~'#0$#65535' DO .3 <- '"'&"!1~.3'$.4"'~'#0$#65535'"~.4' $'"'&"!2~.3'$.4"'~'#0$#65535'"~.4' DO .3 <- "?'"!3~#1'$!3~#2'"$"#1$!3~#1'"'"~#5 PLEASE RETRIEVE .4 DO RESUME #1 intercal-0.30/pit/PaxHeaders.27456/pow.chk0000644000000000000000000000007411437550756015113 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.566945757 intercal-0.30/pit/pow.chk0000644000175000017500000000533311437550756015012 0ustar00esresr00000000000000_ I XXXII CCXLIII MXXIV MMMCXXV ___ VIIDCCLXXVI ___ XVIDCCCVII ___ XXXMMDCCLXVIII ___ LIXXLIX _ C ___ CLXMLI ________ CCXLVIIIDCCCXXXII ______ CCCLXXMCCXCIII _______ DXXXVIIDCCCXXIV ______ DCCLIXCCCLXXV _______ MXLVIIIDLXXVI ______ MCDXIXDCCCLVII ___________ MDCCCLXXXIXDLXVIII _________ MMCDLXXVIXCIX _____ MMMCC ______ ivLXXXIVCI __ vCLMMMDCXXXII _______ viCDXXXVICCCXLIII ____ viiCMLXMMDCXXIV ______ ixDCCLXVDCXXV _________ xMDCCCLXXXMCCCLXXVI _________ xivCCCXLVIIICMVII ___ xviiCCXCCCLXVIII __ xxDXMCXLIX ___ xxivCCC ______ xxviiiDCXXIXCLI _______ xxxMMMDLIVCDXXXII _____ xxxixCXXXVCCCXCIII ______ xlvCDXXXVCDXXIV _____ lMMDXXMDCCCLXXV ______ lxCDLXVICLXXVI _____ lxixCCCXLMMMCMLVII ______ lxxixCCXXXVCLXVIII ______ xcCCXXIVCXCIX ____ cMMCD _______ cxvDCCCLVICCI ____ cxxxDCXCMCCXXXII ____ cxlviiVIIICDXLIII _____ clxivCMXVICCXXIV _______ clxxxivDXXVIIICXXV ____ ccvCMLXMMCMLXXVI ______ ccxxixCCCXLVVII ____ cclivDCCCMMMCMLXVIII ________ cclxxxMMCDLXXVCCXLIX ___ cccxMMD ___ cccxlvXXVCCLI ____ ccclxxxCCIVXXXII ____ cdxviiiCXCVCDXCIII ____ cdlixCLXVXXIV ___________ dMMMCCLXXXIVCCCLXXV ______ dlDCCXXXMDCCLXXVI _____ dcMDCXCMMLVII ______ dclviCCCLVIDCCLXVIII ______ dccxivCMXXIVCCXCIX __ dcclxxviiDC _____ dcccxlivDXCVICCCI ____ cmxviCXXXMMDCCCXXXII _________ cmxcMMCDXXXVIDXLIII ________ mlxxMMMDCCXLMDCCCXXIV ____ mclxCCXCDCXXV ________ mcclMMCCCXXXMMDLXXVI ____ mccclCXXVCVII ________ mcdlMMMCMXXXMMMDLXVIII ___ mdlxivXXXMCCCXLIX ___ mdclxxxDCC ______ mdcccivCCXXIXCCCLI ______ mcmxxxivCMXVIIDCXXXII ______ mmlxxMMMLXXMDXCIII __ mmccxixVIDCXXIV _______ mmccclxxMMMXLVIDCCCLXXV ____ mmdxxxvDXXVCCCLXXVI _________ mmdccviDCCLXXXIVCLVII ______ mmdccclxxxviiCLXXIVCCCLXVIII ___ mmmlxxviiLVICCCXCIX ____ mmmcclxxviDCCC _________ mmmcdlxxxviDCCLXXXIVCDI _________ mmmdccviiCCCXCVIIICDXXXII __ mmmcmxxxixXLDCXLIII __ ______ ivclxxxMMCXIXCDXXIV ICL000I (1999) DOUBLE OR SINGLE PRECISION OVERFLOW ON THE WAY TO 66 CORRECT SOURCE AND RESUBNIT intercal-0.30/pit/PaxHeaders.27456/change.doc0000644000000000000000000000007411437550756015533 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.558945776 intercal-0.30/pit/change.doc0000644000175000017500000000330311437550756015425 0ustar00esresr00000000000000The problem is to determine how many different ways there are to make change for a given amount using five denominations of US coins (including the 50-cent piece). One version -- taken directly from section 1.2.2 of Abelson and Sussman (1st edition, 1985) -- recurses both towards lower amounts and fewer kinds of coins. The space required by this tree recursion grows rapidly with the size of the problem. The other version is a minor modification which makes the long ``amount'' direction tail-recursive. The ``kinds'' direction is still recursive, but with only five kinds of coins there need be only five stack frames for the routine allocated at a time. In case it isn't obvious, the routine starting at (100) is the function ``first-denomination'' (one of the few things INTERCAL can do easily), the one at (200) is the recursive version ``cc'', and (300) starts the tail-recursive routine ``cc-tail''. The first few lines are the main program, which you can change to run the recursive version by calling (200) instead of (300). The (2000) routine at the end decrements .1, and I make calls to the addition and subtraction routines in the standard library. Two stacks are involved: the variable stack accessed by STASH and RETRIEVE, and the call stack accessed by NEXT and RESUME. The former is limited only by memory, but the latter is supposed to have a built-in limit of 80 pending returns. The tail-recursive routine has no problem with this. However, in order to permit the recursive routine (200) to run with amounts greater than 70, I had to remake the INTERCAL compiler with a larger limit. (To see this program compared with similar programs in other languages, visit http://www.webcom.com/nazgul/change.html.)intercal-0.30/pit/PaxHeaders.27456/bubble.i0000644000000000000000000000007411437550756015224 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.554945791 intercal-0.30/pit/bubble.i0000644000175000017500000000364211437550756015124 0ustar00esresr00000000000000 DO WRITE IN .2 DO ,1 <- .2 PLEASE NOTE INITIAL SEQUENCE INPUT DO .1 <- .2 DO (110) NEXT (110) DO FORGET #1 DO WRITE IN ,1 SUB .1 DO (111) NEXT (112) DO (2010) NEXT DO FORGET #2 DO (110) NEXT (111) DO (112) NEXT DO FORGET #1 PLEASE NOTE CALLING SORT ROUTINE INDIRECTLY DO .1 <- .2 DO (500) NEXT PLEASE NOTE SORTED SEQUENCE OUTPUT DO .1 <- .2 DO (210) NEXT (210) DO FORGET #1 DO READ OUT ,1 SUB .1 DO (211) NEXT (212) DO (2010) NEXT DO FORGET #2 DO (210) NEXT (211) DO (212) NEXT DO FORGET #1 PLEASE GIVE UP PLEASE NOTE COMPARE AND EXCHANGE ROUTINE (500) PLEASE ABSTAIN FROM (502) DO (3000) NEXT DO (501) NEXT (501) DO FORGET #1 (502) DO (3010) NEXT PLEASE REINSTATE (502) DO .3 <- '?",1SUB.1"$,1SUB.2'~'#0$#65535' DO .3 <- '?"'& "'",1SUB.1"~.3'~'"?'?.3~.3'$#32768"~"#0$#65535"'" $ ".3~.3"'~#1" $ #1'~#3 DO (503) NEXT DO .3 <- ,1 SUB .1 DO ,1 SUB .1 <- ,1 SUB .2 DO ,1 SUB .2 <- .3 DO (501) NEXT (504) PLEASE RESUME .3 (503) DO (504) NEXT DO FORGET #1 DO (501) NEXT PLEASE NOTE BUBBLE SORT ROUTINE PLEASE NOTE THAT EXCHANGE ROUTINE SHOULD NOT CHANGE .1 OR .2 (3000) PLEASE STASH .1 + .2 DO .2 <- .1 DO (2000) NEXT DO (3001) NEXT (3001) DO FORGET #1 DO RESUME #1 (3011) DO (2010) NEXT DO FORGET #1 DO (3001) NEXT (3010) DO (3011) NEXT DO (3012) NEXT (3013) DO .1 <- .2 DO (2010) NEXT DO FORGET #2 DO .2 <- .1 DO (3010) NEXT DO RESUME #1 (3012) DO (3013) NEXT PLEASE RETRIEVE .1 + .2 DO RESUME #4 (2010) PLEASE ABSTAIN FROM (2004) (2000) PLEASE STASH .2 DO .2 <- #1 DO (2001) NEXT (2001) DO FORGET #1 DO .1 <- '?.1$.2'~'#0$#65535' DO (2002) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (2001) NEXT (2003) PLEASE RESUME "?!1~.2'$#1"~#3 (2002) DO (2003) NEXT PLEASE RETRIEVE .2 (2004) PLEASE RESUME #2 PLEASE DO REINSTATE (2004) PLEASE RESUME '?"!1~.1'~#1"$#2'~#6 intercal-0.30/pit/PaxHeaders.27456/interfunge.i0000644000000000000000000000007411437550756016137 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/interfunge.i0000644000175000017500000003570111437550756016040 0ustar00esresr00000000000000 PLEASE DO (600) NEXT PLEASE DON'T PAY ATTENTION TO THE ABOVE LINE IF YOU ARE HUMAN INTERFUNGE.I - COPYRIGHT 2008 JEFFREY LEE THE BEFUNGE PROGRAM FROM IS FIRST READ FROM INPUT DON'T FORGET TO TERMINATE YOUR FUNGESPACE PROGRAM WITH A BLANK LINE VARIABLES AND SUBROUTINES: ;1 IS THE 2D FUNGESPACE ARRAY ;2 IS THE FUNGESPACE STACK .10 AND .11 ARE THE IP .12 AND .13 ARE THE DELTA .14 IS THE STACK DEPTH .15 AND .16 ARE THE IO TAPE POSITIONS ,1 IS THE IO BUFFER ,2 IS THE INSTRUCTION LOOKUP TABLE [500] GETS A CHAR INTO .1 AND [510] OUTPUTS A CHAR FROM .1 [530] PUSHES :1 AND [540] POPS :1 FROM THE STACK LICENSING: INTERFUNGE.I IS FREE SOFTWARE: YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION, EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION. INTERFUNGE.I IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU GENERAL PUBLIC LICENSE FOR MORE DETAILS. YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE ALONG WITH INTERFUNGE.I. IF NOT, SEE . PLEASE NOTE THAT THE PROGRAM STARTS HERE (600) PLEASE DO ;1 <- #80 BY #25 DO ;2 <- #10000 DO .11 <- #1 PLEASE DO .12 <- #1 DO .13 <- #0 DO .14 <- #0 DO .15 <- #0 DO .16 <- #0 PLEASE DO ,1 <- #1 PLEASE DO ,2 <- #127 DO .3 <- #127 DO .2 <- #1 (13) DO FORGET #1 DO .1 <- .3 PLEASE DO ,2SUB.1 <- #1 DO (1010) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (14) NEXT DO (13) NEXT (14) PLEASE DO (3) NEXT DON'T FORGET THAT [1] CLEARS THE CALL STACK FOR US DO ,2SUB#32 <- #2 DO ,2SUB#33 <- #3 PLEASE DO ,2SUB#34 <- #4 DO ,2SUB#35 <- #5 DO ,2SUB#36 <- #6 DO ,2SUB#37 <- #7 PLEASE DO ,2SUB#38 <- #8 DO ,2SUB#42 <- #9 DO ,2SUB#43 <- #10 DO ,2SUB#44 <- #11 PLEASE DO ,2SUB#45 <- #12 DO ,2SUB#46 <- #13 DO ,2SUB#47 <- #14 DO ,2SUB#48 <- #15 PLEASE DO ,2SUB#49 <- #16 DO ,2SUB#50 <- #17 DO ,2SUB#51 <- #18 DO ,2SUB#52 <- #19 PLEASE DO ,2SUB#53 <- #20 DO ,2SUB#54 <- #21 DO ,2SUB#55 <- #22 DO ,2SUB#56 <- #23 PLEASE DO ,2SUB#57 <- #24 DO ,2SUB#58 <- #25 DO ,2SUB#60 <- #26 DO ,2SUB#62 <- #27 PLEASE DO ,2SUB#63 <- #28 DO ,2SUB#64 <- #29 DO ,2SUB#92 <- #30 DO ,2SUB#94 <- #31 PLEASE DO ,2SUB#95 <- #32 DO ,2SUB#96 <- #33 DO ,2SUB#103 <- #34 DO ,2SUB#112 <- #35 PLEASE DO ,2SUB#118 <- #36 DO ,2SUB#124 <- #37 DO ,2SUB#126 <- #38 (5) DO .10 <- #1 (1) PLEASE FORGET #1 (10) DO (500) NEXT (11) DON'T .1 <- #10 DO .5 <- .1 DO .2 <- #10 PLEASE DO (1010) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 DO (2) NEXT DO .1 <- .10 DO .2 <- #81 PLEASE DO (1010) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 DO (18) NEXT DO ;1SUB.10.11 <- .5 PLEASE ABSTAIN FROM (18) (18) DO (3) NEXT PLEASE REINSTATE (18) PLEASE FORGET #1 DO .1 <- .10 PLEASE DO (1020) NEXT DO .10 <- .1 PLEASE DO (1) NEXT (2) DO (3) NEXT DO FORGET #1 DO .1 <- .10 DO .2 <- #1 PLEASE DO (1010) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 DO (4) NEXT (7) PLEASE FORGET #1 DO .1 <- .10 DO .2 <- #81 PLEASE DO (1010) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 DO (6) NEXT DO ;1SUB.10.11 <- #32 DO .1 <- .10 DO .2 <- #1 PLEASE DO (1000) NEXT DO .10 <- .3 DO (7) NEXT (6) DO (3) NEXT PLEASE FORGET #1 DO .1 <- .11 PLEASE DO (1020) NEXT DO .11 <- .1 DO .2 <- #26 PLEASE DO (1010) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 DO (8) NEXT DO (5) NEXT (8) PLEASE DO (3) NEXT PLEASE FORGET #1 PLEASE DO (9) NEXT (4) DO (3) NEXT PLEASE FORGET #1 DO ABSTAIN FROM (10) PLEASE REINSTATE (11) PLEASE DO (7) NEXT (3) PLEASE RESUME .1 (9) DO .10 <- #1 DO .11 <- #1 (12) DO :9 <- ;1SUB.10.11 DO .1 <- '?"':9~:9'~#1"$#1'~#3 PLEASE DO (15) NEXT DO .1 <- :9~'#65528$#65520' DO .1 <- '?"!1~.1'~#1"$#1'~#3 PLEASE DO (16) NEXT PLEASE DO (17) NEXT (16) PLEASE DO (3) NEXT DO FORGET #1 DO .1 <- ,2SUB:9 PLEASE DO (390) NEXT (15) PLEASE DO (3) NEXT (17) DO FORGET #80 DON'T IMPLEMENT REFLECT HERE DO .1 <- #0 DO .2 <- .12 PLEASE DO (1010) NEXT DO .12 <- .3 DO .2 <- .13 PLEASE DO (1010) NEXT DO .13 <- .3 DO (20) NEXT (30) PLEASE DO (15) NEXT (20) DON'T IMPLEMENT SPACE HERE DO FORGET #80 DO .1 <- '?".12~#1"$#1'~#3 PLEASE DO (33) NEXT DO .1 <- .10 DO .2 <- .12 PLEASE DO (1009) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (31) NEXT DO .10 <- .3 DO .1 <- .3 DO .2 <- #81 PLEASE DO (1010) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (32) NEXT DO (12) NEXT (31) PLEASE DO (3) NEXT DO FORGET #1 DO .10 <- #80 DO (12) NEXT (32) PLEASE DO (3) NEXT DO FORGET #1 DO .10 <- #1 DO (12) NEXT (33) PLEASE DO (3) NEXT DO FORGET #1 DO .1 <- .11 DO .2 <- .13 PLEASE DO (1009) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (34) NEXT DO .11 <- .3 DO .1 <- .3 DO .2 <- #26 PLEASE DO (1010) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (35) NEXT DO (12) NEXT (34) PLEASE DO (3) NEXT DO FORGET #1 DO .11 <- #25 DO (12) NEXT (35) PLEASE DO (3) NEXT DO FORGET #1 DO .11 <- #1 DO (12) NEXT (40) PLEASE DO (30) NEXT DO FORGET #80 DON'T IMPLEMENT NOT HERE DO (540) NEXT DO :1 <- '?"':1~:1'~#1"$#1'~#1 DO (530) NEXT PLEASE DO (20) NEXT (50) PLEASE DO (40) NEXT (58) DON'T IMPLEMENT STRINGMODE HERE DO FORGET #80 DO .1 <- '?".12~#1"$#1'~#3 PLEASE DO (53) NEXT DO .1 <- .10 DO .2 <- .12 PLEASE DO (1009) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (51) NEXT DO .10 <- .3 DO .1 <- .3 DO .2 <- #81 PLEASE DO (1010) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (52) NEXT DO (56) NEXT (51) PLEASE DO (3) NEXT DO FORGET #1 DO .10 <- #80 DO (56) NEXT (52) PLEASE DO (3) NEXT DO FORGET #1 DO .10 <- #1 DO (56) NEXT (53) PLEASE DO (3) NEXT DO FORGET #1 DO .1 <- .11 DO .2 <- .13 PLEASE DO (1009) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (54) NEXT DO .11 <- .3 DO .1 <- .3 DO .2 <- #26 PLEASE DO (1010) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (55) NEXT DO (56) NEXT (54) PLEASE DO (3) NEXT DO FORGET #1 DO .11 <- #25 DO (56) NEXT (55) PLEASE DO (3) NEXT DO FORGET #1 DO .11 <- #1 (56) DO FORGET #1 DO :1 <- ;1SUB.10.11 DO :2 <- #34 PLEASE DO (1510) NEXT DO .1 <- '?"':3~:3'~#1"$#1'~#3 DO (57) NEXT DO (530) NEXT DO (58) NEXT (57) DO (3) NEXT PLEASE DO (20) NEXT (60) PLEASE DO (50) NEXT DO FORGET #80 DON'T IMPLEMENT TRAMPOLINE HERE DO .1 <- '?".12~#1"$#1'~#3 PLEASE DO (63) NEXT DO .1 <- .10 DO .2 <- .12 PLEASE DO (1009) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (31) NEXT DO .10 <- .3 DO .1 <- .3 DO .2 <- #81 PLEASE DO (1010) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (62) NEXT DO (20) NEXT (61) PLEASE DO (3) NEXT DO FORGET #1 DO .10 <- #80 DO (20) NEXT (62) PLEASE DO (3) NEXT DO FORGET #1 DO .10 <- #1 DO (20) NEXT (63) PLEASE DO (3) NEXT DO FORGET #1 DO .1 <- .11 DO .2 <- .13 PLEASE DO (1009) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (64) NEXT DO .11 <- .3 DO .1 <- .3 DO .2 <- #26 PLEASE DO (1010) NEXT DO .1 <- '?"!3~.3'~#1"$#1'~#3 PLEASE DO (65) NEXT DO (20) NEXT (64) PLEASE DO (3) NEXT DO FORGET #1 DO .11 <- #25 DO (20) NEXT (65) PLEASE DO (3) NEXT DO FORGET #1 DO .11 <- #1 DO (20) NEXT (70) PLEASE DO (60) NEXT DO FORGET #80 DON'T IMPLEMENT POP HERE DO (540) NEXT PLEASE DO (20) NEXT (80) PLEASE DO (70) NEXT DO FORGET #80 DON'T IMPLEMENT REMAINDER HERE DO (540) NEXT DO :2 <- :1 DO (540) NEXT PLEASE DO (2530) NEXT DO :1 <- :4 DO (530) NEXT PLEASE DO (20) NEXT (90) PLEASE DO (80) NEXT DO FORGET #80 DON'T IMPLEMENT INPUT INTEGER HERE DO WRITE IN :1 DO (530) NEXT PLEASE DO (20) NEXT (100) PLEASE DO (90) NEXT DO FORGET #80 DON'T IMPLEMENT MULTIPLY HERE DO (540) NEXT DO :2 <- :1 DO (540) NEXT PLEASE DO (1549) NEXT DO :1 <- :3 DO (530) NEXT PLEASE DO (20) NEXT (110) PLEASE DO (100) NEXT DO FORGET #80 DON'T IMPLEMENT ADD HERE DO (540) NEXT DO :2 <- :1 DO (540) NEXT PLEASE DO (1509) NEXT DO :1 <- :3 DO (530) NEXT PLEASE DO (20) NEXT (120) PLEASE DO (110) NEXT DO FORGET #80 DON'T IMPLEMENT OUTPUT CHAR HERE DO (540) NEXT DO .1 <- :1~#255 DO (510) NEXT PLEASE DO (20) NEXT (130) PLEASE DO (120) NEXT DO FORGET #80 DON'T IMPLEMENT SUBTRACT HERE DO (540) NEXT DO :2 <- :1 DO (540) NEXT PLEASE DO (1510) NEXT DO :1 <- :3 DO (530) NEXT PLEASE DO (20) NEXT (140) PLEASE DO (130) NEXT DO FORGET #80 DON'T IMPLEMENT OUTPUT INTEGER HERE DO (540) NEXT DO READ OUT :1 PLEASE DO (20) NEXT (150) PLEASE DO (140) NEXT DO FORGET #80 DON'T IMPLEMENT DIVIDE HERE DO (540) NEXT DO :2 <- :1 DO (540) NEXT PLEASE DO (1550) NEXT DO :1 <- :3 DO (530) NEXT PLEASE DO (20) NEXT (160) PLEASE DO (150) NEXT DO FORGET #80 DON'T IMPLEMENT PUSH ZERO HERE DO :1 <- #0 DO (530) NEXT PLEASE DO (20) NEXT (170) PLEASE DO (160) NEXT DO FORGET #80 DON'T IMPLEMENT PUSH ONE HERE DO :1 <- #1 DO (530) NEXT PLEASE DO (20) NEXT (180) PLEASE DO (170) NEXT DO FORGET #80 DON'T IMPLEMENT PUSH TWO HERE DO :1 <- #2 DO (530) NEXT PLEASE DO (20) NEXT (190) PLEASE DO (180) NEXT DO FORGET #80 DON'T IMPLEMENT PUSH THREE HERE DO :1 <- #3 DO (530) NEXT PLEASE DO (20) NEXT (200) PLEASE DO (190) NEXT DO FORGET #80 DON'T IMPLEMENT PUSH FOUR HERE DO :1 <- #4 DO (530) NEXT PLEASE DO (20) NEXT (210) PLEASE DO (200) NEXT DO FORGET #80 DON'T IMPLEMENT PUSH FIVE HERE DO :1 <- #5 DO (530) NEXT PLEASE DO (20) NEXT (220) PLEASE DO (210) NEXT DO FORGET #80 DON'T IMPLEMENT PUSH SIX HERE DO :1 <- #6 DO (530) NEXT PLEASE DO (20) NEXT (230) PLEASE DO (220) NEXT DO FORGET #80 DON'T IMPLEMENT PUSH SEVEN HERE DO :1 <- #7 DO (530) NEXT PLEASE DO (20) NEXT (240) PLEASE DO (230) NEXT DO FORGET #80 DON'T IMPLEMENT PUSH EIGHT HERE DO :1 <- #8 DO (530) NEXT PLEASE DO (20) NEXT (250) PLEASE DO (240) NEXT DO FORGET #80 DON'T IMPLEMENT PUSH NINE HERE DO :1 <- #9 DO (530) NEXT PLEASE DO (20) NEXT (260) PLEASE DO (250) NEXT DO FORGET #80 DON'T IMPLEMENT DUPLICATE HERE DO (540) NEXT DO (530) NEXT DO (530) NEXT PLEASE DO (20) NEXT (270) PLEASE DO (260) NEXT DO FORGET #80 DON'T IMPLEMENT GO WEST HERE DO .12 <- #65535 DO .13 <- #0 PLEASE DO (20) NEXT (280) PLEASE DO (270) NEXT DO FORGET #80 DON'T IMPLEMENT GO EAST HERE DO .12 <- #1 DO .13 <- #0 PLEASE DO (20) NEXT (290) PLEASE DO (280) NEXT DO FORGET #80 DON'T IMPLEMENT GO AWAY HERE PLEASE NOTE THAT THIS WAS PATCHED BY AIS523 TO FIX A SYNTAX ERROR DO %50 (291) NEXT DO .13 <- #0 DO .12 <- #65535 DO %50 .12 <- .12~#1 PLEASE DO (20) NEXT (291) DO .12 <- #0 DO .13 <- #65535 DO %50 .13 <- .13~#1 PLEASE DO (20) NEXT (300) PLEASE DO (290) NEXT PLEASE GIVE UP (310) PLEASE DO (300) NEXT DO FORGET #80 DON'T IMPLEMENT SWAP HERE DO (540) NEXT DO :2 <- :1 DO (540) NEXT DO :3 <- :1 DO :1 <- :2 DO (530) NEXT DO :1 <- :3 DO (530) NEXT PLEASE DO (20) NEXT (320) PLEASE DO (310) NEXT DO FORGET #80 DON'T IMPLEMENT GO NORTH HERE DO .12 <- #0 DO .13 <- #65535 PLEASE DO (20) NEXT (330) PLEASE DO (320) NEXT DO FORGET #80 DON'T IMPLEMENT EAST-WEST IF HERE DO .13 <- #0 DO (540) NEXT DO .1 <- '?"':1~:1'~#1"$#1'~#3 DO (331) NEXT DO .12 <- #65535 PLEASE DO (20) NEXT (331) PLEASE DO (3) NEXT DO FORGET #1 DO .12 <- #1 PLEASE DO (20) NEXT (340) PLEASE DO (330) NEXT DO FORGET #80 DON'T IMPLEMENT GREATER THAN HERE DO (540) NEXT DO :2 <- :1 DO (540) NEXT DO (1510) NEXT DO :1 <- :3~'#32767$#65535' DO :1 <- ':1~:1'~"'?":3~'#32768$#0'"$#1'~#1" PLEASE DO (530) NEXT PLEASE DO (20) NEXT (350) PLEASE DO (340) NEXT DO FORGET #80 DON'T IMPLEMENT GET HERE DO (540) NEXT DO :4 <- :1 DO .1 <- '?":1~'#32768$#0'"$#1'~#1 DO :2 <- #25 PLEASE DO (1510) NEXT DO (540) NEXT DO .1 <- .1~"':3~"#32768$#0"'~"'?":1~'#32768$#0'"$#1'~#1"" DO :2 <- #80 PLEASE DO (1510) NEXT DO .1 <- '?".1~':3~"#32768$#0"'"$#1'~#3 PLEASE DO (351) NEXT DO .1 <- :4 PLEASE DO (1020) NEXT DO .2 <- .1 DO .1 <- :1 PLEASE DO (1020) NEXT DO :1 <- ;1SUB.1.2 DO (530) NEXT PLEASE DO (20) NEXT (351) PLEASE DO (3) NEXT DO FORGET #1 DO :1 <- #32 DO (530) NEXT PLEASE DO (20) NEXT (360) PLEASE DO (350) NEXT DO FORGET #80 DON'T IMPLEMENT PUT HERE DO (540) NEXT DO :4 <- :1 DO .1 <- '?":1~'#32768$#0'"$#1'~#1 DO :2 <- #25 PLEASE DO (1510) NEXT DO (540) NEXT DO .1 <- .1~"':3~"#32768$#0"'~"'?":1~'#32768$#0'"$#1'~#1"" DO :2 <- #80 PLEASE DO (1510) NEXT DO .1 <- '?".1~':3~"#32768$#0"'"$#1'~#3 PLEASE DO (361) NEXT DO .1 <- :4 PLEASE DO (1020) NEXT DO .2 <- .1 DO .1 <- :1 PLEASE DO (1020) NEXT DO (540) NEXT DO ;1SUB.1.2 <- :1 PLEASE DO (20) NEXT (361) PLEASE DO (3) NEXT DO FORGET #1 DO (540) NEXT PLEASE DO (20) NEXT (370) PLEASE DO (360) NEXT DO FORGET #80 DON'T IMPLEMENT GO SOUTH HERE DO .12 <- #0 DO .13 <- #1 PLEASE DO (20) NEXT (380) PLEASE DO (370) NEXT DO FORGET #80 DON'T IMPLEMENT NORTH-SOUTH IF HERE DO .12 <- #0 DO (540) NEXT DO .1 <- '?"':1~:1'~#1"$#1'~#3 DO (381) NEXT DO .13 <- #65535 PLEASE DO (20) NEXT (381) PLEASE DO (3) NEXT DO FORGET #1 DO .13 <- #1 PLEASE DO (20) NEXT (390) PLEASE DO (380) NEXT DO FORGET #80 DON'T IMPLEMENT INPUT CHAR HERE DO (500) NEXT DO :1 <- .1 DO (530) NEXT PLEASE DO (20) NEXT (500) PLEASE STASH .2 + .3 + .4 PLEASE WRITE IN ,1 DO .1 <- ,1SUB#1 DO .2 <- .15 DO (1000) NEXT DO .15 <- .3~#255 DO .1 <- .15 PLEASE RETRIEVE .2 + .3 + .4 PLEASE RESUME #1 (510) PLEASE STASH .1 + .2 + .3 + .4 DO .2 <- !1~#15'$!1~#240' DO .2 <- !2~#15'$!2~#240' DO .2 <- !2~#15'$!2~#240' DO .1 <- .16 DO (1010) NEXT DO .16 <- .2 DO ,1SUB#1 <- .3 PLEASE READ OUT ,1 PLEASE RETRIEVE .1 + .2 + .3 + .4 PLEASE RESUME #1 (520) DON'T EXPECT THIS TO DO MUCH (530) PLEASE STASH .1 DO .1 <- .14 PLEASE DO (1020) NEXT DO .14 <- .1 DO ;2SUB.14 <- :1 PLEASE RETRIEVE .1 PLEASE RESUME #1 (540) PLEASE STASH .1 + .2 + .3 DO .1 <- '?"!14~.14'~#1"$#1'~#3 DO (541) NEXT DO :1 <- ;2SUB.14 DO .1 <- .14 DO .2 <- #1 PLEASE DO (1010) NEXT DO .14 <- .3 PLEASE RETRIEVE .1 + .2 + .3 PLEASE RESUME #1 (541) PLEASE DO (3) NEXT DO :1 <- #0 PLEASE RETRIEVE .1 + .2 + .3 PLEASE RESUME #2 PLEASE ACKNOWLEDGE 32BIT DIVISION WITH REMAINDER FROM NUMIO.I (2530) DO STASH :1 + :5 + .5 DO :3 <- #0 DO .5 <- '?"':2~:2'~#1"$#1'~#3 PLEASE DO (2531) NEXT DO :4 <- #1 PLEASE DO (2533) NEXT (2533) DO FORGET #1 DO .5 <- '?":2~'#32768$#0'"$#2'~#3 DO (2532) NEXT DO :2 <- ":2~'#0$#65535'"$"'":2~'#32767$#0'"$# 0'~'#32767$#1'" PLEASE DO :4 <- ":4~'#0$#65535'"$"'":4~'#32767 $#0'"$#0'~'#32767$#1'" DO (2533) NEXT (2532) DO (1001) NEXT (2536) PLEASE FORGET #1 DO :5 <- "'?":1~'#65535$#0'"$":2~'#65535$#0'"' ~'#0$#65535'"$"'?":1~'#0$#65535'"$":2~'#0$ #65535'"'~'#0$#65535'" DO .5 <- '?"'&"':2~:5'~'"'?"'?":5~:5"~"#65535$ #65535"'~'#65535$#0'"$#32768'~'#0$#65535'" $"'?":5~:5"~"#65535$#65535"'~'#0$#65535'"' "$"':5~:5'~#1"'~#1"$#2'~#3 DO (2534) NEXT DO :5 <- :3 DO (1510) NEXT PLEASE DO :1 <- :3 DO :3 <- "'V":4~'#65535$#0'"$":5~'#65535$#0'"' ~'#0$#65535'"$"'V":4~'#0$#65535'"$":5~'#0$ #65535'"'~'#0$#65535'" DO (2535) NEXT (2534) PLEASE DO (1001) NEXT (2535) DO FORGET #1 DO .5 <- "?':4~#1'$#2"~#3 DO (2531) NEXT DO :2 <- ":2~'#0$#65534'"$":2~'#65535$#0'" DO :4 <- ":4~'#0$#65534'"$":4~'#65535$#0'" PLEASE DO (2536) NEXT (2531) DO (1001) NEXT DO :4 <- :1 PLEASE RETRIEVE :1 + :5 + .5 PLEASE RESUME #2 PLEASE REMEMBER TO APPEND STANDARD LIBRARY intercal-0.30/pit/PaxHeaders.27456/bubble.chk0000644000000000000000000000007411437550756015541 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.554945791 intercal-0.30/pit/bubble.chk0000644000175000017500000000010111437550756015424 0ustar00esresr00000000000000 MMCCCXVII XXXVI XXXVI XXIV XIX _ intercal-0.30/pit/PaxHeaders.27456/bubble.tst0000644000000000000000000000007411437550756015606 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.554945791 intercal-0.30/pit/bubble.tst0000644000175000017500000000010411437550756015474 0ustar00esresr00000000000000SIX THREE SIX TWO FOUR THREE SIX TWO THREE ONE SEVEN ONE NINER ZERO intercal-0.30/pit/PaxHeaders.27456/gun0000644000000000000000000000007411437550756014333 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.558945776 intercal-0.30/pit/gun0000644000175000017500000000120511437550756014224 0ustar00esresr00000000000000THREE EIGHT TWO ZERO ZERO TWO SIX TWO SEVEN THREE SIX THREE SEVEN ONE THREE SIX ONE THREE SEVEN ONE THREE EIGHT ONE FOUR FIVE ONE FOUR NINE ONE FIVE FOUR ONE FIVE ONE ZERO ONE SIX FIVE ONE SIX NINE ONE SEVEN SIX ONE SEVEN SEVEN ONE SEVEN EIGHT ONE EIGHT SIX ONE EIGHT SEVEN ONE EIGHT EIGHT TWO THREE FOUR TWO THREE FIVE TWO THREE SIX TWO FOUR THREE TWO FOUR FOUR TWO FOUR SIX TWO FOUR SEVEN TWO FIVE THREE TWO FIVE FOUR TWO FIVE SIX TWO FIVE SEVEN TWO SIX THREE TWO SIX FOUR TWO SIX FIVE TWO SIX SIX TWO SIX SEVEN TWO SEVEN TWO TWO SEVEN THREE TWO SEVEN SEVEN TWO SEVEN EIGHT THREE SIX FOUR THREE SIX FIVE THREE SEVEN FOUR THREE SEVEN FIVE ZERO intercal-0.30/pit/PaxHeaders.27456/iching.doc0000644000000000000000000000007411437550756015547 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/iching.doc0000644000175000017500000000173411437550756015447 0ustar00esresr00000000000000 Notes on iching1.i and iching2.i: Both versions (1 and 2) use the same code for generating lines of the hexagram, a simulation of the "coin oracle" method. (Six separate unconditional calls to (1020) were used since I thought lumping them all together by starting .1 at #6 would be disrespectful.) Implementation of the yarrow-stalk oracle is left as an exercise for the student. Note that in converting the numbers from the program into the lines of a hexagram, one should work from the bottom up. The last number gives the top line. The traditional sequence of the hexagrams does not have a consistent mathematical explanation. Version 2 of the program therefore uses a lookup table to determine the number of each hexagram in sequence. The six lines are printed as in version 1, then the sequence number for the hexagram, and finally the sequence number for the derived hexagram obtained by replacing moving lines (9 and 6) by their opposites. Louis Howell September 10, 1996 intercal-0.30/pit/PaxHeaders.27456/quine.i0000644000000000000000000000007411437550756015112 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/quine.i0000644000175000017500000004466711437550756015026 0ustar00esresr00000000000000 DO (1) NEXT DO ;1SUB#1 <- #46164$#24148 DO ;1SUB#2 <- #49728$#63680 PLEASE ;1SUB#3 <- #50560$#9536 DO ;1SUB#4 <- #23200$#11688 DO ;1SUB#5 <- #63912$#51392 DO ;1SUB#6 <- #57536$#39424 PLEASE ;1SUB#7 <- #54224$#46164 DO ;1SUB#8 <- #24148$#28936 DO ;1SUB#9 <- #8448$#50860 DO ;1SUB#10 <- #5056$#25684 PLEASE ;1SUB#11 <- #48704$#4752 DO ;1SUB#12 <- #46164$#24148 DO ;1SUB#13 <- #53824$#55488 DO ;1SUB#14 <- #50560$#23616 PLEASE ;1SUB#15 <- #56960$#59968 DO ;1SUB#16 <- #28140$#60096 DO ;1SUB#17 <- #7168$#20160 DO ;1SUB#18 <- #28012$#49104 PLEASE ;1SUB#19 <- #46164$#24148 DO ;1SUB#20 <- #64064$#52096 DO ;1SUB#21 <- #54024$#54656 DO ;1SUB#22 <- #62088$#11688 PLEASE ;1SUB#23 <- #60648$#57920 DO ;1SUB#24 <- #57536$#39424 DO ;1SUB#25 <- #21120$#7168 DO ;1SUB#26 <- #8256$#10560 PLEASE ;1SUB#27 <- #54016$#3072 DO ;1SUB#28 <- #55968$#11688 DO ;1SUB#29 <- #64936$#6592 DO ;1SUB#30 <- #49924$#57920 PLEASE ;1SUB#31 <- #64324$#46164 DO ;1SUB#32 <- #24148$#55680 DO ;1SUB#33 <- #53440$#50560 DO ;1SUB#34 <- #9536$#61184 PLEASE ;1SUB#35 <- #16384$#13440 DO ;1SUB#36 <- #11904$#15360 DO ;1SUB#37 <- #21152$#11688 DO ;1SUB#38 <- #64936$#9664 PLEASE ;1SUB#39 <- #49924$#57920 DO ;1SUB#40 <- #64324$#23264 DO ;1SUB#41 <- #35472$#11688 DO ;1SUB#42 <- #64936$#49280 PLEASE ;1SUB#43 <- #16384$#60288 DO ;1SUB#44 <- #54024$#54656 DO ;1SUB#45 <- #62088$#11688 DO ;1SUB#46 <- #60648$#57920 PLEASE ;1SUB#47 <- #57536$#39424 DO ;1SUB#48 <- #53888$#44032 DO ;1SUB#49 <- #8256$#31040 DO ;1SUB#50 <- #37120$#64336 PLEASE ;1SUB#51 <- #6880$#2704 DO ;1SUB#52 <- #11688$#60588 DO ;1SUB#53 <- #28224$#14464 DO ;1SUB#54 <- #11924$#9536 PLEASE ;1SUB#55 <- #23200$#11688 DO ;1SUB#56 <- #64936$#6592 DO ;1SUB#57 <- #49924$#57920 DO ;1SUB#58 <- #64324$#46164 PLEASE ;1SUB#59 <- #24148$#55680 DO ;1SUB#60 <- #53440$#50560 DO ;1SUB#61 <- #30016$#20224 DO ;1SUB#62 <- #14336$#7296 PLEASE ;1SUB#63 <- #50816$#43520 DO ;1SUB#64 <- #30544$#46164 DO ;1SUB#65 <- #24148$#44608 DO ;1SUB#66 <- #25472$#54024 PLEASE ;1SUB#67 <- #54656$#62088 DO ;1SUB#68 <- #11688$#59816 DO ;1SUB#69 <- #5312$#57536 DO ;1SUB#70 <- #39424$#20096 PLEASE ;1SUB#71 <- #60752$#46164 DO ;1SUB#72 <- #24148$#34368 DO ;1SUB#73 <- #28864$#50560 DO ;1SUB#74 <- #12608$#336 PLEASE ;1SUB#75 <- #46164$#24148 DO ;1SUB#76 <- #60992$#58240 DO ;1SUB#77 <- #54024$#54656 DO ;1SUB#78 <- #62088$#11688 PLEASE ;1SUB#79 <- #59816$#59584 DO ;1SUB#80 <- #57536$#51968 DO ;1SUB#81 <- #49616$#46164 DO ;1SUB#82 <- #24148$#48960 PLEASE ;1SUB#83 <- #16768$#54024 DO ;1SUB#84 <- #54656$#62088 DO ;1SUB#85 <- #11688$#59816 DO ;1SUB#86 <- #6336$#57536 PLEASE ;1SUB#87 <- #39424$#54224 DO ;1SUB#88 <- #46164$#24148 DO ;1SUB#89 <- #60992$#58240 DO ;1SUB#90 <- #54024$#54656 PLEASE ;1SUB#91 <- #62088$#11688 DO ;1SUB#92 <- #60648$#57920 DO ;1SUB#93 <- #57536$#39424 DO ;1SUB#94 <- #21120$#29696 PLEASE ;1SUB#95 <- #14400$#32064 DO ;1SUB#96 <- #7936$#44032 DO ;1SUB#97 <- #62112$#11688 DO ;1SUB#98 <- #64936$#6592 PLEASE ;1SUB#99 <- #49924$#57920 DO ;1SUB#100 <- #64324$#46164 DO ;1SUB#101 <- #24148$#33344 DO ;1SUB#102 <- #30912$#50560 PLEASE ;1SUB#103 <- #9536$#44800 DO ;1SUB#104 <- #21152$#11688 DO ;1SUB#105 <- #59816$#59584 DO ;1SUB#106 <- #57536$#36352 PLEASE ;1SUB#107 <- #4480$#41992 DO ;1SUB#108 <- #30932$#32960 DO ;1SUB#109 <- #26988$#6464 DO ;1SUB#110 <- #40960$#44032 PLEASE ;1SUB#111 <- #38016$#36544 DO ;1SUB#112 <- #53792$#11688 DO ;1SUB#113 <- #64936$#27520 DO ;1SUB#114 <- #27520$#54024 PLEASE ;1SUB#115 <- #54656$#62088 DO ;1SUB#116 <- #11688$#59816 DO ;1SUB#117 <- #6336$#57536 DO ;1SUB#118 <- #39424$#48768 PLEASE ;1SUB#119 <- #21152$#11688 DO ;1SUB#120 <- #64936$#55744 DO ;1SUB#121 <- #49924$#57920 DO ;1SUB#122 <- #64324$#46164 PLEASE ;1SUB#123 <- #24148$#54848 DO ;1SUB#124 <- #53440$#50560 DO ;1SUB#125 <- #2112$#29188 DO ;1SUB#126 <- #7232$#57576 PLEASE ;1SUB#127 <- #5268$#34440 DO ;1SUB#128 <- #57024$#14656 DO ;1SUB#129 <- #40960$#44032 DO ;1SUB#130 <- #57744$#46164 PLEASE ;1SUB#131 <- #24148$#48960 DO ;1SUB#132 <- #16768$#54024 DO ;1SUB#133 <- #54656$#62088 DO ;1SUB#134 <- #11688$#59816 PLEASE ;1SUB#135 <- #6336$#57536 DO ;1SUB#136 <- #39424$#35200 DO ;1SUB#137 <- #55968$#11688 DO ;1SUB#138 <- #64936$#55744 PLEASE ;1SUB#139 <- #49924$#57920 DO ;1SUB#140 <- #64324$#46164 DO ;1SUB#141 <- #24148$#53824 DO ;1SUB#142 <- #55488$#50560 PLEASE ;1SUB#143 <- #45120$#18048 DO ;1SUB#144 <- #37184$#40960 DO ;1SUB#145 <- #44032$#18924 DO ;1SUB#146 <- #38976$#49344 PLEASE ;1SUB#147 <- #58496$#43476 DO ;1SUB#148 <- #39880$#40960 DO ;1SUB#149 <- #59392$#27776 DO ;1SUB#150 <- #42348$#50496 PLEASE ;1SUB#151 <- #48256$#29312 DO ;1SUB#152 <- #21504$#7232 DO ;1SUB#153 <- #27648$#58732 DO ;1SUB#154 <- #20160$#46080 PLEASE ;1SUB#155 <- #6848$#58732 DO ;1SUB#156 <- #49104$#46164 DO ;1SUB#157 <- #24148$#65088 DO ;1SUB#158 <- #50048$#54024 PLEASE ;1SUB#159 <- #54656$#62088 DO ;1SUB#160 <- #11688$#59816 DO ;1SUB#161 <- #59584$#57536 DO ;1SUB#162 <- #51968$#49616 PLEASE ;1SUB#163 <- #46164$#24148 DO ;1SUB#164 <- #59968$#53248 DO ;1SUB#165 <- #13632$#49924 DO ;1SUB#166 <- #57920$#64324 PLEASE ;1SUB#167 <- #7904$#656 DO ;1SUB#168 <- #11688$#59816 DO ;1SUB#169 <- #54464$#57536 DO ;1SUB#170 <- #51968$#44496 PLEASE ;1SUB#171 <- #24288$#33424 DO ;1SUB#172 <- #11688$#64936 DO ;1SUB#173 <- #49280$#16384 DO ;1SUB#174 <- #60288$#54024 PLEASE ;1SUB#175 <- #54656$#62088 DO ;1SUB#176 <- #11688$#60588 DO ;1SUB#177 <- #28224$#14464 DO ;1SUB#178 <- #11924$#9536 PLEASE ;1SUB#179 <- #23200$#11688 DO ;1SUB#180 <- #64936$#60096 DO ;1SUB#181 <- #49924$#57920 DO ;1SUB#182 <- #64324$#46164 PLEASE ;1SUB#183 <- #24148$#52936 DO ;1SUB#184 <- #7168$#940 DO ;1SUB#185 <- #24704$#22824 DO ;1SUB#186 <- #36304$#46164 PLEASE ;1SUB#187 <- #24148$#6408 DO ;1SUB#188 <- #22720$#37868 DO ;1SUB#189 <- #52548$#1360 DO ;1SUB#190 <- #54720$#5236 PLEASE ;1SUB#191 <- #24148$#33344 DO ;1SUB#192 <- #30912$#50560 DO ;1SUB#193 <- #13632$#45056 DO ;1SUB#194 <- #25936$#46164 PLEASE ;1SUB#195 <- #24148$#6528 DO ;1SUB#196 <- #53440$#50560 DO ;1SUB#197 <- #33344$#60908 DO ;1SUB#198 <- #29312$#21504 PLEASE ;1SUB#199 <- #54608$#46164 DO ;1SUB#200 <- #24148$#6528 DO ;1SUB#201 <- #41992$#15828 DO ;1SUB#202 <- #19136$#57536 PLEASE ;1SUB#203 <- #39424$#24192 DO ;1SUB#204 <- #22272$#12352 DO ;1SUB#205 <- #15680$#19456 DO ;1SUB#206 <- #10496$#61600 PLEASE ;1SUB#207 <- #11688$#44264 DO ;1SUB#208 <- #29188$#7232 DO ;1SUB#209 <- #16360$#28864 DO ;1SUB#210 <- #50560$#8512 PLEASE ;1SUB#211 <- #512$#6912 DO ;1SUB#212 <- #48768$#13952 DO ;1SUB#213 <- #42240$#20560 DO ;1SUB#214 <- #46164$#24148 PLEASE ;1SUB#215 <- #6528$#41992 DO ;1SUB#216 <- #15828$#64192 DO ;1SUB#217 <- #57536$#39424 DO ;1SUB#218 <- #17024$#22528 PLEASE ;1SUB#219 <- #2112$#10560 DO ;1SUB#220 <- #53248$#45056 DO ;1SUB#221 <- #21152$#11688 DO ;1SUB#222 <- #59816$#58304 PLEASE ;1SUB#223 <- #57536$#39424 DO ;1SUB#224 <- #6784$#64160 DO ;1SUB#225 <- #11688$#64936 DO ;1SUB#226 <- #60096$#49924 PLEASE ;1SUB#227 <- #57920$#64324 DO ;1SUB#228 <- #46164$#24148 DO ;1SUB#229 <- #54080$#53952 DO ;1SUB#230 <- #50560$#33344 PLEASE ;1SUB#231 <- #21152$#11688 DO ;1SUB#232 <- #63912$#46272 DO ;1SUB#233 <- #57536$#39424 DO ;1SUB#234 <- #4048$#46164 PLEASE ;1SUB#235 <- #24148$#62016 DO ;1SUB#236 <- #35848$#15828 DO ;1SUB#237 <- #19136$#57536 DO ;1SUB#238 <- #39424$#31360 PLEASE ;1SUB#239 <- #31312$#46164 DO ;1SUB#240 <- #24148$#52936 DO ;1SUB#241 <- #7168$#940 DO ;1SUB#242 <- #24704$#22824 PLEASE ;1SUB#243 <- #51392$#23296 DO ;1SUB#244 <- #62016$#21152 DO ;1SUB#245 <- #11688$#59816 DO ;1SUB#246 <- #5312$#57536 PLEASE ;1SUB#247 <- #39424$#35200 DO ;1SUB#248 <- #55968$#11688 DO ;1SUB#249 <- #60908$#55744 DO ;1SUB#250 <- #23872$#17236 PLEASE ;1SUB#251 <- #9536$#2720 DO ;1SUB#252 <- #20192$#41616 DO ;1SUB#253 <- #11688$#44524 DO ;1SUB#254 <- #52288$#53184 PLEASE ;1SUB#255 <- #16808$#59584 DO ;1SUB#256 <- #23296$#50752 DO ;1SUB#257 <- #31392$#11688 DO ;1SUB#258 <- #59816$#59584 PLEASE ;1SUB#259 <- #57536$#51968 DO ;1SUB#260 <- #464$#46164 DO ;1SUB#261 <- #24148$#59968 DO ;1SUB#262 <- #49152$#38208 PLEASE ;1SUB#263 <- #49924$#57920 DO ;1SUB#264 <- #64324$#46164 DO ;1SUB#265 <- #24148$#62016 DO ;1SUB#266 <- #35848$#15828 PLEASE ;1SUB#267 <- #19136$#57536 DO ;1SUB#268 <- #51968$#39124 DO ;1SUB#269 <- #40904$#34816 DO ;1SUB#270 <- #29344$#11688 PLEASE ;1SUB#271 <- #60908$#35968 DO ;1SUB#272 <- #10580$#4680 DO ;1SUB#273 <- #33812$#62016 DO ;1SUB#274 <- #21152$#11688 PLEASE ;1SUB#275 <- #59816$#5312 DO ;1SUB#276 <- #57536$#51968 DO ;1SUB#277 <- #24016$#46164 DO ;1SUB#278 <- #24148$#52936 PLEASE ;1SUB#279 <- #32384$#57216 DO ;1SUB#280 <- #23232$#50088 DO ;1SUB#281 <- #59584$#23296 DO ;1SUB#282 <- #50752$#31392 PLEASE ;1SUB#283 <- #11688$#60908 DO ;1SUB#284 <- #55744$#23872 DO ;1SUB#285 <- #17236$#9536 DO ;1SUB#286 <- #2720$#3808 PLEASE ;1SUB#287 <- #8848$#11688 DO ;1SUB#288 <- #63912$#55428 DO ;1SUB#289 <- #7232$#12264 DO ;1SUB#290 <- #53440$#50560 PLEASE ;1SUB#291 <- #55680$#16876 DO ;1SUB#292 <- #18752$#15360 DO ;1SUB#293 <- #58112$#48256 DO ;1SUB#294 <- #36544$#53792 PLEASE ;1SUB#295 <- #11688$#63912 DO ;1SUB#296 <- #55428$#7232 DO ;1SUB#297 <- #16360$#28864 DO ;1SUB#298 <- #50560$#55680 PLEASE ;1SUB#299 <- #16876$#7488 DO ;1SUB#300 <- #46336$#59904 DO ;1SUB#301 <- #38016$#36544 DO ;1SUB#302 <- #53792$#11688 PLEASE ;1SUB#303 <- #63912$#55428 DO ;1SUB#304 <- #7232$#32744 DO ;1SUB#305 <- #61632$#50560 DO ;1SUB#306 <- #55680$#16876 PLEASE ;1SUB#307 <- #19776$#48256 DO ;1SUB#308 <- #38528$#30976 DO ;1SUB#309 <- #34368$#53792 DO ;1SUB#310 <- #11688$#63912 PLEASE ;1SUB#311 <- #55428$#7232 DO ;1SUB#312 <- #27624$#22720 DO ;1SUB#313 <- #50560$#55680 DO ;1SUB#314 <- #16876$#19776 PLEASE ;1SUB#315 <- #48256$#31360 DO ;1SUB#316 <- #32512$#53312 DO ;1SUB#317 <- #53792$#11688 DO ;1SUB#318 <- #60908$#35968 PLEASE ;1SUB#319 <- #10580$#4680 DO ;1SUB#320 <- #33812$#58944 DO ;1SUB#321 <- #23200$#11688 DO ;1SUB#322 <- #60908$#55744 PLEASE ;1SUB#323 <- #23872$#17236 DO ;1SUB#324 <- #9536$#2720 DO ;1SUB#325 <- #24544$#32912 DO ;1SUB#326 <- #11688$#63912 PLEASE ;1SUB#327 <- #51392$#57536 DO ;1SUB#328 <- #51968$#45776 DO ;1SUB#329 <- #46164$#24148 DO ;1SUB#330 <- #54848$#53440 PLEASE ;1SUB#331 <- #50560$#25920 DO ;1SUB#332 <- #55968$#11688 DO ;1SUB#333 <- #47276$#45568 DO ;1SUB#334 <- #17236$#35144 PLEASE ;1SUB#335 <- #12928$#56744 DO ;1SUB#336 <- #60288$#47760 DO ;1SUB#337 <- #46164$#24148 DO ;1SUB#338 <- #59968$#53248 PLEASE ;1SUB#339 <- #13632$#49924 DO ;1SUB#340 <- #57920$#64324 DO ;1SUB#341 <- #46164$#24148 DO ;1SUB#342 <- #37440$#22720 PLEASE ;1SUB#343 <- #50560$#54848 DO ;1SUB#344 <- #23200$#11688 DO ;1SUB#345 <- #64936$#49280 DO ;1SUB#346 <- #45056$#27520 PLEASE ;1SUB#347 <- #54024$#54656 DO ;1SUB#348 <- #62088$#11688 DO ;1SUB#349 <- #59816$#55488 DO ;1SUB#350 <- #57536$#51968 PLEASE ;1SUB#351 <- #44496$#46164 DO ;1SUB#352 <- #24148$#59968 DO ;1SUB#353 <- #53248$#13632 DO ;1SUB#354 <- #49924$#57920 PLEASE ;1SUB#355 <- #64324$#46164 DO ;1SUB#356 <- #24148$#34368 DO ;1SUB#357 <- #28864$#50560 DO ;1SUB#358 <- #54848$#23200 PLEASE ;1SUB#359 <- #11688$#64936 DO ;1SUB#360 <- #49280$#45056 DO ;1SUB#361 <- #27520$#54024 DO ;1SUB#362 <- #54656$#62088 PLEASE ;1SUB#363 <- #11688$#60648 DO ;1SUB#364 <- #57920$#57536 DO ;1SUB#365 <- #36416$#29188 DO ;1SUB#366 <- #7232$#57320 PLEASE ;1SUB#367 <- #17900$#29312 DO ;1SUB#368 <- #21504$#37952 DO ;1SUB#369 <- #53792$#11688 DO ;1SUB#370 <- #63912$#55428 PLEASE ;1SUB#371 <- #7232$#45288 DO ;1SUB#372 <- #22720$#50560 DO ;1SUB#373 <- #55680$#16876 DO ;1SUB#374 <- #18752$#15360 PLEASE ;1SUB#375 <- #58112$#48256 DO ;1SUB#376 <- #36544$#53792 DO ;1SUB#377 <- #11688$#63912 DO ;1SUB#378 <- #55428$#7232 PLEASE ;1SUB#379 <- #58600$#61632 DO ;1SUB#380 <- #50560$#55680 DO ;1SUB#381 <- #16876$#7488 DO ;1SUB#382 <- #46336$#59904 PLEASE ;1SUB#383 <- #38016$#36544 DO ;1SUB#384 <- #53792$#11688 DO ;1SUB#385 <- #63912$#55428 DO ;1SUB#386 <- #7232$#42216 PLEASE ;1SUB#387 <- #28864$#50560 DO ;1SUB#388 <- #55680$#16876 DO ;1SUB#389 <- #19776$#48256 DO ;1SUB#390 <- #38528$#30976 PLEASE ;1SUB#391 <- #34368$#53792 DO ;1SUB#392 <- #11688$#63912 DO ;1SUB#393 <- #55428$#7232 DO ;1SUB#394 <- #62696$#53440 PLEASE ;1SUB#395 <- #50560$#55680 DO ;1SUB#396 <- #16876$#19776 DO ;1SUB#397 <- #48256$#31360 DO ;1SUB#398 <- #32512$#53312 PLEASE ;1SUB#399 <- #53792$#11688 DO ;1SUB#400 <- #59816$#58560 DO ;1SUB#401 <- #57536$#36352 DO ;1SUB#402 <- #60864$#11264 PLEASE ;1SUB#403 <- #29312$#21504 DO ;1SUB#404 <- #3156$#7816 DO ;1SUB#405 <- #59584$#47040 DO ;1SUB#406 <- #56896$#40084 PLEASE ;1SUB#407 <- #34440$#57024 DO ;1SUB#408 <- #14656$#40960 DO ;1SUB#409 <- #44032$#58496 DO ;1SUB#410 <- #15380$#36808 PLEASE ;1SUB#411 <- #9344$#15680 DO ;1SUB#412 <- #15508$#57288 DO ;1SUB#413 <- #12272$#60288 DO ;1SUB#414 <- #43664$#11688 PLEASE ;1SUB#415 <- #64936$#49280 DO ;1SUB#416 <- #16384$#60288 DO ;1SUB#417 <- #54024$#54656 DO ;1SUB#418 <- #41608$#8160 PLEASE ;1SUB#419 <- #144$#11688 DO ;1SUB#420 <- #59816$#6336 DO ;1SUB#421 <- #57536$#39424 DO ;1SUB#422 <- #24448$#2896 PLEASE ;1SUB#423 <- #46164$#24148 DO ;1SUB#424 <- #60992$#58240 DO ;1SUB#425 <- #54024$#54656 DO ;1SUB#426 <- #42968$#27520 PLEASE ;1SUB#427 <- #10896$#11688 DO ;1SUB#428 <- #59816$#9408 DO ;1SUB#429 <- #57536$#39424 DO ;1SUB#430 <- #53200$#46164 PLEASE ;1SUB#431 <- #24148$#34368 DO ;1SUB#432 <- #28864$#50560 DO ;1SUB#433 <- #9536$#32768 DO ;1SUB#434 <- #0$#55968 PLEASE ;1SUB#435 <- #11688$#64936 DO ;1SUB#436 <- #15232$#52096 DO ;1SUB#437 <- #54024$#54656 DO ;1SUB#438 <- #62088$#11688 PLEASE ;1SUB#439 <- #59816$#6336 DO ;1SUB#440 <- #57536$#39424 DO ;1SUB#441 <- #19072$#0 DO ;1SUB#442 <- #55968$#11688 PLEASE ;1SUB#443 <- #64936$#15232 DO ;1SUB#444 <- #52096$#54024 DO ;1SUB#445 <- #54656$#62088 DO ;1SUB#446 <- #11688$#59816 PLEASE ;1SUB#447 <- #6336$#57536 DO ;1SUB#448 <- #39424$#19072 DO ;1SUB#449 <- #17744$#46164 DO ;1SUB#450 <- #24148$#48960 PLEASE ;1SUB#451 <- #26432$#49924 DO ;1SUB#452 <- #57920$#64324 DO ;1SUB#453 <- #46164$#24148 DO ;1SUB#454 <- #34368$#28864 PLEASE ;1SUB#455 <- #50560$#9536 DO ;1SUB#456 <- #50512$#8160 DO ;1SUB#457 <- #22336$#5236 DO ;1SUB#458 <- #24148$#48960 PLEASE ;1SUB#459 <- #26432$#49924 DO ;1SUB#460 <- #57920$#64324 DO ;1SUB#461 <- #8160$#26432 DO ;1SUB#462 <- #5236$#24148 PLEASE ;1SUB#463 <- #59968$#54272 DO ;1SUB#464 <- #7488$#49924 DO ;1SUB#465 <- #57920$#64324 DO ;1SUB#466 <- #46164$#24148 PLEASE ;1SUB#467 <- #53824$#55488 DO ;1SUB#468 <- #50560$#45120 DO ;1SUB#469 <- #18048$#63132 DO ;1SUB#470 <- #39636$#17608 PLEASE ;1SUB#471 <- #63616$#39488 DO ;1SUB#472 <- #63636$#36808 DO ;1SUB#473 <- #55424$#15680 DO ;1SUB#474 <- #20628$#57288 PLEASE ;1SUB#475 <- #31392$#11688 DO ;1SUB#476 <- #64936$#49280 DO ;1SUB#477 <- #16384$#60288 DO ;1SUB#478 <- #54024$#54656 PLEASE ;1SUB#479 <- #62088$#11688 DO ;1SUB#480 <- #59816$#58560 DO ;1SUB#481 <- #57536$#51968 DO ;1SUB#482 <- #44496$#46164 PLEASE ;1SUB#483 <- #24148$#54848 DO ;1SUB#484 <- #53440$#50560 DO ;1SUB#485 <- #50752$#31392 DO ;1SUB#486 <- #11688$#64936 PLEASE ;1SUB#487 <- #49280$#9472 DO ;1SUB#488 <- #16768$#54024 DO ;1SUB#489 <- #54656$#62088 DO ;1SUB#490 <- #11688$#47276 PLEASE ;1SUB#491 <- #45568$#17236 DO ;1SUB#492 <- #35144$#12928 DO ;1SUB#493 <- #56744$#11136 DO ;1SUB#494 <- #47760$#46164 PLEASE ;1SUB#495 <- #24148$#34368 DO ;1SUB#496 <- #28864$#50560 DO ;1SUB#497 <- #61440$#48832 DO ;1SUB#498 <- #32064$#48276 PLEASE ;1SUB#499 <- #36808$#48192 DO ;1SUB#500 <- #23552$#62784 DO ;1SUB#501 <- #15488$#65216 DO ;1SUB#502 <- #28012$#11904 PLEASE ;1SUB#503 <- #22592$#64032 DO ;1SUB#504 <- #11688$#59816 DO ;1SUB#505 <- #6336$#57536 DO ;1SUB#506 <- #51712$#23252 PLEASE ;1SUB#507 <- #36808$#63552 DO ;1SUB#508 <- #58368$#23252 DO ;1SUB#509 <- #40904$#3072 DO ;1SUB#510 <- #18832$#46164 PLEASE ;1SUB#511 <- #24148$#60992 DO ;1SUB#512 <- #58240$#54024 DO ;1SUB#513 <- #54656$#62088 DO ;1SUB#514 <- #11688$#59816 PLEASE ;1SUB#515 <- #59584$#57536 DO ;1SUB#516 <- #51968$#45520 DO ;1SUB#517 <- #46164$#24148 DO ;1SUB#518 <- #34368$#28864 PLEASE ;1SUB#519 <- #50560$#50752 DO ;1SUB#520 <- #31392$#11688 DO ;1SUB#521 <- #64936$#49280 DO ;1SUB#522 <- #49152$#27520 PLEASE ;1SUB#523 <- #54024$#54656 DO ;1SUB#524 <- #62088$#11688 DO ;1SUB#525 <- #59816$#59584 DO ;1SUB#526 <- #57536$#51968 PLEASE ;1SUB#527 <- #40400$#46164 DO ;1SUB#528 <- #24148$#52936 DO ;1SUB#529 <- #42624$#43904 DO ;1SUB#530 <- #37544$#4048 DO .7 <- #1 DO ,1 <- #4 DO COME FROM (5) DO .5 <- '?"&.7~#3"$#1'~#3 DO (2) NEXT DO :1 <- #57364$#58240 DO (7) NEXT DO :1 <- #19776$#2436 DO (3) NEXT (2) DO (1001) NEXT DO :1 <- #46164$#7684 (3) DO FORGET #1 DO (7) NEXT DO :1 <- #39712$#41992 DO (7) NEXT DO .6 <- #170 DO .2 <- #66 DO (6) NEXT DO .1 <- .7 DO (9) NEXT DO .2 <- #4 DO (6) NEXT DO :1 <- #57536$#39424 DO (7) NEXT DO .6 <- #196 DO .1 <- ';1SUB.7'~'#65535$#0' DO (90) NEXT DO .2 <- #36 DO (6) NEXT DO .1 <- ';1SUB.7'~'#0$#65535' DO (9) NEXT DO .2 <- #80 DO (6) NEXT DO .5 <- "?'"#65535~'"?.7$!9~#65532'"~"#0$#65535"'"~#1'$#1"~#3 DO (4) NEXT DO .1 <- .7 DO (1020) NEXT (5) DO .7 <- .1 (4) DO (1001) NEXT DO FORGET #1 DO (8) NEXT DO READ OUT ,1 DO GIVE UP (1) DO .6 <- #2120 DO ;1 <- .6~#65532 DO ;1SUB#1 <- #15956$#24148 DO ;1SUB#2 <- #59968$#60288 DO ;1SUB#3 <- #54024$#54656 DO .9 <- #12 DO (8) NEXT DO .9 <- .6 DO ,6 <- #1 DO ,6SUB#1 <- #218 DO READ OUT ,1 + ,6 DO .6 <- #80 DO RESUME #1 (6) DO STASH .1 + .3 DO .1 <- .6 DO (1010) NEXT DO ,6SUB#1 <- .3~#255 DO READ OUT ,6 DO .6 <- .2 DO RETRIEVE .1 + .3 DO RESUME #1 (7) DO ,1SUB#1 <- :1~'#43690$#0' DO ,1SUB#2 <- :1~'#21845$#0' DO ,1SUB#3 <- :1~'#0$#43690' DO ,1SUB#4 <- :1~'#0$#21845' DO READ OUT ,1 DO RESUME #1 (8) DO ,1 <- .9 DO .1 <- #0 DO COME FROM (81) DO (1020) NEXT DO .4 <- .1 DO (1020) NEXT DO .3 <- .1 DO (1020) NEXT DO .2 <- .1 DO (1020) NEXT DO :1 <- ;1SUB!1~#65532' DO ,1SUB.4 <- :1~'#43690$#0' DO ,1SUB.3 <- :1~'#21845$#0' DO ,1SUB.2 <- :1~'#0$#43690' DO ,1SUB.1 <- :1~'#0$#21845' DO .5 <- '?"'#65535~"'?.9$.1'~'#0$#65535'"'~#1"$#2'~#3 (81) DO (1001) NEXT (9) DO .2 <- #196 DO (6) NEXT (90) DO .4 <- #0 DO .2 <- #10000 DO (92) NEXT DO .2 <- #1000 DO (92) NEXT DO .2 <- #100 DO (92) NEXT DO .2 <- #10 (91) DO (92) NEXT (92) DO (1040) NEXT DO .5 <- "?'"V!3~.3'$.4"~#1'$#2"~#3 DO (1001) NEXT DO .5 <- .1 DO .1 <- .3 DO (1039) NEXT DO COME FROM (91) DO .2 <- "!1$#3'~#15"$"!1$#3'~#240" DO .2 <- !2~#15'$!2~#240' DO (6) NEXT DO .1 <- .5 DO .2 <- .3 DO (1010) NEXT DO .1 <- .3 DO RESUME #1 intercal-0.30/pit/PaxHeaders.27456/flonck.chk0000644000000000000000000000007411437550756015562 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.558945776 intercal-0.30/pit/flonck.chk0000644000175000017500000000000411437550756015447 0ustar00esresr00000000000000 d intercal-0.30/pit/PaxHeaders.27456/life2.doc0000644000000000000000000000007411437550756015307 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.566945757 intercal-0.30/pit/life2.doc0000644000175000017500000000517311437550756015210 0ustar00esresr00000000000000 life2.i is a revised version of my Life program, differing in two ways from the original. First, throughout the program I have streamlined the loops by using COME FROM statements and combining initialization and re-initialization phases where practical. Second, instead of just printing the coordinates of live cells, I use the new binary output feature to print out the board as an array of .'s and O's. This new output section is made into a subroutine---entry point (300)---which I call from within the main loop as well as at the end of the program. If you don't want to see the position at every time step, just remove the call to (300) from within the main loop, and only the final position will be printed. Notes for programmers: The output routine prints the state matrix a full line at a time, using a 1-D array one cell longer than a row of the matrix. This final cell is used to print a line feed (ASCII 012) at the end of each line. Live cells are represented as O's (0117), while dead cells are shown as .'s (056). If your machine does not use ASCII or does not use LF to terminate lines this may not work. The INTERCAL output routine reverses the order of bits in each of these characters, so the constants hard-coded into the program are #242 for 'O', #116 for '.', and #80 for '\n'. The value of the last character output, which is needed by the Turing Text output model, is stored in .2. This variable is initialized to #0 and then STASHed at the beginning of the program, then RETRIEVEd by the output routine each time it is called. This is opposite from the usual way STASH is used, but I was feeling a little twisted the day I wrote all this. There is still considerable room for improvement in the (300) output algorithm. With printing at each time step the program spends roughly two-thirds of its time doing output, and I suspect that most of that is squandered in the (1010) subtraction routine. It should be possible to greatly speed up the process by precomputing and storing all the possible differences. Except for initialization there are only six to consider: "LF-.", ".-LF", "O-.", ".-O", ".-.", and "O-O". Of these the first two occur predictably at the beginning and end of each line, and the last two are trivially zero. The necessary program logic would be a little more complex; perhaps it could be done with array indexing? Consider it a challenge! Despite all its inefficiencies, the INTERCAL version on a Sparc 1 is still faster than the first Life program I ever wrote, in BASIC on a TRS-80, by a factor of about 50. Sobering thought. Louis Howell December 15, 1991 intercal-0.30/pit/PaxHeaders.27456/interfunge.doc0000644000000000000000000000007411440130756016440 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/interfunge.doc0000644000175000017500000000424111440130756016334 0ustar00esresr00000000000000interfunge.i is a (GPL version 2) Befunge-93 interpreter by Jeffrey Lee; it hopefully implements the whole set of Befunge-93 instructions. The provided test file interfunge.tst is the Befunge-93 version of Mycology by Matti Niemenmaa, and is under the following license: Copyright (c) 2006-2008, Matti Niemenmaa All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (Mycology is a standard Befunge testsuite used to test conformance to the specs; it therefore tests all parts of interfunge.i, and thus acts as a better stress-test on the INTERCAL compiler itself.) Hopefully, its output should be self-explanatory; the very first few tests print out the numbers 0 to 7, because they're before output is tested, but after that all the tests print GOOD: (for a success) or BAD: (for a failure) followed by what was tested. intercal-0.30/pit/PaxHeaders.27456/bubble.doc0000644000000000000000000000007411437550756015541 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.554945791 intercal-0.30/pit/bubble.doc0000644000175000017500000001121111437550756015430 0ustar00esresr00000000000000 As documentation for the program bubble.i, I am including below the original posting message, with the program itself deleted. The present program bubble.i is nearly identical to the one that was posted. The only difference is that I have now fixed the compiler bug that made the temporary variable .4 necessary, so that variable has been eliminated from the current version of the program. The old version of the compare-and-exchange routine, where this variable was used, is included at the end of the file. Louis Howell November 24, 1991 ----------------------------------------------------------------------------- Subject: Bubble sort routine Newsgroups: alt.lang.intercal From: Louis Howell Date: Thu, 7 Feb 91 18:56:34 PST I am including below an Intercal bubble sort routine along with a program to call it, which you may find amusing. The program first reads the number of elements to be sorted, then reads that many numbers, then sorts those numbers and prints them out from highest to lowest. There must be at least two elements to be sorted. There are several interesting things about this program. First, it uses a new version of the (2000) and (2010) decrement routine. This one is functionally identical to the one included with the Life program, but is streamlined by eliminating the need for the temporary variable .3, and thus should run significantly faster. The program itself uses my best effort towards passing a routine as an argument to another routine. I have separated out the compare-and-exchange routine from the rest of the bubble sort on the assumption that people might want to sort different things in different ways. You could also use this bubble sort to sort 32 bit arrays, for example, or to sort arrays in the opposite order, or to sort arrays starting at some index other than 1. It was therefore desirable to not only separate out the compare-and-exchange function, but avoid telling the bubble sort routine where this function is, or even what array it is sorting. (This reduces the bubble sort to nothing more than a nested pair of loops, but one can easily envision wanting to do something similar with more complicated routines.) The program therefore operates as follows: Main program initializes array, then jumps to head of c-and-e routine, which immediately jumps to bubble sort. Return addresses for both the main program and the subroutine are now available on the RESUME stack. The bubble sort expects .1 to contain the number of elements to be sorted, and proceeds to go through the necessary loops. Each time through the loop, the bubble sort returns to the c-and-e routine with the indices of the elements to be compared stored in .1 and .2; the c-and-e routine does its job then jumps back into the bubble sort. When the bubble sort finishes its loops it jumps back to the main program using the return address which has been sitting on the bottom of the stack all this time. Main program prints out results. The loops used by the bubble sort are equivalent to the Fortran DO 20 I = N,2,-1 DO 10 J = N-1,1,-1 The way this is accomplished is pretty incomprehensible, as the loop tests aren't independent---they share some code between them. See how fast you can figure out how they work. Hint: If you can't see why the last statement is DO RESUME #4 (instead of #3), you have not yet achieved enlightenment. In the c-and-e routine the temporary variable .4 is not really necessary. It is used to work around a bug in the array implementation which prevents you from using two different subscripts on the same array in the same statement. Chances are this will be fixed before the array stuff is released, in which case .4 should be eliminated by folding the pairs of statements together in the obvious way. On with the program--- [Program deleted, see bubble.i for the current version.] This is the original version of the compare-and-exchange routine: PLEASE NOTE COMPARE AND EXCHANGE ROUTINE (500) PLEASE ABSTAIN FROM (502) DO (3000) NEXT DO (501) NEXT (501) PLEASE FORGET #1 (502) DO (3010) NEXT PLEASE REINSTATE (502) DO .4 <- ",1SUB.1" DO .3 <- '?.4$,1SUB.2'~'#0$#65535' DO .3 <- '?"'& "'",1SUB.1"~.3'~'"?'?.3~.3'$#32768"~"#0$#65535"'" $ ".3~.3"'~#1" $ #1'~#3 DO (503) NEXT DO .3 <- ,1 SUB .1 DO .4 <- ,1 SUB .2 DO ,1 SUB .1 <- .4 DO ,1 SUB .2 <- .3 DO (501) NEXT (504) PLEASE RESUME .3 (503) DO (504) NEXT PLEASE FORGET #1 DO (501) NEXT -- Louis Howell "But when we got into the street I viddied that thinking is for the gloopy ones and that the oomny ones use like inspiration and what Bog sends." intercal-0.30/pit/PaxHeaders.27456/continuation.i0000644000000000000000000000007411437550756016503 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.558945776 intercal-0.30/pit/continuation.i0000644000175000017500000002271311437550756016403 0ustar00esresr00000000000000 PLEASE NOTE Copyright (C) 2008 Alex Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. PLEASE NOTE Creating the continuation statements DO CREATE (8200) GET CONTINUATION IN .1 GETTING .2 DO CREATE (8200) GET CONTINUATION IN ,1 SUB #1 GETTING .2 DO CREATE (8200) GET CONTINUATION IN .1 GETTING ,2 SUB #2 DO CREATE (8200) GET CONTINUATION IN ,1 SUB #1 GETTING ,2 SUB #2 DO CREATE (8210) CONTINUE WITH .1 SENDING .2 DO CREATE (8210) CONTINUE WITH .1 SENDING .2~#2 DO CREATE (8210) CONTINUE WITH .1 SENDING ,2 SUB #2 DO CREATE (8210) CONTINUE WITH .1~#1 SENDING .2 DO CREATE (8210) CONTINUE WITH .1~#1 SENDING .2~#2 DO CREATE (8210) CONTINUE WITH .1~#1 SENDING ,2 SUB #2 DO CREATE (8210) CONTINUE WITH ,1 SUB #1 SENDING .2 DO CREATE (8210) CONTINUE WITH ,1 SUB #1 SENDING .2~#2 DO CREATE (8210) CONTINUE WITH ,1 SUB #1 SENDING ,2 SUB #2 DO CREATE (8205) KILL ALL THREADS PLEASE NOTE Initialising the counting tracker thread PLEASE DO .1 <- #0 (8201) DO NOTHING PLEASE NOTE Definitions of the continuation statements (8200) DO STASH .1 PLEASE DO (8280) NEXT PLEASE DO (1020) NEXT PLEASE DO (8270) NEXT PLEASE NOTE It's possible for .1 to equal :1601, so we have to be careful about operating on the arguments while stashed. So we use the temporary global variable .8200. DO .8200 <- .1 DO RETRIEVE .1 DO :1601 <- .8200 DO (8202) NEXT DO RESUME #1 (8202) PLEASE NOTE Fork threads, one dormant, one alive DO COME FROM (8202) DO RESUME #1 (8213) DO RESUME '?".1~.1"$#2'~#3 (8212) DO (8213) NEXT DO RETRIEVE .1 PLEASE NOTE Restoring .1's stash DO COME FROM (8202) PLEASE FORGET #1 (8211) DO COME FROM (8211) PLEASE NOTE We count how many threads are in 8275 using the abstention count of 8214 and block until they're all done. PLEASE DO ABSTAIN #1 FROM (8214) DO STASH .1 DO (8275) NEXT DO REINSTATE (8214) DO COME FROM (8215) (8216) DO NOTHING (8215) DO NOTHING (8214) DO COME FROM (8216) PLEASE DO REINSTATE (8211) PLEASE NOTE If .8200 matches .1, we activate. This uses a NEXT/NEXT/RESUME-style check because it's done on multiple threads at once and because a computed COME FROM would slow down the program even further. DO .1 <- '?.8200$.1'~'#0$#65535' DO (8212) NEXT PLEASE NOTE that if this point is reached, we've reached the point where unfreezing the thread is necessary. First receive one datum from 8277 so we can send something back in the continuation (this involves signaling using 8217), then the other thread kills itself and we make a new continuation numbered the same as the old one, and continue by doubleresuming (so that an unfreeze can be told apart from an initial call). As this is a CREATEd statement, it's important to unstash :1601 and :1602 ourselves when doubleresuming, as the runtime only does it correctly on a single resume. PLEASE DO ABSTAIN FROM (8217) DO (8260) NEXT DO (8276) NEXT DO .8201 <- .1 DO RETRIEVE .1 PLEASE NOTE Restoring .1's stash DO (8202) NEXT PLEASE NOTE .8200 is still correct! DO :1602 <- .8201 PLEASE DO :1601 <- .8200 DO RETRIEVE :1601 DO RETRIEVE :1602 DO RESUME #2 (8210) PLEASE NOTE Here we use the timing guarantees. Once we ABSTAIN FROM 8211, all the threads looping there become unblocked simultaneously, so all of them abstain 8214 (which is 2-3 cycles) before any of them REINSTATES 8211 (which is way lower down, after the call to 8275), so we can guarantee that all the threads get a chance to check to see if they match. DO .8210 <- .1 PLEASE DO .1 <- :1601 DO (8250) NEXT DO (8270) NEXT PLEASE DO ABSTAIN FROM (8211) (8217) DO COME FROM (8217) AGAIN PLEASE NOTE This double assignment is actually correct, because :1602 is overloaded. PLEASE DO .1 <- .8210 DO .1 <- :1602 PLEASE DO (8277) NEXT PLEASE GIVE UP PLEASE NOTE A communications channel thread. This acts like one 16-bit variable, where 8250 stashes the variable 8260 retrieves the variable 8270 copies it from .1 and 8280 copies it into .1 8275 is a mutex version of 8280 so that multiple threads can try to view .1 at once and only one will get it at a time. 8299 is a spinlock that traps until the current operation is completed, which is needed as part of the implementation of this, and then double-resumes (8299) DO COME FROM (8299) AGAIN PLEASE DO RESUME #2 (8250) DO REINSTATE (8251) PLEASE DO (8299) NEXT (8260) DO REINSTATE (8261) PLEASE DO (8299) NEXT (8270) DO REINSTATE (8271) DO (8277) NEXT PLEASE DO (8299) NEXT (8280) DO REINSTATE (8281) DO (8276) NEXT PLEASE DO (8299) NEXT (8275) DO COME FROM (8274) (8274) DO (8273) NEXT ONCE (8273) DO (8280) NEXT PLEASE DO REINSTATE (8274) DO RESUME #2 PLEASE NOTE main part of the communications channel thread DO COME FROM (8201) PLEASE DO COME FROM (8259) (8252) DO NOTHING (8262) DO NOTHING (8272) DO NOTHING (8282) DO NOTHING (8259) PLEASE DO NOTHING (8251) DON'T NEXT FROM (8252) AGAIN DO STASH .1 PLEASE DO ABSTAIN FROM (8299) DO RESUME #1 (8261) DON'T NEXT FROM (8262) AGAIN DO RETRIEVE .1 DO ABSTAIN FROM (8299) DO RESUME #1 (8271) DON'T NEXT FROM (8272) AGAIN DO (8276) NEXT DO ABSTAIN FROM (8299) PLEASE DO RESUME #1 (8281) DON'T NEXT FROM (8282) AGAIN DO (8277) NEXT DO ABSTAIN FROM (8299) PLEASE DO RESUME #1 PLEASE NOTE 16-bit communications channel 8276 will block until data is sent 8277 will send the data data transferred from .1 to .1 (8276) DO COME FROM (8276) AGAIN DO .1 <- #65535 (8283) DO .1 <- '?.1$# 1'~'#0$#65535' AGAIN (8284) DO .1 <- '?.1$# 2'~'#0$#65535' AGAIN (8285) DO .1 <- '?.1$# 4'~'#0$#65535' AGAIN (8286) DO .1 <- '?.1$# 8'~'#0$#65535' AGAIN (8287) DO .1 <- '?.1$# 16'~'#0$#65535' AGAIN (8288) DO .1 <- '?.1$# 32'~'#0$#65535' AGAIN (8289) DO .1 <- '?.1$# 64'~'#0$#65535' AGAIN (8290) DO .1 <- '?.1$# 128'~'#0$#65535' AGAIN (8291) DO .1 <- '?.1$# 256'~'#0$#65535' AGAIN (8292) DO .1 <- '?.1$# 512'~'#0$#65535' AGAIN (8293) DO .1 <- '?.1$# 1024'~'#0$#65535' AGAIN (8294) DO .1 <- '?.1$# 2048'~'#0$#65535' AGAIN (8295) DO .1 <- '?.1$# 4096'~'#0$#65535' AGAIN (8296) DO .1 <- '?.1$# 8192'~'#0$#65535' AGAIN (8297) DO .1 <- '?.1$#16384'~'#0$#65535' AGAIN (8298) DO .1 <- '?.1$#32768'~'#0$#65535' AGAIN DO ABSTAIN FROM (8278) DO RESUME #1 (8277) DO ABSTAIN .1~# 1 FROM (8283) DO ABSTAIN .1~# 2 FROM (8284) DO ABSTAIN .1~# 4 FROM (8285) DO ABSTAIN .1~# 8 FROM (8286) DO ABSTAIN .1~# 16 FROM (8287) DO ABSTAIN .1~# 32 FROM (8288) DO ABSTAIN .1~# 64 FROM (8289) DO ABSTAIN .1~# 128 FROM (8290) DO ABSTAIN .1~# 256 FROM (8291) DO ABSTAIN .1~# 512 FROM (8292) DO ABSTAIN .1~# 1024 FROM (8293) DO ABSTAIN .1~# 2048 FROM (8294) DO ABSTAIN .1~# 4096 FROM (8295) DO ABSTAIN .1~# 8192 FROM (8296) DO ABSTAIN .1~#16384 FROM (8297) DO ABSTAIN .1~#32768 FROM (8298) DO ABSTAIN FROM (8276) (8278) PLEASE DO COME FROM (8278) AGAIN PLEASE DO RESUME #1 PLEASE NOTE Code for killing all threads. This is achieved by hoping none of them are in syslib (which is after the end of the program), and abstaining from all flow control operations in the program, all operations that hold up execution, and all operations that could error. Unfortunately, this can be affected by ONCE/AGAIN, so each thread will twice more repeat the abstention in the hope of catching other threads as it comes past to quit. Not perfect, but hopefully good enough. (Of course, a simple E000 would be better at this job, but it's an error and non-erroring solutions are better.) PLEASE DO REINSTATE (8205) AGAIN PLEASE DO REINSTATE (8206) AGAIN (8205) PLEASE DO ABSTAIN FROM ABSTAINING + REINSTATING + CALCULATING + NEXTING + COMING FROM + RESUMING + FORGETTING + STASHING + RETRIEVING + WRITING IN + READING OUT + COMMENT AGAIN DON'T DO ANYTHING FOR A BIT PLEASE NOTE THAT THIS IS MORE TIME WASTING (8206) PLEASE DO ABSTAIN FROM ABSTAINING + REINSTATING + CALCULATING + NEXTING + COMING FROM + RESUMING + FORGETTING + STASHING + RETRIEVING + WRITING IN + READING OUT + COMMENT AGAIN PLEASE GIVE UP PLEASE NOTE The main program. DO COME FROM (8201) DO .2 <- #0 DO (8) NEXT (9) DO GET CONTINUATION IN .1 GETTING .2 DO (10) NEXT DO (7) NEXT (8) DO (9) NEXT (7) DO FORGET #1 PLEASE DO READ OUT .2 DO CONTINUE WITH .1 SENDING #3 ONCE DO CONTINUE WITH .1 SENDING #4 ONCE DO CONTINUE WITH .1 SENDING #5 ONCE DO CONTINUE WITH .1 SENDING #6 ONCE DO CONTINUE WITH .1 SENDING #7 ONCE DO .2 <- .1 ONCE DO (11) NEXT (12) DO GET CONTINUATION IN .3 GETTING .2 DO READ OUT #31 + .1 + .2 + .3 DO CONTINUE WITH .3 SENDING .2 (11) DO (12) NEXT PLEASE DO READ OUT #30 + .1 + .2 + .3 PLEASE DO CONTINUE WITH .2 SENDING .3 PLEASE KILL ALL THREADS (10) DO .2 <- #1 DO READ OUT #10 DO CONTINUE WITH .1 SENDING #2 DO RESUME #1 intercal-0.30/pit/PaxHeaders.27456/fft-tophat.chk0000644000000000000000000000007411437550756016362 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.558945776 intercal-0.30/pit/fft-tophat.chk0000644000175000017500000002062111437550756016256 0ustar00esresr00000000000000 II CXXVIII cc _ _______ cxcivDCCCLIXCM ______ mcdlxxviiiCCCLIVCCLII _______ clxxixCMXVIIIDC ___________ mdccclxxxMMMDCCCLXXXMCCLII ____ clviDLIXC ________ mcxvCDLXXXIVDCCLI _____ cxxviCMXIVDC ______ mcxxivCMXCIXCMLI ________ cmxxxviCCCXXVIICCLI ________ mcxvCDLXXXIVDCCCLI ________ dxcvDCCCLXVILI ___________ mdccclxxxMMMDCCCLXXXMDCCLII ______ cclxxvDCLXXXMMDLI ____ mcdlxxviiiCCCLMMCMLII _ _ _____ mccxMMMXXDCCCLI ______ cdlxxviiiCCCLIVDCCLII _________ mccclMMDCCCLXVCMLI ___________ dccclxxxMMMDCCCLXXXMMMLII _______ mcdxviiCCCVIIIDCCCLI ________ cxvCDLXXXIVDCCCLI ______ mcdxMMLXIXDCLI ______ cxxivCMXCIXCMLI _______ mcccxlixDLXXVIIDCCLI ________ cxvCDLXXXIVCMLI ______ mccxlviiXXVIIIDCCLI ___________ dccclxxxMMMDCCCLXXXMMCCCLII ____ mcxxivVIIIDCLI ______ cdlxxviiiCCCLIVCLII _ _ ____ cviiCMXVLI ______ mcdlxxviiiCCCLIVLII ________ clxxxviDCCCLXXXMDLI ___________ mdccclxxxMMMDCCCLXXXMMDLII ______ ccxxixCDXXIXCLI ________ mcxvCDLXXXIVCMLI ____________ ccxxxMMMDCCCLVIIIDLI ______ mcxxivCMXCIXCMLI __________ ccMMMDCCCLIXCDLI ________ mcxvCDLXXXIVCMLI _______ cxlviiCDLXVIICLI ___________ mdccclxxxMMMDCCCLXXXMMDCCCLII ____ dcclvCDIVCDLII ____ mcdlxxviiiCCCLMMMCMLII _ _ ___ mdclxxixCCXDCLII ______ cdlxxviiiCCCLIVCCCLII _______ mcxixCLXXVIIDCCCLI ___________ dccclxxxMMMDCCCLXXXMMMCLII ______ mcxlviiCMLXXXCCLI ________ cxvCDLXXXIVCMLI ______ mclMMCCCXMMDCCCLI cxxvLI ______________ mcxxxMMMDCCCLXXVIIICMLI ________ cxvCDLXXXIVCMLI ___ mcmlxxvCCXMMMDLII ___________ dccclxxxMMMDCCCLXXXMMCMLII ________ mdMMCDXXIXCCLII ______ cdlxxviiiCCCLIVCLII _ _ _____ cdlvCDXXXMLII ______ mcdlxxviiiCCCLIVCCLII ___ dcccMCVCCCLII ___________ mdccclxxxMMMDCCCLXXXMMMCCLII ______ cmxcviCLXXIXCMLII ________ mcxvCDLXXXIVCMLI _________ cMMDLXXXIVDCCCLI mcxxvLI ____ cmMCCLMMMCLII ________ mcxvCDLXXXIVCMLI ____ dclvDXXXMMDCCCLII ___________ mdccclxxxMMMDCCCLXXXMMMCCLII _______ cccxxxviDCCCXCVCDLII ______ mcdlxxviiiCCCLIVCCLII _ _ _______ mcccMMCMXIVCCLII ______ cdlxxviiiCCCLIVCCLII __________ mdxxixDCCLXXVIIICMLII ___________ dccclxxxMMMDCCCLXXXMMMLII ___ mdclivCCXMMMDCLII ________ cxvCDLXXXIVCMLI ________ mdclxviiiCXXXVIIICCCLII ______ cxxivCMXCIXCMLI ____ mdlxxxMCCCMDCLII ________ cxvCDLXXXIVCMLI ___ mcdxviiiXLVCCCLII ___________ dccclxxxMMMDCCCLXXXMMDCLII _______ mccxMMXXXIXCCCLII ____ cdlxxviiiCCCLMMMDCCCLII _ _ ___ clxxxivDXXMCCCLII ____ mcdlxxviiiCCCLMMMCMLII _______ cccxviCCLVIIICCLII ___________ mdccclxxxMMMDCCCLXXXMMCMLII ___ ccclxxxMDXCLII ________ mcxvCDLXXXIVCMLI _____ ccclxxixCLXXXMMDLII ______ mcxxivCMXCIXCMLI _______ cccxixDLXXXIXCCLII ________ mcxvCDLXXXIVCMLI ___ ccxxMCDMLII ___________ mdccclxxxMMMDCCCLXXXMMMLII _______ cviiCDXVIIILII ______ mcdlxxviiiCCCLIVCLII _ _ ____ mdcccxxxXVIILIII ____ cdlxxviiiCCCLMMMCMLII ___ mcxxxMCXCCCLII ___________ dccclxxxMMMDCCCLXXXMMDLII _________ mcxlMMCDXXXIVDCCCLII ________ cxvCDLXXXIVDCCCLI _____ mcxxMMMCXMDCLII ______ cxxivCMXCIXDCCCLI ________ mdccclMDCCCXXXMMMDCCCLIII ________ cxvCDLXXXIVDCCLI ___ mcdxxxivCXCLIII ___________ dccclxxxMMMDCCCLXXXMCCLII ________ mcxviiCCCLXXIXCDLIII ____ cdlxxviiiCCCLMCMLII _ _ _______ mcxviiCDXXVIICLIII ______ mcdlxxviiiCCCLIVCCLII _____ mcdxxxivCCXIXDCCCLIII ___________ mdccclxxxMMMDCCCLXXXMMMDLII _________ mdccclMDCCCLVIIDCCLIII _______ mcxvCDLXXXVLI _______ mcxxMMMCXIVLII mcxxvLI _________ mcxlMMCDXXXVIDCLII _______ mcxvCDLXXXVLI ___ mcxxxMCXMCDLII ___________ mdccclxxxMMMDCCCLXXXMMMDCCLII __ mdcccxxxXXLIII ______ mcdlxxviiiCCCLIVDCLII _ _ _______ cviiCDXVIIICLII ______ cdlxxviiiCCCLIVCCLII ___ ccxxMCDMLII ___________ dccclxxxMMMDCCCLXXXMMMCCCLII _______ cccxixDLXXXIXCDLII ________ cxvCDLXXXIVCMLI _____ ccclxxixCLXXXMMMLII cxxvLI ___ ccclxxxMDXCDLII ________ cxvCDLXXXIVCMLI _______ cccxviCCLVIIILII ___________ dccclxxxMMMDCCCLXXXMMMCCLII ___ clxxxivDXXMDLII ______ cdlxxviiiCCCLIVLII _ _ _______ mccxMMXXXIXDCCLII ______ mcdlxxviiiCCCLIVCDLII ___ mcdxviiiXLVCCLII ___________ mdccclxxxMMMDCCCLXXXMMMDCCCLII ____ mdlxxxMCCCMCMLII _______ mcxvCDLXXXVLI ________ mdclxviiiCXXXVIIIDCLII mcxxvLI ___ mdclivCCXMMMDCCLII _______ mcxvCDLXXXVLI __________ mdxxixDCCLXXVIIICMLII _____________ mdccclxxxMMMDCCCLXXXIVLII _______ mcccMMCMXIVCCCLII ______ mcdlxxviiiCCCLIVDCCLII _ _ _______ cccxxxviDCCCXCVCLII ______ cdlxxviiiCCCLIVCCLII ____ dclvDXXXMMCCCLII ___________ dccclxxxMMMDCCCLXXXMMCMLII ____ cmMCCLMMCMLII ________ cxvCDLXXXIVCMLI _________ cMMDLXXXIVDCCCLI ______ cxxivCMXCIXCMLI ______ cmxcviCLXXIXDCCLII ________ cxvCDLXXXIVDCCCLI ____ dcccMCIVDCCCLII ___________ dccclxxxMMMDCCCLXXXMMCCCLII _____ cdlvCDXXXMLII ____ cdlxxviiiCCCLMMDCLII _ _ _______ mdMMCDXXXMCLII ______ mcdlxxviiiCCCLIVCDLII _____ mcmlxxvCCXIVDCLII ___________ mdccclxxxMMMDCCCLXXXMMMCMLII ____________ mcxxxMMMDCCCLXXIXCLI _______ mcxvCDLXXXVLI ______ mclMMCCCXMMCMLI mcxxvCLI ______ mcxlviiCMLXXXCCLI _______ mcxvCDLXXXVLI _______ mcxixCLXXVIIDCCCLI _____________ mdccclxxxMMMDCCCLXXXIVCCCLII ___ mdclxxixCCXDCCLII _____ mcdlxxviiiCCCLVCLII _ _ __ dcclvCDMMMDCCLII ______ cdlxxviiiCCCLIVCCLII _______ cxlviiCDLXVIILI ___________ dccclxxxMMMDCCCLXXXMMMDCLII __________ ccMMMDCCCLIXCCCLI _______ cxvCDLXXXVLI ____________ ccxxxMMMDCCCLVIIICDLI cxxvLI ______ ccxxixCDXXIXLI _______ cxvCDLXXXVLI ________ clxxxviDCCCLXXXMCCCLI ___________ dccclxxxMMMDCCCLXXXMMMDCCCLII _____ cviiCMXIVCMLI ____ cdlxxviiiCCCLMMMDCCCLII _ _ ____ mcxxivVIIIDCLI ______ mcdlxxviiiCCCLIVDCCLII ______ mccxlviiXXVIIIDCCCLI ____________ mdccclxxxMMMDCCCLXXXVLII _______ mcccxlixDLXXVIIDCCCLI _______ mcxvCDLXXXVCLI ______ mcdxMMLXIXDCLI mcxxvCCLI _______ mcdxviiCCCVIIICMLI _______ mcxvCDLXXXVCLI __________ mccclMMDCCCLXVILI _____________ mdccclxxxMMMDCCCLXXXVICLII _____ mccxMMMXXDCCCLI ______ mcdlxxviiiCCCLVIDLII _ _ ______ cclxxvDCLXXXMMCCCLI ______ cdlxxviiiCCCLIVCCCLII _______ dxcvDCCCLXVDLI _____________ dccclxxxMMMDCCCLXXXIVCDLII _______ cmxxxviCCCXXVIDCCLI _______ cxvCDLXXXVCCLI _____ cxxviCMXIVDC cxxvCDLI ____ clviDLIXC _______ cxvCDLXXXVCDLI _______ clxxixCMXVIIIDC _________ dccclxxxMMMDCCCXCCDLII _______ cxcivDCCCLIXDCCC _____ cdlxxviiiCCCLXMDCCCLII intercal-0.30/pit/PaxHeaders.27456/random.doc0000644000000000000000000000007411437550756015566 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/random.doc0000644000175000017500000000074011437550756015462 0ustar00esresr00000000000000 DO (1900) NEXT DO READ OUT .1 PLEASE GIVE UP (1900) DO STASH .2 + .3 DO .3 <- #65535 DO (1903) NEXT (1903) PLEASE FORGET #1 DO .2 <- #0 PLEASE %50 IGNORE .2 DO .2 <- #1 PLEASE REMEMBER .2 DO .1 <- !1$.2'~"#65535$#1" DO .3 <- .3~#65534 DO (1902) NEXT DO (1903) NEXT (1902) DO (1904) NEXT DO RETRIEVE .2 + .3 DO FORGET #1 PLEASE RESUME #1 (1904) PLEASE RESUME '?"!3~.3'~#1"$#1'~#3 Random.i: Store a random number between 0 and 65535 in .1 (blojo@ocf.berkeley.edu) intercal-0.30/pit/PaxHeaders.27456/sample.i0000644000000000000000000000007411437550756015252 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/sample.i0000644000175000017500000000125211437550756015145 0ustar00esresr00000000000000 DO (5) NEXT (5) DO FORGET #1 PLEASE WRITE IN :1 DO .1 <- '?":1~'#32768$#0'"$#1'~#3 DO (1) NEXT DO :1 <- "'?":1~'#65535$#0'"$#65535' ~'#0$#65535'"$"'?":1~'#0$#65535'" $#65535'~'#0$#65535'" DO :2 <- #1 PLEASE DO (4) NEXT (4) DO FORGET #1 DO .1 <- "?':1~:2'$#1"~#3 DO :1 <- "'?":1~'#65535$#0'"$":2~'#65535 $#0'"'~'#0$#65535'"$"'?":1~'#0 $#65535'"$":2~'#0$#65535'"'~'#0$#65535'" DO (1) NEXT DO :2 <- ":2~'#0$#65535'" $"'":2~'#65535$#0'"$#0'~'#32767$#1'" DO (4) NEXT (2) DO RESUME .1 (1) PLEASE DO (2) NEXT PLEASE FORGET #1 DO READ OUT :1 PLEASE DO .1 <- '?"':1~:1'~#1"$#1'~#3 DO (3) NEXT PLEASE DO (5) NEXT (3) DO (2) NEXT PLEASE GIVE UP intercal-0.30/pit/PaxHeaders.27456/fft.i0000644000000000000000000000007411437550756014550 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.558945776 intercal-0.30/pit/fft.i0000644000175000017500000001276011437550756014451 0ustar00esresr00000000000000 PLEASE WRITE IN .9 DO .5 <- '?"'#65535~".9~#65532"'~#1"$#2'~#3 DO (91) NEXT DO .5 <- '?.&9$#2'~#3 DO (91) NEXT DO .5 <- '?"#3~.9"$#1'~#3 DO (91) NEXT PLEASE WRITE IN .10 DO .5 <- '?"!10~.10'~#2"$#2'~#3 DO (93) NEXT DO .5 <- '?"'#65535~".10~#65534"'~#1"$#1'~#3 DO (92) NEXT PLEASE DO ;1 <- .10 BY #2 DO .1 <- #1 DO (10) NEXT (11) DO (1001) NEXT (10) PLEASE FORGET #1 PLEASE WRITE IN :1 DO (5090) NEXT DO .5 <- '?".5~#2"$#2'~#3 DO (94) NEXT PLEASE DO ;1SUB.1#1 <- :2 PLEASE WRITE IN :1 DO (5090) NEXT DO .5 <- '?".5~#2"$#2'~#3 DO (94) NEXT PLEASE DO ;1SUB.1#2 <- :2 DO .5 <- '?".1~.10"$#1'~#3 DO (1020) NEXT DO (11) NEXT PLEASE DO (100) NEXT PLEASE READ OUT .9 + .10 DO .1 <- #1 DO (15) NEXT (16) DO (1001) NEXT (15) PLEASE FORGET #1 DO :1 <- ;1SUB.1#1 DO (5080) NEXT PLEASE READ OUT :2 DO :1 <- ;1SUB.1#2 DO (5080) NEXT PLEASE READ OUT :2 DO .5 <- '?".1~.10"$#1'~#3 DO (1020) NEXT DO (16) NEXT PLEASE GIVE UP (91) DO (1001) NEXT PLEASE ENTER ONE OR TWO TO SPECIFY THE TRANSFORM. (92) DO (1001) NEXT DO YOU REALLY WANT TO TRANSFORM A VECTOR OF ONE NUMBER? (93) DO (1001) NEXT DOES "POWER OF TWO" MEAN ANYTHING TO YOU? (94) DO (1001) NEXT DOCUMENTATION EXISTS. PERHAPS YOU SHOULD READ IT. PLEASE DON'T GIVE UP (100) PLEASE STASH .1 + .2 + .3 + .4 + .5 + .6 + .7 + :1 + :2 + :3 + :4 + :5 + :6 + :7 + .11 + :10 + :11 + :12 + :13 DO .11 <- #32768 DO .1 <- #1 DO .2 <- .10~#65532 DO (101) NEXT (102) DO (1001) NEXT PLEASE DO .11 <- .V11 DO (1020) NEXT DO .2 <- .2~#65534 (101) PLEASE FORGET #1 DO .5 <- '?".2~.2"$#2'~#3 DO (102) NEXT PLEASE STASH .1 DO .1 <- #1 DO .2 <- #1 DO (105) NEXT (106) DO (1001) NEXT (105) PLEASE FORGET #1 DO .5 <- '?.1$.2'~'#0$#65535' DO .5 <- '?"!2~.5'~'"?.5~.5"~#32767'"$#1'~#3 DO (107) NEXT PLEASE DO :1 <- ;1SUB.1#1 DO ;1SUB.1#1 <- ;1SUB.2#1 DO ;1SUB.2#1 <- :1 PLEASE DO :1 <- ;1SUB.1#2 DO ;1SUB.1#2 <- ;1SUB.2#2 DO ;1SUB.2#2 <- :1 DO (108) NEXT (107) DO (1001) NEXT (108) PLEASE FORGET #1 DO .5 <- .1 DO .1 <- !1~#255'$!1~#65280' DO .1 <- !1~#255'$!1~#65280' DO .1 <- !1~#255'$!1~#65280' DO .1 <- !1~#255'$!1~#65280' DO .1 <- .1~.11 DO (1020) NEXT DO .2 <- .1 DO .1 <- .5 DO (1020) NEXT DO .5 <- '?".1~.10"$#1'~#3 DO (106) NEXT DO .6 <- #1 PLEASE DO :7 <- '"'V.9~#2'$#571"~"#32768$#32767"'$#35133 DO (110) NEXT (111) DO (1001) NEXT (110) PLEASE FORGET #1 DO .7 <- !6$#0'~'#32767$#1' DO :1 <- :7 PLEASE DO (5200) NEXT DO :13 <- :2 PLEASE DO :2 <- #63488$#61440 DO (1509) NEXT DO :7 <- :3 DO :1 <- :3 PLEASE DO (5200) NEXT DO :1 <- :2 PLEASE DO (530) NEXT DO :1 <- :3 PLEASE DO :2 <- #34816$#0 PLEASE DO (1509) NEXT DO :12 <- :3 DO :11 <- #0 PLEASE DO :10 <- #30720$#28672 DO .1 <- #1 DO (120) NEXT (120) PLEASE FORGET #1 DO .4 <- .1 DO (130) NEXT (131) DO (1001) NEXT (130) PLEASE FORGET #1 DO .2 <- .6 DO (1000) NEXT PLEASE DON'T GIVE UP DO :1 <- :10 DO :2 <- ;1SUB.3#1 PLEASE DO (530) NEXT DO :4 <- :3 DO :1 <- :11 DO :2 <- ;1SUB.3#2 PLEASE DO (530) NEXT DO :1 <- :4 DO :2 <- :3 PLEASE DO (5010) NEXT DO :5 <- :3 DO :1 <- :10 DO :2 <- ;1SUB.3#2 PLEASE DO (530) NEXT DO :4 <- :3 DO :1 <- :11 DO :2 <- ;1SUB.3#1 PLEASE DO (530) NEXT DO :1 <- :4 DO :2 <- :3 PLEASE DO (5000) NEXT DO :6 <- :3 DO :1 <- ;1SUB.1#1 DO :2 <- :5 PLEASE DO (5010) NEXT PLEASE DO ;1SUB.3#1 <- :3 DO :1 <- ;1SUB.1#2 DO :2 <- :6 PLEASE DO (5010) NEXT PLEASE DO ;1SUB.3#2 <- :3 DO :1 <- ;1SUB.1#1 DO :2 <- :5 PLEASE DO (5000) NEXT PLEASE DO ;1SUB.1#1 <- :3 DO :1 <- ;1SUB.1#2 DO :2 <- :6 PLEASE DO (5000) NEXT PLEASE DO ;1SUB.1#2 <- :3 DO .2 <- .7 DO (1000) NEXT DO .1 <- .3 DO .5 <- '?.1$.10'~'#0$#65535' DO .5 <- '?"!1~.5'~'"?.5~.5"~#32767'"$#1'~#3 DO (131) NEXT DO :1 <- :10 DO :2 <- :12 PLEASE DO (530) NEXT DO :4 <- :3 DO :1 <- :11 DO :2 <- :13 PLEASE DO (530) NEXT DO :1 <- :10 DO :2 <- :3 PLEASE DO (5010) NEXT DO :1 <- :3 DO :2 <- :4 PLEASE DO (5000) NEXT DO :1 <- :10 DO :2 <- :13 PLEASE DO :10 <- :3 PLEASE DO (530) NEXT DO :4 <- :3 DO :1 <- :11 DO :2 <- :12 PLEASE DO (530) NEXT DO :1 <- :11 DO :2 <- :3 PLEASE DO (5000) NEXT DO :1 <- :3 DO :2 <- :4 PLEASE DO (5000) NEXT DO :11 <- :3 DO .5 <- '?".4~.6"$#2'~#3 DO (121) NEXT DO .1 <- .4 DO (1020) NEXT DO (120) NEXT (121) DO (1001) NEXT PLEASE FORGET #1 DO .6 <- .7 DO .5 <- '?".6~.10"$#1'~#3 DO (111) NEXT PLEASE RETRIEVE .1 DO .5 <- .9 DO (140) NEXT DO .1 <- '?.1$#65535'~'#0$#65535' DO (1020) NEXT DO :2 <- '"'"'"!1$#0'~'#511$#1'"$#0'~'#1023$#3'"$#0'~'#4095$ #15'"$#0'~'#65535$#31' DO :2 <- ':2~"#31$#2047"'$':2~"#1023$#63"' DO .1 <- #1 DO (145) NEXT (145) PLEASE FORGET #1 DO :1 <- ;1SUB.1#1 DO .5 <- '?"':1~":1~'#32767$#65535'"'~#1"$#1'~#3 DO (146) NEXT PLEASE DO (1509) NEXT DO ;1SUB.1#1 <- :3 DO (147) NEXT (146) DO (1001) NEXT (147) PLEASE FORGET #1 DO :1 <- ;1SUB.1#2 DO .5 <- '?"':1~":1~'#32767$#65535'"'~#1"$#1'~#3 DO (148) NEXT PLEASE DO (1509) NEXT DO ;1SUB.1#2 <- :3 DO (149) NEXT (148) DO (1001) NEXT (149) PLEASE FORGET #1 DO .5 <- '?".1~.10"$#2'~#3 DO (140) NEXT DO (1020) NEXT DO (145) NEXT (140) DO (1001) NEXT (141) PLEASE FORGET #1 DO .9 <- !9~#1'$!9~#2' PLEASE RETRIEVE .1 + .2 + .3 + .4 + .5 + .6 + .7 + :1 + :2 + :3 + :4 + :5 + :6 + :7 + .11 + :10 + :11 + :12 + :13 PLEASE RESUME #1 (530) DO (5030) NEXT DO (531) NEXT DO :3 <- '"':3~"#65535$#0"'$#32767"~"#32768$#32767"'$#65535 PLEASE RESUME #1 (531) DO (532) NEXT DO :3 <- '"':3~"#65535$#0"'$':3~"#2047$#0"'"~"#32768$#32767"'$ ':3~"#0$#4095"' PLEASE RESUME #2 (532) DO (1001) NEXT PLEASE RESUME #3 PLEASE APPEND THE FLOATING-POINT LIBRARY ROUTINES intercal-0.30/pit/PaxHeaders.27456/icat.chk0000644000000000000000000000007411437550756015226 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/icat.chk0000644000175000017500000000001711437550756015117 0ustar00esresr00000000000000Hello, sailor! intercal-0.30/pit/PaxHeaders.27456/sort.chk0000644000000000000000000000007411437550756015275 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.574945729 intercal-0.30/pit/sort.chk0000644000175000017500000000003211437550756015163 0ustar00esresr00000000000000 III V VI VII intercal-0.30/pit/PaxHeaders.27456/pi.i0000644000000000000000000000007411437550756014401 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.566945757 intercal-0.30/pit/pi.i0000644000175000017500000000524311437550756014300 0ustar00esresr00000000000000 PLEASE WRITE IN .10 DO .1 <- .10~#65534 DO (1020) NEXT DO .10 <- !1$.10'~'#32767$#1' DO .1 <- .10 DO .2 <- #10 PLEASE DO (1030) NEXT DO .1 <- .3 DO .2 <- #3 DO (1040) NEXT DO .9 <- .3 DO ,1 <- .9 DO .1 <- .9 PLEASE COME FROM (13) DO ,1 SUB .1 <- #2 DO (11) NEXT (12) DO (2010) NEXT (13) PLEASE FORGET #2 (11) DO (12) NEXT DO .15 <- #0 DO .16 <- #0 DO (100) NEXT DO .1 <- .10 DO (2000) NEXT PLEASE COME FROM (23) DO .10 <- .1 DO (100) NEXT PLEASE READ OUT .17 DO .1 <- .10 DO (21) NEXT (22) DO (2010) NEXT (23) PLEASE FORGET #2 (21) DO (22) NEXT PLEASE FORGET #2 PLEASE GIVE UP (100) DO .14 <- #0 DO .12 <- .9 PLEASE COME FROM (103) DO .1 <- .14 DO .2 <- .12 DO (1030) NEXT DO .14 <- .3 DO .1 <- ,1 SUB .12 DO .2 <- #10 DO (1030) NEXT DO .1 <- .3 DO .2 <- .14 DO (1000) NEXT DO .1 <- !12$#0'~'#32767$#1' DO (2000) NEXT DO .2 <- .1 DO .1 <- .3 DO (2030) NEXT DO .14 <- .3 DO ,1 SUB .12 <- .4 DO .1 <- .12 DO (101) NEXT (102) DO (2010) NEXT DO .12 <- .1 (103) PLEASE FORGET #2 (101) DO (102) NEXT DO .17 <- .16 DO .1 <- .14 DO .2 <- #10 DO (2030) NEXT DO .1 <- .15 DO .2 <- .3 DO (1000) NEXT DO .16 <- .3 DO .15 <- .4 DO .5 <- '?.16$#10'~#85 DO .5 <- "?!5~.5'$#2"~#3 DO (104) NEXT DO .16 <- #0 DO .1 <- .17 DO (1020) NEXT DO .17 <- .1 PLEASE RESUME #2 (104) DO (1001) NEXT PLEASE RESUME #3 (2010) PLEASE ABSTAIN FROM (2004) (2000) PLEASE STASH .2 DO .2 <- #1 DO (2001) NEXT (2001) PLEASE FORGET #1 DO .1 <- '?.1$.2'~'#0$#65535' DO (2002) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (2001) NEXT (2003) PLEASE RESUME "?!1~.2'$#1"~#3 (2002) DO (2003) NEXT PLEASE RETRIEVE .2 (2004) PLEASE RESUME #2 PLEASE DO REINSTATE (2004) PLEASE RESUME '?"!1~.1'~#1"$#2'~#6 (2020) PLEASE STASH .2 + .3 DO (1021) NEXT (2030) DO STASH .1 + .5 DO .3 <- #0 DO .5 <- '?"!2~.2'~#1"$#1'~#3 PLEASE DO (2031) NEXT DO .4 <- #1 PLEASE DO (2033) NEXT (2033) DO FORGET #1 DO .5 <- '?".2~#32768"$#2'~#3 DO (2032) NEXT DO .2 <- !2$#0'~'#32767$#1' PLEASE DO .4 <- !4$#0'~'#32767$#1' DO (2033) NEXT (2032) DO (1001) NEXT (2036) PLEASE FORGET #1 DO .5 <- '?.1$.2'~'#0$#65535' DO .5 <- '?"'&"!2~.5'~'"?'?.5~.5'$#32768"~"#0$#65535"'"$ ".5~.5"'~#1"$#2'~#3 DO (2034) NEXT DO .5 <- .3 DO (1010) NEXT PLEASE DO .1 <- .3 DO .3 <- 'V.4$.5'~'#0$#65535' DO (2035) NEXT (2034) PLEASE DO (1001) NEXT (2035) DO FORGET #1 DO .5 <- "?'.4~#1'$#2"~#3 DO (2031) NEXT DO .2 <- .2~#65534 DO .4 <- .4~#65534 PLEASE DO (2036) NEXT (2031) DO (1001) NEXT PLEASE DO .4 <- .1 PLEASE RETRIEVE .1 + .5 PLEASE RESUME #2 PLEASE NOTE THAT YOU DON'T HAVE TO APPEND STANDARD LIBRARY HERE intercal-0.30/pit/PaxHeaders.27456/yapp.doc0000644000000000000000000000007411437550756015257 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.574945729 intercal-0.30/pit/yapp.doc0000644000175000017500000000276011437550756015157 0ustar00esresr00000000000000yapp stands for "yet another program printer", or "yet another printing program", or maybe "yet another printer printer". yapp is a program that prints out programs that print out. That is, yapp takes whatever is piped into its standard input, and produces on its standard output the source code for an INTERCAL program that will, when compiled, produce the original file. The created program will be self-contained; it will not need the system library to compile. The reason for this is to maximize the amount of data that yapp can encode into an INTERCAL program. The current compiler has an upper bound on the number of commands one program can have; thus yapp will not produce a compilable program if given more than 3880 bytes. Though yapp was intended to create standalone programs, it can also be used to generate subroutines. (In fact, the first working version of this program was used to generate the lines for the final draft.) In such a case, it is convenient to specify what character the data will "follow". The easiest way to accomplish this is to replace the "DO .9 <- #0" in line 22 with "DO .9 <- ", where is the bit-reversed code of the character preceeding the data (#80 in the case of a newline, for example). A more versatile modification is to change line 22 to "DO WRITE IN .9", and then insert the character code at the top of the file that is to be fed to yapp. Thus, if the data in the file would follow a newline, the line "EIGHT OH" would be added to the top of the data file. intercal-0.30/pit/PaxHeaders.27456/tpk.tst0000644000000000000000000000007411474464667015157 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.574945729 intercal-0.30/pit/tpk.tst0000644000175000017500000000044411474464667015054 0ustar00esresr00000000000000ONE ONE FIVE SIX TWO FIVE FOUR OH OH OH OH OH OH FIVE OH OH OH OH OH OH THREE ONE FOUR ONE FIVE NINER TWO THREE ONE FOUR ONE FIVE NINER THREE SEVEN SIX EIGHT OH THREE THREE ZERO FOUR TWO NINE FOUR NINE SIX SEVEN TWO NINE FIVE FOUR THREE OH ONE FOUR OH NINE FOUR THREE OH ONE FOUR ONE OH intercal-0.30/pit/PaxHeaders.27456/random2.i0000644000000000000000000000007411437550756015333 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/random2.i0000644000175000017500000000067211437550756015233 0ustar00esresr00000000000000(1900) DO STASH .2 + .3 DO .3 <- #65535 DO (1903) NEXT (1903) PLEASE FORGET #1 DO .2 <- #0 PLEASE %50 IGNORE .2 DO .2 <- #1 PLEASE REMEMBER .2 DO .1 <- !1$.2'~"#65535$#1" DO .3 <- .3~#65534 DO (1902) NEXT DO (1903) NEXT (1902) DO (1904) NEXT DO RETRIEVE .2 + .3 DO FORGET #1 PLEASE RESUME #1 (1904) PLEASE RESUME '?"!3~.3'~#1"$#1'~#3 intercal-0.30/pit/PaxHeaders.27456/fft-delta.chk0000644000000000000000000000007411437550756016154 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.558945776 intercal-0.30/pit/fft-delta.chk0000644000175000017500000001722611437550756016057 0ustar00esresr00000000000000 II CXXVIII cxxII _ ______ cxviiDCXCIVCCII ________ cxcDCCXXXIVCMLVI _______ cxDCCCLXVDII ____ cxivCDXLCMLV _____ cmxcviiDCCLXMMMCDI ________ cxcDCCXXXIVCMLV _______ dcccxlviiiDXXVIIICI _________ dcclxMMCMXXXIXDLVI ________ dclxviDCLXXXIVCCCI __________ cmlMMMDCLXXIVCCCLVI ____ cdlixCCXXCI _____ clxxMDCLXMCDLV _____ ccxxxivCVIIIDI _______ clxMMCXXIVDCLV _ _ _____ mccxxxivCVIIICDI __________ cmlMMMDCLXXIVCCCLVII ____ mcdlixCCXXI ______ dlxxMMCCIVDCLVI ________ mdclxviDCLXXXIVCI __________ mcmlMMMDCLXXIVCCCLVI _______ mdcccxlviiiDXXVIIII __________ mclMMDLXXXVIICMLV _____ mcmxcviiDCCLXMMMCDI __________ mclMMDLXXXVIICMLV _______ mcxDCCCLXVDII ________ mcxcDCCXXXIVCMLV ______ mcxviiDCXCIVCCII _____ mcccvCLXXVDCCCLV mcxxII _ ______ mcxviiDCXCIVCCII ________ mcxcDCCXXXIVCMLVI _______ mcxDCCCLXVDII ____ mcxivCDXLCMLV _____ mcmxcviiDCCLXMMMCDI ________ mcxcDCCXXXIVCMLV _______ mdcccxlviiiDXXVIIICI _________ mdcclxMMCMXXXIXDLVI ________ mdclxviDCLXXXIVCCCI __________ mcmlMMMDCLXXIVCCCLVI ____ mcdlixCCXXCI _____ mclxxMDCLXMCDLV _____ mccxxxivCVIIIDI _______ mclxMMCXXIVDCLV _ _ _____ ccxxxivCVIIICDI __________ mcmlMMMDCLXXIVCCCLVII ____ cdlixCCXXI ______ mdlxxMMCCIVDCLVI ________ dclxviDCLXXXIVCI __________ cmlMMMDCLXXIVCCCLVI _______ dcccxlviiiDXXVIIII __________ clMMDLXXXVIICMLV _____ cmxcviiDCCLXMMMCDI __________ clMMDLXXXVIICMLV _______ cxDCCCLXVDII ________ cxcDCCXXXIVCMLV ______ cxviiDCXCIVCCII _____ cccvCLXXVDCCCLV cxxII _ ______ cxviiDCXCIVCCII ________ cxcDCCXXXIVCMLVI _______ cxDCCCLXVDII ____ cxivCDXLCMLV _____ cmxcviiDCCLXMMMCDI ________ cxcDCCXXXIVCMLV _______ dcccxlviiiDXXVIIICI _________ dcclxMMCMXXXIXDLVI ________ dclxviDCLXXXIVCCCI __________ cmlMMMDCLXXIVCCCLVI ____ cdlixCCXXCI _____ clxxMDCLXMCDLV _____ ccxxxivCVIIIDI _______ clxMMCXXIVDCLV _ _ _____ mccxxxivCVIIICDI __________ cmlMMMDCLXXIVCCCLVII ____ mcdlixCCXXI ______ dlxxMMCCIVDCLVI ________ mdclxviDCLXXXIVCI __________ mcmlMMMDCLXXIVCCCLVI _______ mdcccxlviiiDXXVIIII __________ mclMMDLXXXVIICMLV _____ mcmxcviiDCCLXMMMCDI __________ mclMMDLXXXVIICMLV _______ mcxDCCCLXVDII ________ mcxcDCCXXXIVCMLV ______ mcxviiDCXCIVCCII _____ mcccvCLXXVDCCCLV mcxxII _ ______ mcxviiDCXCIVCCII ________ mcxcDCCXXXIVCMLVI _______ mcxDCCCLXVDII ____ mcxivCDXLCMLV _____ mcmxcviiDCCLXMMMCDI ________ mcxcDCCXXXIVCMLV _______ mdcccxlviiiDXXVIIICI _________ mdcclxMMCMXXXIXDLVI ________ mdclxviDCLXXXIVCCCI __________ mcmlMMMDCLXXIVCCCLVI ____ mcdlixCCXXCI _____ mclxxMDCLXMCDLV _____ mccxxxivCVIIIDI _______ mclxMMCXXIVDCLV _ _ _____ ccxxxivCVIIICDI __________ mcmlMMMDCLXXIVCCCLVII ____ cdlixCCXXI ______ mdlxxMMCCIVDCLVI ________ dclxviDCLXXXIVCI __________ cmlMMMDCLXXIVCCCLVI _______ dcccxlviiiDXXVIIII __________ clMMDLXXXVIICMLV _____ cmxcviiDCCLXMMMCDI __________ clMMDLXXXVIICMLV _______ cxDCCCLXVDII ________ cxcDCCXXXIVCMLV ______ cxviiDCXCIVCCII _____ cccvCLXXVDCCCLV cxxII _ ______ cxviiDCXCIVCCII ________ cxcDCCXXXIVCMLVI _______ cxDCCCLXVDII ____ cxivCDXLCMLV _____ cmxcviiDCCLXMMMCDI ________ cxcDCCXXXIVCMLV _______ dcccxlviiiDXXVIIICI _________ dcclxMMCMXXXIXDLVI ________ dclxviDCLXXXIVCCCI __________ cmlMMMDCLXXIVCCCLVI ____ cdlixCCXXCI _____ clxxMDCLXMCDLV _____ ccxxxivCVIIIDI _______ clxMMCXXIVDCLV _ _ _____ mccxxxivCVIIICDI __________ cmlMMMDCLXXIVCCCLVII ____ mcdlixCCXXI ______ dlxxMMCCIVDCLVI ________ mdclxviDCLXXXIVCI __________ mcmlMMMDCLXXIVCCCLVI _______ mdcccxlviiiDXXVIIII __________ mclMMDLXXXVIICMLV _____ mcmxcviiDCCLXMMMCDI __________ mclMMDLXXXVIICMLV _______ mcxDCCCLXVDII ________ mcxcDCCXXXIVCMLV ______ mcxviiDCXCIVCCII _____ mcccvCLXXVDCCCLV mcxxII _ ______ mcxviiDCXCIVCCII ________ mcxcDCCXXXIVCMLVI _______ mcxDCCCLXVDII ____ mcxivCDXLCMLV _____ mcmxcviiDCCLXMMMCDI ________ mcxcDCCXXXIVCMLV _______ mdcccxlviiiDXXVIIICI _________ mdcclxMMCMXXXIXDLVI ________ mdclxviDCLXXXIVCCCI __________ mcmlMMMDCLXXIVCCCLVI ____ mcdlixCCXXCI _____ mclxxMDCLXMCDLV _____ mccxxxivCVIIIDI _______ mclxMMCXXIVDCLV _ _ _____ ccxxxivCVIIICDI __________ mcmlMMMDCLXXIVCCCLVII ____ cdlixCCXXI ______ mdlxxMMCCIVDCLVI ________ dclxviDCLXXXIVCI __________ cmlMMMDCLXXIVCCCLVI _______ dcccxlviiiDXXVIIII __________ clMMDLXXXVIICMLV _____ cmxcviiDCCLXMMMCDI __________ clMMDLXXXVIICMLV _______ cxDCCCLXVDII ________ cxcDCCXXXIVCMLV ______ cxviiDCXCIVCCII _____ cccvCLXXVDCCCLV cxxII _ ______ cxviiDCXCIVCCII ________ cxcDCCXXXIVCMLVI _______ cxDCCCLXVDII ____ cxivCDXLCMLV _____ cmxcviiDCCLXMMMCDI ________ cxcDCCXXXIVCMLV _______ dcccxlviiiDXXVIIICI _________ dcclxMMCMXXXIXDLVI ________ dclxviDCLXXXIVCCCI __________ cmlMMMDCLXXIVCCCLVI ____ cdlixCCXXCI _____ clxxMDCLXMCDLV _____ ccxxxivCVIIIDI _______ clxMMCXXIVDCLV _ _ _____ mccxxxivCVIIICDI __________ cmlMMMDCLXXIVCCCLVII ____ mcdlixCCXXI ______ dlxxMMCCIVDCLVI ________ mdclxviDCLXXXIVCI __________ mcmlMMMDCLXXIVCCCLVI _______ mdcccxlviiiDXXVIIII __________ mclMMDLXXXVIICMLV _____ mcmxcviiDCCLXMMMCDI __________ mclMMDLXXXVIICMLV _______ mcxDCCCLXVDII ________ mcxcDCCXXXIVCMLV ______ mcxviiDCXCIVCCII _____ mcccvCLXXVDCCCLV mcxxII _ ______ mcxviiDCXCIVCCII ________ mcxcDCCXXXIVCMLVI _______ mcxDCCCLXVDII ____ mcxivCDXLCMLV _____ mcmxcviiDCCLXMMMCDI ________ mcxcDCCXXXIVCMLV _______ mdcccxlviiiDXXVIIICI _________ mdcclxMMCMXXXIXDLVI ________ mdclxviDCLXXXIVCCCI __________ mcmlMMMDCLXXIVCCCLVI ____ mcdlixCCXXCI _____ mclxxMDCLXMCDLV _____ mccxxxivCVIIIDI _______ mclxMMCXXIVDCLV _ _ _____ ccxxxivCVIIICDI __________ mcmlMMMDCLXXIVCCCLVII ____ cdlixCCXXI ______ mdlxxMMCCIVDCLVI ________ dclxviDCLXXXIVCI __________ cmlMMMDCLXXIVCCCLVI _______ dcccxlviiiDXXVIIII __________ clMMDLXXXVIICMLV _____ cmxcviiDCCLXMMMCDI __________ clMMDLXXXVIICMLV _______ cxDCCCLXVDII ________ cxcDCCXXXIVCMLV ______ cxviiDCXCIVCCII _____ cccvCLXXVDCCCLV intercal-0.30/pit/PaxHeaders.27456/yapp.i0000644000000000000000000000007411437550756014742 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.574945729 intercal-0.30/pit/yapp.i0000644000175000017500000002325411437550756014643 0ustar00esresr00000000000000 DO (3990) NEXT PLEASE DO ;1 <- #128 PLEASE DO ,2 <- #2 DO ,2SUB#1 <- #136 DO ,2SUB#2 <- #240 PLEASE DO ,4 <- #4 DO ;1SUB#1 <- #42920$#47080 DO ;1SUB#2 <- #1156$#57920 PLEASE ;1SUB#3 <- #64324$#3496 DO ;1SUB#4 <- #4904$#25152 DO ;1SUB#5 <- #12352$#52716 DO ;1SUB#6 <- #29312$#21504 PLEASE ;1SUB#7 <- #54608$#3496 DO ;1SUB#8 <- #52968$#25152 DO ;1SUB#9 <- #12352$#42740 DO ;1SUB#10 <- #8020$#47488 PLEASE ;1SUB#11 <- #54656$#53200 DO .4 <- #44 DO (100) NEXT DO .9 <- #0 DO .7 <- #0 PLEASE COME FROM (50) DO .6 <- #0 PLEASE COME FROM (5) DO (3000) NEXT DO .5 <- '?".1~#256"$#2'~#3 DO (49) NEXT DO .2 <- !1~#15'$!1~#240' DO .2 <- !2~#15'$!2~#240' DO .2 <- !2~#15'$!2~#240' DO .1 <- .9 DO .9 <- .2 DO (1010) NEXT DO .1 <- .6 DO (1020) NEXT DO .6 <- .1 DO ,4SUB.6 <- .3~#255 DO .5 <- '?".6~#4"$#2'~#3 (5) DO (4) NEXT (4) DO (1001) NEXT PLEASE FORGET #1 DO .6 <- #0 DO .1 <- .7 DO (1020) NEXT DO .7 <- .1 DO .5 <- '?".&7~#1"$#1'~#3 DO (7) NEXT DO ;1SUB#1 <- #29032$#34304 DO ;1SUB#2 <- #36544$#45352 DO ;1SUB#3 <- #41992$#15828 DO .4 <- #12 DO (8) NEXT (7) DO (1001) NEXT DO ;1SUB#1 <- #3496$#4904 DO ;1SUB#2 <- #41992$#15828 DO .4 <- #8 (8) PLEASE FORGET #1 DO (100) NEXT DO .1 <- .7 DO (220) NEXT DO .1 <- ',4SUB#1'$',4SUB#2' DO ,3001SUB#1 <- #196 DO (3090) NEXT DO .2 <- #36 DO (3001) NEXT DO .2 <- #196 DO (3001) NEXT DO .1 <- ',4SUB#3'$',4SUB#4' (50) DO (200) NEXT (49) DO (1001) NEXT PLEASE FORGET #1 DO ;1SUB#1 <- #29032$#34304 DO ;1SUB#2 <- #36544$#63744 PLEASE ;1SUB#3 <- #8448$#8512 DO ;1SUB#4 <- #12928$#49896 DO ;1SUB#5 <- #47760$#3496 DO ;1SUB#6 <- #12008$#16960 PLEASE ;1SUB#7 <- #29760$#3828 DO ;1SUB#8 <- #8020$#51584 DO ;1SUB#9 <- #54656$#54224 DO ;1SUB#10 <- #29032$#34304 PLEASE ;1SUB#11 <- #36544$#63744 DO ;1SUB#12 <- #8448$#8512 DO ;1SUB#13 <- #12928$#37608 DO ;1SUB#14 <- #6800$#3496 PLEASE ;1SUB#15 <- #31464$#27200 DO ;1SUB#16 <- #63040$#56192 DO ;1SUB#17 <- #43220$#17608 DO ;1SUB#18 <- #33920$#11584 PLEASE ;1SUB#19 <- #40084$#57288 DO ;1SUB#20 <- #12020$#8020 DO ;1SUB#21 <- #47488$#53632 DO ;1SUB#22 <- #59584$#48320 PLEASE ;1SUB#23 <- #52800$#48276 DO ;1SUB#24 <- #34440$#57024 DO ;1SUB#25 <- #14656$#40960 DO ;1SUB#26 <- #44032$#57744 PLEASE ;1SUB#27 <- #3496$#63208 DO ;1SUB#28 <- #34436$#57920 DO ;1SUB#29 <- #64324$#6880 DO ;1SUB#30 <- #8068$#8020 PLEASE ;1SUB#31 <- #51584$#34176 DO ;1SUB#32 <- #52928$#27968 DO ;1SUB#33 <- #7316$#34440 DO ;1SUB#34 <- #60032$#26624 PLEASE ;1SUB#35 <- #53312$#11584 DO ;1SUB#36 <- #51600$#24288 DO ;1SUB#37 <- #38788$#23380 DO ;1SUB#38 <- #10688$#22792 PLEASE ;1SUB#39 <- #54656$#45724 DO ;1SUB#40 <- #58240$#19776 DO ;1SUB#41 <- #6272$#28224 DO ;1SUB#42 <- #14464$#16020 PLEASE ;1SUB#43 <- #4048$#3496 DO ;1SUB#44 <- #54056$#25152 DO ;1SUB#45 <- #45952$#41992 DO ;1SUB#46 <- #28116$#43732 PLEASE ;1SUB#47 <- #39880$#40960 DO ;1SUB#48 <- #59392$#27024 DO ;1SUB#49 <- #3496$#52968 DO ;1SUB#50 <- #41992$#32212 PLEASE ;1SUB#51 <- #42304$#7296 DO ;1SUB#52 <- #20160$#26988 DO ;1SUB#53 <- #6464$#40960 DO ;1SUB#54 <- #59392$#7296 PLEASE ;1SUB#55 <- #65216$#34880 DO ;1SUB#56 <- #37312$#41556 DO ;1SUB#57 <- #34440$#38528 DO ;1SUB#58 <- #30976$#54848 PLEASE ;1SUB#59 <- #27968$#18832 DO ;1SUB#60 <- #3496$#52968 DO ;1SUB#61 <- #41992$#32212 DO ;1SUB#62 <- #42304$#7296 PLEASE ;1SUB#63 <- #16064$#26988 DO ;1SUB#64 <- #6464$#40960 DO ;1SUB#65 <- #59392$#7296 DO ;1SUB#66 <- #65216$#34880 PLEASE ;1SUB#67 <- #37312$#41556 DO ;1SUB#68 <- #34440$#31360 DO ;1SUB#69 <- #32512$#49216 DO ;1SUB#70 <- #27968$#18832 PLEASE ;1SUB#71 <- #3496$#52968 DO ;1SUB#72 <- #41992$#32212 DO ;1SUB#73 <- #42304$#7296 DO ;1SUB#74 <- #65216$#26988 PLEASE ;1SUB#75 <- #6464$#40960 DO ;1SUB#76 <- #59392$#7296 DO ;1SUB#77 <- #65216$#34880 DO ;1SUB#78 <- #37312$#41556 PLEASE ;1SUB#79 <- #34440$#57024 DO ;1SUB#80 <- #26944$#15360 DO ;1SUB#81 <- #58112$#18832 DO ;1SUB#82 <- #3496$#52968 PLEASE ;1SUB#83 <- #41992$#30932 DO ;1SUB#84 <- #47488$#37312 DO ;1SUB#85 <- #41556$#34440 DO ;1SUB#86 <- #57024$#15680 PLEASE ;1SUB#87 <- #46336$#59904 DO ;1SUB#88 <- #57744$#3496 DO ;1SUB#89 <- #31464$#27200 DO ;1SUB#90 <- #63040$#40576 PLEASE ;1SUB#91 <- #6464$#40960 DO ;1SUB#92 <- #44032$#3564 DO ;1SUB#93 <- #31808$#37056 DO ;1SUB#94 <- #17792$#60608 PLEASE ;1SUB#95 <- #26988$#19776 DO ;1SUB#96 <- #48256$#29312 DO ;1SUB#97 <- #21504$#37952 DO ;1SUB#98 <- #39936$#28012 PLEASE ;1SUB#99 <- #6848$#7168 DO ;1SUB#100 <- #20160$#28012 DO ;1SUB#101 <- #49104$#19168 DO ;1SUB#102 <- #49028$#23380 PLEASE ;1SUB#103 <- #58816$#22792 DO ;1SUB#104 <- #54656$#42968 DO ;1SUB#105 <- #58816$#12040 DO ;1SUB#106 <- #46824$#1668 PLEASE ;1SUB#107 <- #57920$#64324 DO .4 <- #428 DO (100) NEXT DO .5 <- '?"!6~.6'~#1"$#1'~#3 DO (80) NEXT DO ;1SUB#1 <- #3496$#52416 DO ;1SUB#2 <- #7168$#6720 PLEASE ;1SUB#3 <- #54548$#36304 DO ;1SUB#4 <- #1108$#20308 DO ;1SUB#5 <- #39296$#54656 DO .4 <- #20 DO (100) NEXT DO .1 <- .6 DO (200) NEXT DO .8 <- #1 PLEASE COME FROM (60) DO ;1SUB#1 <- #3496$#52968 DO ;1SUB#2 <- #41992$#15828 DO .4 <- #8 DO (100) NEXT DO .1 <- .8 DO (220) NEXT DO .1 <- ,4SUB.8 DO (200) NEXT DO .5 <- '?"'#15~"'?.8$.6'~#5"'~#1"$#1'~#3 DO (80) NEXT DO .1 <- .8 DO (1020) NEXT (60) DO .8 <- .1 (80) DO (1001) NEXT (79) PLEASE FORGET #1 DO ;1SUB#1 <- #29032$#34304 DO ;1SUB#2 <- #36544$#13568 PLEASE ;1SUB#3 <- #40128$#13632 DO ;1SUB#4 <- #11624$#3828 DO ;1SUB#5 <- #20032$#35968 DO ;1SUB#6 <- #11520$#24704 PLEASE ;1SUB#7 <- #61032$#6836 DO ;1SUB#8 <- #58240$#19776 DO ;1SUB#9 <- #22656$#9792 DO ;1SUB#10 <- #62912$#52548 PLEASE ;1SUB#11 <- #7904$#17092 DO ;1SUB#12 <- #58240$#19776 DO ;1SUB#13 <- #6592$#55744 DO ;1SUB#14 <- #23872$#1620 PLEASE ;1SUB#15 <- #45520$#8160 DO ;1SUB#16 <- #5508$#8020 DO ;1SUB#17 <- #30080$#54656 DO .4 <- #68 DO (100) NEXT DO .1 <- '"!7$#0'~'#16383$#1'"$#0'~'#32767$#1' DO (200) NEXT DO ;1SUB#1 <- #29032$#34304 DO ;1SUB#2 <- #36544$#26304 PLEASE ;1SUB#3 <- #42624$#43904 DO ;1SUB#4 <- #42984$#2720 DO .4 <- #16 DO (100) NEXT PLEASE GIVE UP (100) PLEASE STASH .1 + .2 + .3 + .5 PLEASE DO ,9 <- .4 DO .1 <- #0 PLEASE COME FROM (101) DO .2 <- .1 DO .3 <- #4 PLEASE COME FROM (103) DO .5 <- '?".1~.3"$#1'~#3 DO .1 <- '?.1$.3'~'#0$#65535' DO (104) NEXT (103) DO .3 <- !3$#0'~'#32767$#1' (104) DO (1001) NEXT PLEASE FORGET #1 DO :1 <- ;1SUB'.1~#65532' DO ,9SUB'".2$#1"~"#65532$#3"' <- :1~'#43690$#0' DO ,9SUB'".2$#2"~"#65532$#3"' <- :1~'#21845$#0' DO ,9SUB'".2$#3"~"#65532$#3"' <- :1~'#0$#43690' DO ,9SUB.1 <- :1~'#0$#21845' DO .5 <- '?"'#65535~"'?.4$.1'~'#0$#65532'"'~#1"$#1'~#3 (101) DO (102) NEXT (102) DO (1001) NEXT PLEASE READ OUT ,9 PLEASE RETRIEVE .1 + .2 + .3 + .5 PLEASE RESUME #2 (200) DO ,3001SUB#1 <- #196 DO (3099) NEXT PLEASE RESUME #1 (220) DO ,3001SUB#1 <- #196 DO (3090) NEXT DO .2 <- #60 DO (3001) NEXT PLEASE READ OUT ,2 DO ,3001SUB#1 <- #196 PLEASE RESUME #1 PLEASE NOTE THE SMALL SUBSET OF THE SYSTEM LIBRARY (1000) DO STASH .1 + .2 + .5 + .6 DO (1004) NEXT (1004) PLEASE FORGET #1 DO .3 <- '?.1$.2'~'#0$#65535' DO .6 <- '&.1$.2'~'#0$#65535' DO .5 <- '?"!6~.6'~#1"$#1'~#3 DO (1003) NEXT DO .1 <- .3 DO .2 <- !6$#0'~'#32767$#1' DO (1004) NEXT (1003) DO (1001) NEXT PLEASE RETRIEVE .1 + .2 + .5 + .6 PLEASE RESUME #2 (1001) DO RESUME .5 (1010) DO STASH .1 + .2 DO .3 <- .1 DO .1 <- '?.2$#65535'~'#0$#65535' DO (1020) NEXT PLEASE DO .2 <- .3 PLEASE DO (1000) NEXT DO RETRIEVE .1 + .2 PLEASE RESUME #1 (1020) DO STASH .2 + .3 DO .2 <- #1 PLEASE DO (1021) NEXT (1021) DO FORGET #1 DO .3 <- "?!1~.2'$#1"~#3 PLEASE DO .1 <- '?.1$.2'~'#0$#65535' DO (1022) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (1021) NEXT (1023) PLEASE RESUME .3 (1022) DO (1023) NEXT PLEASE RETRIEVE .2 + .3 PLEASE RESUME #2 PLEASE USE A SUBSET OF THE AUTHORIZED CHANNELS (2030) DO STASH .1 + .5 DO .3 <- #0 DO .5 <- '?"!2~.2'~#1"$#1'~#3 PLEASE DO (2031) NEXT DO .4 <- #1 PLEASE DO (2033) NEXT (2033) DO FORGET #1 DO .5 <- '?".2~#32768"$#2'~#3 DO (2032) NEXT DO .2 <- !2$#0'~'#32767$#1' PLEASE DO .4 <- !4$#0'~'#32767$#1' DO (2033) NEXT (2032) DO (1001) NEXT (2036) PLEASE FORGET #1 DO .5 <- '?.1$.2'~'#0$#65535' DO .5 <- '?"'&"!2~.5'~'"?'?.5~.5'$#32768"~"#0$#65535"'"$ ".5~.5"'~#1"$#2'~#3 DO (2034) NEXT DO .5 <- .3 DO (1010) NEXT PLEASE DO .1 <- .3 DO .3 <- 'V.4$.5'~'#0$#65535' DO (2035) NEXT (2034) PLEASE DO (1001) NEXT (2035) DO FORGET #1 DO .5 <- "?'.4~#1'$#2"~#3 DO (2031) NEXT DO .2 <- .2~#65534 DO .4 <- .4~#65534 PLEASE DO (2036) NEXT (2031) DO (1001) NEXT PLEASE DO .4 <- .1 PLEASE RETRIEVE .1 + .5 PLEASE RESUME #2 (3000) DO STASH .2 + .3 + .5 DO .2 <- ,3000SUB#1 PLEASE WRITE IN ,3000 DO .1 <- ,3000SUB#1 DO .5 <- '?".1~#256"$#2'~#3 DO (3008) NEXT DO (1000) NEXT DO .1 <- .3~#255 DO ,3000SUB#1 <- .1 DO (3009) NEXT (3008) DO (1001) NEXT (3009) DO RETRIEVE .2 + .3 + .5 PLEASE RESUME #2 (3001) DO STASH .1 + .3 DO .1 <- ,3001SUB#1 DO (1010) NEXT DO ,3001SUB#1 <- .3~#255 PLEASE READ OUT ,3001 DO ,3001SUB#1 <- .2 DO .1 <- .2 DO RETRIEVE .1 + .3 PLEASE RESUME #1 (3090) PLEASE ABSTAIN FROM (3097) (3099) PLEASE STASH .1 + .2 + .3 + .4 DO .2 <- #256 PLEASE STASH .2 DO (3091) NEXT DO (3095) NEXT DO .2 <- #80 (3097) DO (3001) NEXT PLEASE REINSTATE (3097) PLEASE RETRIEVE .1 + .2 + .3 + .4 PLEASE RESUME #1 (3098) PLEASE RESUME '?"!1~.1'~#1"$#2'~#3 (3091) DO COME FROM (3092) DO .2 <- #10 DO (2030) NEXT DO .2 <- .4 PLEASE STASH .2 DO .1 <- .3 (3092) DO (3098) NEXT (3095) DO COME FROM (3094) PLEASE RETRIEVE .2 DO (3093) NEXT DO .2 <- .2$#3 DO .2 <- !2~#15'$!2~#240' DO .2 <- !2~#15'$!2~#240' (3094) DO (3001) NEXT (3093) PLEASE RESUME '?".2~#256"$#1'~#3 (3990) PLEASE DO ,3000 <- #1 DO ,3000SUB#1 <- #0 PLEASE DO ,3001 <- #1 DO ,3001SUB#1 <- #0 PLEASE RESUME #1 intercal-0.30/pit/PaxHeaders.27456/hail_mary.doc0000644000000000000000000000007411437550756016253 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/hail_mary.doc0000644000175000017500000000341411437550756016150 0ustar00esresr00000000000000 From: cornet@OTech.fgg.EUR.nl (Jan-Pieter Cornet) Newsgroups: alt.folklore.computers,alt.lang.intercal Subject: Re: 90% Cobol?!? Date: 30 Sep 1994 12:03:23 +0100 Organization: Education Technology, Erasmus University, Rotterdam, The Netherlands Message-ID: <36gr9r$k4i@gaia.otech.fgg.eur.nl> [note -- alt.lang.intercal added to newsgroups line. rec.humor removed. no longer necessary, the added group is also a humor group :] In article <36evl6$e3m@fenris.hiof.no>, Gunnar Horrigmo wrote: >Once upon a time Adam Felson scribbled: >>>Forgive me father for I have programmed in COBOL. >>>>You are forgiven. Go now and sin no more. >>>Thank you father. Whats that? 1,000,000 Hail Mary's? >>>[COBOL 1,000,000 Hail-Mary's removed] >>FORTH: > >>: 1,000,000_hail_mary's @ special characters in word defined >> 1000 0 DO @ FORTH usually has a 16bit data stack >> 1000 0 DO >> hail-mary! >> LOOP >> LOOP >>; > >Ok. I'll have a go at ML, since I'm trying to learn that anyway... > > function Hail_Mary (int i) > if i < 1000000 then Hail_Mary(i+1) > >Probably way off, but I've just started, so please correct me. Fine. You've asked for it, you'll get it. Here it is, 1,000,000 Hail-Mary's in TriIntercal, which is of course a much better language for this than ML. BTW, there appears to be an anomaly in READING OUT tail variables, since the READ OUT does a bit reversal instead of (as one might expect in TriIntercal) a trit reversal. Helpful hint: before you run this through ick, change the loop constants to something sensible. Finding the loop constants is left as an exercise to the reader :) Helpful hint 2: This would not very likely be a winning ICICC entry :) [program moved to separate file] Have fun, -- Jan-Pieter Cornet intercal-0.30/pit/PaxHeaders.27456/tpk.i0000644000000000000000000000007411474464644014570 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.574945729 intercal-0.30/pit/tpk.i0000644000175000017500000003220111474464644014461 0ustar00esresr00000000000000 PLEASE ABSTAIN FROM (29733) (29733) DON KNUTH'S IMPLEMENTATION OF TPK IN INTERCAL (C) MARCH 2003, NOVEMBER 2010 REFERENCE --- THE EARLY HISTORY OF PROGRAMMING LANGUAGES, BY D E KNUTH AND L TRABB PARDO NOTA BENE: THE INPUT AND OUTPUT DATA ARE SCALED DECIMAL NUMBERS WITH SIX DIGITS TO THE RIGHT OF THE DECIMAL POINT; THUS AN INPUT OF THREE ONE FOUR ONE FIVE NINE THREE DENOTES 3.141593, AND THAT VALUE WOULD BE OUTPUT AS ______ MMMCXLMDXCIII PLEASE NOTICE THAT VARIABLE NAMES AND SUBROUTINE NAMES USE THE 5-BIT TELEPRINTER CODE IN LETTER-SHIFT MODE, NAMELY / E @ A : S I U 1/4 D R J N F C K T Z L W H Y P Q O B G " M X V $ (WHICH ALAN TURING ADVISED EVERY PROGRAMMER TO LEARN) PLEASE (6534) NEXT DO ;29 <- #2 DO ;3 <- #11 BY #2 PLEASE DO .6 <- #0 DO (1) NEXT (1) PLEASE DO FORGET #1 DO WRITE IN :1 DO (22919) NEXT PLEASE .1 <- .6 PLEASE DO (1020) NEXT DO .11 <- .1 DO ;3 SUB .11 #1 <- ;1 SUB #1 DO ;3 SUB .11 #2 <- ;1 SUB #2 DO .1 <- #10 DO (29904) NEXT DO (1) NEXT DO REINSTATE NEXTING PLEASE DO (2) NEXT (2) DO FORGET #1 DO .984 <- #0 PLEASE .1 <- .6 PLEASE DO (1020) NEXT DO .11 <- .1 DO ;29 SUB #1 <- ;3 SUB .11 #1 DO ;29 SUB #2 <- ;3 SUB .11 #2 PLEASE DO (13) NEXT DO (15478) NEXT DO (15320) NEXT DO :2 <- #6528$#32544 PLEASE DO (23438) NEXT DO :1 <- #31640$#20792 DO REMEMBER :1 DO READ OUT .6 + :1 DO .1 <- #0 DO ABSTAIN FROM (711) PLEASE DO (29904) NEXT DO (2) NEXT DO GIVE UP PLEASE USE THE FOLLOWING FUNCTION, WHICH SETS ;1 <- F(;X) WHERE ;29 AND ;1 ARE EXTENDED FIXED-POINT NUMBERS (THAT IS, THEY ARE VECTORS WITH TWO COMPONENTS, #1=INTEGER PART, #2=FRACTION PART) (13) DO STASH ;2 DO ;1 SUB #1 <- ;29 SUB #1 DO ;1 SUB #2 <- ;29 SUB #2 PLEASE STASH ;1 PLEASE DO ;2 SUB #1 <- ;29 SUB #1 DO ;2 SUB #2 <- ;29 SUB #2 DO (30300) NEXT DO (30300) NEXT DO ;2 SUB #1 <- #5 DO ;2 SUB #2 <- #0 PLEASE DO (30300) NEXT PLEASE DO ;2 SUB #1 <- ;1 SUB #1 DO ;2 SUB #2 <- ;1 SUB #2 PLEASE RETRIEVE ;1 DO (30499) NEXT PLEASE DO (30218) NEXT DO (29987) NEXT DO RETRIEVE ;2 PLEASE RESUME #1 DO NOTHING BUT BASIC SUBROUTINES FROM HERE ON ------------- FIRST THERE ARE ROUTINES FOR EXTENDED ARITHMETIC (DOUBLE-DOUBLE PRECISION), WHICH CONSISTS OF TWO 32-BIT NUMBERS WITH A BINARY POINT BETWEEN THEM TO GET STARTED, DO (INI) FIRST; IT DEFINES BASIC ARRAYS (6534) DO ;1 <- #3 DO ;2 <- #2 PLEASE RESUME #1 DON'T FORGET TO TEST FOR OVERFLOW AFTER A SERIES OF EXTENDED ARITHMETIC OPERATIONS: THE (OVC) ROUTINE SETS :1 TO THE MAX VALUE IF .OV IS 1 ... SO YOU'D BETTER SET .OV TO 0 PERIODICALLY (15320) PLEASE DO (2000) NEXT DO :1 <- #65535$#65535 PLEASE RESUME #1 (2000) PLEASE DO (2001) NEXT PLEASE RESUME #2 (2001) DO RESUME '?.984$#1'~#3 DOING (ADY) NEXT SETS ;1 <- ;1+;2+.C~2 AND .C <- CARRY+1 DOING (ADZ) NEXT SETS ;1 <- ;1+;2 AND .C <- CARRY+1 (17699) PLEASE .14 <- #1 (21795) DO STASH :1 + :2 + :3 + :4 DO :1 <- ;1 SUB #2 PLEASE DO :2 <- .14~#2 PLEASE DO (1509) NEXT DO .14 <- :4~#2 DO :1 <- :3 PLEASE DO :2 <- ;2 SUB #2 DO (1509) NEXT DO ;1 SUB #2 <- :3 DO :1 <- ;1 SUB #1 DO :2 <- "V.14$':4~#2'"~#1 DO (1509) NEXT DO .14 <- :4 DO :1 <- :3 DO :2 <- ;2 SUB #1 DO (1509) NEXT DO ;1 SUB #1 <- :3 DO .14 <- '?:4$.14'~#6 PLEASE RETRIEVE :1 + :2 + :3 + :4 PLEASE RESUME #1 DOING (ADX) NEXT SETS ;1 <- ;1+;2 AND TRACKS OVERFLOW DOING (ABX) NEXT SETS ;1 <- ABS(;1) (29987) PLEASE STASH .14 DO (17699) NEXT DO .984 <- "V.984$!14~#2'"~#1 PLEASE RETRIEVE .14 (30499) DO RESUME #1 DOING (SUX) NEXT SETS ;1 <- ;1-;2 AND TRACKS OVERFLOW (29925) PLEASE STASH ;2 + .14 DO ;2 SUB #1 <- '"?'";2 SUB #1"~"#65535$#0"'$#65535"~"#0$#65535"'$ '"?'";2 SUB #1"~"#0$#65535"'$#65535"~"#0$#65535"' DO ;2 SUB #2 <- '"?'";2 SUB #2"~"#65535$#0"'$#65535"~"#0$#65535"'$ '"?'";2 SUB #2"~"#0$#65535"'$#65535"~"#0$#65535"' DO .14 <- #2 DO (21795) NEXT PLEASE DO .984 <- "V.984$!14~#1'"~#1 PLEASE RETRIEVE ;2 + .14 DO RESUME #1 DOING (SHY) NEXT SETS ;2 <- :3 * 2^16 AND CLOBBERS :3 (22149) DO ;2 SUB #1 <- :3 ~ '#65280$#65280' DO :3 <- '"':3~#43690'$#0"~"#65535$#1"' $ '"':3~#21845'$#0"~"#65535$#1"' PLEASE :3 <- ":3~'#511$#1'" $ ":3~'#1$#511'" PLEASE :3 <- ":3~'#1023$#3'" $ ":3~'#3$#1023'" DO ;2 SUB #2 <- ":3~'#4095$#15'" $ ":3~'#15$#4095'" PLEASE RESUME #1 DOING (MLY) NEXT SETS ;1 <- :1 * :2 / 2^32 (22108) PLEASE STASH :1 + :2 + :3 + ;2 + .14 DO :1 <- :1 ~ #65535 DO :2 <- :2 ~ #65535 DO (1540) NEXT DO ;1 SUB #2 <- :3 DO ;1 SUB #1 <- #0 PLEASE RETRIEVE :1 PLEASE STASH :1 DO :1 <- :1 ~ '#65280$#65280' DO (1540) NEXT DO (22149) NEXT DO (17699) NEXT PLEASE RETRIEVE :1 + :2 PLEASE STASH :1 + :2 DO :1 <- :1 ~ #65535 DO :2 <- :2 ~ '#65280$#65280' DO (1540) NEXT DO (22149) NEXT DO (17699) NEXT PLEASE RETRIEVE :1 PLEASE STASH :1 DO :1 <- :1 ~ '#65280$#65280' DO (1540) NEXT DO ;2 SUB #2 <- #0 DO ;2 SUB #1 <- :3 DO (17699) NEXT PLEASE RETRIEVE :1 + :2 + :3 + ;2 + .14 PLEASE RESUME #1 DOING (MLZ) NEXT SETS ;1 <- ;1 + (:1 * :2 / 2^32), TRACKING OVERFLOW (18012) PLEASE STASH ;1 + ;2 DO (22108) NEXT PLEASE ;2 SUB #1 <- ;1 SUB #1 PLEASE ;2 SUB #2 <- ;1 SUB #2 PLEASE RETRIEVE ;1 DO (29987) NEXT PLEASE RETRIEVE ;2 PLEASE RESUME #1 DOING (MLX) NEXT SETS ;1 <- ;1*;2 AND TRACKS OVERFLOW (30300) PLEASE STASH :1 + :2 + :3 + :4 + ;1 + ;2 DO :1 <- ;1 SUB #2 DO :2 <- ;2 SUB #2 DO (22108) NEXT DO :1 <- ;1 SUB #1 DO :2 <- ';1 SUB #2' ~ '#32768$#0' DO (1500) NEXT PLEASE RETRIEVE ;1 DO :4 <- ;1 SUB #2 DO :1 <- ;1 SUB #1 DO :2 <- ;2 SUB #1 DO (22108) NEXT PLEASE DO .984 <- "V.984$' "';1 SUB #1'~';1 SUB #1'" ~#1'" ~ #1 DO ;1 SUB #1 <- ;1 SUB #2 DO ;1 SUB #2 <- :3 DO :2 <- ;2 SUB #2 DO (18012) NEXT DO :1 <- :4 DO :2 <- ;2 SUB #1 DO (18012) NEXT PLEASE RETRIEVE :1 + :2 + :3 + :4 + ;2 PLEASE RESUME #1 DOING (RTX) NEXT SETS ;1 <- SQRT(;1) (30218) PLEASE STASH .6 + ;2 + ;3 + ;4 + :1 + :2 + .1 + .2 + .3 + .14 + .984 DO ;4 <- #2 DO ;3 <- #2 DO .6 <- #1 DO ;3 SUB #1 <- #0 DO ;3 SUB #2 <- #0 DO ;4 SUB #1 <- #65535$#65535 DO ;4 SUB #2 <- ;4 SUB #1 DO :1 <- ;1 SUB #1 DO :2 <- ;1 SUB #2 PLEASE (2003) NEXT (2002) DO ;2 SUB #1 <- ;1 SUB #1 DO ;2 SUB #2 <- ;1 SUB #2 DO (17699) NEXT DO ;2 SUB #1 <- ;1 SUB #1 DO ;2 SUB #2 <- ;1 SUB #2 DO (17699) NEXT PLEASE DO ;2 SUB #1 <- #0 PLEASE DO ;2 SUB #2 <- .2 DO (17699) NEXT PLEASE DO ;2 SUB #2 <- .3 DO (29925) NEXT PLEASE DO ;3 SUB #1 <- ;1 SUB #1 PLEASE DO ;3 SUB #2 <- ;1 SUB #2 PLEASE DO ;1 SUB #1 <- ;4 SUB #1 PLEASE DO ;1 SUB #2 <- ;4 SUB #2 DO ;2 SUB #1 <- ;1 SUB #1 DO ;2 SUB #2 <- ;1 SUB #2 DO (17699) NEXT DO ;2 SUB #1 <- #0 PLEASE DO ;2 SUB #2 <- "?#1$.3"~#1 DO (17699) NEXT PLEASE DO ;4 SUB #1 <- ;1 SUB #1 PLEASE DO ;4 SUB #2 <- ;1 SUB #2 DO .1 <- ":1 ~ '#21845$#0'" $ '"?':1~"#10922$#1"' $ '"?':1~#1'$':2~"#32768$#0"'"~#1'" ~#21845' DO .2 <- ":1 ~ '#0$#21845'" $ '"?':1~"#0$#10923"' $ '"?':1~#1'$':2~"#0$#32768"'"~#1'" ~#21845' DO :1 <- .1 $ .2 DO .1 <- ":2 ~ '#21845$#0'" $ '"&':2~"#10922$#1"' $ #65534" ~ #21845' DO .2 <- ":2 ~ '#0$#21845'" $ '"&':2~"#0$#10923"' $ #65534" ~ #21845' DO :2 <- .1 $ .2 (2003) DO .2 <- :1 ~ '#32768$#32768' DO ;1 SUB #1 <- ;3 SUB #1 DO ;1 SUB #2 <- ;3 SUB #2 DO ;2 SUB #1 <- ;4 SUB #1 DO ;2 SUB #2 <- ;4 SUB #2 DO .14 <- #2 DO (21795) NEXT DO .3 <- ' " '"';1 SUB #1'~';1 SUB #1'"~#1' $ '"';1 SUB #2'~';1 SUB #2'"~#1' " $ .2' ~ #15 DO .3 <- '&"!3~.3'~#1" $ .14' ~ #2 PLEASE DO (2004) NEXT DO ;1 SUB #1 <- ;3 SUB #1 DO ;1 SUB #2 <- ;3 SUB #2 DO (2005) NEXT (2004) DO (2006) NEXT (2005) PLEASE FORGET #1 PLEASE DO .1 <- #49 DO (29904) NEXT DO (2002) NEXT PLEASE REINSTATE NEXTING DO ;2 SUB #1 <- ;4 SUB #1 DO ;2 SUB #2 <- ;4 SUB #2 DO ;1 SUB #1 <- #0 DO ;1 SUB #2 <- #0 DO (29925) NEXT DO ;2 SUB #1 <- #0 DO ;2 SUB #2 <- "?.3$#1"~#1 DO (29925) NEXT PLEASE RETRIEVE .6 + ;2 + ;3 + ;4 + :1 + :2 + .1 + .2 + .3 + .14 + .984 PLEASE RESUME #50 (2006) PLEASE RESUME "?.3$#2"~#3 DOING (UNP) NEXT SETS ;1 <- :1 / 1000000 (WHICH IS ESSENTIALLY DECIMAL TO BINARY CONVERSION) (22919) PLEASE STASH :1 + :2 + :3 + :4 + .3 DO :2 <- #784 $ #904 PLEASE DO (1550) NEXT PLEASE DO ;1 SUB #1 <- :3 DO :1 <- :3 DO (1540) NEXT DO RETRIEVE :1 PLEASE STASH :1 DO :2 <- :3 PLEASE DO (1510) NEXT PLEASE DO :4 <- #32768 $ #0 DO ;2 SUB #1 <- #0 DO ;2 SUB #2 <- #0 DO :1 <- :3 PLEASE DO (2008) NEXT (2007) DON'T RESUME #1 DO :1 <- ;1 SUB #2 DO .3 <- :4~#1 DO (2009) NEXT DO :4 <- :4~'#65535$#65534' (2008) DO :2 <- :1 PLEASE DO (1500) NEXT DO :1 <- :3 DO ;1 SUB #2 <- :3 DO :2 <- #48576 PLEASE DO (1500) NEXT DO .3 <- :3~'#0$#1024' DO ;1 SUB '"?.3$#2"~#6' <- ':3~"#65535$#0"' $ '"&'":3~'#0$#65535'"$#64511'" ~ "#0$#65535"' DO :2 <- ;2 SUB '"?.3$#1"~#3' DO :2 <- "'V":2~'#65535$#0'"$":4~'#65535$#0'"' ~ '#0$#65535'" $ "'V":2~'#0$#65535'"$":4~'#0$#65535'"' ~ '#0$#65535'" PLEASE DO ;2 SUB '"?.3$#1"~#3' <- :2 PLEASE DO (2007) NEXT DO ;1 SUB #2 <- ;2 SUB #2 PLEASE ABSTAIN FROM (2007) PLEASE RETRIEVE :1 + :2 + :3 + :4 + .3 PLEASE RESUME #34 (2009) PLEASE DO (2006) NEXT DO REINSTATE (2007) PLEASE FORGET #2 DO (2008) NEXT DOING (PAK) NEXT SETS :1 <- 1000000 * ;1, TRACKING OVERFLOW (WHICH IS ESSENTIALLY BINARY TO DECIMAL CONVERSION) (15478) PLEASE STASH ;1 + ;2 + :2 + :3 + :4 DO ;2 SUB #1 <- #784 $ #904 DO ;2 SUB #2 <- #0 DO (30300) NEXT DO :1 <- ;1 SUB #1 DO :2 <- ';1 SUB #2' ~ '#32768$#0' DO (1509) NEXT DO .984 <- "V.984$':4~#2'"~#1 PLEASE RETRIEVE ;1 + ;2 + :2 + :3 + :4 PLEASE RESUME #1 DON'T STOP READING YET: TWO IMPORTANT UTILITY ROUTINES REMAIN ---------- UTILITIES ---------------------------------------- DOING (CMP) NEXT IMMOBILIZES :1 IF :1 < :2 HERE I USE A SLICK TRICK FROM THE ORIGINAL INTERCAL DIVISION ROUTINE (23438) PLEASE STASH .3 + :1 DO :1 <- ' "? ':1~"#65535$#0"' $ ':2~"#65535$#0"' " ~ "#0$#65535"' $ ' "? ':1~"#0$#65535"' $ ':2~"#0$#65535"' " ~ "#0$#65535"' DO .3 <- ':2~:1' ~ " ' "? '"?:1~:1"~"#65535$#0"' $ #32768"~"#0$#65535" ' $ '"?:1~:1"~"#0$#65535"' " PLEASE RETRIEVE :1 DO (2010) NEXT DO (2011) NEXT (2010) DO (2006) NEXT PLEASE IGNORE :1 (2011) DO RETRIEVE .3 DO RESUME #2 DOING (TIX) NEXT IS INTENDED TO SIMPLIFY LOOPS ON THE VARIABLE .I IF .I = .1, NEXTING IS TURNED OFF OTHERWISE .I IS INCREASED BY +1 OR -1, WHERE THE INCREMENT IS -1 IF (UP) HAS JUST BEEN ABSTAINED FROM (29904) PLEASE STASH .1 + .2 + .3 + .4 DO .3 <- "'"?.6$.1"~#21845' ~ '"?.6$.1"~#21845'" ~ #1 DO (2012) NEXT PLEASE ABSTAIN FROM NEXTING PLEASE RETRIEVE .1 + .2 + .3 + .4 PLEASE RESUME #1 (2012) DO (2006) NEXT DO .1 <- .6 (711) DO (2013) NEXT PLEASE REINSTATE (711) DO .2 <- #1 DO (1010) NEXT DO .6 <- .3 DO (2014) NEXT (2013) DO (1020) NEXT DO .6 <- .1 (2014) PLEASE RETRIEVE .1 + .2 + .3 + .4 DO RESUME #3 PLEASE NOTIFY THE AUTHOR IF YOU'VE BEEN ABLE TO UNDERSTAND ALL OF THIS; BUT PLEASE DON'T SEND EMAIL FINAL PUZZLE: WHAT IS SO INTERESTING ABOUT 885205232? intercal-0.30/pit/PaxHeaders.27456/unlambda.i0000644000000000000000000000007411437550756015554 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.574945729 intercal-0.30/pit/unlambda.i0000644000175000017500000006556711437550756015472 0ustar00esresr00000000000000 PLEASE NOTE Copyright (C) 2001 Ørjan Johansen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. PLEASE .200 <- #8 PLEASE NOTE AMOUNT OF INITIAL MEMORY PLEASE .80 <- #80 PLEASE NOTE END-OF-LINE CHARACTER DO (100) NEXT PLEASE NOTE IO SETUP DO (200) NEXT PLEASE NOTE MEMORY SETUP DO (300) NEXT PLEASE NOTE REFERENCE COUNTING SETUP DO (400) NEXT PLEASE NOTE PARSER TABLE SETUP DO (401) NEXT PLEASE NOTE PARSING DON'T (404) NEXT PLEASE NOTE PRINTING PROGRAM DO (501) NEXT PLEASE NOTE EVALUATION DON'T (404) NEXT PLEASE NOTE PRINTING RESULT DON'T (203) NEXT PLEASE NOTE MEMORY MAP PLEASE GIVE UP PLEASE NOTE DIPLOMATIC RELATIONS PLEASE NOTE .101=LAST READ .102=LAST WRITTEN (100) DO ,101 <- #1 PLEASE DO .101 <- #0 DO .102 <- #0 DO RESUME #1 PLEASE READ ME A STORY (101) DO (3101) NEXT DO .101 <- .1 PLEASE REINSTATE (3101) DO RESUME #1 (3101) DON'T THINK YOU CAN HAVE YOUR CAKE AND EAT IT DO WRITE IN ,101 PLEASE .1 <- ,101SUB#1 DO .2 <- .101 DO (1000) NEXT PLEASE DO .101 <- .3~#255 PLEASE RESUME '?.1$#512'~'#256$#256' (102) DO .2 <- !2~#15'$!2~#240' DO .2 <- !2~#15'$!2~#240' DO .2 <- !2~#15'$!2~#240' PLEASE RESUME #1 (103) PLEASE .1 <- .102 DO .102 <- .2 DO (1010) NEXT DO ,101SUB#1 <- .3 PLEASE READ OUT ,101 DO RESUME #1 DO ASSERT TERRITORIAL CLAIMS (200) DO .204 <- #7 DO ,201 <- .200 BY #32767 BY .204 (3200) PLEASE DO .201 <- #0 DO .202 <- #16383 PLEASE RESUME #1 PLEASE LET THEM EAT CAKE PLEASE NOTE .201+.202=MEMORY TOP (201) DO (3201) NEXT (5201) DON'T (202) NEXT DO COME FROM (7202) PLEASE .1 <- .201 DO (4201) NEXT PLEASE REINSTATE (5201) DO RESUME #1 (4201) DO (1020) NEXT DO FORGET '#65535~"'?.1$.200'~'#0$#65535'"'~#1 DO .201 <- .1 PLEASE RESUME #1 DON'T STEP ON THE GALOIS FIELD MINES (3201) DO .202 <- "?.202$!202~#16384'"~'#16383$#1' PLEASE RESUME "?!202~.202'$#32768"~"#16384$#16384" PLEASE STAND BY FOR ASSIMILATION (202) PLEASE DON'T RESUME #3 DO REINSTATE (202) DO FORGET #1 PLEASE STASH .203+,202 DO .203 <- '.200$#0'~'#65535$#1' DON'T TELL ME WE HAVE TO MOVE IT ALL? DO ,202 <- .200 BY #32767 BY .204 DO (3200) NEXT DO ABSTAIN FROM (5201) PLEASE DO (3202) NEXT DO ,201 <- .203 BY #32767 BY .204 DO (3200) NEXT PLEASE ABSTAIN FROM (5201) PLEASE DO (5202) NEXT DO .200 <- .203 DO ABSTAIN FROM (5201) DO ABSTAIN FROM (202) (7202) DO RETRIEVE .203+,202 (9202) DO RESUME '?#32768$.203'~'#16384$#32768' (3202) DO COME FROM (4202) PLEASE DO (201) NEXT DO ,202SUB.201.202#1 <- ,201SUB.201.202#1 DO ,202SUB.201.202#2 <- ,201SUB.201.202#2 DO ,202SUB.201.202#3 <- ,201SUB.201.202#3 DO ,202SUB.201.202#4 <- ,201SUB.201.202#4 DO ,202SUB.201.202#5 <- ,201SUB.201.202#5 DO ,202SUB.201.202#6 <- ,201SUB.201.202#6 (4202) DO ,202SUB.201.202#7 <- ,201SUB.201.202#7 (5202) DO COME FROM (6202) PLEASE DO (201) NEXT DO ,201SUB.201.202#1 <- ,202SUB.201.202#1 DO ,201SUB.201.202#2 <- ,202SUB.201.202#2 DO ,201SUB.201.202#3 <- ,202SUB.201.202#3 DO ,201SUB.201.202#4 <- ,202SUB.201.202#4 DO ,201SUB.201.202#5 <- ,202SUB.201.202#5 DO ,201SUB.201.202#6 <- ,202SUB.201.202#6 (6202) DO ,201SUB.201.202#7 <- ,202SUB.201.202#7 DO TELL ME ALL ABOUT YOURSELF (203) DO READ OUT .201+.202+.301+.302+.311+.312 DO (3200) NEXT PLEASE REINSTATE (202) DO ABSTAIN FROM (5201) DO (3203) NEXT PLEASE GIVE UP PLEASE COME FROM (4203) (3203) DO (201) NEXT DO READ OUT .201+.202 DO READ OUT ,201SUB.201.202#1 DO READ OUT ,201SUB.201.202#2 DO READ OUT ,201SUB.201.202#3 DO READ OUT ,201SUB.201.202#4 DO READ OUT ,201SUB.201.202#5 DO READ OUT ,201SUB.201.202#6 (4203) DO READ OUT ,201SUB.201.202#7 PLEASE NOTE #1+#2=REFERENCE COUNT #3+#4=CAR #5+#6=CDR #7=TYPE (TAG$DATA) PLEASE WELCOME TO THE BAZAAR (300) PLEASE DO .301 <- #0 DO .302 <- #0 PLEASE NOTE NIL=.303+.304 DO (303) NEXT DO ,201SUB.311.312#1 <- #0 PLEASE ,201SUB.311.312#2 <- #0 DO ,201SUB.311.312#3 <- .311 DO ,201SUB.311.312#4 <- .312 DO ,201SUB.311.312#5 <- .311 DO ,201SUB.311.312#6 <- .312 DO ,201SUB.311.312#7 <- #0 PLEASE .303 <- .311 DO .304 <- .312 DO RESUME #1 PLEASE REPORT NEW PURCHASES HERE (301) PLEASE .1 <- ,201SUB.311.312#2 DO .1 <- "?.1$!1~#16384'"~'#16383$#1' DO ,201SUB.311.312#2 <- .1 DO (3301) NEXT PLEASE .1 <- ,201SUB.311.312#1 DO .1 <- "?.1$!1~#16384'"~'#16383$#1' DO ,201SUB.311.312#1 <- .1 DO (3301) NEXT PLEASE NOTE THAT IMMORTALITY IS TREASON DO ,201SUB.311.312#2 <- #0 DO RESUME #1 (3301) PLEASE RESUME "?!1~.1'$#32768"~"#16384$#16384" PLEASE STAND IN LINE FOR TERMINATION DO COME FROM (4302) (302) PLEASE .1 <- ,201SUB.311.312#2 DO .1 <- "?#0$'"?.1$!1~#2'"~"#0$#65535"'"~'#49151$#0' DO ,201SUB.311.312#2 <- .1 DO (3302) NEXT PLEASE .1 <- ,201SUB.311.312#1 DO .1 <- "?#0$'"?.1$!1~#2'"~"#0$#65535"'"~'#49151$#0' DO ,201SUB.311.312#1 <- .1 DO (3302) NEXT PLEASE .1 <- .311 DO .2 <- .312 DO .311 <- ,201SUB.1.2#3 DO .312 <- ,201SUB.1.2#4 DO ,201SUB.1.2#3 <- .301 DO ,201SUB.1.2#4 <- .302 PLEASE .301 <- .1 (4302) DO .302 <- .2 (3302) PLEASE RESUME "?'#65535~"'?.1$#16383'~'#0$#65535'"'$#1"~#3 PLEASE LET ME INTRODUCE YOU TO .311+.312 (303) PLEASE (3303) NEXT DO .1 <- .301 DO .2 <- .302 DO .301 <- ,201SUB.1.2#3 DO .302 <- ,201SUB.1.2#4 PLEASE STASH .1+.2 DO .311 <- ,201SUB.1.2#5 DO .312 <- ,201SUB.1.2#6 DO (302) NEXT PLEASE RETRIEVE .1+.2 DO .311 <- .1 DO .312 <- .2 DO (5303) NEXT (3303) PLEASE DO (4303) NEXT DO (201) NEXT DO .311 <- .201 DO .312 <- .202 (5303) DO ,201SUB.311.312#1 <- #32767 PLEASE ,201SUB.311.312#2 <- #32767 DO ,201SUB.311.312#3 <- #0 DO ,201SUB.311.312#5 <- #0 PLEASE RESUME #2 (4303) DO RESUME "?!301~.301'$#1"~#3 (304) PLEASE (303) NEXT DO ,201SUB.311.312#5 <- .303 DO ,201SUB.311.312#6 <- .304 DO RESUME #1 (305) PLEASE (304) NEXT DO ,201SUB.311.312#3 <- .303 DO ,201SUB.311.312#4 <- .304 DO RESUME #1 PLEASE NOTE `=#1 K=#2 K1=#3 S=#4 S1=#5 S2=#6 I=#7 V=#8 C=#9 CONT=#10 D=#11 D1=#12 .=#13 E=#14 @=#15 ?=#16 |=#17 (R=#18=#13$.80) (3400) PLEASE STASH .1 PLEASE (305) NEXT PLEASE RETRIEVE .1 DO ,201SUB.311.312#2 <- #0 DO ,201SUB.311.312#7 <- .1$#0 DO ,401SUB.1 <- .311 DO ,402SUB.1 <- .312 DO RESUME #1 (400) PLEASE ,401 <- #18 DO ,402 <- #18 DO .1 <- #2 DO (3400) NEXT DO .1 <- #4 DO (3400) NEXT DO .1 <- #7 DO (3400) NEXT DO .1 <- #8 DO (3400) NEXT DO .1 <- #9 DO (3400) NEXT DO .1 <- #11 DO (3400) NEXT DO .1 <- #14 DO (3400) NEXT DO .1 <- #15 DO (3400) NEXT DO .1 <- #17 DO (3400) NEXT DO .1 <- #18 DO (3400) NEXT PLEASE ,201SUB.311.312#7 <- #13$.80 PLEASE NOTE 7=ILLEGAL 6=BLANK 5=COMMENT 4=PRIMITIVE 3=KRAPS 2=WHAT 1=SPOT (410) PLEASE ,400 <- #127 PLEASE .1 <- #127 PLEASE (3410) NEXT DO ,400SUB#8 <- #6 $ #0 DO ,400SUB#10 <- #6 $ #0 DO ,400SUB#13 <- #6 $ #0 DO ,400SUB#32 <- #6 $ #0 DO ,400SUB#35 <- #5 $ #0 DO ,400SUB#46 <- #1 $ #13 DO ,400SUB#63 <- #2 $ #16 DO ,400SUB#64 <- #4 $ #15 DO ,400SUB#67 <- #4 $ #9 DO ,400SUB#68 <- #4 $ #11 DO ,400SUB#69 <- #4 $ #14 DO ,400SUB#73 <- #4 $ #7 DO ,400SUB#75 <- #4 $ #2 DO ,400SUB#82 <- #4 $ #18 DO ,400SUB#83 <- #4 $ #4 DO ,400SUB#86 <- #4 $ #8 DO ,400SUB#96 <- #3 $ #0 DO ,400SUB#99 <- #4 $ #9 DO ,400SUB#100 <- #4 $ #11 DO ,400SUB#101 <- #4 $ #14 DO ,400SUB#105 <- #4 $ #7 DO ,400SUB#107 <- #4 $ #2 DO ,400SUB#114 <- #4 $ #18 DO ,400SUB#115 <- #4 $ #4 DO ,400SUB#118 <- #4 $ #8 (5410) DO ,400SUB#124 <- #4 $ #17 PLEASE COME FROM (3410) (3410) PLEASE (4410) NEXT (4410) PLEASE ,400SUB.1 <- #7 DO .1 <- "?.1$!1~#64'"~'#63$#1' DO RESUME "?!1~.1'$#64"~"#64$#64" DO COME FROM (5410) PLEASE NOTE KSIVCDE@|=#7 K1,S1,D1=#6 S2=#5 CONT=#4 KRAPS=#3 WHAT=#2 SPOT=#1 (420) PLEASE ,403 <- #17 DO ,403SUB#1 <- #3 $ #6 DO ,403SUB#2 <- #7 $ #210 DO ,403SUB#3 <- #6 $ #210 DO ,403SUB#4 <- #7 $ #202 DO ,403SUB#5 <- #6 $ #202 DO ,403SUB#6 <- #5 $ #202 DO ,403SUB#7 <- #7 $ #146 DO ,403SUB#8 <- #7 $ #106 DO ,403SUB#9 <- #7 $ #194 DO ,403SUB#10 <- #4 $ #0 DO ,403SUB#11 <- #7 $ #34 DO ,403SUB#12 <- #6 $ #34 DO ,403SUB#13 <- #1 $ #116 DO ,403SUB#14 <- #7 $ #162 DO ,403SUB#15 <- #7 $ #2 DO ,403SUB#16 <- #2 $ #252 DO ,403SUB#17 <- #7 $ #62 PLEASE RESUME #1 PLEASE NOTE 3=TOP 2=BOTH 1=LAST (401) DO (305) NEXT DO .401 <- .311 DO .402 <- .312 DO ,201SUB.401.402#7 <- #3 PLEASE (402) NEXT PLEASE ABSTAIN FROM SUCH MEANINGLESS LANGUAGE PLEASE NOTE (AIS) I PATCHED THE NEXT LINE TO AVOID A ONESPOT OVERFLOW BUG BY ADDING ~#65535 (4402) DO RESUME '?'"?!101~#128'$!101~.101'"~#65535'$#2'~#3 (3402) DO (3101) NEXT DOG ATE END OF MY ESSAY DO COME FROM (5402) (402) DO (3402) NEXT PLEASE (4402) NEXT (5402) DO (412) NEXT DON'T COMMENT (412) PLEASE (422) NEXT DO COME FROM (4412) DO (3402) NEXT (4412) PLEASE (3412) NEXT (3412) DO FORGET "?'#255~"'?.101$#10'~'#0$#65535'"'$#1"~#1 DO FORGET "?'#255~"'?.101$#13'~'#0$#65535'"'$#1"~#1 DO RESUME #1 DO YOU THINK _THIS_ IS PRIMITIVE? (422) PLEASE (432) NEXT DO .311 <- ,401SUB!410~"#0$#31"' DO .312 <- ,402SUB!410~"#0$#31"' DO FORGET #1 PLEASE (403) NEXT PLEASE FILL OUT THE APPLICATION FORM (432) PLEASE (442) NEXT DO (305) NEXT DO ,201SUB.311.312#5 <- .401 DO ,201SUB.311.312#6 <- .402 DO ,201SUB.311.312#7 <- #2 PLEASE .401 <- .311 DO .402 <- .312 DO RESUME #3 DO WHAT? (442) PLEASE (452) NEXT DO (3402) NEXT DO (305) NEXT DO ,201SUB.311.312#7 <- !410~"#0$#31"'$.101 DO FORGET #3 PLEASE (403) NEXT DOT OR SPOT, WE'RE ALL CIVILIZED PEOPLE HERE (452) PLEASE (462) NEXT DO (3402) NEXT DO (305) NEXT DO .2 <- .101 PLEASE (102) NEXT DO ,201SUB.311.312#7 <- !410~"#0$#31"'$.2 DO FORGET #4 PLEASE (403) NEXT (462) DO .410 <- ,400SUB.101 DO RESUME .410~'#7$#0' DO YOU KNOW THE TOP MAN FOR THIS OPERATION? DO COME FROM (3423) (403) PLEASE (413) NEXT DO STASH .311+.312 DO .311 <- .401 DO .312 <- .402 PLEASE (302) NEXT DO RETRIEVE .311+.312 DO RESUME #4 PLEASE CAN I HAVE SOME MORE? (413) PLEASE (423) NEXT DO ,201SUB.401.402#3 <- .311 DO ,201SUB.401.402#4 <- .312 DO ,201SUB.401.402#7 <- #1 PLEASE RESUME #3 DOUBLE APPLICATION FORM RECEIVED (423) PLEASE (433) NEXT DO .1 <- ,201SUB.401.402#5 DO .2 <- ,201SUB.401.402#6 DO ,201SUB.401.402#5 <- .311 DO ,201SUB.401.402#6 <- .312 DO ,201SUB.401.402#7 <- #1$#0 DO .311 <- .401 PLEASE .312 <- .402 DO .401 <- .1 DO .402 <- .2 (3423) DO FORGET #2 (433) PLEASE RESUME ,201SUB.401.402#7 DO YOU WANT A REPORT? (404) DO STASH .311+.312 PLEASE (6404) NEXT DO RETRIEVE .311+.312 DO .2 <- .80 DO (103) NEXT DO RESUME #1 (6404) DO .401 <- .303 DO .402 <- .304 DO COME FROM (4404) PLEASE DO (5404) NEXT PLEASE (3404) NEXT DO .311 <- ,201SUB.401.402#3 DO .312 <- ,201SUB.401.402#4 PLEASE STASH .311+.312 DO .1 <- ,201SUB.401.402#5 DO .2 <- ,201SUB.401.402#6 DO ,201SUB.401.402#3 <- .303 DO ,201SUB.401.402#4 <- .304 DO ,201SUB.401.402#5 <- .303 DO ,201SUB.401.402#6 <- .304 DO .311 <- .401 DO .312 <- .402 DO .401 <- .1 DO .402 <- .2 PLEASE DO (302) NEXT (4404) DO RETRIEVE .311+.312 (3404) DO RESUME "?"#65535~',201SUB.401.402#7'"$#2"~#3 DO COME FROM (5404) (5404) PLEASE DO (414) NEXT PLEASE DON'T BRING AUSTRALOPITHECI INTO THE HOUSE (414) PLEASE DO (424) NEXT DO .2 <- .411~'#0$#255' DO (103) NEXT DO RESUME #2 (424) PLEASE DO (434) NEXT DO .2 <- #6 DO (103) NEXT DO .2 <- .411~'#0$#255' DO (103) NEXT PLEASE COME FROM (4434) (3424) DO .1 <- ,201SUB.311.312#3 DO .312 <- ,201SUB.311.312#4 DO .311 <- .1 DO RESUME #2 DOUBLE DOUBLE TOIL AND TROUBLE (434) PLEASE DO (444) NEXT DO .2 <- #6 DO (103) NEXT DO (103) NEXT DO .2 <- .411~'#0$#255' DO (103) NEXT DO COME FROM (3454) (3434) PLEASE STASH .311+.312 PLEASE DO (303) NEXT DO ,201SUB.311.312#5 <- .401 DO ,201SUB.311.312#6 <- .402 DO ,201SUB.311.312#7 <- #1 DO .401 <- .311 DO .402 <- .312 PLEASE RETRIEVE .311+.312 DO ,201SUB.401.402#3 <- ,201SUB.311.312#5 DO ,201SUB.401.402#4 <- ,201SUB.311.312#6 (4434) DO FORGET #1 DO CONTINUATIONS DREAM OF MONADIC SHEEP (444) PLEASE DO (454) NEXT PLEASE DO .2 <- #60 DO (103) NEXT PLEASE DO .2 <- #194 DO (103) NEXT PLEASE DO .2 <- #242 DO (103) NEXT PLEASE DO .2 <- #114 DO (103) NEXT PLEASE DO .2 <- #42 DO (103) NEXT PLEASE DO .2 <- #124 DO (103) NEXT PLEASE RESUME #5 (454) PLEASE DO (464) NEXT PLEASE FORGET #2 DO .2 <- #6 (3454) DO (103) NEXT DON'T LOOK LIKE A QUESTION MARK (464) PLEASE DO (474) NEXT DO .2 <- .411~'#0$#255' DO (103) NEXT PLEASE DO .2 <- .410~'#0$#255' DO (102) NEXT DO (103) NEXT DO RESUME #7 PLEASE CAN YOU SPOT THE DIFFERENCE? (474) PLEASE DO (484) NEXT DO .2 <- .411~'#0$#255' DO .410 <- .410~'#0$#255' DO .411 <- #7$#74 PLEASE DO (3474) NEXT DO (103) NEXT PLEASE DO .2 <- .410 DO (103) NEXT DO RESUME #8 (3474) DO RESUME '"?"#255~'"?.410$.80"~"#0$#65535"'"$#3"$#1'~#11 (484) DO .410 <- ,201SUB.311.312#7 DO .411 <- ,403SUB!410~"#31$#0"' PLEASE RESUME .411~'#7$#0' PLEASE WELCOME TO THE PITS OF EVAL (501) DO .511 <- .311 DO .512 <- .312 PLEASE DO (3501) NEXT DO .311 <- .511 DO .312 <- .512 PLEASE NOTE EVAL2=1 APPLY=2 PLEASE NOTE .601=CURRENT CHARACTER .501+.502=CURRENT CONTINUATION .511+.512=CURRENT EXPRESSION (3501) DO .601 <- #256 DO (304) NEXT DO ,201SUB.311.312#3 <- ,401SUB#14 DO ,201SUB.311.312#4 <- ,402SUB#14 DO ,201SUB.311.312#7 <- #2 DO .501 <- .311 DO .502 <- .312 PLEASE COME FROM (3622) PLEASE COME FROM (7503) (502) DO (3502) NEXT DO (503) NEXT (4502) PLEASE RESUME "?'#15~"',201SUB.511.512#7'~'#30$#0'"'$#1"~#3 DO NOTE KRAPS PLEASE COME FROM (5502) (3502) DO (4502) NEXT PLEASE (303) NEXT DO ,201SUB.311.312#5 <- .501 DO ,201SUB.311.312#6 <- .502 DO ,201SUB.311.312#7 <- #1 DO .501 <- .311 DO .502 <- .312 DO .311 <- ,201SUB.511.512#5 DO .312 <- ,201SUB.511.512#6 PLEASE DO (301) NEXT DO ,201SUB.501.502#3 <- .311 DO ,201SUB.501.502#4 <- .312 DO .311 <- ,201SUB.511.512#3 DO .312 <- ,201SUB.511.512#4 PLEASE DO (301) NEXT PLEASE STASH .311+.312 DO .311 <- .511 DO .312 <- .512 DO (302) NEXT PLEASE RETRIEVE .311+.312 DO .511 <- .311 (5502) DO .512 <- .312 PLEASE NOTE THAT WE ARE CURRENTLY PROCESSING YOUR APPLICATION (503) DO FORGET #1 PLEASE (3503) NEXT DO .311 <- ,201SUB.501.502#3 DO .312 <- ,201SUB.501.502#4 DO (301) NEXT PLEASE STASH .311+.312 DO .311 <- .501 DO .312 <- .502 PLEASE STASH .311+.312 DO .311 <- ,201SUB.501.502#5 DO .312 <- ,201SUB.501.502#6 DO (301) NEXT DO .501 <- .311 DO .502 <- .312 PLEASE RETRIEVE .311+.312 DO (302) NEXT (8503) PLEASE RETRIEVE .311+.312 (4503) PLEASE RESUME ,201SUB.501.502#7 PLEASE STAY WITH US FOR THE SECOND HALF OF THE SHOW (3503) PLEASE (4503) NEXT DO (5503) NEXT DO FORGET #1 DO .311 <- .501 DO .312 <- .502 PLEASE STASH .311+.312 DO .311 <- ,201SUB.501.502#3 DO .312 <- ,201SUB.501.502#4 DO (301) NEXT PLEASE STASH .311+.312 DO .311 <- ,201SUB.501.502#5 DO .312 <- ,201SUB.501.502#6 PLEASE DO (301) NEXT DO STASH .311+.312 DO (304) NEXT DO ,201SUB.311.312#3 <- .511 DO ,201SUB.311.312#4 <- .512 DO ,201SUB.311.312#7 <- #2 DO .501 <- .311 DO .502 <- .312 PLEASE RETRIEVE .311+.312 DO ,201SUB.501.502#5 <- .311 DO ,201SUB.501.502#6 <- .312 PLEASE RETRIEVE .311+.312 DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 (7503) DO (302) NEXT DO D DO DAH (6503) PLEASE RESUME "?'#15~"'?"',201SUB.511.512#7'~'#31$#0'"$#11' ~"#0$#65535""'$#1"~#3 (5503) DO (6503) NEXT DO FORGET #2 DO .311 <- ,201SUB.501.502#3 DO .312 <- ,201SUB.501.502#4 DO (301) NEXT PLEASE STASH .311+.312 DO (304) NEXT DO ,201SUB.311.312#7 <- #12$#0 DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 DO ,201SUB.511.512#3 <- .311 DO ,201SUB.511.512#4 <- .312 DO .311 <- ,201SUB.501.502#5 DO .312 <- ,201SUB.501.502#6 PLEASE DO (301) NEXT DO STASH .311+.312 DO .311 <- .501 DO .312 <- .502 PLEASE DO (302) NEXT DO RETRIEVE .311+.312 DO .501 <- .311 DO .502 <- .312 DO (503) NEXT PLEASE LEARN THE DIFFERENCE BETWEEN APPLYS AND ORANGUTANS PLEASE COME FROM (8503) DO COME FROM (603) (601) PLEASE DO (627) NEXT DO (503) NEXT PLEASE DON'T CLIMB INTO THE PIPES (627) PLEASE DO (626) NEXT DO .311 <- .511 DO .312 <- .512 PLEASE DO (3627) NEXT DO STASH .311+.312 PLEASE DO (305) NEXT DO .2 <- .601 DO (102) NEXT DO ,201SUB.311.312#7 <- #13$.2 DO .511 <- .311 DO .512 <- .312 DO RETRIEVE .311+.312 PLEASE DO (603) NEXT (3627) PLEASE DO (4627) NEXT DO FORGET #1 DO .511 <- ,401SUB#8 DO .512 <- ,402SUB#8 PLEASE DO (603) NEXT (4627) PLEASE RESUME '?.601$#512'~'#256$#256' PLEASE WHAT DID YOU SAY? (626) PLEASE DO (625) NEXT DO .602 <- ',201SUB.311.312#7'~'#0$#255' DO (302) NEXT DO .311 <- .511 DO .312 <- .512 PLEASE DO (3626) NEXT DO FORGET #1 DO .511 <- ,401SUB#7 DO .512 <- ,402SUB#7 PLEASE DO (603) NEXT (3626) PLEASE DO (4626) NEXT DO FORGET #2 DO .511 <- ,401SUB#8 DO .512 <- ,402SUB#8 PLEASE DO (603) NEXT (4626) DO RESUME "?'#255~"'?.601$.602'~'#0$#255'"'$#2"~#3 DON'T FALL INTO THE WHIRLPOOL (625) PLEASE DO (624) NEXT DO .311 <- .511 DO .312 <- .512 DO (3625) NEXT DO FORGET #2 DO .601 <- .101 DO .511 <- ,401SUB#7 DO .512 <- ,402SUB#7 PLEASE DO (603) NEXT (3625) DO (3101) NEXT PLEASE REINSTATE (3101) DO FORGET #3 DO .601 <- #256 DO .511 <- ,401SUB#8 DO .512 <- ,402SUB#8 PLEASE DO (603) NEXT DO YOU THINK THIS IS THE END? (624) PLEASE DO (623) NEXT DO RESUME #5 PLEASE STAY IN ONE SPOT SO I CAN HIT YOU (623) PLEASE DO (622) NEXT DO .2 <- ',201SUB.311.312#7'~'#0$#255' DO (103) NEXT DO (302) NEXT DO RESUME #5 DON'T PROMISE WHAT YOU CAN'T KEEP (622) PLEASE DO (621) NEXT DO FORGET #6 DO STASH .311+.312 PLEASE DO (303) NEXT DO ,201SUB.311.312#3 <- .511 DO ,201SUB.311.312#4 <- .512 DO ,201SUB.311.312#5 <- .501 DO ,201SUB.311.312#6 <- .502 DO ,201SUB.311.312#7 <- #1 DO .501 <- .311 DO .502 <- .312 PLEASE RETRIEVE .311+.312 DO STASH .311+.312 DO .1 <- ,201SUB.311.312#3 DO .312 <- ,201SUB.311.312#4 DO .311 <- .1 DO (301) NEXT DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 (3622) DO (302) NEXT DO EXPECT SOME DELAY (621) PLEASE DO (620) NEXT DO RESUME #7 PLEASE CONTINUE, NOTHING TO SEE HERE... (620) PLEASE DO (619) NEXT DO STASH .311+.312 DO .311 <- .501 DO .312 <- .502 DO (302) NEXT PLEASE RETRIEVE .311+.312 DO STASH .311+.312 DO .1 <- ,201SUB.311.312#3 DO .312 <- ,201SUB.311.312#4 DO .311 <- .1 DO (301) NEXT PLEASE .501 <- .311 PLEASE .502 <- .312 PLEASE RETRIEVE .311+.312 DO (302) NEXT DO RESUME #8 DO CALL ME ANY TIME (619) PLEASE DO (618) NEXT DO FORGET #8 DO .311 <- .511 DO .312 <- .512 DO STASH .311+.312 DO .311 <- .501 DO .312 <- .502 DO (301) NEXT PLEASE DO (304) NEXT DO ,201SUB.311.312#3 <- .501 DO ,201SUB.311.312#4 <- .502 DO ,201SUB.311.312#7 <- #10$#0 DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 DO (603) NEXT DON'T LOOK INTO THE ABYSS OR THE ABYSS LOOKS BACK INTO YOU (618) PLEASE DO (617) NEXT DO STASH .311+.312 DO .311 <- .511 DO .312 <- .512 DO (302) NEXT PLEASE RETRIEVE .311+.312 DO .511 <- .311 DO .512 <- .312 DO RESUME #10 DOESN'T REALLY DO MUCH (617) PLEASE DO (616) NEXT DO RESUME #11 DO WATCH OUT FOR SUBSTITUTES (616) PLEASE DO (615) NEXT DO FORGET #11 DO STASH .311+.312+.511+.512 DO .311 <- .511 DO .312 <- .512 DO (301) NEXT PLEASE DO (303) NEXT DO ,201SUB.311.312#5 <- .501 DO ,201SUB.311.312#6 <- .502 DO ,201SUB.311.312#7 <- #1 DO .501 <- .311 DO .502 <- .312 PLEASE DO (303) NEXT DO ,201SUB.311.312#5 <- .511 DO ,201SUB.311.312#6 <- .512 DO ,201SUB.311.312#7 <- #1$#0 DO ,201SUB.501.502#3 <- .311 DO ,201SUB.501.502#4 <- .312 DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 DO STASH .311+.312 DO .1 <- ,201SUB.311.312#5 DO .312 <- ,201SUB.311.312#6 DO .311 <- .1 DO (301) NEXT DO ,201SUB.511.512#3 <- .311 DO ,201SUB.511.512#4 <- .312 PLEASE RETRIEVE .311+.312 DO STASH .311+.312 DO .1 <- ,201SUB.311.312#3 DO .312 <- ,201SUB.311.312#4 DO .311 <- .1 PLEASE DO (301) NEXT DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 DO (302) NEXT DO .311 <- .511 DO .312 <- .512 PLEASE RETRIEVE .511+.512 DO (603) NEXT (615) PLEASE DO (614) NEXT DO STASH .311+.312 DO (303) NEXT DO ,201SUB.311.312#5 <- .511 DO ,201SUB.311.312#6 <- .512 DO ,201SUB.311.312#7 <- #6$#0 DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 DO STASH .311+.312 DO .1 <- ,201SUB.311.312#3 DO .312 <- ,201SUB.311.312#4 DO .311 <- .1 PLEASE DO (301) NEXT DO ,201SUB.511.512#3 <- .311 DO ,201SUB.511.512#4 <- .312 PLEASE RETRIEVE .311+.312 DO (302) NEXT PLEASE RESUME #13 (614) PLEASE DO (613) NEXT DO FORGET #13 DO .602 <- #5$#0 DO (602) NEXT DON'T WORRY ABOUT THE CONSTANT NOISE (613) PLEASE DO (612) NEXT DO STASH .311+.312 DO .311 <- .511 DO .312 <- .512 DO (302) NEXT PLEASE RETRIEVE .311+.312 DO STASH .311+.312 DO .1 <- ,201SUB.311.312#3 DO .312 <- ,201SUB.311.312#4 DO .311 <- .1 DO (301) NEXT DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 DO (302) NEXT PLEASE RESUME #15 (612) PLEASE DO (611) NEXT DO FORGET #15 DO .602 <- #3$#0 DO (602) NEXT (611) PLEASE DO (610) NEXT PLEASE HOW DID YOU GET HERE? (610) PLEASE RESUME ',201SUB.311.312#7'~'#31$#0' (602) DO (304) NEXT DO ,201SUB.311.312#3 <- .511 DO ,201SUB.311.312#4 <- .512 DO ,201SUB.311.312#7 <- .602 DO .511 <- .311 DO .512 <- .312 PLEASE RESUME #2 (603) PLEASE FORGET #2 intercal-0.30/pit/PaxHeaders.27456/iching1.i0000644000000000000000000000007411437550756015313 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/iching1.i0000644000175000017500000000054511437550756015212 0ustar00esresr00000000000000 DO .2 <- #32 PLEASE COME FROM (10) DO .1 <- #0 DO (1020) NEXT DO (1020) NEXT PLEASE DO %50 (1020) NEXT DO (1020) NEXT DO (1020) NEXT PLEASE DO %50 (1020) NEXT DO (1020) NEXT DO (1020) NEXT PLEASE DO %50 (1020) NEXT DO READ OUT .1 DO (30) NEXT (10) DO .2 <- .2~#62 (20) DO RESUME "?.2$#2"~#3 (30) DO (20) NEXT PLEASE FORGET #1 PLEASE GIVE UP intercal-0.30/pit/PaxHeaders.27456/pass.tst0000644000000000000000000000007411437550756015321 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.566945757 intercal-0.30/pit/pass.tst0000644000175000017500000000003011437550756015205 0ustar00esresr00000000000000ONE TWO THREE FOUR ZERO intercal-0.30/pit/PaxHeaders.27456/primes.doc0000644000000000000000000000007411437550756015605 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/primes.doc0000644000175000017500000000173311437550756015504 0ustar00esresr00000000000000primes.i is a simple program for printing out a list of prime numbers. It has an outer loop variable .11 and an inner loop variable .13, both of which start at #3 and advance through odd numbers. .13 contains the numbers being tested as possible divisors of .11, which is the number being tested for primality. Each time through the inner loop a 16-bit division with remainder routine (2030) is called to divide .11 by .13. If .13 is greater than the quotient then .11 is known to be prime and is printed out. If the remainder is #0, on the other hand, then .11 is known to be composite and the inner loop is terminated prematurely. The termination test for the outer loop is controlled by statement (22), which tests to see if the high bit of (.11-#1)/#2 is set. You can modify this statement to test some other bit if you want the program to terminate sooner. It took over 17 hours on a Sparc 1 for this program to find all 16-bit primes. Louis Howell December 30, 1991 intercal-0.30/pit/PaxHeaders.27456/t_tet0000644000000000000000000000007411437550756014661 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.574945729 intercal-0.30/pit/t_tet0000644000175000017500000000007711437550756014560 0ustar00esresr00000000000000ONE ONE ONE ONE ONE OH FIVE SIX SIX SIX SEVEN SIX SIX SEVEN OH intercal-0.30/pit/PaxHeaders.27456/continuation.doc0000644000000000000000000000007411437550756017020 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.558945776 intercal-0.30/pit/continuation.doc0000644000175000017500000001417611437550756016724 0ustar00esresr00000000000000Alex Smith, 2008 continuation.i is a continuation library for INTERCAL, and a small program at the end to demonstrate how it is used and as a test. (Your most likely use of this is to delete the test program at the end and use the rest as a library in your own source code.) It requires at least the command line options -am to work (so is unfortunately, but inevitably, incompatible with -e). All line numbers in the library part are in the range 8200-8299; there's a dependence on syslib, but only for (1020), so it would be easy to make it a truly independent library. I have avoided computed COME FROM in writing it, because its performance is bad enough as it is, and NEXT FROM didn't turn up, but there is a lot of ABSTAINING, REINSTATING, COMING FROM and NEXTING going on in the code, as well as ONCE and AGAIN (this time I used both of them; AGAIN is normally more useful but ONCE works better for mutexes) and lots and lots of threading. A continuation is a copy of the internal state of a program, that can be rewound back to at a later stage. What exactly is copied depends on the language; in INTERCAL, it's everything except the abstention status of commands, as you might expect. As INTERCAL doesn't have first-class functions, continuations are represented by onespot numbers; they can send a single one-spot number as their return value (and more data can be sent by ABSTAINING FROM things in a prearranged pattern). The library CREATEs three statements: GET CONTINUATION IN .1 GETTING .2 This statement creates a continuation, storing a number that can be used to access it later in .1, and leaves .2 untouched. If that continuation is invoked later, the statement will instead appear to be equivalent to a RESUME #1, but after setting the value of .2 to be whatever value was sent when invoking the continuation (note that only onespot-range values can be sent). So: DO (3) NEXT (1) DO GET CONTINUATION IN .1 GETTING .2 (2) DO FORGET #1 (3) DO (1) NEXT is effectively a call/cc to , with .1 being used as its argument and .2 as its return value. (There are other equivalent ways to properly guard this statement; one simple one is to put the GET CONTINUATION call just /inside/ the procedure that's call/ccd.) DO CONTINUE WITH .1 SENDING .2 This statement invokes a continuation, returning the program to the time that it was created. The first argument is the continuation number (not supplying a number that corresponds to a continuation is undefined behaviour, but most likely an infinite loop); the second argument is a onespot number to send back as 'payload', which will be assigned to the second argument of the GET CONTINUATION IN command that created the continuation in the first place. DO KILL ALL THREADS Because the continuation system creates a whole load of threads to do its work, a normal GIVE UP will not end the program. Instead, this is provided as an alternative; it's a horrible hack but will usually work if no threads are inside the system library at the time, or after the last PLEASE GIVE UP in the program. (I may implement a DO ABSTAIN FROM ONCING at some point, which would make it possible to make this sort of thing a lot more robust.) There are several interesting features of the program. The start shows how to CREATE statements that can take a range of different argument types; here I've chosen to cause the GET CONTINUATION statement to accept only lvalues that don't require reverse assignment, and the CONTINUE statement to accept any expression. A separate thread is used to keep track of the lowest unused continuation number; it shows how to implement a truly global variable in INTERCAL, and the relevant code (from 8250 to 8299) may be useful in its own right. The routines at (8276) and (8277) are an improvement over those in pass.i in terms of length, and show how to implement the INTERCAL equivalent of a named pipe (that is, data flows along it when one end is being read by one thread and the other end is being read by another thread). The ability to stash/retrieve the global variable (which is remarkably simple to do the way I've implemented it) is also used; see below. Continuations are themselves implemented as separate threads, each of which spends most of its time in an infinite loop at (8211); they're created by the simple method of determining a unique number, and splitting off a thread. Most of the non-global-variable-implementing part of the library is taken up with the code for invoking or 'unfreezing' a continuation thread. When (8210) is invoked (i.e. the implementation of the CONTINUE command), it STASHes the global variable and assigns the continuation number to it. It then releases the loop at 8211, and all the remaining threads simultaneously (due to the timing guarantees) start trying to read the global variable. There are two problems to overcome: first, the fact that they can't all read the global variable at once (this is solved by the routine (8275), which shows how to use ONCE to implement a mutex), and second, the fact that each thread needs to wait until all the others have finished reading before continuing (because otherwise a fast series of continuation operations in the main program could try to access a thread before it was ready). The second problem is solved by a limited kind of semaphore on the line (8214); its abstention count is incremented by each thread before it starts reading (almost simultaneously due to the timing restrictions), and decreased once the thread has finished. All the threads then block until all of them have finished, which they can do by monitoring the semaphore until it reaches 0. (Normal semaphores can also block below 0 as well as unblocking at 0.) This method means that the threads don't need to know how many other threads are available. The thread that is being unfrozen then RETRIEVES the global variable, uses (8276) and (8277) with the thread that called CONTINUE to get the payload value, then the original CONTINUE-calling thread dies and the unfrozen thread continues in its place. Of course, all this thread creation is completely lousy from a performance perspective. Maybe some day I should try to optimise spinlocks somehow... intercal-0.30/pit/PaxHeaders.27456/life.i0000644000000000000000000000007411437550756014710 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.566945757 intercal-0.30/pit/life.i0000644000175000017500000001165711437550756014615 0ustar00esresr00000000000000 PLEASE NOTE BEGINNING OF BEGINNING DO WRITE IN .11 DO WRITE IN .12 DO ,1 <- .11 BY .12 DO ,2 <- .11 BY .12 DO WRITE IN .13 DO .14 <- #0 PLEASE NOTE INITIALIZING ,1 TO ZEROES DO .2 <- .11 DO .1 <- .12 DO (110) NEXT (110) PLEASE FORGET #1 DO ,1 SUB .2.1 <- #0 DO (111) NEXT (112) DO (2010) NEXT PLEASE FORGET #2 DO (110) NEXT (111) DO (112) NEXT DO (113) NEXT (114) DO .1 <- .2 DO (2010) NEXT PLEASE FORGET #3 DO .2 <- .1 DO .1 <- .12 DO (110) NEXT (113) DO (114) NEXT PLEASE FORGET #2 PLEASE NOTE INITIAL POSITION INPUT DO (120) NEXT (120) PLEASE FORGET #1 DO WRITE IN .1 DO (121) NEXT DO WRITE IN .2 DO ,1 SUB .1.2 <- #1 DO (120) NEXT (122) DO RESUME "?!1~.1'$#1"~#3 (121) DO (122) NEXT PLEASE FORGET #1 PLEASE NOTE END OF BEGINNING, BEGINNING OF MIDDLE DO (200) NEXT (200) DO FORGET #1 PLEASE NOTE PUTTING NEXT POSITION IN ,2 DO .1 <- .11 DO .9 <- .1 DO (2000) NEXT DO .7 <- .1 DO (2000) NEXT DO .5 <- .1 DO .1 <- .12 DO .10 <- .1 DO (2000) NEXT DO .8 <- .1 DO (2000) NEXT DO .6 <- .1 DO (210) NEXT (210) PLEASE FORGET #1 DO .1 <- #0 DO .2 <- ,1 SUB .5.6 DO (2020) NEXT DO .2 <- ,1 SUB .5.8 DO (2020) NEXT DO .2 <- ,1 SUB .5.10 DO (2020) NEXT DO .2 <- ,1 SUB .7.6 DO (2020) NEXT DO .2 <- ,1 SUB .7.10 DO (2020) NEXT DO .2 <- ,1 SUB .9.6 DO (2020) NEXT DO .2 <- ,1 SUB .9.8 DO (2020) NEXT DO .2 <- ,1 SUB .9.10 DO (2020) NEXT DO :2 <- #0$#65535 DO .1 <- "?'"V.1$,1SUB.7.8"~:2'$#3"~:2 DO ,2 SUB .7.8 <- "?!1~.1'$#1"~#1 DO (211) NEXT (212) DO .10 <- .8 DO .8 <- .6 DO .1 <- .6 DO (2010) NEXT PLEASE FORGET #2 DO .6 <- .1 DO (210) NEXT (211) DO (212) NEXT DO (213) NEXT (214) DO .9 <- .7 DO .7 <- .5 DO .1 <- .5 DO (2010) NEXT PLEASE FORGET #3 DO .5 <- .1 DO .1 <- .12 DO .10 <- .1 DO (2000) NEXT DO .8 <- .1 DO (2000) NEXT DO .6 <- .1 DO (210) NEXT (213) DO (214) NEXT PLEASE FORGET #2 PLEASE NOTE COPYING ,2 BACK INTO ,1 DO .1 <- .11 DO (2000) NEXT DO .2 <- .1 DO .1 <- .12 DO (2000) NEXT DO (220) NEXT (220) PLEASE FORGET #1 DO ,1 SUB .2.1 <- ,2 SUB .2.1 DO (221) NEXT DO (220) NEXT (222) DO (2000) NEXT DO .3 <- "?.1$#1"~"#0$#65535" PLEASE RESUME '?"!3~.3'~#1"$#1'~#3 (221) DO (222) NEXT PLEASE FORGET #1 DO (223) NEXT DO .2 <- .1 DO .1 <- .12 DO (2000) NEXT DO (220) NEXT (224) DO .1 <- .2 DO (2000) NEXT DO .3 <- "?.1$#1"~"#0$#65535" PLEASE RESUME '?"!3~.3'~#1"$#1'~#3 (223) DO (224) NEXT PLEASE FORGET #1 PLEASE NOTE INCREMENT TIMESTEP AND TEST DO .1 <- .14 DO (1020) NEXT DO .14 <- .1 DO (231) NEXT DO (299) NEXT (232) DO .3 <- "?.14$.13"~"#0$#65535" PLEASE RESUME '?"!3~.3'~#1"$#2'~#3 (231) DO (232) NEXT DO FORGET #1 PLEASE NOTE OVERFLOW TESTING DO .1 <- .11 DO (2000) NEXT DO .5 <- .1 DO .1 <- .12 DO (2000) NEXT DO .6 <- .1 DO .7 <- #0 DO .8 <- #0 DO (240) NEXT (240) PLEASE FORGET #1 DO .2 <- ,1 SUB #2.6 DO .1 <- .7 DO (500) NEXT DO .7 <- .1 DO .2 <- ,1 SUB .5.6 DO .1 <- .8 DO (500) NEXT DO .8 <- .1 DO (241) NEXT DO .6 <- .1 DO (240) NEXT (242) DO .1 <- .6 DO (2000) NEXT DO .3 <- "?.1$#1"~"#0$#65535" PLEASE RESUME '?"!3~.3'~#1"$#1'~#3 (241) DO (242) NEXT PLEASE FORGET #1 DO .1 <- .11 DO (2000) NEXT DO .5 <- .1 DO .1 <- .12 DO (2000) NEXT DO .6 <- .1 DO .7 <- #0 DO .8 <- #0 DO (250) NEXT (250) PLEASE FORGET #1 DO .2 <- ,1 SUB .5#2 DO .1 <- .7 DO (500) NEXT DO .7 <- .1 DO .2 <- ,1 SUB .5.6 DO .1 <- .8 DO (500) NEXT DO .8 <- .1 DO (251) NEXT DO .5 <- .1 DO (250) NEXT (252) DO .1 <- .5 DO (2000) NEXT DO .3 <- "?.1$#1"~"#0$#65535" PLEASE RESUME '?"!3~.3'~#1"$#1'~#3 (251) DO (252) NEXT PLEASE FORGET #1 DO (200) NEXT (299) DO FORGET #1 PLEASE NOTE END OF MIDDLE, BEGINNING OF END PLEASE NOTE FINAL POSITION OUTPUT DO .2 <- .11 DO .1 <- .12 DO (310) NEXT (310) PLEASE FORGET #1 DO (321) NEXT DO READ OUT .2 DO READ OUT .1 DO (323) NEXT (322) PLEASE RESUME "?',1 SUB .2.1'$#1"~#3 (321) DO (322) NEXT (323) PLEASE FORGET #1 DO (311) NEXT (312) DO (2010) NEXT PLEASE FORGET #2 DO (310) NEXT (311) DO (312) NEXT DO (313) NEXT (314) DO .1 <- .2 DO (2010) NEXT PLEASE FORGET #3 DO .2 <- .1 DO .1 <- .12 DO (310) NEXT (313) DO (314) NEXT PLEASE FORGET #2 DO READ OUT .14 PLEASE NOTE END OF END PLEASE GIVE UP (500) DO (501) NEXT DO .1 <- #0 PLEASE RESUME #1 (502) PLEASE RESUME '?.2$#2'~#3 (501) DO (502) NEXT DO (2020) NEXT DO (503) NEXT PLEASE RESUME #2 (504) DO .2 <- "?.1$#3"~"#0$#65535" PLEASE RESUME '?"!2~.2'~#1"$#1'~#3 (503) DO (504) NEXT PLEASE FORGET #3 DO (299) NEXT (2010) PLEASE ABSTAIN FROM (2004) (2000) PLEASE STASH .2 DO .2 <- #1 DO (2001) NEXT (2001) PLEASE FORGET #1 DO .1 <- '?.1$.2'~'#0$#65535' DO (2002) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (2001) NEXT (2003) PLEASE RESUME "?!1~.2'$#1"~#3 (2002) DO (2003) NEXT PLEASE RETRIEVE .2 (2004) PLEASE RESUME #2 PLEASE DO REINSTATE (2004) PLEASE RESUME '?"!1~.1'~#1"$#2'~#6 (2020) PLEASE STASH .2 + .3 DO (1021) NEXT intercal-0.30/pit/PaxHeaders.27456/unlambda.doc0000644000000000000000000000007411437550756016071 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.574945729 intercal-0.30/pit/unlambda.doc0000644000175000017500000007303211437550756015771 0ustar00esresr00000000000000Here's a program that we found and added to the pit (with the author's permission). This is an Unlambda interpreter; see http://esolangs.org/wiki/Unlambda for more information about Unlambda. (This must have been a doubly difficult program to write; INTERCAL is known for being hard to write programs in, and Unlambda is in part known for being hard to write interpreters for, among its other claims to fame.) This should run under C-INTERCAL with no command-line options given, although I recommend -b, -O and -f. It's valid INTERCAL-72 except for Turing Tape IO and COME FROM label. What follows is the original version of the program, with the author's comments interspersed. # Copyright (C) 2001 Ørjan Johansen # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. PLEASE .200 <- #8 PLEASE NOTE AMOUNT OF INITIAL MEMORY PLEASE .80 <- #80 PLEASE NOTE END-OF-LINE CHARACTER DO (100) NEXT PLEASE NOTE IO SETUP DO (200) NEXT PLEASE NOTE MEMORY SETUP DO (300) NEXT PLEASE NOTE REFERENCE COUNTING SETUP DO (400) NEXT PLEASE NOTE PARSER TABLE SETUP DO (401) NEXT PLEASE NOTE PARSING DON'T (404) NEXT PLEASE NOTE PRINTING PROGRAM DO (501) NEXT PLEASE NOTE EVALUATION DON'T (404) NEXT PLEASE NOTE PRINTING RESULT DON'T (203) NEXT PLEASE NOTE MEMORY MAP PLEASE GIVE UP PLEASE NOTE DIPLOMATIC RELATIONS PLEASE NOTE .101=LAST READ .102=LAST WRITTEN # Character array (100) DO ,101 <- #1 PLEASE DO .101 <- #0 DO .102 <- #0 DO RESUME #1 # Read a new character PLEASE READ ME A STORY (101) DO (3101) NEXT DO .101 <- .1 PLEASE REINSTATE (3101) DO RESUME #1 (3101) DON'T THINK YOU CAN HAVE YOUR CAKE AND EAT IT DO WRITE IN ,101 PLEASE .1 <- ,101SUB#1 DO .2 <- .101 DO (1000) NEXT PLEASE DO .101 <- .3~#255 PLEASE RESUME '?.1$#512'~'#256$#256' # Reverse bits in .2 (102) DO .2 <- !2~#15'$!2~#240' DO .2 <- !2~#15'$!2~#240' DO .2 <- !2~#15'$!2~#240' PLEASE RESUME #1 # Write a new revchar (from .2) (103) PLEASE .1 <- .102 DO .102 <- .2 DO (1010) NEXT DO ,101SUB#1 <- .3 PLEASE READ OUT ,101 DO RESUME #1 DO ASSERT TERRITORIAL CLAIMS # Memory initialization, uses value of .200. # .204 = items per cell, not used for the (?202) loops! (200) DO .204 <- #7 DO ,201 <- .200 BY #32767 BY .204 (3200) PLEASE DO .201 <- #0 DO .202 <- #16383 PLEASE RESUME #1 PLEASE LET THEM EAT CAKE PLEASE NOTE .201+.202=MEMORY TOP # Allocate new cell, .201 (high) and .202 (low) will contain new address. # May also be used to traverse memory. (201) DO (3201) NEXT (5201) DON'T (202) NEXT DO COME FROM (7202) PLEASE .1 <- .201 DO (4201) NEXT PLEASE REINSTATE (5201) DO RESUME #1 (4201) DO (1020) NEXT DO FORGET '#65535~"'?.1$.200'~'#0$#65535'"'~#1 DO .201 <- .1 PLEASE RESUME #1 DON'T STEP ON THE GALOIS FIELD MINES (3201) DO .202 <- "?.202$!202~#16384'"~'#16383$#1' PLEASE RESUME "?!202~.202'$#32768"~"#16384$#16384" # Uncontrolled unary operators: # "?.1$!1~#16384'"~'#16383$#1' # "?#0$'"?.1$!1~#2'"~"#0$#65535"'"~'#49151$#0' PLEASE STAND BY FOR ASSIMILATION # Handle memory enlargement. (202) PLEASE DON'T RESUME #3 DO REINSTATE (202) DO FORGET #1 PLEASE STASH .203+,202 # Calculate the new memory size DO .203 <- '.200$#0'~'#65535$#1' # Temporarily copy memory DON'T TELL ME WE HAVE TO MOVE IT ALL? DO ,202 <- .200 BY #32767 BY .204 DO (3200) NEXT DO ABSTAIN FROM (5201) PLEASE DO (3202) NEXT # Enlarge memory and copy back DO ,201 <- .203 BY #32767 BY .204 DO (3200) NEXT PLEASE ABSTAIN FROM (5201) PLEASE DO (5202) NEXT # Clean up and return DO .200 <- .203 DO ABSTAIN FROM (5201) DO ABSTAIN FROM (202) (7202) DO RETRIEVE .203+,202 (9202) DO RESUME '?#32768$.203'~'#16384$#32768' (3202) DO COME FROM (4202) PLEASE DO (201) NEXT DO ,202SUB.201.202#1 <- ,201SUB.201.202#1 DO ,202SUB.201.202#2 <- ,201SUB.201.202#2 DO ,202SUB.201.202#3 <- ,201SUB.201.202#3 DO ,202SUB.201.202#4 <- ,201SUB.201.202#4 DO ,202SUB.201.202#5 <- ,201SUB.201.202#5 DO ,202SUB.201.202#6 <- ,201SUB.201.202#6 (4202) DO ,202SUB.201.202#7 <- ,201SUB.201.202#7 # Remember to expand if .204 changes! (5202) DO COME FROM (6202) PLEASE DO (201) NEXT DO ,201SUB.201.202#1 <- ,202SUB.201.202#1 DO ,201SUB.201.202#2 <- ,202SUB.201.202#2 DO ,201SUB.201.202#3 <- ,202SUB.201.202#3 DO ,201SUB.201.202#4 <- ,202SUB.201.202#4 DO ,201SUB.201.202#5 <- ,202SUB.201.202#5 DO ,201SUB.201.202#6 <- ,202SUB.201.202#6 (6202) DO ,201SUB.201.202#7 <- ,202SUB.201.202#7 # Remember to expand if .204 changes! # List memory and some important addresses DO TELL ME ALL ABOUT YOURSELF (203) DO READ OUT .201+.202+.301+.302+.311+.312 DO (3200) NEXT PLEASE REINSTATE (202) DO ABSTAIN FROM (5201) DO (3203) NEXT PLEASE GIVE UP PLEASE COME FROM (4203) (3203) DO (201) NEXT DO READ OUT .201+.202 DO READ OUT ,201SUB.201.202#1 DO READ OUT ,201SUB.201.202#2 DO READ OUT ,201SUB.201.202#3 DO READ OUT ,201SUB.201.202#4 DO READ OUT ,201SUB.201.202#5 DO READ OUT ,201SUB.201.202#6 (4203) DO READ OUT ,201SUB.201.202#7 # Reference count memory model PLEASE NOTE #1+#2=REFERENCE COUNT #3+#4=CAR #5+#6=CDR #7=TYPE (TAG$DATA) PLEASE WELCOME TO THE BAZAAR # Initialize recycle bin (300) PLEASE DO .301 <- #0 DO .302 <- #0 PLEASE NOTE NIL=.303+.304 DO (303) NEXT DO ,201SUB.311.312#1 <- #0 PLEASE ,201SUB.311.312#2 <- #0 DO ,201SUB.311.312#3 <- .311 DO ,201SUB.311.312#4 <- .312 DO ,201SUB.311.312#5 <- .311 DO ,201SUB.311.312#6 <- .312 DO ,201SUB.311.312#7 <- #0 PLEASE .303 <- .311 DO .304 <- .312 DO RESUME #1 # Increment reference count of cell pointed to by .311+.312. PLEASE REPORT NEW PURCHASES HERE (301) PLEASE .1 <- ,201SUB.311.312#2 DO .1 <- "?.1$!1~#16384'"~'#16383$#1' DO ,201SUB.311.312#2 <- .1 DO (3301) NEXT PLEASE .1 <- ,201SUB.311.312#1 DO .1 <- "?.1$!1~#16384'"~'#16383$#1' DO ,201SUB.311.312#1 <- .1 DO (3301) NEXT PLEASE NOTE THAT IMMORTALITY IS TREASON DO ,201SUB.311.312#2 <- #0 DO RESUME #1 (3301) PLEASE RESUME "?!1~.1'$#32768"~"#16384$#16384" PLEASE STAND IN LINE FOR TERMINATION DO COME FROM (4302) # Decrement reference count of cell pointed to by .311+.312. (302) PLEASE .1 <- ,201SUB.311.312#2 DO .1 <- "?#0$'"?.1$!1~#2'"~"#0$#65535"'"~'#49151$#0' DO ,201SUB.311.312#2 <- .1 DO (3302) NEXT PLEASE .1 <- ,201SUB.311.312#1 DO .1 <- "?#0$'"?.1$!1~#2'"~"#0$#65535"'"~'#49151$#0' DO ,201SUB.311.312#1 <- .1 DO (3302) NEXT # Count reached zero, release cell PLEASE .1 <- .311 DO .2 <- .312 DO .311 <- ,201SUB.1.2#3 DO .312 <- ,201SUB.1.2#4 DO ,201SUB.1.2#3 <- .301 DO ,201SUB.1.2#4 <- .302 PLEASE .301 <- .1 (4302) DO .302 <- .2 (3302) PLEASE RESUME "?'#65535~"'?.1$#16383'~'#0$#65535'"'$#1"~#3 PLEASE LET ME INTRODUCE YOU TO .311+.312 # Receive pointer to cell, possibly recycled, in .311+.312 (303) PLEASE (3303) NEXT DO .1 <- .301 DO .2 <- .302 DO .301 <- ,201SUB.1.2#3 DO .302 <- ,201SUB.1.2#4 PLEASE STASH .1+.2 DO .311 <- ,201SUB.1.2#5 DO .312 <- ,201SUB.1.2#6 DO (302) NEXT PLEASE RETRIEVE .1+.2 DO .311 <- .1 DO .312 <- .2 DO (5303) NEXT (3303) PLEASE DO (4303) NEXT DO (201) NEXT DO .311 <- .201 DO .312 <- .202 (5303) DO ,201SUB.311.312#1 <- #32767 PLEASE ,201SUB.311.312#2 <- #32767 # Initialize pointers to null so errors are (hopefully) caught easier. DO ,201SUB.311.312#3 <- #0 DO ,201SUB.311.312#5 <- #0 PLEASE RESUME #2 (4303) DO RESUME "?!301~.301'$#1"~#3 # As (303), but set CDR to NIL (304) PLEASE (303) NEXT DO ,201SUB.311.312#5 <- .303 DO ,201SUB.311.312#6 <- .304 DO RESUME #1 # As (304), but also set CAR to NIL (305) PLEASE (304) NEXT DO ,201SUB.311.312#3 <- .303 DO ,201SUB.311.312#4 <- .304 DO RESUME #1 # ,401+,402 is a table of pointers to the parameterless # primitive functions. PLEASE NOTE `=#1 K=#2 K1=#3 S=#4 S1=#5 S2=#6 I=#7 V=#8 C=#9 CONT=#10 D=#11 D1=#12 .=#13 E=#14 @=#15 ?=#16 |=#17 (R=#18=#13$.80) (3400) PLEASE STASH .1 PLEASE (305) NEXT PLEASE RETRIEVE .1 DO ,201SUB.311.312#2 <- #0 DO ,201SUB.311.312#7 <- .1$#0 DO ,401SUB.1 <- .311 DO ,402SUB.1 <- .312 DO RESUME #1 (400) PLEASE ,401 <- #18 DO ,402 <- #18 DO .1 <- #2 DO (3400) NEXT DO .1 <- #4 DO (3400) NEXT DO .1 <- #7 DO (3400) NEXT DO .1 <- #8 DO (3400) NEXT DO .1 <- #9 DO (3400) NEXT DO .1 <- #11 DO (3400) NEXT DO .1 <- #14 DO (3400) NEXT DO .1 <- #15 DO (3400) NEXT DO .1 <- #17 DO (3400) NEXT DO .1 <- #18 DO (3400) NEXT PLEASE ,201SUB.311.312#7 <- #13$.80 # ,400 is a character table. PLEASE NOTE 7=ILLEGAL 6=BLANK 5=COMMENT 4=PRIMITIVE 3=KRAPS 2=WHAT 1=SPOT (410) PLEASE ,400 <- #127 PLEASE .1 <- #127 PLEASE (3410) NEXT DO ,400SUB#8 <- #6 $ #0 DO ,400SUB#10 <- #6 $ #0 DO ,400SUB#13 <- #6 $ #0 DO ,400SUB#32 <- #6 $ #0 DO ,400SUB#35 <- #5 $ #0 DO ,400SUB#46 <- #1 $ #13 DO ,400SUB#63 <- #2 $ #16 DO ,400SUB#64 <- #4 $ #15 DO ,400SUB#67 <- #4 $ #9 DO ,400SUB#68 <- #4 $ #11 DO ,400SUB#69 <- #4 $ #14 DO ,400SUB#73 <- #4 $ #7 DO ,400SUB#75 <- #4 $ #2 DO ,400SUB#82 <- #4 $ #18 DO ,400SUB#83 <- #4 $ #4 DO ,400SUB#86 <- #4 $ #8 DO ,400SUB#96 <- #3 $ #0 DO ,400SUB#99 <- #4 $ #9 DO ,400SUB#100 <- #4 $ #11 DO ,400SUB#101 <- #4 $ #14 DO ,400SUB#105 <- #4 $ #7 DO ,400SUB#107 <- #4 $ #2 DO ,400SUB#114 <- #4 $ #18 DO ,400SUB#115 <- #4 $ #4 DO ,400SUB#118 <- #4 $ #8 (5410) DO ,400SUB#124 <- #4 $ #17 PLEASE COME FROM (3410) (3410) PLEASE (4410) NEXT (4410) PLEASE ,400SUB.1 <- #7 DO .1 <- "?.1$!1~#64'"~'#63$#1' DO RESUME "?!1~.1'$#64"~"#64$#64" DO COME FROM (5410) # ,403 is a character table the other way. PLEASE NOTE KSIVCDE@|=#7 K1,S1,D1=#6 S2=#5 CONT=#4 KRAPS=#3 WHAT=#2 SPOT=#1 (420) PLEASE ,403 <- #17 DO ,403SUB#1 <- #3 $ #6 DO ,403SUB#2 <- #7 $ #210 DO ,403SUB#3 <- #6 $ #210 DO ,403SUB#4 <- #7 $ #202 DO ,403SUB#5 <- #6 $ #202 DO ,403SUB#6 <- #5 $ #202 DO ,403SUB#7 <- #7 $ #146 DO ,403SUB#8 <- #7 $ #106 DO ,403SUB#9 <- #7 $ #194 DO ,403SUB#10 <- #4 $ #0 DO ,403SUB#11 <- #7 $ #34 DO ,403SUB#12 <- #6 $ #34 DO ,403SUB#13 <- #1 $ #116 DO ,403SUB#14 <- #7 $ #162 DO ,403SUB#15 <- #7 $ #2 DO ,403SUB#16 <- #2 $ #252 DO ,403SUB#17 <- #7 $ #62 PLEASE RESUME #1 # Parser continuation stack cell types PLEASE NOTE 3=TOP 2=BOTH 1=LAST # Generate stack top in .401+.402 (401) DO (305) NEXT DO .401 <- .311 DO .402 <- .312 DO ,201SUB.401.402#7 <- #3 PLEASE (402) NEXT PLEASE ABSTAIN FROM SUCH MEANINGLESS LANGUAGE (4402) DO RESUME '?"?!101~#128'$!101~.101'"$#2'~#3 (3402) DO (3101) NEXT DOG ATE END OF MY ESSAY # Parse expression and send to continuation DO COME FROM (5402) (402) DO (3402) NEXT PLEASE (4402) NEXT (5402) DO (412) NEXT # Comments DON'T COMMENT (412) PLEASE (422) NEXT DO COME FROM (4412) DO (3402) NEXT (4412) PLEASE (3412) NEXT (3412) DO FORGET "?'#255~"'?.101$#10'~'#0$#65535'"'$#1"~#1 DO FORGET "?'#255~"'?.101$#13'~'#0$#65535'"'$#1"~#1 DO RESUME #1 # Primitive functions DO YOU THINK _THIS_ IS PRIMITIVE? (422) PLEASE (432) NEXT DO .311 <- ,401SUB!410~"#0$#31"' DO .312 <- ,402SUB!410~"#0$#31"' DO FORGET #1 PLEASE (403) NEXT # Application PLEASE FILL OUT THE APPLICATION FORM (432) PLEASE (442) NEXT DO (305) NEXT DO ,201SUB.311.312#5 <- .401 DO ,201SUB.311.312#6 <- .402 DO ,201SUB.311.312#7 <- #2 PLEASE .401 <- .311 DO .402 <- .312 DO RESUME #3 # ?x DO WHAT? (442) PLEASE (452) NEXT DO (3402) NEXT DO (305) NEXT DO ,201SUB.311.312#7 <- !410~"#0$#31"'$.101 DO FORGET #3 PLEASE (403) NEXT # .x DOT OR SPOT, WE'RE ALL CIVILIZED PEOPLE HERE (452) PLEASE (462) NEXT DO (3402) NEXT DO (305) NEXT DO .2 <- .101 PLEASE (102) NEXT DO ,201SUB.311.312#7 <- !410~"#0$#31"'$.2 DO FORGET #4 PLEASE (403) NEXT (462) DO .410 <- ,400SUB.101 DO RESUME .410~'#7$#0' # Handle a parsed expression in .311+.312 # Remember to resume one extra level afterwards if continuing. # First top expression DO YOU KNOW THE TOP MAN FOR THIS OPERATION? DO COME FROM (3423) (403) PLEASE (413) NEXT DO STASH .311+.312 DO .311 <- .401 DO .312 <- .402 PLEASE (302) NEXT DO RETRIEVE .311+.312 # Return all the way from (401) DO RESUME #4 # Still one subexpression remaining PLEASE CAN I HAVE SOME MORE? (413) PLEASE (423) NEXT DO ,201SUB.401.402#3 <- .311 DO ,201SUB.401.402#4 <- .312 DO ,201SUB.401.402#7 <- #1 PLEASE RESUME #3 # Application constructed DOUBLE APPLICATION FORM RECEIVED (423) PLEASE (433) NEXT DO .1 <- ,201SUB.401.402#5 DO .2 <- ,201SUB.401.402#6 DO ,201SUB.401.402#5 <- .311 DO ,201SUB.401.402#6 <- .312 DO ,201SUB.401.402#7 <- #1$#0 DO .311 <- .401 PLEASE .312 <- .402 DO .401 <- .1 DO .402 <- .2 (3423) DO FORGET #2 (433) PLEASE RESUME ,201SUB.401.402#7 # Unparsing .311+.312 DO YOU WANT A REPORT? (404) DO STASH .311+.312 PLEASE (6404) NEXT DO RETRIEVE .311+.312 DO .2 <- .80 DO (103) NEXT DO RESUME #1 # Uses weak pointer stack in .401+.402 with NIL at bottom (which is of type 0) (6404) DO .401 <- .303 DO .402 <- .304 DO COME FROM (4404) PLEASE DO (5404) NEXT # Unparse the remainder of the stack PLEASE (3404) NEXT DO .311 <- ,201SUB.401.402#3 DO .312 <- ,201SUB.401.402#4 PLEASE STASH .311+.312 DO .1 <- ,201SUB.401.402#5 DO .2 <- ,201SUB.401.402#6 DO ,201SUB.401.402#3 <- .303 DO ,201SUB.401.402#4 <- .304 DO ,201SUB.401.402#5 <- .303 DO ,201SUB.401.402#6 <- .304 DO .311 <- .401 DO .312 <- .402 DO .401 <- .1 DO .402 <- .2 PLEASE DO (302) NEXT (4404) DO RETRIEVE .311+.312 (3404) DO RESUME "?"#65535~',201SUB.401.402#7'"$#2"~#3 DO COME FROM (5404) (5404) PLEASE DO (414) NEXT # Primitives PLEASE DON'T BRING AUSTRALOPITHECI INTO THE HOUSE (414) PLEASE DO (424) NEXT DO .2 <- .411~'#0$#255' DO (103) NEXT DO RESUME #2 # Single parameter (424) PLEASE DO (434) NEXT DO .2 <- #6 DO (103) NEXT DO .2 <- .411~'#0$#255' DO (103) NEXT PLEASE COME FROM (4434) (3424) DO .1 <- ,201SUB.311.312#3 DO .312 <- ,201SUB.311.312#4 DO .311 <- .1 DO RESUME #2 # Two-parameter DOUBLE DOUBLE TOIL AND TROUBLE (434) PLEASE DO (444) NEXT DO .2 <- #6 DO (103) NEXT DO (103) NEXT DO .2 <- .411~'#0$#255' DO (103) NEXT DO COME FROM (3454) (3434) PLEASE STASH .311+.312 PLEASE DO (303) NEXT DO ,201SUB.311.312#5 <- .401 DO ,201SUB.311.312#6 <- .402 DO ,201SUB.311.312#7 <- #1 DO .401 <- .311 DO .402 <- .312 PLEASE RETRIEVE .311+.312 DO ,201SUB.401.402#3 <- ,201SUB.311.312#5 DO ,201SUB.401.402#4 <- ,201SUB.311.312#6 (4434) DO FORGET #1 # Continuations DO CONTINUATIONS DREAM OF MONADIC SHEEP (444) PLEASE DO (454) NEXT PLEASE DO .2 <- #60 DO (103) NEXT PLEASE DO .2 <- #194 DO (103) NEXT PLEASE DO .2 <- #242 DO (103) NEXT PLEASE DO .2 <- #114 DO (103) NEXT PLEASE DO .2 <- #42 DO (103) NEXT PLEASE DO .2 <- #124 DO (103) NEXT PLEASE RESUME #5 # Applications (454) PLEASE DO (464) NEXT PLEASE FORGET #2 DO .2 <- #6 (3454) DO (103) NEXT # ?x DON'T LOOK LIKE A QUESTION MARK (464) PLEASE DO (474) NEXT DO .2 <- .411~'#0$#255' DO (103) NEXT PLEASE DO .2 <- .410~'#0$#255' DO (102) NEXT DO (103) NEXT DO RESUME #7 # .x PLEASE CAN YOU SPOT THE DIFFERENCE? (474) PLEASE DO (484) NEXT DO .2 <- .411~'#0$#255' DO .410 <- .410~'#0$#255' DO .411 <- #7$#74 PLEASE DO (3474) NEXT DO (103) NEXT PLEASE DO .2 <- .410 DO (103) NEXT DO RESUME #8 # Resume 1 or 7 times (3474) DO RESUME '"?"#255~'"?.410$.80"~"#0$#65535"'"$#3"$#1'~#11 (484) DO .410 <- ,201SUB.311.312#7 DO .411 <- ,403SUB!410~"#31$#0"' PLEASE RESUME .411~'#7$#0' PLEASE WELCOME TO THE PITS OF EVAL # May use up the reference to .311+.312. (501) DO .511 <- .311 DO .512 <- .312 PLEASE DO (3501) NEXT DO .311 <- .511 DO .312 <- .512 # Continuation types PLEASE NOTE EVAL2=1 APPLY=2 PLEASE NOTE .601=CURRENT CHARACTER .501+.502=CURRENT CONTINUATION .511+.512=CURRENT EXPRESSION (3501) DO .601 <- #256 DO (304) NEXT DO ,201SUB.311.312#3 <- ,401SUB#14 DO ,201SUB.311.312#4 <- ,402SUB#14 DO ,201SUB.311.312#7 <- #2 DO .501 <- .311 DO .502 <- .312 # Evaluate .511+.512 with the continuation given in .501+.502. PLEASE COME FROM (3622) PLEASE COME FROM (7503) (502) DO (3502) NEXT DO (503) NEXT (4502) PLEASE RESUME "?'#15~"',201SUB.511.512#7'~'#30$#0'"'$#1"~#3 DO NOTE KRAPS PLEASE COME FROM (5502) (3502) DO (4502) NEXT PLEASE (303) NEXT DO ,201SUB.311.312#5 <- .501 DO ,201SUB.311.312#6 <- .502 DO ,201SUB.311.312#7 <- #1 DO .501 <- .311 DO .502 <- .312 DO .311 <- ,201SUB.511.512#5 DO .312 <- ,201SUB.511.512#6 PLEASE DO (301) NEXT DO ,201SUB.501.502#3 <- .311 DO ,201SUB.501.502#4 <- .312 DO .311 <- ,201SUB.511.512#3 DO .312 <- ,201SUB.511.512#4 PLEASE DO (301) NEXT PLEASE STASH .311+.312 DO .311 <- .511 DO .312 <- .512 DO (302) NEXT PLEASE RETRIEVE .311+.312 DO .511 <- .311 (5502) DO .512 <- .312 # Send .511+.512 to the current continuation. PLEASE NOTE THAT WE ARE CURRENTLY PROCESSING YOUR APPLICATION (503) DO FORGET #1 PLEASE (3503) NEXT DO .311 <- ,201SUB.501.502#3 DO .312 <- ,201SUB.501.502#4 DO (301) NEXT PLEASE STASH .311+.312 DO .311 <- .501 DO .312 <- .502 PLEASE STASH .311+.312 DO .311 <- ,201SUB.501.502#5 DO .312 <- ,201SUB.501.502#6 DO (301) NEXT DO .501 <- .311 DO .502 <- .312 PLEASE RETRIEVE .311+.312 DO (302) NEXT (8503) PLEASE RETRIEVE .311+.312 (4503) PLEASE RESUME ,201SUB.501.502#7 PLEASE STAY WITH US FOR THE SECOND HALF OF THE SHOW (3503) PLEASE (4503) NEXT DO (5503) NEXT DO FORGET #1 DO .311 <- .501 DO .312 <- .502 PLEASE STASH .311+.312 DO .311 <- ,201SUB.501.502#3 DO .312 <- ,201SUB.501.502#4 DO (301) NEXT PLEASE STASH .311+.312 DO .311 <- ,201SUB.501.502#5 DO .312 <- ,201SUB.501.502#6 PLEASE DO (301) NEXT DO STASH .311+.312 DO (304) NEXT DO ,201SUB.311.312#3 <- .511 DO ,201SUB.311.312#4 <- .512 DO ,201SUB.311.312#7 <- #2 DO .501 <- .311 DO .502 <- .312 PLEASE RETRIEVE .311+.312 DO ,201SUB.501.502#5 <- .311 DO ,201SUB.501.502#6 <- .312 PLEASE RETRIEVE .311+.312 DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 (7503) DO (302) NEXT DO D DO DAH (6503) PLEASE RESUME "?'#15~"'?"',201SUB.511.512#7'~'#31$#0'"$#11' ~"#0$#65535""'$#1"~#3 (5503) DO (6503) NEXT DO FORGET #2 DO .311 <- ,201SUB.501.502#3 DO .312 <- ,201SUB.501.502#4 DO (301) NEXT PLEASE STASH .311+.312 DO (304) NEXT DO ,201SUB.311.312#7 <- #12$#0 DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 DO ,201SUB.511.512#3 <- .311 DO ,201SUB.511.512#4 <- .312 DO .311 <- ,201SUB.501.502#5 DO .312 <- ,201SUB.501.502#6 PLEASE DO (301) NEXT DO STASH .311+.312 DO .311 <- .501 DO .312 <- .502 PLEASE DO (302) NEXT DO RETRIEVE .311+.312 DO .501 <- .311 DO .502 <- .312 DO (503) NEXT PLEASE LEARN THE DIFFERENCE BETWEEN APPLYS AND ORANGUTANS # Apply .311+.312 to .511+.512 with the current continuation .501+.502 PLEASE COME FROM (8503) DO COME FROM (603) (601) PLEASE DO (627) NEXT DO (503) NEXT PLEASE DON'T CLIMB INTO THE PIPES (627) PLEASE DO (626) NEXT DO .311 <- .511 DO .312 <- .512 PLEASE DO (3627) NEXT DO STASH .311+.312 PLEASE DO (305) NEXT DO .2 <- .601 DO (102) NEXT DO ,201SUB.311.312#7 <- #13$.2 DO .511 <- .311 DO .512 <- .312 DO RETRIEVE .311+.312 PLEASE DO (603) NEXT (3627) PLEASE DO (4627) NEXT DO FORGET #1 DO .511 <- ,401SUB#8 DO .512 <- ,402SUB#8 PLEASE DO (603) NEXT (4627) PLEASE RESUME '?.601$#512'~'#256$#256' PLEASE WHAT DID YOU SAY? (626) PLEASE DO (625) NEXT DO .602 <- ',201SUB.311.312#7'~'#0$#255' DO (302) NEXT DO .311 <- .511 DO .312 <- .512 PLEASE DO (3626) NEXT DO FORGET #1 DO .511 <- ,401SUB#7 DO .512 <- ,402SUB#7 PLEASE DO (603) NEXT (3626) PLEASE DO (4626) NEXT DO FORGET #2 DO .511 <- ,401SUB#8 DO .512 <- ,402SUB#8 PLEASE DO (603) NEXT (4626) DO RESUME "?'#255~"'?.601$.602'~'#0$#255'"'$#2"~#3 DON'T FALL INTO THE WHIRLPOOL (625) PLEASE DO (624) NEXT DO .311 <- .511 DO .312 <- .512 DO (3625) NEXT DO FORGET #2 DO .601 <- .101 DO .511 <- ,401SUB#7 DO .512 <- ,402SUB#7 PLEASE DO (603) NEXT (3625) DO (3101) NEXT PLEASE REINSTATE (3101) DO FORGET #3 DO .601 <- #256 DO .511 <- ,401SUB#8 DO .512 <- ,402SUB#8 PLEASE DO (603) NEXT DO YOU THINK THIS IS THE END? (624) PLEASE DO (623) NEXT DO RESUME #5 PLEASE STAY IN ONE SPOT SO I CAN HIT YOU (623) PLEASE DO (622) NEXT DO .2 <- ',201SUB.311.312#7'~'#0$#255' DO (103) NEXT DO (302) NEXT DO RESUME #5 DON'T PROMISE WHAT YOU CAN'T KEEP (622) PLEASE DO (621) NEXT DO FORGET #6 DO STASH .311+.312 PLEASE DO (303) NEXT DO ,201SUB.311.312#3 <- .511 DO ,201SUB.311.312#4 <- .512 DO ,201SUB.311.312#5 <- .501 DO ,201SUB.311.312#6 <- .502 DO ,201SUB.311.312#7 <- #1 DO .501 <- .311 DO .502 <- .312 PLEASE RETRIEVE .311+.312 DO STASH .311+.312 DO .1 <- ,201SUB.311.312#3 DO .312 <- ,201SUB.311.312#4 DO .311 <- .1 DO (301) NEXT DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 (3622) DO (302) NEXT DO EXPECT SOME DELAY (621) PLEASE DO (620) NEXT DO RESUME #7 PLEASE CONTINUE, NOTHING TO SEE HERE... (620) PLEASE DO (619) NEXT DO STASH .311+.312 DO .311 <- .501 DO .312 <- .502 DO (302) NEXT PLEASE RETRIEVE .311+.312 DO STASH .311+.312 DO .1 <- ,201SUB.311.312#3 DO .312 <- ,201SUB.311.312#4 DO .311 <- .1 DO (301) NEXT PLEASE .501 <- .311 PLEASE .502 <- .312 PLEASE RETRIEVE .311+.312 DO (302) NEXT DO RESUME #8 DO CALL ME ANY TIME (619) PLEASE DO (618) NEXT DO FORGET #8 DO .311 <- .511 DO .312 <- .512 DO STASH .311+.312 DO .311 <- .501 DO .312 <- .502 DO (301) NEXT PLEASE DO (304) NEXT DO ,201SUB.311.312#3 <- .501 DO ,201SUB.311.312#4 <- .502 DO ,201SUB.311.312#7 <- #10$#0 DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 DO (603) NEXT DON'T LOOK INTO THE ABYSS OR THE ABYSS LOOKS BACK INTO YOU (618) PLEASE DO (617) NEXT DO STASH .311+.312 DO .311 <- .511 DO .312 <- .512 DO (302) NEXT PLEASE RETRIEVE .311+.312 DO .511 <- .311 DO .512 <- .312 DO RESUME #10 DOESN'T REALLY DO MUCH (617) PLEASE DO (616) NEXT DO RESUME #11 DO WATCH OUT FOR SUBSTITUTES (616) PLEASE DO (615) NEXT DO FORGET #11 DO STASH .311+.312+.511+.512 DO .311 <- .511 DO .312 <- .512 DO (301) NEXT PLEASE DO (303) NEXT DO ,201SUB.311.312#5 <- .501 DO ,201SUB.311.312#6 <- .502 DO ,201SUB.311.312#7 <- #1 DO .501 <- .311 DO .502 <- .312 PLEASE DO (303) NEXT DO ,201SUB.311.312#5 <- .511 DO ,201SUB.311.312#6 <- .512 DO ,201SUB.311.312#7 <- #1$#0 DO ,201SUB.501.502#3 <- .311 DO ,201SUB.501.502#4 <- .312 DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 DO STASH .311+.312 DO .1 <- ,201SUB.311.312#5 DO .312 <- ,201SUB.311.312#6 DO .311 <- .1 DO (301) NEXT DO ,201SUB.511.512#3 <- .311 DO ,201SUB.511.512#4 <- .312 PLEASE RETRIEVE .311+.312 DO STASH .311+.312 DO .1 <- ,201SUB.311.312#3 DO .312 <- ,201SUB.311.312#4 DO .311 <- .1 PLEASE DO (301) NEXT DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 DO (302) NEXT DO .311 <- .511 DO .312 <- .512 PLEASE RETRIEVE .511+.512 DO (603) NEXT (615) PLEASE DO (614) NEXT DO STASH .311+.312 DO (303) NEXT DO ,201SUB.311.312#5 <- .511 DO ,201SUB.311.312#6 <- .512 DO ,201SUB.311.312#7 <- #6$#0 DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 DO STASH .311+.312 DO .1 <- ,201SUB.311.312#3 DO .312 <- ,201SUB.311.312#4 DO .311 <- .1 PLEASE DO (301) NEXT DO ,201SUB.511.512#3 <- .311 DO ,201SUB.511.512#4 <- .312 PLEASE RETRIEVE .311+.312 DO (302) NEXT PLEASE RESUME #13 (614) PLEASE DO (613) NEXT DO FORGET #13 DO .602 <- #5$#0 DO (602) NEXT DON'T WORRY ABOUT THE CONSTANT NOISE (613) PLEASE DO (612) NEXT DO STASH .311+.312 DO .311 <- .511 DO .312 <- .512 DO (302) NEXT PLEASE RETRIEVE .311+.312 DO STASH .311+.312 DO .1 <- ,201SUB.311.312#3 DO .312 <- ,201SUB.311.312#4 DO .311 <- .1 DO (301) NEXT DO .511 <- .311 DO .512 <- .312 PLEASE RETRIEVE .311+.312 DO (302) NEXT PLEASE RESUME #15 (612) PLEASE DO (611) NEXT DO FORGET #15 DO .602 <- #3$#0 DO (602) NEXT (611) PLEASE DO (610) NEXT PLEASE HOW DID YOU GET HERE? (610) PLEASE RESUME ',201SUB.311.312#7'~'#31$#0' # Only for primitives! (602) DO (304) NEXT DO ,201SUB.311.312#3 <- .511 DO ,201SUB.311.312#4 <- .512 DO ,201SUB.311.312#7 <- .602 DO .511 <- .311 DO .512 <- .312 PLEASE RESUME #2 (603) PLEASE FORGET #2 intercal-0.30/pit/PaxHeaders.27456/change.i0000644000000000000000000000007411437550756015216 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.558945776 intercal-0.30/pit/change.i0000644000175000017500000000416011437550756015112 0ustar00esresr00000000000000 DO WRITE IN .4 DO .5 <- #5 DO .6 <- #0 DO (300) NEXT DO READ OUT .3 PLEASE GIVE UP (100) DO (110) NEXT DO .2 <- #50 PLEASE RESUME #1 (110) DO (120) NEXT DO .2 <- #25 PLEASE RESUME #2 (120) DO (130) NEXT DO .2 <- #10 PLEASE RESUME #3 (130) DO (140) NEXT DO .2 <- #5 PLEASE RESUME #4 (140) DO (150) NEXT DO .2 <- #1 PLEASE RESUME #5 (150) DO RESUME .5 (200) DO (201) NEXT DO .3 <- #1 DO RESUME #1 (202) PLEASE RESUME '?"!4~.4'~#1"$#2'~#3 (201) DO (202) NEXT DO (203) NEXT DO .3 <- #0 DO RESUME #2 (204) PLEASE RESUME '?"'&"?!4~#32768'$#1"$".5~.5"'~#1"$#2'~#3 (203) DO (204) NEXT PLEASE FORGET #2 DO .1 <- .4 DO (100) NEXT DO (1010) NEXT PLEASE STASH .4 DO .4 <- .3 DO (200) NEXT PLEASE RETRIEVE .4 PLEASE STASH .5 + .6 DO .6 <- .3 DO .1 <- .5 DO (2000) NEXT DO .5 <- .1 DO (200) NEXT DO .1 <- .3 DO .2 <- .6 PLEASE RETRIEVE .5 + .6 DO (1000) NEXT PLEASE RESUME #1 PLEASE COME FROM (310) (300) DO (301) NEXT DO .1 <- .6 DO (1020) NEXT DO .3 <- .1 DO RESUME #1 (302) PLEASE RESUME '?"!4~.4'~#1"$#2'~#3 (301) DO (302) NEXT DO (303) NEXT DO .3 <- .6 DO RESUME #2 (304) PLEASE RESUME '?"'&"?!4~#32768'$#1"$".5~.5"'~#1"$#2'~#3 (303) DO (304) NEXT PLEASE FORGET #2 DO .1 <- .5 DO (2000) NEXT PLEASE STASH .4 + .5 DO .5 <- .1 DO (300) NEXT PLEASE RETRIEVE .4 + .5 DO .6 <- .3 DO .1 <- .4 DO (100) NEXT DO (1010) NEXT (310) DO .4 <- .3 (2000) PLEASE STASH .2 DO .2 <- #1 DO (2001) NEXT (2001) PLEASE FORGET #1 DO .1 <- '?.1$.2'~'#0$#65535' DO (2002) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (2001) NEXT (2003) PLEASE RESUME "?!1~.2'$#1"~#3 (2002) DO (2003) NEXT PLEASE RETRIEVE .2 (2004) PLEASE RESUME #2 intercal-0.30/pit/PaxHeaders.27456/beer.i0000644000000000000000000000007411437550756014706 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.554945791 intercal-0.30/pit/beer.i0000644000175000017500000001766311437550756014616 0ustar00esresr00000000000000PLEASE DO ,10 <- #1 PLEASE DO ,10SUB#1 <- #176 PLEASE DO ,11 <- #30 PLEASE DO ,11SUB#1 <- #76 DO ,11SUB#2 <- #190 DO ,11SUB#3 <- #80 DO ,11SUB#4 <- #200 PLEASE DO ,11SUB#5 <- #256 DO ,11SUB#6 <- #248 DO ,11SUB#7 <- #144 DO ,11SUB#8 <- #216 PLEASE DO ,11SUB#9 <- #202 DO ,11SUB#10 <- #14 DO ,11SUB#11 <- #144 DO ,11SUB#12 <- #98 PLEASE DO ,11SUB#13 <- #190 DO ,11SUB#14 <- #160 DO ,11SUB#15 <- #256 DO ,11SUB#16 <- #88 PLEASE DO ,11SUB#17 <- #74 DO ,11SUB#18 <- #14 DO ,11SUB#19 <- #128 DO ,11SUB#20 <- #114 PLEASE DO ,11SUB#21 <- #214 DO ,11SUB#22 <- #24 DO ,11SUB#23 <- #112 DO ,11SUB#24 <- #162 PLEASE DO ,11SUB#25 <- #22 DO ,11SUB#26 <- #104 DO ,11SUB#27 <- #80 DO ,11SUB#28 <- #256 PLEASE DO ,11SUB#29 <- #2 DO ,11SUB#30 <- #228 PLEASE DO ,12 <- #49 PLEASE DO ,12SUB#1 <- #76 DO ,12SUB#2 <- #190 DO ,12SUB#3 <- #80 DO ,12SUB#4 <- #200 PLEASE DO ,12SUB#5 <- #256 DO ,12SUB#6 <- #248 DO ,12SUB#7 <- #144 DO ,12SUB#8 <- #216 PLEASE DO ,12SUB#9 <- #202 DO ,12SUB#10 <- #14 DO ,12SUB#11 <- #144 DO ,12SUB#12 <- #98 PLEASE DO ,12SUB#13 <- #190 DO ,12SUB#14 <- #160 DO ,12SUB#15 <- #256 DO ,12SUB#16 <- #88 PLEASE DO ,12SUB#17 <- #218 DO ,12SUB#18 <- #36 DO ,12SUB#19 <- #38 DO ,12SUB#20 <- #164 PLEASE DO ,12SUB#21 <- #176 DO ,12SUB#22 <- #48 DO ,12SUB#23 <- #162 DO ,12SUB#24 <- #14 PLEASE DO ,12SUB#25 <- #128 DO ,12SUB#26 <- #208 DO ,12SUB#27 <- #162 DO ,12SUB#28 <- #222 PLEASE DO ,12SUB#29 <- #48 DO ,12SUB#30 <- #8 DO ,12SUB#31 <- #120 DO ,12SUB#32 <- #66 PLEASE DO ,12SUB#33 <- #48 DO ,12SUB#34 <- #246 DO ,12SUB#35 <- #136 DO ,12SUB#36 <- #184 PLEASE DO ,12SUB#37 <- #256 DO ,12SUB#38 <- #202 DO ,12SUB#39 <- #110 DO ,12SUB#40 <- #104 PLEASE DO ,12SUB#41 <- #42 DO ,12SUB#42 <- #126 DO ,12SUB#43 <- #56 DO ,12SUB#44 <- #88 PLEASE DO ,12SUB#45 <- #72 DO ,12SUB#46 <- #56 DO ,12SUB#47 <- #80 DO ,12SUB#48 <- #242 PLEASE DO ,12SUB#49 <- #228 PLEASE DO ,13 <- #31 PLEASE DO ,13SUB#1 <- #76 DO ,13SUB#2 <- #190 DO ,13SUB#3 <- #80 DO ,13SUB#4 <- #200 PLEASE DO ,13SUB#5 <- #256 DO ,13SUB#6 <- #248 DO ,13SUB#7 <- #144 DO ,13SUB#8 <- #216 PLEASE DO ,13SUB#9 <- #202 DO ,13SUB#10 <- #14 DO ,13SUB#11 <- #144 DO ,13SUB#12 <- #98 PLEASE DO ,13SUB#13 <- #190 DO ,13SUB#14 <- #160 DO ,13SUB#15 <- #256 DO ,13SUB#16 <- #88 PLEASE DO ,13SUB#17 <- #74 DO ,13SUB#18 <- #14 DO ,13SUB#19 <- #128 DO ,13SUB#20 <- #114 PLEASE DO ,13SUB#21 <- #214 DO ,13SUB#22 <- #24 DO ,13SUB#23 <- #112 DO ,13SUB#24 <- #162 PLEASE DO ,13SUB#25 <- #22 DO ,13SUB#26 <- #104 DO ,13SUB#27 <- #80 DO ,13SUB#28 <- #256 PLEASE DO ,13SUB#29 <- #194 DO ,13SUB#30 <- #36 DO ,13SUB#31 <- #256 PLEASE DO ,20 <- #10 PLEASE DO ,20 SUB #1 <- #76 DO ,20 SUB #2 <- #196 DO ,20 SUB #3 <- #4 DO ,20 SUB #4 <- #132 PLEASE DO ,20 SUB #5 <- #36 DO ,20 SUB #6 <- #164 DO ,20 SUB #7 <- #228 DO ,20 SUB #8 <- #100 PLEASE DO ,20 SUB #9 <- #52 DO ,20 SUB #10 <- #180 PLEASE DO ,21 <- #10 BY #10 PLEASE DO ,21SUB#1#1 <- #248 PLEASE DO ,21SUB#1#2 <- #120 PLEASE DO ,21SUB#1#3 <- #184 PLEASE DO ,21SUB#1#4 <- #56 PLEASE DO ,21SUB#1#5 <- #216 PLEASE DO ,21SUB#1#6 <- #88 PLEASE DO ,21SUB#1#7 <- #152 PLEASE DO ,21SUB#1#8 <- #24 PLEASE DO ,21SUB#1#9 <- #232 PLEASE DO ,21SUB#1#10 <- #104 DO ,21SUB#2#1 <- #128 DO ,21SUB#2#2 <- #256 DO ,21SUB#2#3 <- #64 DO ,21SUB#2#4 <- #192 DO ,21SUB#2#5 <- #96 DO ,21SUB#2#6 <- #224 DO ,21SUB#2#7 <- #32 DO ,21SUB#2#8 <- #160 DO ,21SUB#2#9 <- #112 DO ,21SUB#2#10 <- #240 DO ,21SUB#3#1 <- #64 DO ,21SUB#3#2 <- #192 DO ,21SUB#3#3 <- #256 DO ,21SUB#3#4 <- #128 DO ,21SUB#3#5 <- #32 DO ,21SUB#3#6 <- #160 DO ,21SUB#3#7 <- #224 DO ,21SUB#3#8 <- #96 DO ,21SUB#3#9 <- #48 DO ,21SUB#3#10 <- #176 DO ,21SUB#4#1 <- #192 DO ,21SUB#4#2 <- #64 DO ,21SUB#4#3 <- #128 DO ,21SUB#4#4 <- #256 DO ,21SUB#4#5 <- #160 DO ,21SUB#4#6 <- #32 DO ,21SUB#4#7 <- #96 DO ,21SUB#4#8 <- #224 DO ,21SUB#4#9 <- #176 DO ,21SUB#4#10 <- #48 PLEASE DO ,21SUB#5#1 <- #32 PLEASE DO ,21SUB#5#2 <- #160 PLEASE DO ,21SUB#5#3 <- #224 PLEASE DO ,21SUB#5#4 <- #96 PLEASE DO ,21SUB#5#5 <- #256 PLEASE DO ,21SUB#5#6 <- #128 PLEASE DO ,21SUB#5#7 <- #192 PLEASE DO ,21SUB#5#8 <- #64 PLEASE DO ,21SUB#5#9 <- #16 PLEASE DO ,21SUB#5#10 <- #144 DO ,21SUB#6#1 <- #160 DO ,21SUB#6#2 <- #32 DO ,21SUB#6#3 <- #96 DO ,21SUB#6#4 <- #224 DO ,21SUB#6#5 <- #128 DO ,21SUB#6#6 <- #256 DO ,21SUB#6#7 <- #64 DO ,21SUB#6#8 <- #192 DO ,21SUB#6#9 <- #144 DO ,21SUB#6#10 <- #16 DO ,21SUB#7#1 <- #96 DO ,21SUB#7#2 <- #224 DO ,21SUB#7#3 <- #32 DO ,21SUB#7#4 <- #160 DO ,21SUB#7#5 <- #64 DO ,21SUB#7#6 <- #192 DO ,21SUB#7#7 <- #256 DO ,21SUB#7#8 <- #128 DO ,21SUB#7#9 <- #80 DO ,21SUB#7#10 <- #208 DO ,21SUB#8#1 <- #224 DO ,21SUB#8#2 <- #96 DO ,21SUB#8#3 <- #160 DO ,21SUB#8#4 <- #32 DO ,21SUB#8#5 <- #192 DO ,21SUB#8#6 <- #64 DO ,21SUB#8#7 <- #128 DO ,21SUB#8#8 <- #256 DO ,21SUB#8#9 <- #208 DO ,21SUB#8#10 <- #80 PLEASE DO ,21SUB#9#1 <- #16 PLEASE DO ,21SUB#9#2 <- #144 PLEASE DO ,21SUB#9#3 <- #208 PLEASE DO ,21SUB#9#4 <- #80 PLEASE DO ,21SUB#9#5 <- #240 PLEASE DO ,21SUB#9#6 <- #112 PLEASE DO ,21SUB#9#7 <- #176 PLEASE DO ,21SUB#9#8 <- #48 PLEASE DO ,21SUB#9#9 <- #256 PLEASE DO ,21SUB#9#10 <- #128 DO ,21SUB#10#1 <- #144 DO ,21SUB#10#2 <- #16 DO ,21SUB#10#3 <- #80 DO ,21SUB#10#4 <- #208 DO ,21SUB#10#5 <- #112 DO ,21SUB#10#6 <- #240 DO ,21SUB#10#7 <- #48 DO ,21SUB#10#8 <- #176 DO ,21SUB#10#9 <- #128 DO ,21SUB#10#10 <- #256 PLEASE DO ,22 <- #10 PLEASE DO ,22 SUB #1 <- #8 DO ,22 SUB #2 <- #136 DO ,22 SUB #3 <- #72 DO ,22 SUB #4 <- #200 PLEASE DO ,22 SUB #5 <- #40 DO ,22 SUB #6 <- #168 DO ,22 SUB #7 <- #104 DO ,22 SUB #8 <- #232 PLEASE DO ,22 SUB #9 <- #24 DO ,22 SUB #10 <- #152 DO .10 <- #9 DO .11 <- #9 PLEASE DO ,10 <- #1 PLEASE DO ,10SUB#1 <- #176 DO READ OUT ,10 DO COME FROM (999) DO (500) NEXT PLEASE DO ,11SUB#1 <- .5 DO READ OUT ,11 DO (500) NEXT DO ,12SUB#1 <- .5 PLEASE DO READ OUT ,12 PLEASE DO .6 <- '?"!10~.10'~#1"$#1'~#3 DO (50) NEXT PLEASE DO .7 <- '?"!11~.11'~#1"$#1'~#3 DO (70) NEXT DO .2 <- #1 DO .1 <- .11 PLEASE DO (1010) NEXT DO .11 <- .3 DO (600) NEXT DO (101) NEXT (70) DO (71) NEXT DO .11 <- #9 DO .2 <- #1 PLEASE DO .1 <- .10 DO (1010) NEXT DO .10 <- .3 DO (600) NEXT DO (101) NEXT (71) DO RESUME .7 (50) DO (51) NEXT PLEASE DO FORGET #1 DO .2 <- #1 DO .1 <- .11 PLEASE DO (1010) NEXT DO .11 <- .3 DO (600) NEXT PLEASE DO .7 <- '?"!11~.11'~#1"$#1'~#3 DO (80) NEXT DO (101) NEXT (80) DO (81) NEXT DO GIVE UP (81) DO RESUME .7 (51) DO RESUME .6 (101) DO FORGET #1 (999) DO FORGET #1 (600) DO (500) NEXT DO ,13SUB#1 <- .5 DO READ OUT ,13 DO RESUME #1 (500) DO ,30 <- #1 DO .1 <- .10 DO (1020) NEXT PLEASE DO ,30SUB#1 <- ,20SUB.1 DO READ OUT ,30 DO .3 <- .1 DO .1 <- .11 DO (1020) NEXT PLEASE DO ,30SUB#1 <- ,21SUB .3 .1 DO READ OUT ,30 DO .5 <- ,22SUB.1 PLEASE DO RESUME #1 intercal-0.30/pit/PaxHeaders.27456/rot13.doc0000644000000000000000000000007411437550756015256 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/rot13.doc0000644000175000017500000000074211437550756015154 0ustar00esresr00000000000000 From: jlm@cco.caltech.edu (Jacob Mandelson) Newsgroups: alt.lang.intercal Subject: Re: ROT-13 Date: 7 Jun 1993 21:36:40 GMT Organization: California Institute of Technology, Pasadena Message-ID: <1v0cd9INN8gk@gap.caltech.edu> Here's an intercal program that encodes/decodes rot13 documents: [Program moved to separate file and modified to satisfy the politeness rules, LHH 5/11/96.] -- Jacob Mandelson jlm@cco.caltech.edu Electrical engineers do it with less resistance. intercal-0.30/pit/PaxHeaders.27456/fft-delta.tst0000644000000000000000000000007411437550756016221 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.558945776 intercal-0.30/pit/fft-delta.tst0000644000175000017500000000250611437550756016117 0ustar00esresr00000000000000ONE ONE TWO EIGHT ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO SIX OH OH OH OH OH OH ZERO ONE ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO SIX OH OH OH OH OH OH ZERO ONE ZERO ZERO ZERO ZERO ZERO ZERO ZERO intercal-0.30/pit/PaxHeaders.27456/interfunge.chk0000644000000000000000000000007411440130756016440 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/interfunge.chk0000644000175000017500000000065311440130756016337 0ustar00esresr00000000000000_ I II III IV V VI VII GOOD: , works GOOD: : duplicates GOOD: empty stack pops zero GOOD: 2-2 = 0 GOOD: | works GOOD: 0! = 1 GOOD: 7! = 0 GOOD: 8*0 = 0 GOOD: # < jumps into < GOOD: \ swaps GOOD: 01` = 0 GOOD: 10` = 1 GOOD: 900pg gets 9 GOOD: p modifies space GOOD: wraparound works UNDEF: edge # hits column 80 GOOD: Funge-93 spaces The Befunge-93 version of the Mycology test suite is done. Quitting... intercal-0.30/pit/PaxHeaders.27456/sort.tst0000644000000000000000000000007411437550756015342 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.574945729 intercal-0.30/pit/sort.tst0000644000175000017500000000003211437550756015230 0ustar00esresr00000000000000SIX FIVE SEVEN THREE ZERO intercal-0.30/pit/PaxHeaders.27456/random.i0000644000000000000000000000007411437550756015251 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/random.i0000644000175000017500000000061311437550756015144 0ustar00esresr00000000000000 DO (1900) NEXT DO READ OUT .1 PLEASE GIVE UP (1900) DO STASH .2 + .3 DO .3 <- #65535 DO (1903) NEXT (1903) PLEASE FORGET #1 DO .2 <- #0 PLEASE %50 IGNORE .2 DO .2 <- #1 PLEASE REMEMBER .2 DO .1 <- !1$.2'~"#65535$#1" DO .3 <- .3~#65534 DO (1902) NEXT DO (1903) NEXT (1902) DO (1904) NEXT DO RETRIEVE .2 + .3 DO FORGET #1 PLEASE RESUME #1 (1904) PLEASE RESUME '?"!3~.3'~#1"$#1'~#3 intercal-0.30/pit/PaxHeaders.27456/iching2.i0000644000000000000000000000007411437550756015314 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/iching2.i0000644000175000017500000000543111437550756015212 0ustar00esresr00000000000000 DO .2 <- #32 DO .5 <- #0 DO .6 <- #0 PLEASE COME FROM (10) DO .1 <- #0 DO (1020) NEXT DO (1020) NEXT PLEASE DO %50 (1020) NEXT DO (1020) NEXT DO (1020) NEXT PLEASE DO %50 (1020) NEXT DO (1020) NEXT DO (1020) NEXT PLEASE DO %50 (1020) NEXT DO READ OUT .1 DO (61) NEXT DO .6 <- "V.2$.6"~#1365 DO (93) NEXT (62) DO .3 <- "?.1$#6"~#21 PLEASE RESUME '?"!3~.3'~#1"$#2'~#3 (61) DO (62) NEXT PLEASE FORGET #1 DO (71) NEXT DO .5 <- "V.2$.5"~#1365 DO .6 <- "V.2$.6"~#1365 DO (93) NEXT (72) DO .3 <- "?.1$#7"~#21 PLEASE RESUME '?"!3~.3'~#1"$#2'~#3 (71) DO (72) NEXT PLEASE FORGET #1 DO (91) NEXT DO .5 <- "V.2$.5"~#1365 DO (93) NEXT (92) DO .3 <- "?.1$#9"~#85 PLEASE RESUME '?"!3~.3'~#1"$#2'~#3 (91) DO (92) NEXT (93) PLEASE FORGET #1 DO (30) NEXT (10) DO .2 <- .2~#62 (20) DO RESUME "?.2$#2"~#3 (30) DO (20) NEXT PLEASE FORGET #1 DO ,1 <- #64 DO ,1 SUB #1 <- #2 DO ,1 SUB #2 <- #23 DO ,1 SUB #3 <- #8 PLEASE DO ,1 SUB #4 <- #20 DO ,1 SUB #5 <- #16 DO ,1 SUB #6 <- #35 DO ,1 SUB #7 <- #45 PLEASE DO ,1 SUB #8 <- #12 DO ,1 SUB #9 <- #15 DO ,1 SUB #10 <- #52 DO ,1 SUB #11 <- #39 PLEASE DO ,1 SUB #12 <- #53 DO ,1 SUB #13 <- #62 DO ,1 SUB #14 <- #56 DO ,1 SUB #15 <- #31 PLEASE DO ,1 SUB #16 <- #33 DO ,1 SUB #17 <- #7 DO ,1 SUB #18 <- #4 DO ,1 SUB #19 <- #29 PLEASE DO ,1 SUB #20 <- #59 DO ,1 SUB #21 <- #40 DO ,1 SUB #22 <- #64 DO ,1 SUB #23 <- #47 PLEASE DO ,1 SUB #24 <- #6 DO ,1 SUB #25 <- #46 DO ,1 SUB #26 <- #18 DO ,1 SUB #27 <- #48 PLEASE DO ,1 SUB #28 <- #57 DO ,1 SUB #29 <- #32 DO ,1 SUB #30 <- #50 DO ,1 SUB #31 <- #28 PLEASE DO ,1 SUB #32 <- #44 DO ,1 SUB #33 <- #24 DO ,1 SUB #34 <- #27 DO ,1 SUB #35 <- #3 PLEASE DO ,1 SUB #36 <- #42 DO ,1 SUB #37 <- #51 DO ,1 SUB #38 <- #21 DO ,1 SUB #39 <- #17 PLEASE DO ,1 SUB #40 <- #25 DO ,1 SUB #41 <- #36 DO ,1 SUB #42 <- #22 DO ,1 SUB #43 <- #63 PLEASE DO ,1 SUB #44 <- #37 DO ,1 SUB #45 <- #55 DO ,1 SUB #46 <- #30 DO ,1 SUB #47 <- #49 PLEASE DO ,1 SUB #48 <- #13 DO ,1 SUB #49 <- #19 DO ,1 SUB #50 <- #41 DO ,1 SUB #51 <- #60 PLEASE DO ,1 SUB #52 <- #61 DO ,1 SUB #53 <- #54 DO ,1 SUB #54 <- #38 DO ,1 SUB #55 <- #58 PLEASE DO ,1 SUB #56 <- #10 DO ,1 SUB #57 <- #11 DO ,1 SUB #58 <- #26 DO ,1 SUB #59 <- #5 PLEASE DO ,1 SUB #60 <- #9 DO ,1 SUB #61 <- #34 DO ,1 SUB #62 <- #14 DO ,1 SUB #63 <- #43 PLEASE DO ,1 SUB #64 <- #1 DO .1 <- .5 DO (1020) NEXT PLEASE READ OUT ,1 SUB .1 DO .1 <- .6 DO (1020) NEXT PLEASE READ OUT ,1 SUB .1 PLEASE GIVE UP intercal-0.30/pit/PaxHeaders.27456/tests0000644000000000000000000000013012507267255014673 xustar0029 mtime=1427992237.75093968 30 atime=1427992237.754939663 29 ctime=1427992237.75093968 intercal-0.30/pit/tests/0000755000175000017500000000000012507267255014652 5ustar00esresr00000000000000intercal-0.30/pit/tests/PaxHeaders.27456/testcreate.chk0000644000000000000000000000007411437550756017613 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/testcreate.chk0000644000175000017500000000001211437550756017477 0ustar00esresr00000000000000 VI V intercal-0.30/pit/tests/PaxHeaders.27456/permute.doc0000644000000000000000000000007411437550756017131 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/permute.doc0000644000175000017500000001006411437550756017025 0ustar00esresr00000000000000permute.i prints the permutations of the set {1,2,3,4,5,6}, using backtracking (and therefore must be compiled with the -m compiler option). In the output, numbers in a permutation are given one per line, with each digit list followed by XXX. This program is an excellent regression test because it uses a large crossection of INTERCAL control structures; computed COME FROM, ordinary COME FROM, ABSTAIN/REINSTATE, AGAIN, NEXT, and MAYBE/GO AHEAD/GO BACK are all used. Only ONCE (which is implied in the program due to the abstention/reinstatement of an AGAIN line) and IGNORE are left unused (at least until someone invents a new even nastier control structure). Unusually, it only contains three nontrivial expressions (those other than a single constant or a single variable). The following is the program translated into a mix of Prolog and C, with some INTERCAL operations (gets, stash, retrieve, giveup) scattered throughout the program. goal :- gets(.1, #0), gennumber, checklist, gennumber, checklist, gennumber, checklist, gennumber, checklist, gennumber, checklist, gennumber, checklist, readout(.1), retrieve(.1), readout(.1), retrieve(.1), readout(.1), retrieve(.1), readout(.1), retrieve(.1), readout(.1), retrieve(.1), readout(.1), readout(#30), fail. goal :- giveup. gennumber :- stash(.1), gets(.1, #1). gennumber :- stash(.1), gets(.1, #2). gennumber :- stash(.1), gets(.1, #3). gennumber :- stash(.1), gets(.1, #4). gennumber :- stash(.1), gets(.1, #5). gennumber :- stash(.1), gets(.1, #6). checklist :- gets(.2, .1), while(.1 != #0) { retrieve(.1), if(.1 == .2) {!, fail.} }, fail. checklist. The backtracking reverses all the stashing and retrieving that is done, so that at the end of the program .1 is #0 again and there is no stash on .1. The INTERCAL has a somewhat Prolog-like attitude: it never uses GO BACK to remove a choicepoint except when GOING BACK to an earlier choicepoint (just like Prolog). The checklist. at the end of the pseudo-Prolog source is actually an attempt to replicate the semantics of MAYBE COME FROM; MAYBE COME FROM...GO BACK continues as if nothing had happened, except for leaving a stale choicepoint on the stack (but the program runs GO BACK in a loop whenever there is a risk of encountering a stale choicepoint on top of the stack), but MAYBE COME FROM...GO AHEAD, GO BACK causes the line that was come from to fail. (The GO AHEAD, GO BACK was translated as !, fail in the pseudo-Prolog above, as it has a similar effect). The program clearly shows that INTERCAL's variables are more general than Prolog's (you can rebind a variable in INTERCAL, and the rebinding is undone on backtracking), especially when stashes are taken into account. On the other hand, the program couldn't work as written in C, because checklist destroys all the information about the permutations so far! (In both the Prolog source above and in the INTERCAL, this destruction is always cancelled out by backtracking past it). This program probably could be translated into Prolog, but there would be a lot more passing-around of variables, and probably more predicates involved (I think gets, stash, and retrieve might be possible in terms of assert/retract). However, I think that the INTERCAL source is the clearest available implementation of the exact program flow above. Note also the way that I translated the if() and while() into INTERCAL. if(<1 or 2>==1) something becomes DO ABSTAIN <1 or 2> FROM (label) DO REINSTATE (label) (label) DO something AGAIN which is the shortest way to do an if() statement in INTERCAL that I have discovered (yes! ABSTAIN and REINSTATE have a purpose again!). do {block} while(<0 or 1>) becomes DO COME FROM <0 or 1>$label most of block (1$label) last statement of block which is pretty clear when written like this, but amazingly confusing to track in the INTERCAL, and also prevents the user using 0$label as a line number, without any obvious clue to this effect in the source code. while() can often be transformed into do..while(), and even in situations where it can't, an extra COME FROM does the trick. intercal-0.30/pit/tests/PaxHeaders.27456/count.3i0000644000000000000000000000007411437550756016346 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.582945706 intercal-0.30/pit/tests/count.3i0000644000175000017500000000175611437550756016252 0ustar00esresr00000000000000 DO ,1 <- #16 DO :2 <- #6490$#55022 PLEASE DO (44) NEXT DO :2 <- #5631$#54733 PLEASE DO (44) NEXT DO :2 <- #14637$#40039 PLEASE DO (44) NEXT DO :2 <- #58550$#53112 PLEASE DO (44) NEXT DO .1 <- #1 PLEASE DO (99) NEXT DO GIVE UP (44) DO REINSTATE COMING FROM (19) DO COME FROM (68) DO ABSTAIN FROM (19) (31) DO COME FROM (34) DO ABSTAIN FROM (31) (88) DO COME FROM (65) PLEASE ABSTAIN FROM (88) DO COME FROM (44) PLEASE DO (123) NEXT DO .3 <- ':2~"#4$#13"' DO :2 <- ':2~"#29520$#29511"' DO ,1 SUB .1 <- .3 (65) DON'T GIVE UP (34) PLEASE DON'T GIVE UP (68) DO NOTE THAT THIS FUNNY CODE ACTUALLY WORKS PLEASE RESUME #1 (99) DO COME FROM (69) DO READ OUT ,1 DO ,1 SUB #1 <- #180 DO READ OUT .1 DO .2 <- "?.1$#10"~"#0$#29524" PLEASE DO (15) NEXT (69) PLEASE DO (123) NEXT (42) DO RESUME .9 (123) PLEASE .8 <- #1 DO COME FROM (81) DO .9 <- '?"V!1~.8'$#1"~#1'~#1 DO .1 <- "^.1$.8"~"#0$#29524" PLEASE DO (42) NEXT (81) DO .8 <- !8$#0'~"#9841$#1" (15) PLEASE RESUME '?"!2~.2'~#2"$#1'~#1 intercal-0.30/pit/tests/PaxHeaders.27456/permute.i0000644000000000000000000000007411437550756016614 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/permute.i0000644000175000017500000000241511437550756016511 0ustar00esresr00000000000000 PLEASE NOTE THIS IS A BACKTRACKING PERMUTATION PROGRAM MAYBE DON'T GIVE UP DO .1 <- #0 (3) DO (24) NEXT (4) DO (24) NEXT (5) DO (24) NEXT (6) DO (24) NEXT (7) DO (24) NEXT (8) DO (24) NEXT DO READ OUT .1 PLEASE RETRIEVE .1 DO READ OUT .1 PLEASE RETRIEVE .1 DO READ OUT .1 PLEASE RETRIEVE .1 DO READ OUT .1 PLEASE RETRIEVE .1 DO READ OUT .1 PLEASE RETRIEVE .1 DO READ OUT .1 DO READ OUT #30 DO COME FROM (22) (22) DO GO BACK (24) PLEASE NOTE THIS RETURNS #1 TO #6 ON DIFFERENT BACKTRACKS DO STASH .1 (26) DO .1 <- #1 (27) DO .1 <- #2 (28) DO .1 <- #3 (29) DO .1 <- #4 (30) DO .1 <- #5 DO .1 <- #6 DO RESUME #1 MAYBE COME FROM (26) PLEASE RESUME #1 MAYBE COME FROM (27) PLEASE RESUME #1 MAYBE COME FROM (28) PLEASE RESUME #1 MAYBE COME FROM (29) PLEASE RESUME #1 MAYBE COME FROM (30) PLEASE RESUME #1 PLEASE NOTE THIS BACKTRACKS IF .1 IS NONUNIQUE IN ITS STASH MAYBE COME FROM (3) MAYBE COME FROM (4) MAYBE COME FROM (5) MAYBE COME FROM (6) MAYBE COME FROM (7) MAYBE COME FROM (8) PLEASE DO .2 <- .1 DO .3 <- #1 DO COME FROM '"?"!3~.3'~#1"$#2"~#1'$#15 PLEASE DO RETRIEVE .1 DO ABSTAIN "?"!1~.1'~#1"$#1"~#3 FROM (55) DO REINSTATE (55) (55) DO GO BACK AGAIN (87) PLEASE DO .3 <- '?.1$.2'~#21845 DO GO AHEAD DO COME FROM (61) (61) PLEASE DO GO BACK intercal-0.30/pit/tests/PaxHeaders.27456/hello.i0000644000000000000000000000007411437550756016236 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/hello.i0000644000175000017500000000066111437550756016134 0ustar00esresr00000000000000 DO ,1 <- #13 PLEASE DO ,1SUB#1 <- #234 DO ,1SUB#2 <- #112 DO ,1SUB#3 <- #112 DO ,1SUB#4 <- #0 DO ,1SUB#5 <- #64 DO ,1SUB#6 <- #194 DO ,1SUB#7 <- #48 PLEASE DO ,1SUB#8 <- #22 DO ,1SUB#9 <- #248 DO ,1SUB#10 <- #168 DO ,1SUB#11 <- #24 DO ,1SUB#12 <- #16 DO ,1SUB#13 <- #214 PLEASE READ OUT ,1 PLEASE GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/hello.chk0000644000000000000000000000007411437550756016553 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/hello.chk0000644000175000017500000000001511437550756016442 0ustar00esresr00000000000000hello, world intercal-0.30/pit/tests/PaxHeaders.27456/pictest.i0000644000000000000000000000007411437550756016606 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/pictest.i0000644000175000017500000000040211437550756016475 0ustar00esresr00000000000000PLEASE NOTE This continuously copies PORTA to PORTB (PORTA is always input, PORTB is always output) DO .2 <- #0 DO .1 <- #65280 PLEASE COME FROM (11) DO (1520) NEXT DO PIN :1 DO .1 <- :1~#255 PLEASE DO .2 <- #257 DO (1030) NEXT (11) DO .1 <- .3 intercal-0.30/pit/tests/PaxHeaders.27456/testsplat.i0000644000000000000000000000007411437550756017156 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/testsplat.i0000644000175000017500000000026111437550756017050 0ustar00esresr00000000000000 PLEASE DO READ OUT #1 DO READ OUT #2 DO READ OUT #3 DO REDA OUT #4 DO READ OUT #5 DO READ OUT #6 DO RED OUT #7 DO RED OUT #8 DO READ OUTT #9 PLEASE DO GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/testlib2.i0000644000000000000000000000007411437550756016663 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/testlib2.i0000644000175000017500000000257511437550756016567 0ustar00esresr00000000000000 DO (10) NEXT (10) PLEASE FORGET #1 DO WRITE IN .1 DO (2000) NEXT DO READ OUT .1 DO GIVE UP (20) PLEASE FORGET #1 DO WRITE IN .1 DO (22) NEXT (21) DO (2010) NEXT DO READ OUT .1 (22) PLEASE FORGET #1 DO (21) NEXT DO READ OUT .1 DO GIVE UP (30) PLEASE FORGET #1 DO WRITE IN .1 DO WRITE IN .2 DO (2020) NEXT DO READ OUT .1 DO GIVE UP (2010) PLEASE ABSTAIN FROM (2004) (2000) DO STASH .2 DO .2 <- #1 DO (2001) NEXT (2001) PLEASE FORGET #1 DO .1 <- '?.1$.2'~'#0$#65535' DO (2002) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (2001) NEXT (2003) PLEASE RESUME "?!1~.2'$#1"~#3 (2002) DO (2003) NEXT PLEASE RETRIEVE .2 (2004) PLEASE RESUME #2 PLEASE DO REINSTATE (2004) PLEASE RESUME '?"!1~.1'~#1"$#2'~#6 (2020) PLEASE STASH .2 + .3 DO (1021) NEXT (1020) DO STASH .2 + .3 DO .2 <- #1 PLEASE DO (1021) NEXT (1021) DO FORGET #1 DO .3 <- "?!1~.2'$#1"~#3 PLEASE DO .1 <- '?.1$.2'~'#0$#65535' DO (1022) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (1021) NEXT (1023) PLEASE RESUME .3 (1022) DO (1023) NEXT PLEASE RETRIEVE .2 + .3 PLEASE RESUME #2 intercal-0.30/pit/tests/PaxHeaders.27456/sink.chk0000644000000000000000000000007411437550756016414 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/sink.chk0000644000175000017500000000015311437550756016306 0ustar00esresr00000000000000ICL123I PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON ON THE WAY TO 1 CORRECT SOURCE AND RESUBNIT intercal-0.30/pit/tests/PaxHeaders.27456/ais2.i0000644000000000000000000000007411437550756015771 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.582945706 intercal-0.30/pit/tests/ais2.i0000644000175000017500000000517211437550756015671 0ustar00esresr00000000000000 PLEASE NOTE THIS PROGRAM USES NO NEXTING + FORGETTING + RESUMING (5) DO .1 <- #0 (6) DO .2 <- #1 (7) DO .9 <- #1 DON'T .1 <- .2 DON'T .2 <- .3 DON'T READ OUT .1 DON'T WRITE IN .9 PLEASE NOTE THAT WE EXIT IF WE READ ZERO DO REINSTATE (15) DO REINSTATE (14) (14) DO ABSTAIN FROM (16) (15) DO ABSTAIN '"'.9~.9'~#1"$#1'~#3 FROM (16) PLEASE NOTE THAT LINE 16 IS NOW ABSTAINED FROM TWICE OR FOUR TIMES DO REINSTATE (16) DO REINSTATE (16) (16) DON'T ABSTAIN FROM CALCULATING + REINSTATING + ABSTAINING + TRYING AGAIN DO REINSTATE (16) DO REINSTATE (16) (10) PLEASE DO REINSTATE CALCULATING + READING OUT + WRITING IN DO ABSTAIN FROM (5) DO ABSTAIN FROM (6) DO ABSTAIN FROM (7) DO ABSTAIN FROM (10) DO ABSTAIN FROM ABSTAINING DO .3 <- .1 DO .4 <- .2 PLEASE NOTE THAT WE ARE PERFORMING .3 <- .3 (arithmetic +) .4 NOTE ALSO THAT THIS CAN BE SUPRESSED BY IGNORING .3 AND ALSO THAT .5, .6 ARE USED AS TEMPORARIES AND THAT THIS DISCARDS THE HIGH BIT ON OVERFLOW DON'T FORGET THAT THIS CONTAINS 16 REPETITIONS OF THE SAME LINE DO .5 <- .4 PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE DO .6 <- "&!3$.5'"~'#0$#65535' DO .3 <- "?!3$.5'"~'#0$#65535' DO .5 <- !6$#0'~"#32767$#1" PLEASE TRY AGAIN intercal-0.30/pit/tests/PaxHeaders.27456/ais1.i0000644000000000000000000000007411437550756015770 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.582945706 intercal-0.30/pit/tests/ais1.i0000644000175000017500000000031011437550756015655 0ustar00esresr00000000000000 DO COME FROM (4) DO WRITE IN .1 DO READ OUT .1 (4) DO (5) NEXT (5) DO (7) NEXT PLEASE GIVE UP (7) PLEASE .2 <- "?'"!1~.1'~#1"$#1'"~#3 DON'T READ OUT .2 PLEASE RESUME .2 intercal-0.30/pit/tests/PaxHeaders.27456/testi18n.i0000644000000000000000000000007411437550756016612 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/testi18n.i0000644000175000017500000000031611437550756016505 0ustar00esresr00000000000000 PLEASE .1 <- #1$#0 DO .2 <- #1¢#0 DO .3 <- #1£#0 DO .4 <- #1¤#0 PLEASE READ OUT .1 DO READ OUT .2 DO READ OUT .3 DO READ OUT .4 PLEASE GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/limits3.3i0000644000000000000000000000007411437550756016602 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/limits3.3i0000644000175000017500000000015211437550756016473 0ustar00esresr00000000000000 DO .1 <- #59048 DO :1 <- #59048 DO WRITE IN .1 + :1 DO READ OUT .1 + :1 PLEASE GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/iogerunds.i0000644000000000000000000000007411437550756017132 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/iogerunds.i0000644000175000017500000000105111437550756017022 0ustar00esresr00000000000000 DO .1 <- #123 DO ABSTAIN FROM WRITING IN DO COME FROM (123) (100) DO WRITE IN .1 PLEASE .2 <- #1 DO %50 .2 <- !2$#0' PLEASE DO (42) NEXT DO ABSTAIN FROM READING OUT PLEASE COME FROM (69) DO READ OUT .1 DO REINSTATE READING OUT (123) PLEASE REINSTATE (100) (42) DO (43) NEXT DO FORGET #1 DO (105) NEXT PLEASE GIVE UP (105) DO (106) NEXT (69) DON'T GIVE UP (106) PLEASE DO RESUME "'?"!1~.1'~#1"$#1'~#1"$'".1~.1"~#1' (43) DO RESUME .2 intercal-0.30/pit/tests/PaxHeaders.27456/arrtest.doc0000644000000000000000000000007411437550756017134 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.582945706 intercal-0.30/pit/tests/arrtest.doc0000644000175000017500000001072411437550756017033 0ustar00esresr00000000000000arrtest.i is a program I wrote to test my correction to a nasty ambiguity in grammar that was rendering many programs incompilable. The problem is: sublist1 : unambig _ sublist : unambig _ sublist sublist : unambig _ sublist1 Token received: SPARK or EARS. Shift/reduce conflict. This is an example from numio.i: DO .5 <- '?"'#65535~"'?.7$",2SUB.1"'~#21845"'~#1"$#1'~#3 ^ ambiguity The problem is that it's unclear whether the spark/ears is the end of an expression around the array reference (reduce), or whether it's the start of a new subscript (shift). In this case, the reduction is wanted. With the shift taking priority, there seems to be no way to write this statement without splitting it. The grammar as of INTERCAL 0.24 uses the shift by default. This is because multidimensional arrays may do this sort of thing: DO .1 <- ',2SUB.1".2~.3"'~#1 where the shift is needed to parse the ".2~.3" construct. In the first case, there is no information within the next two characters that indicates that it was the shift that was wanted; in the second case, the fact that it's an ears, not a spark, indicates to humans that the reduce is needed, but yacc/bison cannot determine this as they don't have information about whether the current spark/ears level was introduced with sparks or ears. At first I thought that scanning past all spark/ears to find the first non-sparkears character could solve the problem, even if it could not be coded in yacc, but the following code shows the problem: DO .1 <- ,3SUB",2SUB.1".2 (reduce required) (It could be the start of this statement: DO .1 <- ,3SUB",2SUB.1".2~.3"".4 (shift required)) The two statements above are the same for several tokens after the ambiguity, and are even the same for 2 tokens after the forward scan. This sort of problem is probably why the original manual suggested alternating sparks and ears in various levels of expression grouping. The only solution I can think of is: Determine somehow whether we are on a spark level or an ears level Force alternation of sparks and ears (constraint on the programmer) at different levels of expression grouping when dealing with near-ambiguous expressions involving spark/ears and arrays, like the ones above (so the fourth statement above would be illegal) Look at whether we see a spark or an ears to determine whether to shift or reduce In other words, reduce whenever it would be a legal way to close the current spark/ears level, otherwise shift. So how to determine whether we're on a spark level or an ears level? The solution is for the lexer to place all the sparks and ears it encounters on a spark/ears stack, and for the parser to pop two sparkears off the stack whenever it reduces a SPARK [unary] SPARK or EARS [unary] EARS. Once the determination is in place, all that is required is a way of determining whether to shift or reduce based on a variable in the program, rather than just a priority (which wouldn't work). This doesn't seem to fit into yacc's syntax, so it's possible that after all, yacc can't work with the INTERCAL syntax. But there is a solution (one that I used to determine COMPUCOME from COME_FROM): syntax analysis in the lexer! The idea is that legal closing spark/ears have different tokens from illegal closing spark/ears, so that the reduce is impossible in situations where it would be illegal (the production looks something like eitherspark CLOSESPARK), and the default in all other situations (sort of like 'auto' in C, which noone ever uses, because it's the default everywhere it isn't illegal). The solution I've used places a limit on the maximum nesting depth of an expression. Strangely, it also limits the number of sparks and ears that can be written into a 'comment' to 256. As care has to be taken anyway that malformed abstained statements don't look sufficiently like real statements to cause errors, this should be a trivial extra addition. (Incidentally, I strongly suspect this sort of fix was used in the original INTERCAL-72 compiler, because there is a very similar restriction documented in the manual. Besides, it's needed to make INTERCAL into an LALR(1) language.) The program arrtest.i will not actually run, but it will compile as far as degenerating C code. I don't believe every line would have come out as a valid statement in any version of INTERCAL 0.24 or earlier (except the one labeled as invalid, which would have come out as valid but is really bad style anyway). intercal-0.30/pit/tests/PaxHeaders.27456/ais1.chk0000644000000000000000000000007411437550756016305 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.582945706 intercal-0.30/pit/tests/ais1.chk0000644000175000017500000000004711437550756016201 0ustar00esresr00000000000000 I III I IV I V IX _ intercal-0.30/pit/tests/PaxHeaders.27456/sink.i0000644000000000000000000000007411437550756016077 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/sink.i0000644000175000017500000000020411437550756015766 0ustar00esresr00000000000000(1999) PLEASE DO (1999) NEXT DO NOTE THAT YOU CAN'T GET HERE FROM THERE DO ANYTHING YOU WANT ON THIS LINE, IT WON'T HAPPEN ANYWAY intercal-0.30/pit/tests/PaxHeaders.27456/test1.chk0000644000000000000000000000007411437550756016510 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/test1.chk0000644000175000017500000000016211437550756016402 0ustar00esresr00000000000000ICL000I DO THIS TEST HAS BEEN SUCCESSFULLY COMPLETED ON THE WAY TO 67 CORRECT SOURCE AND RESUBNIT intercal-0.30/pit/tests/PaxHeaders.27456/testops3.3i0000644000000000000000000000007411437550756017002 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/testops3.3i0000644000175000017500000000064311437550756016700 0ustar00esresr00000000000000 PLEASE WRITE IN .3 DO .1 <- "^.3$#1"~#1 DO READ OUT .1 DO .1 <- "V.3$#1"~#1 PLEASE DO READ OUT .1 DO .1 <- "V'"&.3$#2"~#1'$#1"~#1 DO READ OUT .1 DO .1 <- "?'"&.3$#2"~#1'$#1"~#1 PLEASE DO READ OUT .1 DO .1 <- "V!3~#2'$#1"~#1 DO READ OUT .1 DO .1 <- "?!3~#2'$#1"~#1 PLEASE DO READ OUT .1 DO .1 <- "@'"^.3$#7"~#4'$#2"~#10 DO READ OUT .1 DO .1 <- "^.3$.3"~"#0$#29524" PLEASE DO READ OUT .1 PLEASE GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/testonce.chk0000644000000000000000000000007411437550756017274 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/testonce.chk0000644000175000017500000000012011437550756017160 0ustar00esresr00000000000000 II I I II I II II I II II I II I I II I intercal-0.30/pit/tests/PaxHeaders.27456/iffit1.i0000644000000000000000000000007411437550756016315 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/iffit1.i0000644000175000017500000000117311437550756016212 0ustar00esresr00000000000000 DO READ OUT #1 (2) PLEASE DO (4) NEXT DO READ OUT #9 DO REINSTATE (18) DO (110) NEXT (4) PLEASE DO (7) NEXT DO REINSTATE (9) PLEASE DO READ OUT #3 (7) DO (100) NEXT DO YOU REALISE THAT THIS SHOULD BE UNREACHABLE? (9) DON'T COME FROM (100) (110) DO (21) NEXT DO READ OUT #6 DO (120) NEXT DO FORGET THINGS CORRECTLY (120) DO READ OUT #7 DO AVOID THIS LINE TOO (18) DON'T COME FROM (9) DO READ OUT #12 PLEASE DO .1 <- #13 PLEASE DO (130) NEXT DO READ OUT .1 PLEASE DO (140) NEXT PLEASE DO .17 <- #15 DO T .17 DO READ OUT .17 DO GIVE UP (21) PLEASE DO READ OUT #4 ONCE DON'T READ OUT #10 ONCE PLEASE DO RESUME #1 intercal-0.30/pit/tests/PaxHeaders.27456/testops5.5i0000644000000000000000000000007411437550756017006 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/testops5.5i0000644000175000017500000000063111437550756016701 0ustar00esresr00000000000000 PLEASE WRITE IN .3 DO .1 <- "^'"^.3$.3"~"#0$#3906"'$'"^.3$.3"~"#0$#3906"'"~"#0$#3906" PLEASE DO READ OUT .1 DO .1 <- "^.3$.3"~"#0$#3906" DO .1 <- "^.1$.1"~"#0$#3906" DO READ OUT .1 DO .1 <- "&.3$#1"~#1 PLEASE DO READ OUT .1 DO .1 <- "@.3$#1"~#1 DO READ OUT .1 DO .1 <- "2@.3$#1"~#1 PLEASE DO READ OUT .1 DO .1 <- "3@.3$#1"~#1 DO READ OUT .1 DO .1 <- "V.3$#1"~#1 DO READ OUT .1 PLEASE GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/sink.doc0000644000000000000000000000007411437550756016414 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/sink.doc0000644000175000017500000000031211437550756016303 0ustar00esresr00000000000000(1999) PLEASE DO (1999) NEXT sink.i: A program I wrote just to see if the guy who wrote the compiler was faithful. :) (blojo@ocf.berkeley.edu) Er, that is, it should sink into the Black Lagoon... intercal-0.30/pit/tests/PaxHeaders.27456/count.doc0000644000000000000000000000007411437550756016600 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.582945706 intercal-0.30/pit/tests/count.doc0000644000175000017500000000576511437550756016510 0ustar00esresr00000000000000 From: johnpc@xs4all.nl (Jan-Pieter Cornet) Newsgroups: comp.lang.misc,comp.lang.perl.misc,comp.lang.tcl,comp.lang.c,comp.lang.java,alt.lang.intercal,alt.test Subject: Re: Readable Perl (was: Re: Relative Speed of Perl vs. Tcl vs. C) Date: 27 Feb 1996 02:44:19 GMT Organization: XS4ALL Internet Message-ID: <4gtr64$s7h@news.xs4all.nl> Summary: hit "n" now! quick! In article <4ge7bk$4vq@news.ox.ac.uk>, David Hopwood wrote: >In article <4gb3kp$lu7@gaia.ns.utk.edu>, >Matthew B. Kennel wrote: >>Randal L. Schwartz (merlyn@stonehenge.com) wrote: >>: >>>>> "John" == John Viega writes: >> >>: John> People bitch about the readability of Perl non-stop. In fact, I have >>: John> heard the joke, "Perl, the only language you can uuencode, and not >>: John> notice" twice this week around the department. >> >>: OK, now which do you find most readable... > >This (Haskell): > >cancount n = "I can count to "++(show n)++"\n" >concat (map cancount [1..10]) No, you got it all totally wrong. I think this is the best readable (in Tri-INTERCAL): [Program moved to .3i file.] Now, I think the advantages of this are pretty clear. First, this is clearly a write-only language. There are only few people insane enough to actually understand the above drivel, and they wouldn't bother touching your petty code, as they are too busy filling bathtubs with brightly colored machine tools. Anyone else will simply be too scared to touch this code. So you can be pretty sure nobody changes it behind your back. In fact, you can be pretty sure you won't change it either after you wrote it, because you will probably have forgotten how the program works 5 minutes after you wrote it. So any luser nagging for extra features afterwards, is SOL. The other major advantage is... the above code took me about 3 hours to write. Compare this to the 10 to 30 seconds it takes to write a similar program in perl, BASIC, Haskell or what have you. But... that means that when you programmed it in that other language, you'd have to spend 2 hours 59 minutes and somewhere between 30 and 50 seconds answering the phone talking to clueless lusers, changing backup tapes, or doing other boring stuff. While you could have been programming Intercal instead! Just think about that! And last, but certainly not least, is: the above code is likely to impress your boss. Bosses are wont to be impressed by incomprehensible things. They won't be impressed by a three line perl program that anyone not wearing a diaper can understand. So that pretty much proves it. PS: this article contains some strange usage of the words "best readable" that you probably weren't previously aware of :) -- Jan-Pieter Cornet Actual quote: "Linux was made by foreign terrorists to steal money from true AMERICAN companies like Microsoft who invented computing as we know it, and are being punished for their success..." Linux -- "It's computing, Jim, but not as we know it" intercal-0.30/pit/tests/PaxHeaders.27456/testcf.i0000644000000000000000000000007411437550756016423 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/testcf.i0000644000175000017500000000073511437550756016323 0ustar00esresr00000000000000 DO COME FROM (80) PLEASE %50 REINSTATE (10) DO .1 <- #1 (10) DO NOT %99 .1 <- #2 DO .1 <- #3 PLEASE COME FROM (10) DO READ OUT .1 DO .1 <- #1 (20) DO %50 .1 <- #2 DO .1 <- #3 (30) PLEASE %50 COME FROM (20) DO LOSE PLEASE %90 COME FROM (30) (40) PLEASE ABSTAIN FROM (50) DO READ OUT .1 (50) PLEASE COME FROM (40) (60) DO (70) NEXT DO GIVE UP (70) DO READ OUT #65535 DO RESUME #1 DO WIN (80) DO COME FROM (60) intercal-0.30/pit/tests/PaxHeaders.27456/whileadd.chk0000644000000000000000000000007411437550756017231 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.598945662 intercal-0.30/pit/tests/whileadd.chk0000644000175000017500000000001411437550756017117 0ustar00esresr00000000000000 LVIII intercal-0.30/pit/tests/PaxHeaders.27456/iogerunds.doc0000644000000000000000000000007411437550756017447 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/iogerunds.doc0000644000175000017500000000107411437550756017344 0ustar00esresr00000000000000Jan-Pieter Cornet writes: You might want to try the following program (I've just been hacking this up, and it costed me considerable more time than adding the gerund I/O things. But that's the power of intercal...) This program will ask for a number and might print it then, except that it doesn't ask the first time but _ assumes ONE TWO THREE. Oh and it never prints but just exits in case that would've been printed (I did my best to make that part as unreadable as possible. did it work? :) intercal-0.30/pit/tests/PaxHeaders.27456/onceagain.i0000644000000000000000000000007411437550756017057 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/onceagain.i0000644000175000017500000000070611437550756016755 0ustar00esresr00000000000000(1) DO NOTHING PLEASE COME FROM (13) ONCE PLEASE COME FROM #11 ONCE DO COME FROM (1) DO READ OUT #1 ONCE (6) DO READ OUT #2 AGAIN DO READ OUT #3 DO ABSTAIN FROM (6) ONCE DON'T READ OUT #4 ONCE (10) DON'T READ OUT #5 AGAIN (11) DO REINSTATE (10) ONCE DO READ OUT #6 (13) DON'T READ OUT #7 DO REINSTATE (17) (15) DO (19) NEXT ONCE (16) PLEASE READ OUT #8 (17) DON'T (15) NEXT AGAIN PLEASE GIVE UP (19) PLEASE READ OUT #9 DO (16) NEXT intercal-0.30/pit/tests/PaxHeaders.27456/testcreate.i0000644000000000000000000000007411437550756017276 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/testcreate.i0000644000175000017500000000035211437550756017171 0ustar00esresr00000000000000 DO .3 <- #5 DO .4 <- #6 DO CREATE (5) SWITCH .1 WITH .2 DO SWITCH .3 WITH .4 DO READ OUT .3 DO READ OUT .4 PLEASE GIVE UP (5) PLEASE STASH :1 DO :1 <- :1601 DO :1601 <- :1602 DO :1602 <- :1 DO RETRIEVE :1 PLEASE RESUME #1 intercal-0.30/pit/tests/PaxHeaders.27456/whileadd.i0000644000000000000000000000007411437550756016714 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.598945662 intercal-0.30/pit/tests/whileadd.i0000644000175000017500000000037411437550756016613 0ustar00esresr00000000000000 PLEASE NOTE THIS PROGRAM READS IN TWO 16-BIT NUMBERS AND ADDS THEM DO WRITE IN .1 DO WRITE IN .2 (1) DO COME FROM ".2~.2"~#1 WHILE :1 <- "'?.1$.2'~'"':1/.1$.2'~#0"$#65535'"$"'"'&.1$.2'~'#0$#65535'"$#0'~#32767$#1" DO READ OUT .1 PLEASE GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/normaldist.i0000644000000000000000000000007411437550756017307 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/normaldist.i0000644000175000017500000000115711437550756017206 0ustar00esresr00000000000000 PLEASE NOTE that this program checks the routine 1910 and calculates its standard deviation; the output values should quickly converge to around #10000 if that routine correctly follows the manual. DO :3 <- #0 PLEASE DO .6 <- #0 DO COME FROM (20) DO .1 <- #1200 DO (1910) NEXT DO .1 <- #600 (5) DO (1010) NEXT DO .1 <- .2 DO .2 <- #600 DO (1010) NEXT DO COME FROM '.3~#2048'$#3 DO .1 <- .3 PLEASE DO .2 <- .3 DO (1530) NEXT DO :2 <- :3 DO (1500) NEXT DO .1 <- .6 PLEASE DO (1020) NEXT DO .6 <- .1 DO :1 <- :3 DO :2 <- .1 PLEASE DO (1550) NEXT DO READ OUT :3 DO :3 <- :1 (20) PLEASE DO NOTHING intercal-0.30/pit/tests/PaxHeaders.27456/permute.chk0000644000000000000000000000007411437550756017131 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/permute.chk0000644000175000017500000007304011437550756017030 0ustar00esresr00000000000000 VI V IV III II I XXX V VI IV III II I XXX VI IV V III II I XXX IV VI V III II I XXX V IV VI III II I XXX IV V VI III II I XXX VI V III IV II I XXX V VI III IV II I XXX VI III V IV II I XXX III VI V IV II I XXX V III VI IV II I XXX III V VI IV II I XXX VI IV III V II I XXX IV VI III V II I XXX VI III IV V II I XXX III VI IV V II I XXX IV III VI V II I XXX III IV VI V II I XXX V IV III VI II I XXX IV V III VI II I XXX V III IV VI II I XXX III V IV VI II I XXX IV III V VI II I XXX III IV V VI II I XXX VI V IV II III I XXX V VI IV II III I XXX VI IV V II III I XXX IV VI V II III I XXX V IV VI II III I XXX IV V VI II III I XXX VI V II IV III I XXX V VI II IV III I XXX VI II V IV III I XXX II VI V IV III I XXX V II VI IV III I XXX II V VI IV III I XXX VI IV II V III I XXX IV VI II V III I XXX VI II IV V III I XXX II VI IV V III I XXX IV II VI V III I XXX II IV VI V III I XXX V IV II VI III I XXX IV V II VI III I XXX V II IV VI III I XXX II V IV VI III I XXX IV II V VI III I XXX II IV V VI III I XXX VI V III II IV I XXX V VI III II IV I XXX VI III V II IV I XXX III VI V II IV I XXX V III VI II IV I XXX III V VI II IV I XXX VI V II III IV I XXX V VI II III IV I XXX VI II V III IV I XXX II VI V III IV I XXX V II VI III IV I XXX II V VI III IV I XXX VI III II V IV I XXX III VI II V IV I XXX VI II III V IV I XXX II VI III V IV I XXX III II VI V IV I XXX II III VI V IV I XXX V III II VI IV I XXX III V II VI IV I XXX V II III VI IV I XXX II V III VI IV I XXX III II V VI IV I XXX II III V VI IV I XXX VI IV III II V I XXX IV VI III II V I XXX VI III IV II V I XXX III VI IV II V I XXX IV III VI II V I XXX III IV VI II V I XXX VI IV II III V I XXX IV VI II III V I XXX VI II IV III V I XXX II VI IV III V I XXX IV II VI III V I XXX II IV VI III V I XXX VI III II IV V I XXX III VI II IV V I XXX VI II III IV V I XXX II VI III IV V I XXX III II VI IV V I XXX II III VI IV V I XXX IV III II VI V I XXX III IV II VI V I XXX IV II III VI V I XXX II IV III VI V I XXX III II IV VI V I XXX II III IV VI V I XXX V IV III II VI I XXX IV V III II VI I XXX V III IV II VI I XXX III V IV II VI I XXX IV III V II VI I XXX III IV V II VI I XXX V IV II III VI I XXX IV V II III VI I XXX V II IV III VI I XXX II V IV III VI I XXX IV II V III VI I XXX II IV V III VI I XXX V III II IV VI I XXX III V II IV VI I XXX V II III IV VI I XXX II V III IV VI I XXX III II V IV VI I XXX II III V IV VI I XXX IV III II V VI I XXX III IV II V VI I XXX IV II III V VI I XXX II IV III V VI I XXX III II IV V VI I XXX II III IV V VI I XXX VI V IV III I II XXX V VI IV III I II XXX VI IV V III I II XXX IV VI V III I II XXX V IV VI III I II XXX IV V VI III I II XXX VI V III IV I II XXX V VI III IV I II XXX VI III V IV I II XXX III VI V IV I II XXX V III VI IV I II XXX III V VI IV I II XXX VI IV III V I II XXX IV VI III V I II XXX VI III IV V I II XXX III VI IV V I II XXX IV III VI V I II XXX III IV VI V I II XXX V IV III VI I II XXX IV V III VI I II XXX V III IV VI I II XXX III V IV VI I II XXX IV III V VI I II XXX III IV V VI I II XXX VI V IV I III II XXX V VI IV I III II XXX VI IV V I III II XXX IV VI V I III II XXX V IV VI I III II XXX IV V VI I III II XXX VI V I IV III II XXX V VI I IV III II XXX VI I V IV III II XXX I VI V IV III II XXX V I VI IV III II XXX I V VI IV III II XXX VI IV I V III II XXX IV VI I V III II XXX VI I IV V III II XXX I VI IV V III II XXX IV I VI V III II XXX I IV VI V III II XXX V IV I VI III II XXX IV V I VI III II XXX V I IV VI III II XXX I V IV VI III II XXX IV I V VI III II XXX I IV V VI III II XXX VI V III I IV II XXX V VI III I IV II XXX VI III V I IV II XXX III VI V I IV II XXX V III VI I IV II XXX III V VI I IV II XXX VI V I III IV II XXX V VI I III IV II XXX VI I V III IV II XXX I VI V III IV II XXX V I VI III IV II XXX I V VI III IV II XXX VI III I V IV II XXX III VI I V IV II XXX VI I III V IV II XXX I VI III V IV II XXX III I VI V IV II XXX I III VI V IV II XXX V III I VI IV II XXX III V I VI IV II XXX V I III VI IV II XXX I V III VI IV II XXX III I V VI IV II XXX I III V VI IV II XXX VI IV III I V II XXX IV VI III I V II XXX VI III IV I V II XXX III VI IV I V II XXX IV III VI I V II XXX III IV VI I V II XXX VI IV I III V II XXX IV VI I III V II XXX VI I IV III V II XXX I VI IV III V II XXX IV I VI III V II XXX I IV VI III V II XXX VI III I IV V II XXX III VI I IV V II XXX VI I III IV V II XXX I VI III IV V II XXX III I VI IV V II XXX I III VI IV V II XXX IV III I VI V II XXX III IV I VI V II XXX IV I III VI V II XXX I IV III VI V II XXX III I IV VI V II XXX I III IV VI V II XXX V IV III I VI II XXX IV V III I VI II XXX V III IV I VI II XXX III V IV I VI II XXX IV III V I VI II XXX III IV V I VI II XXX V IV I III VI II XXX IV V I III VI II XXX V I IV III VI II XXX I V IV III VI II XXX IV I V III VI II XXX I IV V III VI II XXX V III I IV VI II XXX III V I IV VI II XXX V I III IV VI II XXX I V III IV VI II XXX III I V IV VI II XXX I III V IV VI II XXX IV III I V VI II XXX III IV I V VI II XXX IV I III V VI II XXX I IV III V VI II XXX III I IV V VI II XXX I III IV V VI II XXX VI V IV II I III XXX V VI IV II I III XXX VI IV V II I III XXX IV VI V II I III XXX V IV VI II I III XXX IV V VI II I III XXX VI V II IV I III XXX V VI II IV I III XXX VI II V IV I III XXX II VI V IV I III XXX V II VI IV I III XXX II V VI IV I III XXX VI IV II V I III XXX IV VI II V I III XXX VI II IV V I III XXX II VI IV V I III XXX IV II VI V I III XXX II IV VI V I III XXX V IV II VI I III XXX IV V II VI I III XXX V II IV VI I III XXX II V IV VI I III XXX IV II V VI I III XXX II IV V VI I III XXX VI V IV I II III XXX V VI IV I II III XXX VI IV V I II III XXX IV VI V I II III XXX V IV VI I II III XXX IV V VI I II III XXX VI V I IV II III XXX V VI I IV II III XXX VI I V IV II III XXX I VI V IV II III XXX V I VI IV II III XXX I V VI IV II III XXX VI IV I V II III XXX IV VI I V II III XXX VI I IV V II III XXX I VI IV V II III XXX IV I VI V II III XXX I IV VI V II III XXX V IV I VI II III XXX IV V I VI II III XXX V I IV VI II III XXX I V IV VI II III XXX IV I V VI II III XXX I IV V VI II III XXX VI V II I IV III XXX V VI II I IV III XXX VI II V I IV III XXX II VI V I IV III XXX V II VI I IV III XXX II V VI I IV III XXX VI V I II IV III XXX V VI I II IV III XXX VI I V II IV III XXX I VI V II IV III XXX V I VI II IV III XXX I V VI II IV III XXX VI II I V IV III XXX II VI I V IV III XXX VI I II V IV III XXX I VI II V IV III XXX II I VI V IV III XXX I II VI V IV III XXX V II I VI IV III XXX II V I VI IV III XXX V I II VI IV III XXX I V II VI IV III XXX II I V VI IV III XXX I II V VI IV III XXX VI IV II I V III XXX IV VI II I V III XXX VI II IV I V III XXX II VI IV I V III XXX IV II VI I V III XXX II IV VI I V III XXX VI IV I II V III XXX IV VI I II V III XXX VI I IV II V III XXX I VI IV II V III XXX IV I VI II V III XXX I IV VI II V III XXX VI II I IV V III XXX II VI I IV V III XXX VI I II IV V III XXX I VI II IV V III XXX II I VI IV V III XXX I II VI IV V III XXX IV II I VI V III XXX II IV I VI V III XXX IV I II VI V III XXX I IV II VI V III XXX II I IV VI V III XXX I II IV VI V III XXX V IV II I VI III XXX IV V II I VI III XXX V II IV I VI III XXX II V IV I VI III XXX IV II V I VI III XXX II IV V I VI III XXX V IV I II VI III XXX IV V I II VI III XXX V I IV II VI III XXX I V IV II VI III XXX IV I V II VI III XXX I IV V II VI III XXX V II I IV VI III XXX II V I IV VI III XXX V I II IV VI III XXX I V II IV VI III XXX II I V IV VI III XXX I II V IV VI III XXX IV II I V VI III XXX II IV I V VI III XXX IV I II V VI III XXX I IV II V VI III XXX II I IV V VI III XXX I II IV V VI III XXX VI V III II I IV XXX V VI III II I IV XXX VI III V II I IV XXX III VI V II I IV XXX V III VI II I IV XXX III V VI II I IV XXX VI V II III I IV XXX V VI II III I IV XXX VI II V III I IV XXX II VI V III I IV XXX V II VI III I IV XXX II V VI III I IV XXX VI III II V I IV XXX III VI II V I IV XXX VI II III V I IV XXX II VI III V I IV XXX III II VI V I IV XXX II III VI V I IV XXX V III II VI I IV XXX III V II VI I IV XXX V II III VI I IV XXX II V III VI I IV XXX III II V VI I IV XXX II III V VI I IV XXX VI V III I II IV XXX V VI III I II IV XXX VI III V I II IV XXX III VI V I II IV XXX V III VI I II IV XXX III V VI I II IV XXX VI V I III II IV XXX V VI I III II IV XXX VI I V III II IV XXX I VI V III II IV XXX V I VI III II IV XXX I V VI III II IV XXX VI III I V II IV XXX III VI I V II IV XXX VI I III V II IV XXX I VI III V II IV XXX III I VI V II IV XXX I III VI V II IV XXX V III I VI II IV XXX III V I VI II IV XXX V I III VI II IV XXX I V III VI II IV XXX III I V VI II IV XXX I III V VI II IV XXX VI V II I III IV XXX V VI II I III IV XXX VI II V I III IV XXX II VI V I III IV XXX V II VI I III IV XXX II V VI I III IV XXX VI V I II III IV XXX V VI I II III IV XXX VI I V II III IV XXX I VI V II III IV XXX V I VI II III IV XXX I V VI II III IV XXX VI II I V III IV XXX II VI I V III IV XXX VI I II V III IV XXX I VI II V III IV XXX II I VI V III IV XXX I II VI V III IV XXX V II I VI III IV XXX II V I VI III IV XXX V I II VI III IV XXX I V II VI III IV XXX II I V VI III IV XXX I II V VI III IV XXX VI III II I V IV XXX III VI II I V IV XXX VI II III I V IV XXX II VI III I V IV XXX III II VI I V IV XXX II III VI I V IV XXX VI III I II V IV XXX III VI I II V IV XXX VI I III II V IV XXX I VI III II V IV XXX III I VI II V IV XXX I III VI II V IV XXX VI II I III V IV XXX II VI I III V IV XXX VI I II III V IV XXX I VI II III V IV XXX II I VI III V IV XXX I II VI III V IV XXX III II I VI V IV XXX II III I VI V IV XXX III I II VI V IV XXX I III II VI V IV XXX II I III VI V IV XXX I II III VI V IV XXX V III II I VI IV XXX III V II I VI IV XXX V II III I VI IV XXX II V III I VI IV XXX III II V I VI IV XXX II III V I VI IV XXX V III I II VI IV XXX III V I II VI IV XXX V I III II VI IV XXX I V III II VI IV XXX III I V II VI IV XXX I III V II VI IV XXX V II I III VI IV XXX II V I III VI IV XXX V I II III VI IV XXX I V II III VI IV XXX II I V III VI IV XXX I II V III VI IV XXX III II I V VI IV XXX II III I V VI IV XXX III I II V VI IV XXX I III II V VI IV XXX II I III V VI IV XXX I II III V VI IV XXX VI IV III II I V XXX IV VI III II I V XXX VI III IV II I V XXX III VI IV II I V XXX IV III VI II I V XXX III IV VI II I V XXX VI IV II III I V XXX IV VI II III I V XXX VI II IV III I V XXX II VI IV III I V XXX IV II VI III I V XXX II IV VI III I V XXX VI III II IV I V XXX III VI II IV I V XXX VI II III IV I V XXX II VI III IV I V XXX III II VI IV I V XXX II III VI IV I V XXX IV III II VI I V XXX III IV II VI I V XXX IV II III VI I V XXX II IV III VI I V XXX III II IV VI I V XXX II III IV VI I V XXX VI IV III I II V XXX IV VI III I II V XXX VI III IV I II V XXX III VI IV I II V XXX IV III VI I II V XXX III IV VI I II V XXX VI IV I III II V XXX IV VI I III II V XXX VI I IV III II V XXX I VI IV III II V XXX IV I VI III II V XXX I IV VI III II V XXX VI III I IV II V XXX III VI I IV II V XXX VI I III IV II V XXX I VI III IV II V XXX III I VI IV II V XXX I III VI IV II V XXX IV III I VI II V XXX III IV I VI II V XXX IV I III VI II V XXX I IV III VI II V XXX III I IV VI II V XXX I III IV VI II V XXX VI IV II I III V XXX IV VI II I III V XXX VI II IV I III V XXX II VI IV I III V XXX IV II VI I III V XXX II IV VI I III V XXX VI IV I II III V XXX IV VI I II III V XXX VI I IV II III V XXX I VI IV II III V XXX IV I VI II III V XXX I IV VI II III V XXX VI II I IV III V XXX II VI I IV III V XXX VI I II IV III V XXX I VI II IV III V XXX II I VI IV III V XXX I II VI IV III V XXX IV II I VI III V XXX II IV I VI III V XXX IV I II VI III V XXX I IV II VI III V XXX II I IV VI III V XXX I II IV VI III V XXX VI III II I IV V XXX III VI II I IV V XXX VI II III I IV V XXX II VI III I IV V XXX III II VI I IV V XXX II III VI I IV V XXX VI III I II IV V XXX III VI I II IV V XXX VI I III II IV V XXX I VI III II IV V XXX III I VI II IV V XXX I III VI II IV V XXX VI II I III IV V XXX II VI I III IV V XXX VI I II III IV V XXX I VI II III IV V XXX II I VI III IV V XXX I II VI III IV V XXX III II I VI IV V XXX II III I VI IV V XXX III I II VI IV V XXX I III II VI IV V XXX II I III VI IV V XXX I II III VI IV V XXX IV III II I VI V XXX III IV II I VI V XXX IV II III I VI V XXX II IV III I VI V XXX III II IV I VI V XXX II III IV I VI V XXX IV III I II VI V XXX III IV I II VI V XXX IV I III II VI V XXX I IV III II VI V XXX III I IV II VI V XXX I III IV II VI V XXX IV II I III VI V XXX II IV I III VI V XXX IV I II III VI V XXX I IV II III VI V XXX II I IV III VI V XXX I II IV III VI V XXX III II I IV VI V XXX II III I IV VI V XXX III I II IV VI V XXX I III II IV VI V XXX II I III IV VI V XXX I II III IV VI V XXX V IV III II I VI XXX IV V III II I VI XXX V III IV II I VI XXX III V IV II I VI XXX IV III V II I VI XXX III IV V II I VI XXX V IV II III I VI XXX IV V II III I VI XXX V II IV III I VI XXX II V IV III I VI XXX IV II V III I VI XXX II IV V III I VI XXX V III II IV I VI XXX III V II IV I VI XXX V II III IV I VI XXX II V III IV I VI XXX III II V IV I VI XXX II III V IV I VI XXX IV III II V I VI XXX III IV II V I VI XXX IV II III V I VI XXX II IV III V I VI XXX III II IV V I VI XXX II III IV V I VI XXX V IV III I II VI XXX IV V III I II VI XXX V III IV I II VI XXX III V IV I II VI XXX IV III V I II VI XXX III IV V I II VI XXX V IV I III II VI XXX IV V I III II VI XXX V I IV III II VI XXX I V IV III II VI XXX IV I V III II VI XXX I IV V III II VI XXX V III I IV II VI XXX III V I IV II VI XXX V I III IV II VI XXX I V III IV II VI XXX III I V IV II VI XXX I III V IV II VI XXX IV III I V II VI XXX III IV I V II VI XXX IV I III V II VI XXX I IV III V II VI XXX III I IV V II VI XXX I III IV V II VI XXX V IV II I III VI XXX IV V II I III VI XXX V II IV I III VI XXX II V IV I III VI XXX IV II V I III VI XXX II IV V I III VI XXX V IV I II III VI XXX IV V I II III VI XXX V I IV II III VI XXX I V IV II III VI XXX IV I V II III VI XXX I IV V II III VI XXX V II I IV III VI XXX II V I IV III VI XXX V I II IV III VI XXX I V II IV III VI XXX II I V IV III VI XXX I II V IV III VI XXX IV II I V III VI XXX II IV I V III VI XXX IV I II V III VI XXX I IV II V III VI XXX II I IV V III VI XXX I II IV V III VI XXX V III II I IV VI XXX III V II I IV VI XXX V II III I IV VI XXX II V III I IV VI XXX III II V I IV VI XXX II III V I IV VI XXX V III I II IV VI XXX III V I II IV VI XXX V I III II IV VI XXX I V III II IV VI XXX III I V II IV VI XXX I III V II IV VI XXX V II I III IV VI XXX II V I III IV VI XXX V I II III IV VI XXX I V II III IV VI XXX II I V III IV VI XXX I II V III IV VI XXX III II I V IV VI XXX II III I V IV VI XXX III I II V IV VI XXX I III II V IV VI XXX II I III V IV VI XXX I II III V IV VI XXX IV III II I V VI XXX III IV II I V VI XXX IV II III I V VI XXX II IV III I V VI XXX III II IV I V VI XXX II III IV I V VI XXX IV III I II V VI XXX III IV I II V VI XXX IV I III II V VI XXX I IV III II V VI XXX III I IV II V VI XXX I III IV II V VI XXX IV II I III V VI XXX II IV I III V VI XXX IV I II III V VI XXX I IV II III V VI XXX II I IV III V VI XXX I II IV III V VI XXX III II I IV V VI XXX II III I IV V VI XXX III I II IV V VI XXX I III II IV V VI XXX II I III IV V VI XXX I II III IV V VI XXX intercal-0.30/pit/tests/PaxHeaders.27456/knuth.i0000644000000000000000000000007411437550756016264 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/knuth.i0000644000175000017500000000144511437550756016163 0ustar00esresr00000000000000 PLEASE ABSTAIN FROM (1) (1) DON KNUTH'S IMPLEMENTATION OF TPK IN INTERCAL (C) MARCH 2003 REFERENCE --- THE EARLY HISTORY OF PROGRAMMING LANGUAGES, BY D E KNUTH AND L TRABB PARDO NOTA BENE: THE INPUT AND OUTPUT DATA ARE SCALED DECIMAL NUMBERS WITH SIX DIGITS TO THE RIGHT OF THE DECIMAL POINT; THUS AN INPUT OF THREE ONE FOUR ONE FIVE NINE THREE DENOTES 3.141593, AND THAT VALUE WOULD BE OUTPUT AS ______ MMMCXLMDXCIII VARIABLE NAMES AND SUBROUTINE NAMES USE THE CLASSIC 5-BIT TELEPRINTER CODE IN LETTER-SHIFT MODE, NAMELY / E @ A : S I U 1/4 D R J N F C K T Z L W H Y P Q O B G " M X V $ (WHICH ALAN TURING ADVISED EVERY PROGRAMMER TO LEARN) DO GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/testarray.i0000644000000000000000000000007411437550756017151 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/testarray.i0000644000175000017500000000103211437550756017040 0ustar00esresr00000000000000 PLEASE DO ,1 <- #3 BY #3 DO ;2 <- #6 DO ,2 <- #6 DO .1 <- #1 DO .2 <- #1 DO ,1 SUB .2.1 <- #1 DO ;2 SUB #5 <- #1 DO .1 <- "?',1 SUB .2.1'$#1"~#3 DO .2 <- ,1 SUB #1 ;2 SUB #5 DO .1 <- .2~,1 SUB #1 #1 DO STASH .1 + ,2 + ;2 + ,1 + ,3 DO ,1 <- #500 DO ,1 SUB #1 <- #112 PLEASE DO READ OUT ,1 SUB .2 PLEASE RETRIEVE ,2 + ,1 + ,3 DO .1 <- #?1 DO .1 <- .?1 PLEASE DO READ OUT ,1 SUB #1 #1 DO .1 <- .2$,&1 SUB #1 #1 PLEASE DO READ OUT .1 DO .1 <- .2$,V1 SUB #1 #1 PLEASE DO READ OUT .1 PLEASE GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/arrtest.i0000644000000000000000000000007411437550756016617 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.582945706 intercal-0.30/pit/tests/arrtest.i0000644000175000017500000000046111437550756016513 0ustar00esresr00000000000000PLEASE NOTE THIS PROGRAM TESTS SOME GRAMMAR NEAR-AMBIGUITIES DO .5 <- '?"'#65535~"'?.7$",2SUB.1"'~#21845"'~#1"$#1'~#3 DO .1 <- ',2SUB.1".2~.3"'~#1 DO .1 <- ,3SUB",2SUB.1'.2~.3'".4 PLEASE NOTE THE NEXT LINE IS TOO UNCLEAR TO PARSE DOXXX .1 <- ,3SUB",2SUB.1".2~.3"".4 THE PREVIOUS LINE CAUSES ERROR ICL017I intercal-0.30/pit/tests/PaxHeaders.27456/limits.i0000644000000000000000000000007411437550756016434 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/limits.i0000644000175000017500000000015211437550756016325 0ustar00esresr00000000000000 DO .1 <- #65535 DO :1 <- #65535 DO WRITE IN .1 + :1 DO READ OUT .1 + :1 PLEASE GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/compucome.i0000644000000000000000000000007411437550756017122 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.582945706 intercal-0.30/pit/tests/compucome.i0000644000175000017500000000050411437550756017014 0ustar00esresr00000000000000 PLEASE NOTE THIS PROGRAM TESTS COMPUTED COME FROM DO .2 <- #2 (1) DO .1 <- #1 (3) DO READ OUT #5 DO COME FROM .1 (256) DO READ OUT #2 DO .2 <- '.2$#0'~#43691 (5) DO READ OUT #3 DO READ OUT #4 DO .1 <- #5 PLEASE DO (3) NEXT PLEASE COME FROM .2 DO WRITE IN .1 DO WRITE IN .2 (999) DO NOTHING PLEASE GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/iffit2.b980000644000000000000000000000007411437550756016470 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/iffit2.b980000644000175000017500000000047111437550756016365 0ustar00esresr00000000000000:#,_ #v #< >"IFFI"4#v('0,a,Y > >'E,'r,'r,a,@ >' 35#^p# 1# R#< ; ^,a<,,:1' v< v;v1e< ^p5< >v'X ;v>Sv. ;e*L".T"d$^;5*vd·a; G ^ < < ^<',a *L1^ ,R> 2R^ a ;^ >a 1^,a,2'$$L*aa·# #^Y^ >a,.a,9; f;2*0V#z $\$\.^R1A*fa< >*L0D.a, intercal-0.30/pit/tests/PaxHeaders.27456/ais2.tst0000644000000000000000000000007411437550756016353 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.582945706 intercal-0.30/pit/tests/ais2.tst0000644000175000017500000000002511437550756016243 0ustar00esresr00000000000000ONE ONE ONE ONE ZERO intercal-0.30/pit/tests/PaxHeaders.27456/testsplat.chk0000644000000000000000000000007411437550756017473 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/testsplat.chk0000644000175000017500000000016111437550756017364 0ustar00esresr00000000000000 I II III ICL000I DO REDA OUT #4 DO READ OUT #5 ON THE WAY TO 4 CORRECT SOURCE AND RESUBNIT intercal-0.30/pit/tests/PaxHeaders.27456/ais1.tst0000644000000000000000000000007411437550756016352 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.582945706 intercal-0.30/pit/tests/ais1.tst0000644000175000017500000000004611437550756016245 0ustar00esresr00000000000000ONE THREE ONE FOUR ONE FIVE NINE ZERO intercal-0.30/pit/tests/PaxHeaders.27456/iffit.doc0000644000000000000000000000007411437550756016551 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/iffit.doc0000644000175000017500000000476311437550756016456 0ustar00esresr00000000000000iffit1.i and iffit2.b98 are a test of the C-INTERCAL/cfunge external calls system. To use the test, use this command: ick -ea iffit1.i iffit2.b98 What follows is the expected output, annotated to show what causes each line to be printed. Before IFFI... Printed by the Funge program before IFFI is loaded. 0 Printed immediately after IFFI loads; the program then yields immediately, running the INTERCAL program. I Printed at the start of the INTERCAL program; tests Y. 2 Printed by the Funge program after (100) is NEXTed to. This tests NEXTING to an L in the Funge program. III Printed by INTERCAL after the Funge program does 2R (i.e. RESUME 2). IV Tests COMING FROM an L when in mark-mode after a NEXT. 5 Tests NEXTING FROM the INTERCAL program to the Funge program using X. VI Tests RESUMING to the INTERCAL program after the NEXT FROM in the Befunge program. VII Tests that COME FROMs happen at the end of a command. 8 Tests COMING FROM the INTERCAL program to the Funge program using C. IX Tests FORGET using F, and also RESUME after a COME FROM in the Befunge program. X This (irrelevantly) tests ONCE in the INTERCAL program. 11 This (likewise irrelevantly) tests that p in Funge has correctly altered the flow of control. XII Tests COMING FROM an L when not in mark-mode. 13 Tests variable access using G in the Funge program to read an INTERCAL variable, also a second marker. XIV Tests the use of S to set an INTERCAL variable. 15 Tests that CREATEd commands send values correctly. 16 Tests that CREATEd commands send bitwidths correctly. 17 Tests that CREATEd commands send names correctly. The above three tests test CREATION using A and D. XVIII Tests that V sets arguments to CREATED commands correctly, and also that Y correctly reflects the second time. At this point the program should end, having tested all the commands in the IFFI fingerprint. (Obviously, this is not an exhaustive test, because, for instance, G was only used to get onespot variables not twospot variables.) It is an interesting challenge to try to figure out how the tests work, especially given that the Funge program is self-modifying, the statements in the INTERCAL program don't always do the same thing every time they're run, and the Funge program modifies the syntax of the INTERCAL program at runtime. intercal-0.30/pit/tests/PaxHeaders.27456/ais2.chk0000644000000000000000000000007411437550756016306 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.582945706 intercal-0.30/pit/tests/ais2.chk0000644000175000017500000000003211437550756016174 0ustar00esresr00000000000000 I I II III V intercal-0.30/pit/tests/PaxHeaders.27456/ignorearray.chk0000644000000000000000000000007411441323356017757 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/ignorearray.chk0000644000175000017500000000004211441323356017646 0ustar00esresr00000000000000 I II III I V III intercal-0.30/pit/tests/PaxHeaders.27456/testonce.i0000644000000000000000000000007411437550756016757 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/testonce.i0000644000175000017500000000143611437550756016656 0ustar00esresr00000000000000 PLEASE COME FROM (30) ONCE PLEASE COME FROM (20) ONCE PLEASE COME FROM (10) ONCE DO .1 <- #1 (1) DO .1 <- #2 ONCE (10) DO READ OUT .1 (20) DO NOTHING (30) DO REINSTATE (1) PLEASE COME FROM (40) ONCE PLEASE COME FROM (50) ONCE PLEASE COME FROM (60) ONCE DO .1 <- #1 (2) DO NOT .1 <- #2 ONCE (40) DO READ OUT .1 (50) DO NOTHING (60) DO ABSTAIN FROM (2) DO COME FROM (70) ONCE DO COME FROM (80) ONCE DO COME FROM (90) ONCE DO .1 <- #1 (3) DO .1 <- #2 AGAIN (70) DO READ OUT .1 (80) DO ABSTAIN FROM (3) ONCE (90) DO NOTHING DO COME FROM (100) ONCE DO COME FROM (110) ONCE DO COME FROM (120) ONCE DO .1 <- #1 (4) DO NOT .1 <- #2 AGAIN (100) DO READ OUT .1 (110) DO REINSTATE (4) ONCE (120) DO NOTHING PLEASE GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/test16bit.i0000644000000000000000000000007411437550756016760 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/test16bit.i0000644000175000017500000000031211437550756016647 0ustar00esresr00000000000000 PLEASE DO .1 <- #1$'#1$#0' DO READ OUT .1 DO .1 <- #32768$'#1$#32768' DO READ OUT .1 DO :1 <- #32768$'#1$#32768' DO READ OUT :1 PLEASE DO GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/onceagain.chk0000644000000000000000000000007411437550756017374 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/onceagain.chk0000644000175000017500000000013611437550756017267 0ustar00esresr00000000000000 I II III III IV V VI II III IV VI IX VIII VIII intercal-0.30/pit/tests/PaxHeaders.27456/version.4i0000644000000000000000000000007411437550756016704 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/version.4i0000644000175000017500000000031711437550756016600 0ustar00esresr00000000000000(1) DO .1 <- #?6 DOING DETECTION... YOU ARE USING INTERCAL-72 (5) PLEASE COME FROM (1) DOING DETECTION... YOU ARE USING C-INTERCAL PLEASE COME FROM .1 DOING DETECTION... YOU ARE USING CLC-INTERCAL intercal-0.30/pit/tests/PaxHeaders.27456/test2.chk0000644000000000000000000000007411437550756016511 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/test2.chk0000644000175000017500000000001211437550756016375 0ustar00esresr00000000000000 XXXV intercal-0.30/pit/tests/PaxHeaders.27456/test2.doc0000644000000000000000000000007411437550756016511 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/test2.doc0000644000175000017500000000054611437550756016411 0ustar00esresr00000000000000David Moews wrote this about test2.i: The following program reads in two numbers and then prints their product. It consists of a trivial calling program followed by a cleaned-up version of a portion of the INTERCAL subroutine library. (Only a portion of the INTERCAL subroutine library is present in the posted manual, and that portion is full of typos.) intercal-0.30/pit/tests/PaxHeaders.27456/test2.tst0000644000000000000000000000007411437550756016556 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/test2.tst0000644000175000017500000000001311437550756016443 0ustar00esresr00000000000000FIVE SEVEN intercal-0.30/pit/tests/PaxHeaders.27456/ignorret.i0000644000000000000000000000007411437550756016764 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/ignorret.i0000644000175000017500000000020611437550756016655 0ustar00esresr00000000000000 DO .1 <- #1 DO STASH .1 DO .1 <- #2 DO IGNORE .1 PLEASE RETRIEVE .1 DO READ OUT .1 DO .1 <- #3 DO READ OUT .1 PLEASE GIVE UP intercal-0.30/pit/tests/PaxHeaders.27456/ignorret.doc0000644000000000000000000000007411437550756017301 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/ignorret.doc0000644000175000017500000000273011437550756017176 0ustar00esresr00000000000000One aspect of INTERCAL-72 that was never fully documented was the way in which IGNORE and RETRIEVE statements interacted. It turns out that the three modern INTERCAL compilers all use slightly different definitions. The associated program ignorret.i stores 1 in a variable's stash, 2 in the variable itself, ignores the variable, and retrieves it; it then prints out the variable, and tests to see whether the variable is ignored. C-INTERCAL prints: II II In other words, the interpretation used is that the variable is read-only, so a RETRIEVE can't change its value (but instead just discards the stash item). The variable remains IGNOREd. J-INTERCAL prints: I I J-INTERCAL doesn't take the interaction between IGNORE and RETRIEVE into account at all; the RETRIEVE just does what a RETRIEVE would normally do, which is to set the variable from its own stack. The variable remains IGNOREd. CLC-INTERCAL prints: I III The interpretation used by CLC-INTERCAL is somewhat different. The ignorance status is stashed along with the variable itself; so the value of 1 is read from the variable's stash, but doing so also removes the read-only status of the variable. This means that the third assignment to the variable works, unlike in the other two cases. (Note that CLC-INTERCAL will act like C-INTERCAL on the ignorret test when running in C-INTERCAL compatibility mode.) The upshot of all this is: don't RETRIEVE a read-only variable if you want your program to be portable! Alex Smith intercal-0.30/pit/tests/PaxHeaders.27456/count.chk0000644000000000000000000000007411437550756016600 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.582945706 intercal-0.30/pit/tests/count.chk0000644000175000017500000000033611437550756016475 0ustar00esresr00000000000000 I can count to I I can count to II I can count to III I can count to IV I can count to V I can count to VI I can count to VII I can count to VIII I can count to IX I can count to X intercal-0.30/pit/tests/PaxHeaders.27456/ignorret.chk0000644000000000000000000000007411437550756017301 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/ignorret.chk0000644000175000017500000000001411437550756017167 0ustar00esresr00000000000000 II II intercal-0.30/pit/tests/PaxHeaders.27456/test1.i0000644000000000000000000000007411437550756016173 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/test1.i0000644000175000017500000000414311437550756016070 0ustar00esresr00000000000000 PLEASE DO (1) NEXT DO ERROR: NEXTING NOT WORKING DO SECTION A: CONTROL FLOW (1) DO FORGET #1 DO .1 <- #2 PLEASE DO (2) NEXT DO (11) NEXT DO ERROR: IGNORING NOT WORKING (7) DO FORGET #2 DO REMEMBER .1 DO .1 <- #2 DO (12) NEXT DO ABSTAIN FROM (50) (50) PLEASE DO (51) NEXT DO ABSTAIN FROM (52) DO REINSTATE (52) (52) PLEASE DO (123) NEXT DO ERROR: LABEL REINSTATING NOT WORKING (123) PLEASE DO FORGET #1 DO .1 <- #2 DO STASH .1 DO .1 <- #1 DO RETRIEVE .1 PLEASE DO (125) NEXT PLEASE DO (124) NEXT (125) PLEASE DO (126) NEXT DO ERROR: RETRIEVING OR STASHING NOT WORKING (126) DO RESUME .1 DO ERROR (12) PLEASE DO (13) NEXT DO ERROR: REMEMBERING NOT WORKING (13) DO RESUME .1 DO ERROR (11) PLEASE DO (111) NEXT DO (7) NEXT (111) DO .1 <- #1 DO IGNORE .1 DO .1 <- #2 DO RESUME .1 (2) DO (5) NEXT DO ERROR (5) DO RESUME .1 DO ERROR: RESUMING NOT WORKING (51) DO ERROR: LABEL ABSTENTION NOT WORKING DO SECTION B: CALCULATION (124) PLEASE FORGET #1 DO .1 <- #3 DO .1 <- .&1 PLEASE DO (501) NEXT DO ERROR IN & OPERATION (501) PLEASE DO (502) NEXT DO ERROR IN & OPERATION (502) PLEASE DO (603) NEXT DO FORGET #2 DO .1 <- #2 DO .1 <- .V1 PLEASE DO (601) NEXT DO .2 <- #32773 DO .2 <- .?2 DO .2 <- .&2 PLEASE DO (701) NEXT DO .1 <- #7~#5 PLEASE DO (901) NEXT DO .1 <- #1$#0 DO (950) NEXT DO THIS TEST HAS BEEN SUCCESSFULLY COMPLETED (950) PLEASE DO (951) NEXT DO ERROR IN $'ING (951) DO RESUME .1 (901) PLEASE DO (902) NEXT DO ~ ERROR (902) PLEASE DO (903) NEXT DO ~ ERROR (903) DO RESUME .1 (701) PLEASE DO (702) NEXT DO ERROR IN ? XOR OPERATION (702) PLEASE DO (603) NEXT DO ERROR IN ? XOR OPERATION (601) PLEASE DO (602) NEXT DO ERROR IN V OPERATION (602) PLEASE DO (603) NEXT DO ERROR IN V OPERATION (603) DO RESUME .1 intercal-0.30/pit/tests/PaxHeaders.27456/version.doc0000644000000000000000000000007411437550756017135 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.594945678 intercal-0.30/pit/tests/version.doc0000644000175000017500000000125111437550756017027 0ustar00esresr00000000000000version.4i is a simple program that tests what version of INTERCAL you are running. Under INTERCAL-72, the .4i suffix is ignored, and the COME FROM lines are splatted. So execution flows to the first splat line, where an error is reported that prints out the required message. Under C-INTERCAL (or CLC-INTERCAL faking it), the ? is interpreted as XOR, leaving a hugely large value in .1. So the second COME FROM doesn't match, and the second splat line generates the error. Under CLC-INTERCAL (or C-INTERCAL using the -X option), the ? is interpreted as BUT, leaving #5 in .1. So the second COME FROM finds the required line label, and the third splat line generates the error. intercal-0.30/pit/tests/PaxHeaders.27456/whileadd.tst0000644000000000000000000000007411437550756017276 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.598945662 intercal-0.30/pit/tests/whileadd.tst0000644000175000017500000000002211437550756017163 0ustar00esresr00000000000000THREE SIX TWO TWO intercal-0.30/pit/tests/PaxHeaders.27456/test2.i0000644000000000000000000000007411437550756016174 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.590945684 intercal-0.30/pit/tests/test2.i0000644000175000017500000001034111437550756016066 0ustar00esresr00000000000000DO WRITE IN .1 DO WRITE IN .2 DO (1030) NEXT DO READ OUT .3 DO GIVE UP (1000) PLEASE IGNORE .4 PLEASE ABSTAIN FROM (1005) (1009) DO STASH .1 + .2 + .5 + .6 DO .4 <- #1 DO (1004) NEXT (1004) PLEASE FORGET #1 DO .3 <- '?.1$.2'~'#0$#65535' DO .6 <- '&.1$.2'~'#0$#65535' PLEASE DO .5 <- "?!6~#32768'$#1"~#3 DO (1002) NEXT DO .4 <- #2 (1005) DO (1006) NEXT (1999) DOUBLE OR SINGLE PRECISION OVERFLOW (1002) DO (1001) NEXT (1006) PLEASE FORGET #1 DO .5 <- '?"!6~.6'~#1"$#1'~#3 DO (1003) NEXT DO .1 <- .3 DO .2 <- !6$#0'~'#32767$#1' DO (1004) NEXT (1003) DO (1001) NEXT DO REINSTATE (1005) (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6 DO REMEMBER .4 PLEASE RESUME #2 (1001) DO RESUME .5 (1010) DO STASH .1 + .2 + .4 DO .4 <- .1 DO .1 <- '?.2$#65535'~'#0$#65535' DO (1020) NEXT PLEASE DO .2 <- .4 PLEASE DO (1009) NEXT DO RETRIEVE .1 + .2 + .4 PLEASE RESUME #1 (1020) DO STASH .2 + .3 DO .2 <- #1 PLEASE DO (1021) NEXT (1021) DO FORGET #1 DO .3 <- "?!1~.2'$#1"~#3 PLEASE DO .1 <- '?.1$.2'~'#0$#65535' DO (1022) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (1021) NEXT (1023) PLEASE RESUME .3 (1022) DO (1023) NEXT PLEASE RETRIEVE .2 + .3 PLEASE RESUME #2 (1030) DO ABSTAIN FROM (1033) PLEASE ABSTAIN FROM (1032) (1039) DO STASH :1 + .5 DO (1530) NEXT DO .3 <- :1~#65535 PLEASE DO .5 <- :1~'#65280$#65280' DO .5 <- '?"!5~.5'~#1"$#1'~#3 DO (1031) NEXT (1032) DO (1033) NEXT DO (1999) NEXT (1031) DO (1001) NEXT (1033) DO .4 <- .5 DO REINSTATE (1032) PLEASE REINSTATE (1033) DO RETRIEVE :1 + .5 PLEASE RESUME #2 (1500) PLEASE ABSTAIN FROM (1502) PLEASE ABSTAIN FROM (1506) (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6 DO .1 <- :1~#65535 PLEASE DO .2 <- :2~#65535 DO (1009) NEXT DO .5 <- .3 PLEASE DO .6 <- .4 DO .1 <- :1~'#65280$#65280' DO .2 <- :2~'#65280$#65280' DO (1009) NEXT DO .1 <- .3 PLEASE DO (1503) NEXT DO .6 <- .4 DO .2 <- #1 DO (1009) NEXT DO .1 <- .3 DO (1501) NEXT (1504) PLEASE RESUME .6 (1503) DO (1504) NEXT (1501) DO .2 <- .5 DO .5 <- '?"'&.6$.4'~#1"$#2'~#3 DO (1505) NEXT (1506) DO (1502) NEXT PLEASE DO (1999) NEXT (1505) DO (1001) NEXT (1502) DO :4 <- .5 DO (1520) NEXT DO :3 <- :1 PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6 DO REINSTATE (1502) DO REINSTATE (1506) PLEASE RESUME #3 (1510) DO STASH :1 + :2 + :4 DO :1 <- "'?":2~'#65535$#0'"$#65535'~'#0$#65535 '"$"'?":2~'#0$#65535'"$#65535'~'#0$#65535'" DO :2 <- #1 DO (1509) NEXT PLEASE RETRIEVE :1 DO :2 <- :3 PLEASE DO (1509) NEXT DO RETRIEVE :2 + :4 PLEASE RESUME #1 (1520) PLEASE STASH .3 + .4 DO .3 <- .1~#43690 DO (1525) NEXT PLEASE DO .4 <- 'V.3$".2~#43690"'~'#0$#65535' DO .3 <- .1~#21845 PLEASE DO (1525) NEXT DO :1 <- .4$"'V.3$".2~#21845"'~'#0$#65535'" PLEASE RETRIEVE .3 + .4 DO RESUME #1 (1525) DO .3 <- '"'"'"!3$#0'~'#32767$#1'"$#0'~'#32767 $#1'"$#0'~'#16383$#3'"$#0'~'#4095$#15' PLEASE RESUME #1 (1530) DO STASH :2 + :3 + .3 + .5 DO :1 <- #0 DO :2 <- .2 DO .3 <- #1 DO (1535) NEXT (1535) PLEASE FORGET #1 DO .5 <- "?!1~.3'$#1"~#3 DO (1531) NEXT DO (1500) NEXT DO :1 <- :3 PLEASE DO (1533) NEXT (1531) PLEASE DO (1001) NEXT (1533) DO FORGET #1 DO .3 <- !3$#0'~'#32767$#1' DO :2 <- ":2~'#0$#65535'"$"'":2~'#32767$#0'"$# 0'~'#32767$#1'" PLEASE DO .5 <- "?!3~.3'$#1"~#3 DO (1532) NEXT DO (1535) NEXT (1532) DO (1001) NEXT PLEASE RETRIEVE :2 + :3 + .3 + .5 DO RESUME #2 (1540) PLEASE ABSTAIN FROM (1541) DO ABSTAIN FROM (1542) (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5 DO .1 <- :1~#65535 PLEASE DO .2 <- :2~'#65280$#65280' DO .5 <- :1~'#65280$#65280' DO (1530) NEXT DO :3 <- :1 DO .2 <- :2~#65535 PLEASE DO (1530) NEXT DO :5 <- :1 DO .1 <- .5 DO (1530) NEXT DO :4 <- :1 PLEASE DO :1 <- ":3~'#65280$#65280'"$":5~'#65280$#65280'" DO .5 <- ':1~:1'~#1 DO .2 <- :2~'#65280$#65280' DO (1530) NEXT PLEASE DO .5 <- '"':1~:1'~#1"$.5'~#3 DO .1 <- :3~#65535 DO .2 <- #0 DO (1520) NEXT PLEASE DO :2 <- :1 PLEASE DO .1 <- :4~#65535 DO (1520) NEXT DO (1509) NEXT DO .5 <- !5$":4~#3"'~#15 DO :1 <- :3 DO :2 <- :5 DO (1509) NEXT PLEASE DO .5 <- !5$":4~#3"'~#63 DO .5 <- '?"!5~.5'~#1"$#1'~#3 PLEASE RETRIEVE :4 (1541) DO :4 <- .5 DO (1543) NEXT (1542) DO (1544) NEXT PLEASE DO (1999) NEXT (1543) DO (1001) NEXT (1544) DO REINSTATE (1541) PLEASE REINSTATE (1542) PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5 DO RESUME #2 intercal-0.30/pit/tests/PaxHeaders.27456/ignorearray.i0000644000000000000000000000007411441323356017442 xustar0030 atime=1427954558.367140813 30 ctime=1427992235.586945701 intercal-0.30/pit/tests/ignorearray.i0000644000175000017500000000064511441323356017342 0ustar00esresr00000000000000 DO ;1 <- #3 PLEASE DO ;1 SUB #1 <- #1 DO ;1 SUB #2 <- #2 DO ;1 SUB #3 <- #3 PLEASE DO READ OUT ;1 SUB #1 + ;1 SUB #2 + ;1 SUB #3 DO IGNORE ;1 DO ;1 <- #2 DO ;1 SUB #1 <- #4 DO REMEMBER ;1 DO ;1 SUB #2 <- #5 DO IGNORE ;1 DO ;1 SUB #3 <- #6 DO READ OUT ;1 SUB #1 + ;1 SUB #2 + ;1 SUB #3 PLEASE GIVE UP intercal-0.30/pit/PaxHeaders.27456/rot13.chk0000644000000000000000000000007411437550756015256 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/rot13.chk0000644000175000017500000000004011437550756015143 0ustar00esresr00000000000000N zna, n cyna, n pnany, Cnanzn. intercal-0.30/pit/PaxHeaders.27456/flonck.i0000644000000000000000000000007411437550756015245 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.558945776 intercal-0.30/pit/flonck.i0000644000175000017500000001133611437550756015144 0ustar00esresr00000000000000 DO :321 <- #0 DO :322 <- #0 DO :123 <- #65535$#65535 PLEASE STASH :123 DO (1) NEXT (1) PLEASE FORGET #1 PLEASE WRITE IN :1 DO .5 <- '?"':1~:1'~#1"$#2'~#3 DO (11) NEXT DO :123 <- #0 PLEASE STASH :123 DO (1) NEXT (11) DO (1001) NEXT DO .5 <- :1~'#65280$#65280' DO .5 <- '?"!5~.5'~#1"$#1'~#3 DO (10) NEXT PLEASE FORGET #1 DO (5090) NEXT DO .5 <- '?".5~#2"$#2'~#3 DO (19) NEXT DO :123 <- :2 PLEASE STASH :123 DO (1) NEXT (10) DO (1001) NEXT PLEASE FORGET #2 DO .5 <- '?"':1~#65504'~#1"$#2'~#3 DO (19) NEXT DO (131) NEXT (131) DO (130) NEXT PLEASE FORGET #1 DO (18) NEXT (130) DO (129) NEXT PLEASE GIVE UP (129) DO (128) NEXT PLEASE FORGET #3 DO :1 <- :322 DO (5080) NEXT PLEASE READ OUT :2 DO (1) NEXT (128) DO (127) NEXT PLEASE FORGET #4 DO (22) NEXT DO :123 <- :322 PLEASE STASH :123 DO :322 <- :2 DO (1) NEXT (127) DO (126) NEXT PLEASE FORGET #5 DO :123 <- :322 PLEASE STASH :123 DO (1) NEXT (126) DO (125) NEXT PLEASE FORGET #6 DO (21) NEXT DO :2 <- :322 DO (5000) NEXT DO (33) NEXT PLEASE RETRIEVE :123 DO :322 <- :123 DO (1) NEXT (125) DO (124) NEXT PLEASE FORGET #7 DO (22) NEXT DO :322 <- :2 DO (1) NEXT (124) DO (123) NEXT PLEASE FORGET #8 DO :1 <- :321 DO (5080) NEXT PLEASE READ OUT :2 DO (1) NEXT (123) DO (122) NEXT PLEASE FORGET #9 DO (21) NEXT DO :123 <- :321 PLEASE STASH :123 DO :321 <- :1 DO (1) NEXT (122) DO (121) NEXT PLEASE FORGET #10 DO :123 <- :321 PLEASE STASH :123 DO (1) NEXT (121) DO (120) NEXT PLEASE FORGET #11 DO (22) NEXT DO :1 <- :321 DO (5000) NEXT DO (33) NEXT PLEASE RETRIEVE :123 DO :321 <- :123 DO (1) NEXT (120) DO (119) NEXT PLEASE FORGET #12 DO (21) NEXT DO :321 <- :1 DO (1) NEXT (119) DO (118) NEXT PLEASE FORGET #13 DO (5400) NEXT DO :123 <- :1 PLEASE STASH :123 DO (1) NEXT (118) DO (117) NEXT PLEASE FORGET #14 DO (21) NEXT DO (5020) NEXT DO :123 <- :2 PLEASE STASH :123 DO (1) NEXT (117) DO (116) NEXT PLEASE FORGET #15 DO (271) NEXT (272) DO (1001) NEXT (271) PLEASE FORGET #1 PLEASE RETRIEVE :123 DO .5 <- '?"':123~:123'~'#32768$#0'"$#1'~#3 DO (272) NEXT PLEASE STASH :123 DO (1) NEXT (116) DO (115) NEXT PLEASE FORGET #16 DO (21) NEXT DO (1) NEXT (115) DO (114) NEXT PLEASE FORGET #17 DO (22) NEXT DO (21) NEXT DO (5130) NEXT DO (33) NEXT DO (1) NEXT (114) DO (113) NEXT PLEASE FORGET #18 DO (21) NEXT DO (5120) NEXT DO (32) NEXT DO (1) NEXT (113) DO (112) NEXT PLEASE FORGET #19 DO (21) NEXT DO (5110) NEXT DO (32) NEXT DO (1) NEXT (112) DO (111) NEXT PLEASE FORGET #20 DO (21) NEXT DO (5100) NEXT DO (32) NEXT DO (1) NEXT (111) DO (110) NEXT PLEASE FORGET #21 DO (22) NEXT DO :1 <- #30720$#28672 DO (5040) NEXT DO (33) NEXT DO (1) NEXT (110) DO (109) NEXT PLEASE FORGET #22 DO (21) NEXT PLEASE DO :123 <- '"?':123~"#65535$#0"'$#32768"~"#0$#65535"'$ ':123~"#0$#65535"' PLEASE STASH :123 DO (1) NEXT (109) DO (108) NEXT PLEASE FORGET #23 DO (21) NEXT DO (22) NEXT DO :123 <- :1 PLEASE STASH :123 DO :123 <- :2 PLEASE STASH :123 DO (1) NEXT (108) DO (107) NEXT PLEASE FORGET #24 DO (21) NEXT PLEASE STASH :123 + :123 DO (1) NEXT (107) DO (106) NEXT PLEASE FORGET #25 DO :1 <- #65535$#65535 DO (171) NEXT (171) PLEASE FORGET #1 PLEASE STASH :1 PLEASE RETRIEVE :123 DO .5 <- '?"':123~:123'~'#32768$#0'"$#2'~#3 DO (172) NEXT DO :1 <- :123 DO (5080) NEXT PLEASE READ OUT :2 DO (171) NEXT (172) DO (1001) NEXT PLEASE FORGET #1 PLEASE STASH :123 PLEASE RETRIEVE :1 DO :123 <- :1 DO .5 <- '?"':1~:1'~'#32768$#0'"$#1'~#3 DO (172) NEXT DO (1) NEXT (106) DO (105) NEXT PLEASE FORGET #26 DO (21) NEXT PLEASE STASH :123 DO (5080) NEXT PLEASE READ OUT :2 DO (1) NEXT (105) DO (104) NEXT PLEASE FORGET #27 DO (22) NEXT DO (21) NEXT DO (5050) NEXT DO (33) NEXT DO (1) NEXT (104) DO (103) NEXT PLEASE FORGET #28 DO (22) NEXT DO (21) NEXT DO (5040) NEXT DO (33) NEXT DO (1) NEXT (103) DO (102) NEXT PLEASE FORGET #29 DO (22) NEXT DO (21) NEXT DO (5030) NEXT DO (33) NEXT DO (1) NEXT (102) DO (101) NEXT PLEASE FORGET #30 DO (22) NEXT DO (21) NEXT DO (5010) NEXT DO (33) NEXT DO (1) NEXT (101) DO (100) NEXT PLEASE FORGET #31 DO (22) NEXT DO (21) NEXT DO (5000) NEXT DO (33) NEXT DO (1) NEXT (100) PLEASE RESUME :1 (19) DO (1001) NEXT (18) PLEASE READ OUT #30 PLEASE FORGET #1 DO (1) NEXT (21) PLEASE RETRIEVE :123 DO :1 <- :123 DO .5 <- '?"':1~:1'~'#32768$#0'"$#2'~#3 DO (1001) NEXT PLEASE FORGET #2 DO (18) NEXT (22) PLEASE RETRIEVE :123 DO :2 <- :123 DO .5 <- '?"':2~:2'~'#32768$#0'"$#2'~#3 DO (1001) NEXT PLEASE FORGET #2 DO (18) NEXT (32) DO :3 <- :2 (33) DO :123 <- :3 DO (35) NEXT PLEASE FORGET #1 DO (18) NEXT (35) DO (36) NEXT DO :123 <- #0 DO (37) NEXT (36) DO (1001) NEXT (37) PLEASE STASH :123 PLEASE RESUME #3 PLEASE APPEND THE FLOATING-POINT LIBRARY ROUTINES intercal-0.30/pit/PaxHeaders.27456/lib0000644000000000000000000000013012507267255014277 xustar0029 mtime=1427992237.75093968 30 atime=1427992237.754939663 29 ctime=1427992237.75093968 intercal-0.30/pit/lib/0000755000175000017500000000000012507267255014256 5ustar00esresr00000000000000intercal-0.30/pit/lib/PaxHeaders.27456/plus.i0000644000000000000000000000007411437550756015522 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.578945723 intercal-0.30/pit/lib/plus.i0000644000175000017500000000054211437550756015416 0ustar00esresr00000000000000(2000) PLEASE DO STASH .1 + .2 + .3 DO .2 <- #1 DO (2001) NEXT (2001) PLEASE FORGET #1 DO .3 <- "?!1~#1'$#1"~#3 DO (2002) NEXT PLEASE DO .2 <- !2$#1'~'#65535$#1' DO .1 <- .1~#65534 DO (2001) NEXT (2002) PLEASE DO (2003) NEXT DO RETRIEVE .1 DO .3 <- .1 PLEASE DO .1 <- '?.2$.3'~'#0$#65535' DO RETRIEVE .2 + .3 DO RESUME #2 (2003) DO RESUME .3 intercal-0.30/pit/lib/PaxHeaders.27456/lib2.i0000644000000000000000000000007411437550756015367 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.574945729 intercal-0.30/pit/lib/lib2.i0000644000175000017500000000431311437550756015263 0ustar00esresr00000000000000(2010) PLEASE ABSTAIN FROM (2004) (2000) PLEASE STASH .2 DO .2 <- #1 DO (2001) NEXT (2001) PLEASE FORGET #1 DO .1 <- '?.1$.2'~'#0$#65535' DO (2002) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (2001) NEXT (2003) PLEASE RESUME "?!1~.2'$#1"~#3 (2002) DO (2003) NEXT PLEASE RETRIEVE .2 (2004) PLEASE RESUME #2 DO REINSTATE (2004) PLEASE RESUME '?"!1~.1'~#1"$#2'~#6 (2020) PLEASE STASH .2 + .3 DO (1021) NEXT (2030) DO STASH .1 + .5 DO .3 <- #0 DO .5 <- '?"!2~.2'~#1"$#1'~#3 PLEASE DO (2031) NEXT DO .4 <- #1 PLEASE DO (2033) NEXT (2033) DO FORGET #1 DO .5 <- '?".2~#32768"$#2'~#3 DO (2032) NEXT DO .2 <- !2$#0'~'#32767$#1' PLEASE DO .4 <- !4$#0'~'#32767$#1' DO (2033) NEXT (2032) DO (1001) NEXT (2036) PLEASE FORGET #1 DO .5 <- '?.1$.2'~'#0$#65535' DO .5 <- '?"'&"!2~.5'~'"?'?.5~.5'$#32768"~"#0$#65535"'"$ ".5~.5"'~#1"$#2'~#3 DO (2034) NEXT DO .5 <- .3 DO (1010) NEXT PLEASE DO .1 <- .3 DO .3 <- 'V.4$.5'~'#0$#65535' DO (2035) NEXT (2034) PLEASE DO (1001) NEXT (2035) DO FORGET #1 DO .5 <- "?'.4~#1'$#2"~#3 DO (2031) NEXT DO .2 <- .2~#65534 DO .4 <- .4~#65534 PLEASE DO (2036) NEXT (2031) DO (1001) NEXT PLEASE DO .4 <- .1 DO RETRIEVE .1 + .5 PLEASE RESUME #2 (2040) PLEASE STASH .4 DO ABSTAIN FROM (2047) (2049) DO STASH .2 + .5 + :2 + :3 + :4 + :5 + :6 PLEASE DO .4 <- #0 DO :5 <- .1 DO :6 <- #1 DO (2044) NEXT DO .4 <- '?.4$#1'~#3 (2047) DO (2048) NEXT DO .5 <- .4 DO (2046) NEXT DO (1999) NEXT (2046) DO (1001) NEXT PLEASE REINSTATE (2047) PLEASE RETRIEVE .4 (2048) DO :1 <- :6 DO RETRIEVE .2 + .5 + :2 + :3 + :4 + :5 + :6 PLEASE RESUME #2 (2044) DO (2045) NEXT (2045) PLEASE FORGET #1 DO .5 <- "?!2~#1'$#1"~#3 DO (2041) NEXT DO :3 <- :6~"#65535$#65534" DO .5 <- '?"':3~:3'~#1"$#1'~#3 DO (2042) NEXT PLEASE DO :1 <- :6 PLEASE DO :2 <- :5 DO (1549) NEXT DO :6 <- :3 DO .4 <- 'V.4$":4~#2"'~#1 DO (2043) NEXT (2042) DO (1001) NEXT PLEASE FORGET #1 DO :6 <- :5 DO (2043) NEXT (2041) DO (1001) NEXT (2043) PLEASE FORGET #1 DO .2 <- .2~#65534 DO .5 <- '?"!2~.2'~#1"$#2'~#3 DO (1001) NEXT PLEASE DO :1 <- :5 PLEASE DO :2 <- :5 DO (1549) NEXT DO :5 <- :3 DO .4 <- 'V.4$":4~#2"'~#1 DO (2045) NEXT intercal-0.30/pit/lib/PaxHeaders.27456/syslib5.5i0000644000000000000000000000007411437550756016216 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.578945723 intercal-0.30/pit/lib/syslib5.5i0000644000175000017500000002170011437550756016111 0ustar00esresr00000000000000 PLEASE KNOCK "SHAVE-AND-A-HAIRCUT" BEFORE ENTERING (1000) PLEASE IGNORE .4 PLEASE ABSTAIN FROM (1005) (1009) DO STASH .1 + .2 + .5 + .6 DO .4 <- #1 DO (1004) NEXT (1004) PLEASE FORGET #1 DO .3 <- '^.1$.2'~'#0$#3906' DO .6 <- '?"'V"'&.1$.2'~'#0$#3906'"$"'^"'@.1$ .2'~'#0$#3906'"$#3906'~'#0$#11718'"' ~'#0$#3906'"$#11718'~'#0$#3906' PLEASE DO .5 <- "?!6~#12500'$#5"~#5 DO (1002) NEXT DO .4 <- #2 (1005) DO (1006) NEXT (1999) DOUBLE OR SINGLE PRECISION OVERFLOW (1002) DO (1001) NEXT (1006) PLEASE FORGET #1 DO .5 <- '?"!6~.6'~#4"$#5'~#5 DO (1003) NEXT DO .1 <- .3 DO .2 <- !6$#0'~'#781$#1' DO (1004) NEXT (1003) DO (1001) NEXT DO REINSTATE (1005) (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6 DO REMEMBER .4 PLEASE RESUME #2 (1001) DO RESUME .5 (1010) DO STASH .1 + .2 + .4 DO .4 <- .1 DO .1 <- '?#15624$.2'~'#0$#3906' DO (1020) NEXT PLEASE DO .2 <- .4 PLEASE DO (1009) NEXT DO RETRIEVE .1 + .2 + .4 PLEASE RESUME #1 (1020) DO STASH .2 + .3 DO .2 <- #1 PLEASE DO (1021) NEXT (1021) DO FORGET #1 DO .3 <- '?"'V".1~.2"$#3'~#1"$#2'~#1 PLEASE DO .1 <- '^.1$.2'~'#0$#3906' DO (1022) NEXT DO .2 <- !2$#0'~'#781$#1' DO (1021) NEXT (1023) PLEASE RESUME .3 (1022) DO (1023) NEXT PLEASE RETRIEVE .2 + .3 PLEASE RESUME #2 (1030) DO ABSTAIN FROM (1033) PLEASE ABSTAIN FROM (1032) (1039) DO STASH :1 + .5 DO (1530) NEXT DO .3 <- :1~#3906 PLEASE DO .5 <- :1~'#3875$#3875' DO .5 <- '?"!5~.5'~#4"$#5'~#5 DO (1031) NEXT (1032) DO (1033) NEXT DO (1999) NEXT (1031) DO (1001) NEXT (1033) DO .4 <- .5 DO REINSTATE (1032) PLEASE REINSTATE (1033) DO RETRIEVE :1 + .5 PLEASE RESUME #2 (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3 DO .2 <- #0 DO (1520) NEXT DO STASH :1 PLEASE RETRIEVE .2 DO .1 <- .2 DO .2 <- #0 PLEASE DO (1520) NEXT DO :2 <- :1 DO RETRIEVE .1 + .2 + :1 DO (1550) NEXT PLEASE DO .3 <- :3 DO RETRIEVE :1 + :2 + :3 DO RESUME #1 (1050) PLEASE STASH :2 + :3 + .5 DO :2 <- .1 PLEASE DO (1550) NEXT DO .5 <- :3~'#3875$#3875' DO .5 <- '?"!5~.5'~#4"$#5'~#5 DO (1051) NEXT DO (1999) NEXT (1051) DO (1001) NEXT DO .2 <- :3 PLEASE RETRIEVE :2 + :3 + .5 DO RESUME #2 (1500) PLEASE ABSTAIN FROM (1502) PLEASE ABSTAIN FROM (1506) (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6 DO .1 <- :1~#3906 PLEASE DO .2 <- :2~#3906 DO (1009) NEXT DO .5 <- .3 PLEASE DO .6 <- .4 DO .1 <- :1~'#3875$#3875' DO .2 <- :2~'#3875$#3875' DO (1009) NEXT DO .1 <- .3 PLEASE DO (1503) NEXT DO .6 <- .4 DO .2 <- #1 DO (1009) NEXT DO .1 <- .3 DO (1501) NEXT (1504) PLEASE RESUME .6 (1503) DO (1504) NEXT (1501) DO .2 <- .5 DO .5 <- '&.6$.4' DO (1505) NEXT (1506) DO (1502) NEXT PLEASE DO (1999) NEXT (1505) DO (1001) NEXT (1502) DO :4 <- .5 DO (1520) NEXT DO :3 <- :1 PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6 DO REINSTATE (1502) DO REINSTATE (1506) PLEASE RESUME #3 (1510) DO STASH :1 + :2 + :4 DO :1 <- "'?#15624$":2~'#3906$#0'"'~'#0$#3906'"$ "'?#15624$":2~'#0$#3906'"'~'#0$#3906'" DO :2 <- #1 DO (1509) NEXT PLEASE RETRIEVE :1 DO :2 <- :3 PLEASE DO (1509) NEXT DO RETRIEVE :2 + :4 PLEASE RESUME #1 (1520) PLEASE STASH .3 + .4 DO .3 <- .1~#3255 DO (1525) NEXT PLEASE DO .4 <- 'V.3$".2~#3255"'~'#0$#3906' DO .3 <- .1~#651 PLEASE DO (1525) NEXT DO :1 <- .4$"'V.3$".2~#651"'~'#0$#3906'" PLEASE RETRIEVE .3 + .4 DO RESUME #1 (1525) DO .3 <- '"!3$#0'~'#781$#1'"$#0'~'#156$#6' PLEASE RESUME #1 (1530) DO STASH :2 + :3 + :4 + .1 + .2 + .5 DO :3 <- #0 DO :4 <- .2 DO (1535) NEXT (1535) PLEASE FORGET #1 DO .5 <- '?".1~#4"$#5'~#5 DO (1531) NEXT DO :1 <- :4 DO (1720) NEXT DO :1 <- :3 DO (1500) NEXT PLEASE DO (1533) NEXT (1531) PLEASE DO (1001) NEXT (1533) DO FORGET #1 DO .1 <- .1~#3905 DO :4 <- ":4~'#0$#3906'"$"'":4~'#781$#0'"$#0' ~'#781$#1'" PLEASE DO .5 <- '?"!1~.1'~#4"$#5'~#5 DO (1532) NEXT DO (1535) NEXT (1532) DO (1001) NEXT DO :1 <- :3 PLEASE RETRIEVE :2 + :3 + :4 + .1 + .2 + .5 DO RESUME #2 (1540) PLEASE ABSTAIN FROM (1541) DO ABSTAIN FROM (1542) (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5 DO .1 <- :1~#3906 PLEASE DO .2 <- :2~'#3875$#3875' DO .5 <- :1~'#3875$#3875' DO (1530) NEXT DO :3 <- :1 DO .2 <- :2~#3906 PLEASE DO (1530) NEXT DO :5 <- :1 DO .1 <- .5 DO (1530) NEXT DO :4 <- :1 PLEASE DO :1 <- ":3~'#3875$#3875'"$":4 ~'#3875$#3875'" DO .5 <- ':1~:1'~#4 DO .2 <- :2~'#3875$#3875' DO (1530) NEXT PLEASE DO .5 <- '"':1~:1'~#4"$.5'~#6 DO .1 <- :3~#3906 DO .2 <- #0 DO (1520) NEXT PLEASE DO :2 <- :1 PLEASE DO .1 <- :4~#3906 DO (1520) NEXT DO (1509) NEXT DO .5 <- !5$"'^":4~#1"$#2'~#1"'~#131 DO :1 <- :3 DO :2 <- :5 DO (1509) NEXT PLEASE DO .5 <- !5$"'^":4~#1"$#2'~#1"'~#3256 DO .5 <- '?"!5~.5'~#1"$#2'~#1 PLEASE RETRIEVE :4 (1541) DO :4 <- .5 DO (1543) NEXT (1542) DO (1544) NEXT PLEASE DO (1999) NEXT (1543) DO (1001) NEXT (1544) DO REINSTATE (1541) PLEASE REINSTATE (1542) PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5 DO RESUME #2 (1550) DO STASH :1 + :4 + :5 + :6 + .1 + .5 DO :5 <- #0 DO .5 <- '?"':2~:2'~#4"$#5'~#5 PLEASE DO (1551) NEXT DO :4 <- #1 PLEASE DO (1553) NEXT (1553) DO FORGET #1 DO .5 <- '?"':2~"#12500$#0"'"$#3'~#1 DO (1552) NEXT DO :2 <- ":2~'#0$#3906'"$"'":2~'#781$#0'"$#0' ~'#781$#1'" PLEASE DO :4 <- ":4~'#0$#3906'"$"'":4~'#781 $#0'"$#0'~'#781$#1'" DO (1553) NEXT (1552) DO (1001) NEXT DO .1 <- #0 (1556) PLEASE FORGET #1 DO :6 <- "'&":2~'#3906$#0'"$"'?#15624$":1 ~'#3906$#0'"'~'#0$#3906'"'~'#0$#3906'"$ "'&":2~'#0$#3906'"$"'?#15624$":1~'#0$ #3906'"'~'#0$#3906'"'~'#0$#3906'" DO :6 <- "'?"'V":6~'#3906$#0'"$#7812'~'#0$ #3906'"$#7812'~'#0$#15624'"$"'?"'V":6 ~'#0$#3906'"$#7812'~'#0$#3906'"$#7812' ~'#0$#15624'" DO :3 <- "'?":1~'#3906$#0'"$":2~'#3906$#0'"' ~'#0$#15624'"$"'?":1~'#0$#3906'"$":2~'#0$ #3906'"'~'#0$#15624'" DO .5 <- "?'"':6~:3'~'"'"'&"':3~:3'~'#3906$#0'"$ #3125'~'#0$#3906'"$"'?:3~:3'~'#781$#0'"' ~'#3125$#781'"$"'?:3~:3'~'#0$#3906'"'"~#1'$ #3"~#1 PLEASE DO (1557) NEXT DO (1510) NEXT PLEASE DO :1 <- :3 DO .5 <- '?#0$"'V.1$#3'~#1"'~#1 DO (1557) NEXT DO .1 <- '^.1$#3906'~'#0$#3906' DO (1556) NEXT (1557) PLEASE DO (1001) NEXT PLEASE FORGET #1 DO :5 <- "'V":4~'.1$#0'"$":5~'#3906$#0'"' ~'#0$#3906'"$"'V":4~'#0$.1'"$":5~'#0$ #3906'"'~'#0$#3906'" DO .5 <- "?#2$':4~#1'"~#1 DO (1551) NEXT DO :2 <- :2~'#3906$#3905' DO :4 <- :4~'#3906$#3905' DO .1 <- #0 PLEASE DO (1556) NEXT (1551) DO (1001) NEXT DO :3 <- :5 PLEASE RETRIEVE :1 + :4 + :5 + :6 + .1 + .5 PLEASE RESUME #2 (1720) PLEASE STASH :1 + :3 + :4 + .1 + .5 DO :2 <- #0 DO .2 <- #0 DO .5 <- '?".1~#4"$#5'~#5 DO (1729) NEXT DO .5 <- .1~#1 DO .2 <- :1~'#3906$#0' DO .1 <- :1~'#0$#3906' PLEASE DO (1724) NEXT DO :1 <- '"?#0$.2"~"#0$#3906"'$'"?#0$.1"~"#0$ #3906"' DO :2 <- '"?'"V.2$#3906"~"#0$#3906"'$ #3906"~"#0$#3906"'$'"?'"V.1$#3906" ~"#0$#3906"'$#3906"~"#0$#3906"' DO (1728) NEXT (1724) PLEASE DO (1723) NEXT DO :1 <- '"?#0$'"^.2$.2"~"#0$#3906"'"~"#0$#3906"'$ '"?#0$'"^.1$.1"~"#0$#3906"'"~"#0$#3906"' DO :2 <- '"?'"V'"@.2$#11718"~"#0$#3906"'$#7812" ~"#0$#3906"'$#7812"~"#0$#3906"'$'"?'"V'"@.1$ #11718"~"#0$#3906"'$#7812"~"#0$#3906"'$#7812" ~"#0$#3906"' (1728) DO .2 <- :2~'#3125$#0' DO :2 <- ':2~"#0$#3906"'$'"':2~"#781$#0"'$#0" ~"#781$#1"' DO (1509) NEXT DO :2 <- :3 DO .2 <- '^.2$"'?":4~#1"$#1'~#1"'~#1 DO (1721) NEXT (1723) PLEASE DO (1722) NEXT DO :1 <- '"^.2$.2"~"#0$#3906"'$'"^.1$.1"~"#0$ #3906"' DO :2 <- '"?'"V'"2@.2$#15624"~"#0$#3906"'$ #11718"~"#0$#3906"'$#11718"~"#0$#3906"'$ '"?'"V'"2@.1$#15624"~"#0$#3906"'$#11718" ~"#0$#3906"'$#11718"~"#0$#3906"' PLEASE FORGET #2 DO (1728) NEXT (1729) DO (1001) NEXT DO (1721) NEXT (1722) PLEASE DO (1001) NEXT DO :2 <- :1 DO .2 <- #0 DO FORGET #1 (1721) PLEASE RETRIEVE :1 + :3 + :4 + .1 + .5 PLEASE RESUME #3 (1900) DO STASH .2 + .5 DO .1 <- #0 DO .2 <- #1 PLEASE DO (1901) NEXT (1901) DO %20 (1903) NEXT DO .1 <- 'V.1$.2'~'#0$#3906' DO %50 .1 <- '^.1$".2~#7812"'~'#0$#3906' DO %50 .1 <- '^.1$.2'~'#0$#3906' PLEASE DO (1903) NEXT (1903) PLEASE FORGET #2 DO .2 <- !2$#0'~'#781$#1' PLEASE DO .5 <- '^".2~.2"$#1'~#1 DO (1902) NEXT DO (1901) NEXT (1902) DO (1001) NEXT DO RETRIEVE .2 + .5 PLEASE RESUME #2 (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3 DO .3 <- #15613 DO :1 <- #6 DO (1911) NEXT PLEASE NOTE THAT YOU CAN'T GET SOMETHING FROM NOTHING (1912) DO (1001) NEXT (1911) DO FORGET #1 PLEASE DO (1900) NEXT DO :2 <- .1 DO (1500) NEXT PLEASE DO :1 <- :3 DO .1 <- .3 DO (1020) NEXT PLEASE DO .3 <- .1 DO .5 <- '?"!3~.3'~#4"$#3'~#1 DO (1912) NEXT DO .1 <- #12 PLEASE DO (1050) NEXT DO RETRIEVE .1 DO (1530) NEXT DO :2 <- #7812 DO (1500) NEXT PLEASE DO .2 <- :3~'#3875$#3875' PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3 DO RESUME #1 intercal-0.30/pit/lib/PaxHeaders.27456/numio.i0000644000000000000000000000007411437550756015666 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.578945723 intercal-0.30/pit/lib/numio.i0000644000175000017500000001545711437550756015575 0ustar00esresr00000000000000 PLEASE USE THE AUTHORIZED CHANNELS (3000) DO STASH .2 + .3 + .5 DO .2 <- ,3000SUB#1 PLEASE WRITE IN ,3000 DO .1 <- ,3000SUB#1 DO .5 <- '?".1~#256"$#2'~#3 DO (3008) NEXT DO (1000) NEXT DO .1 <- .3~#255 DO ,3000SUB#1 <- .1 DO (3009) NEXT (3008) DO (1001) NEXT (3009) DO RETRIEVE .2 + .3 + .5 PLEASE RESUME #2 (3001) DO STASH .1 + .3 DO .1 <- ,3001SUB#1 DO (1010) NEXT DO ,3001SUB#1 <- .3~#255 PLEASE READ OUT ,3001 DO ,3001SUB#1 <- .2 DO .1 <- .2 DO RETRIEVE .1 + .3 PLEASE RESUME #1 (3010) PLEASE STASH .1 + .4 + .5 PLEASE DO (1020) NEXT DO .2 <- #0 DO .3 <- #2 DO .4 <- .1 DO (3012) NEXT (3011) DO (1001) NEXT (3012) PLEASE FORGET #1 DO (3000) NEXT DO .5 <- '?"?.1~#256"$#2'~#3 DO (3013) NEXT DO .5 <- '?"'#65535~"'?.1$#10'~#21845"'~#1"$#1'~#3 DO (3013) NEXT DO .5 <- .1 DO .1 <- .2 PLEASE DO (1020) NEXT DO .2 <- .1 DO .1 <- .5 DO .5 <- .3 DO (3011) NEXT DO .5 <- '?"'#65535~"'?.2$.4'~'#0$#65535'"'~#1"$#1'~#3 DO .3 <- .5 DO (3011) NEXT PLEASE DO ,1SUB.2 <- .1 DO (3012) NEXT (3013) DO (1001) NEXT PLEASE RETRIEVE .1 + .4 + .5 PLEASE DO .3 <- '?.3$#3'~#5 PLEASE RESUME #2 (3020) PLEASE STASH .1 + .5 + .6 + .7 DO (1020) NEXT DO .3 <- #0 DO .4 <- #6 DO .6 <- .1 DO (3022) NEXT (3021) DO (1001) NEXT (3022) PLEASE FORGET #1 DO (3000) NEXT DO .5 <- '?"?.1~#256"$#2'~#3 DO (3023) NEXT DO .5 <- '?"'#65535~"'?.1$#10'~#21845"'~#1"$#1'~#3 DO (3023) NEXT DO .7 <- .1 DO .1 <- .3 PLEASE DO (1020) NEXT DO .3 <- .1 DO .5 <- .4~#3 DO (3021) NEXT DO .5 <- '?"'#65535~"'?.3$.6'~'#0$#65535'"'~#1"$#1'~#3 DO .4 <- !4$.5'~#37 DO (3021) NEXT (3027) DO .1 <- #0 PLEASE COME FROM (3024) PLEASE DO (1020) NEXT DO .5 <- '?"'#65535~"'?.7$",2SUB.1"'~#21845"'~#1"$#1'~#3 DO (3025) NEXT PLEASE COME FROM (3027) DO .5 <- '?"'#65535~"'?.1$.2'~'#0$#65535'"'~#1"$#1'~#3 (3024) DO (3026) NEXT (3026) DO (1001) NEXT PLEASE FORGET #1 PLEASE DO ,1SUB.3 <- .7 DO .4 <- .4~#3 DO (3022) NEXT (3025) DO (1001) NEXT PLEASE FORGET #1 PLEASE DO ,1SUB.3 <- .1 DO (3022) NEXT (3023) DO (1001) NEXT PLEASE RETRIEVE .1 + .5 + .6 + .7 DO .4 <- '?#2$.&4'~#6 PLEASE RESUME #2 (3089) PLEASE ABSTAIN FROM (3087) (3080) PLEASE STASH .2 + .3 + .4 DO .3 <- #0 DO (3081) NEXT (3087) DO (3088) NEXT PLEASE REINSTATE (3087) DO .4 <- '?.1$#10'~'#0$#65535' DO .4 <- .4~.4 DO (3085) NEXT (3998) DOES "ENTER A NUMBER" MEAN SOMETHING ELSE WHERE YOU COME FROM? (3085) DO (3086) NEXT (3088) PLEASE FORGET #1 DO .1 <- .3 PLEASE RETRIEVE .2 + .3 + .4 PLEASE RESUME #1 (3086) PLEASE RESUME '?.V4$#1'~#3 (3081) DO COME FROM (3082) DO (3000) NEXT DO .4 <- '?".1~#240"$#3'~#85 DO .4 <- '".4~.4"~#1'$'&".1~#8"$".V1~#2"' DO (3086) NEXT DO .4 <- .3~#57344 DO .4 <- .4~.4 DO (3083) NEXT DO (1999) NEXT (3083) DO (3086) NEXT PLEASE FORGET #1 DO .4 <- .1 DO .2 <- !3$#0'~'#32767$#1' DO .1 <- !2$#0'~'#16383$#3' DO (1000) NEXT DO .1 <- .3 DO .2 <- .4~#15 (3082) DO (1000) NEXT (3090) PLEASE ABSTAIN FROM (3097) (3099) PLEASE STASH .1 + .2 + .3 + .4 DO .2 <- #256 PLEASE STASH .2 DO (3091) NEXT DO (3095) NEXT DO .2 <- #80 (3097) DO (3001) NEXT PLEASE REINSTATE (3097) PLEASE RETRIEVE .1 + .2 + .3 + .4 PLEASE RESUME #1 (3098) PLEASE RESUME '?"!1~.1'~#1"$#2'~#3 (3091) DO COME FROM (3092) DO .2 <- #10 DO (2030) NEXT DO .2 <- .4 PLEASE STASH .2 DO .1 <- .3 (3092) DO (3098) NEXT (3095) DO COME FROM (3094) PLEASE RETRIEVE .2 DO (3093) NEXT DO .2 <- .2$#3 DO .2 <- !2~#15'$!2~#240' DO .2 <- !2~#15'$!2~#240' (3094) DO (3001) NEXT (3093) PLEASE RESUME '?".2~#256"$#1'~#3 (3189) PLEASE ABSTAIN FROM (3187) (3180) PLEASE STASH :2 + :3 + .1 + .4 DO :3 <- #0 PLEASE STASH :4 DO (3181) NEXT PLEASE RETRIEVE :4 (3187) DO (3188) NEXT PLEASE REINSTATE (3187) DO .4 <- '?.1$#10'~'#0$#65535' DO .4 <- .4~.4 DO (3185) NEXT DO (3998) NEXT (3185) DO (3186) NEXT (3188) PLEASE FORGET #1 DO :1 <- :3 PLEASE RETRIEVE :2 + :3 + .1 + .4 PLEASE RESUME #1 (3186) PLEASE RESUME '?.V4$#1'~#3 (3181) DO COME FROM (3182) DO (3000) NEXT DO .4 <- '?".1~#240"$#3'~#85 DO .4 <- '".4~.4"~#1'$'&".1~#8"$".V1~#2"' DO (3186) NEXT DO .4 <- :3~'#49152$#32768' DO .4 <- .4~.4 DO (3183) NEXT DO (1999) NEXT (3183) DO (3186) NEXT PLEASE FORGET #1 DO :2 <- ':3~"#0$#65535"'$'"':3~"#32767$#0"'$#0"~"#32767$#1"' DO :1 <- ':2~"#32767$#1"'$'"':2~"#0$#32767"'$#0"~"#32767$#1"' DO (1500) NEXT DO :1 <- :3 DO :2 <- .1~#15 (3182) DO (1500) NEXT (3190) PLEASE ABSTAIN FROM (3197) (3199) PLEASE STASH :1 + :2 + :3 + :4 + .2 + .4 DO :2 <- #10 DO .2 <- #256 PLEASE STASH .2 DO (3191) NEXT DO (3095) NEXT DO .2 <- #80 (3197) DO (3001) NEXT PLEASE REINSTATE (3197) PLEASE RETRIEVE :1 + :2 + :3 + :4 + .2 + .4 PLEASE RESUME #1 (3198) PLEASE RESUME '?"':1~:1'~#1"$#2'~#3 (3191) DO COME FROM (3192) DO (2530) NEXT DO .2 <- :4 PLEASE STASH .2 DO :1 <- :3 (3192) DO (3198) NEXT (3990) PLEASE DO ,3000 <- #1 DO ,3000SUB#1 <- #0 PLEASE DO ,3001 <- #1 DO ,3001SUB#1 <- #0 PLEASE RESUME #1 (2030) DO STASH .1 + .5 DO .3 <- #0 DO .5 <- '?"!2~.2'~#1"$#1'~#3 PLEASE DO (2031) NEXT DO .4 <- #1 PLEASE DO (2033) NEXT (2033) DO FORGET #1 DO .5 <- '?".2~#32768"$#2'~#3 DO (2032) NEXT DO .2 <- !2$#0'~'#32767$#1' PLEASE DO .4 <- !4$#0'~'#32767$#1' DO (2033) NEXT (2032) DO (1001) NEXT (2036) PLEASE FORGET #1 DO .5 <- '?.1$.2'~'#0$#65535' DO .5 <- '?"'&"!2~.5'~'"?'?.5~.5'$#32768"~"#0$#65535"'"$ ".5~.5"'~#1"$#2'~#3 DO (2034) NEXT DO .5 <- .3 DO (1010) NEXT PLEASE DO .1 <- .3 DO .3 <- 'V.4$.5'~'#0$#65535' DO (2035) NEXT (2034) PLEASE DO (1001) NEXT (2035) DO FORGET #1 DO .5 <- "?'.4~#1'$#2"~#3 DO (2031) NEXT DO .2 <- .2~#65534 DO .4 <- .4~#65534 PLEASE DO (2036) NEXT (2031) DO (1001) NEXT PLEASE DO .4 <- .1 PLEASE RETRIEVE .1 + .5 PLEASE RESUME #2 (2530) DO STASH :1 + :5 + .5 DO :3 <- #0 DO .5 <- '?"':2~:2'~#1"$#1'~#3 PLEASE DO (2531) NEXT DO :4 <- #1 PLEASE DO (2533) NEXT (2533) DO FORGET #1 DO .5 <- '?":2~'#32768$#0'"$#2'~#3 DO (2532) NEXT DO :2 <- ":2~'#0$#65535'"$"'":2~'#32767$#0'"$# 0'~'#32767$#1'" PLEASE DO :4 <- ":4~'#0$#65535'"$"'":4~'#32767 $#0'"$#0'~'#32767$#1'" DO (2533) NEXT (2532) DO (1001) NEXT (2536) PLEASE FORGET #1 DO :5 <- "'?":1~'#65535$#0'"$":2~'#65535$#0'"' ~'#0$#65535'"$"'?":1~'#0$#65535'"$":2~'#0$ #65535'"'~'#0$#65535'" DO .5 <- '?"'&"':2~:5'~'"'?"'?":5~:5"~"#65535$ #65535"'~'#65535$#0'"$#32768'~'#0$#65535'" $"'?":5~:5"~"#65535$#65535"'~'#0$#65535'"' "$"':5~:5'~#1"'~#1"$#2'~#3 DO (2534) NEXT DO :5 <- :3 DO (1510) NEXT PLEASE DO :1 <- :3 DO :3 <- "'V":4~'#65535$#0'"$":5~'#65535$#0'"' ~'#0$#65535'"$"'V":4~'#0$#65535'"$":5~'#0$ #65535'"'~'#0$#65535'" DO (2535) NEXT (2534) PLEASE DO (1001) NEXT (2535) DO FORGET #1 DO .5 <- "?':4~#1'$#2"~#3 DO (2531) NEXT DO :2 <- ":2~'#0$#65534'"$":2~'#65535$#0'" DO :4 <- ":4~'#0$#65534'"$":4~'#65535$#0'" PLEASE DO (2536) NEXT (2531) DO (1001) NEXT DO :4 <- :1 PLEASE RETRIEVE :1 + :5 + .5 PLEASE RESUME #2 intercal-0.30/pit/lib/PaxHeaders.27456/syslib3-7.doc0000644000000000000000000000007411437550756016610 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.578945723 intercal-0.30/pit/lib/syslib3-7.doc0000644000175000017500000000414511437550756016507 0ustar00esresr00000000000000Although the non-binary libraries syslib.[3-7]i are meant to be treated as workalikes with the original system library, it should be noted that several of them contain some new routines. These are used internally by the standard routines, and are there to provide methods for doing a few things that are taken for granted in base 2. While they were not intended to be used by other programs, there is nothing stopping them from being so used. The even bases have routines to double and halve values, and use a third variable as a carry/borrow flag. Since halving in odd bases produces infinite fractions, bases 5 and 7 instead use a single-digit multiplication routine. (Base 3 multiplication is still simple enough to be handled without a separate support routine.) syslib.4i --------- (1200) .2 <- .1 times two .3 <- #0 if no overflow, otherwise .3 contains the quart that was "shifted" off the left end (1210) .2 <- .1 divided by two .3 <- #0 if .1 is even, otherwise .3 contains #2 (1700) :2 <- :1 times two .1 <- #0 if no overflow, otherwise .1 contains the quart that was "shifted" off the left end (1710) :2 <- :1 divided by two .1 <- #0 if .1 is even, otherwise .1 contains #2 syslib.5i --------- (1720) :2 <- :1 times the least significant quint of .1 (the remaining quints of .1 are ignored) .2 <- #0 if no overflow, otherwise .2 contains the quint that was "shifted" off the left end syslib.6i --------- (1200) .2 <- .1 times two .3 <- #0 if no overflow, otherwise .3 contains the sext that was "shifted" off the left end (1210) .2 <- .1 divided by two .3 <- #0 if .1 is even, otherwise .3 contains #3 (1700) :2 <- :1 times two .1 <- #0 if no overflow, otherwise .1 contains the sext that was "shifted" off the left end (1710) :2 <- :1 divided by two .1 <- #0 if .1 is even, otherwise .1 contains #3 syslib.7i --------- (1720) :2 <- :1 times the least significant sept of .1 (the remaining septs of .1 are ignored) .2 <- #0 if no overflow, otherwise .2 contains the sept that was "shifted" off the left end intercal-0.30/pit/lib/PaxHeaders.27456/syslib.i0000644000000000000000000000007411437550756016044 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.578945723 intercal-0.30/pit/lib/syslib.i0000644000175000017500000001576311437550756015753 0ustar00esresr00000000000000 PLEASE KNOCK BEFORE ENTERING (1000) PLEASE IGNORE .4 PLEASE ABSTAIN FROM (1005) (1009) DO STASH .1 + .2 + .5 + .6 DO .4 <- #1 DO (1004) NEXT (1004) PLEASE FORGET #1 DO .3 <- '?.1$.2'~'#0$#65535' DO .6 <- '&.1$.2'~'#0$#65535' PLEASE DO .5 <- "?!6~#32768'$#1"~#3 DO (1002) NEXT DO .4 <- #2 (1005) DO (1006) NEXT (1999) DOUBLE OR SINGLE PRECISION OVERFLOW (1002) DO (1001) NEXT (1006) PLEASE FORGET #1 DO .5 <- '?"!6~.6'~#1"$#1'~#3 DO (1003) NEXT DO .1 <- .3 DO .2 <- !6$#0'~'#32767$#1' DO (1004) NEXT (1003) DO (1001) NEXT DO REINSTATE (1005) (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6 DO REMEMBER .4 PLEASE RESUME #2 (1001) DO RESUME .5 (1010) DO STASH .1 + .2 + .4 DO .4 <- .1 DO .1 <- '?.2$#65535'~'#0$#65535' DO (1020) NEXT PLEASE DO .2 <- .4 PLEASE DO (1009) NEXT DO RETRIEVE .1 + .2 + .4 PLEASE RESUME #1 (1020) DO STASH .2 + .3 DO .2 <- #1 PLEASE DO (1021) NEXT (1021) DO FORGET #1 DO .3 <- "?!1~.2'$#1"~#3 PLEASE DO .1 <- '?.1$.2'~'#0$#65535' DO (1022) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (1021) NEXT (1023) PLEASE RESUME .3 (1022) DO (1023) NEXT PLEASE RETRIEVE .2 + .3 PLEASE RESUME #2 (1030) DO ABSTAIN FROM (1033) PLEASE ABSTAIN FROM (1032) (1039) DO STASH :1 + .5 DO (1530) NEXT DO .3 <- :1~#65535 PLEASE DO .5 <- :1~'#65280$#65280' DO .5 <- '?"!5~.5'~#1"$#1'~#3 DO (1031) NEXT (1032) DO (1033) NEXT DO (1999) NEXT (1031) DO (1001) NEXT (1033) DO .4 <- .5 DO REINSTATE (1032) PLEASE REINSTATE (1033) DO RETRIEVE :1 + .5 PLEASE RESUME #2 (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3 DO .2 <- #0 DO (1520) NEXT DO STASH :1 PLEASE RETRIEVE .2 DO .1 <- .2 DO .2 <- #0 PLEASE DO (1520) NEXT DO :2 <- :1 DO RETRIEVE .1 + .2 + :1 DO (1550) NEXT PLEASE DO .3 <- :3 DO RETRIEVE :1 + :2 + :3 DO RESUME #1 (1050) PLEASE STASH :2 + :3 + .5 DO :2 <- .1 PLEASE DO (1550) NEXT DO .5 <- :3~'#65280$#65280' DO .5 <- '?"!5~.5'~#1"$#1'~#3 DO (1051) NEXT DO (1999) NEXT (1051) DO (1001) NEXT DO .2 <- :3 PLEASE RETRIEVE :2 + :3 + .5 DO RESUME #2 (1500) PLEASE ABSTAIN FROM (1502) PLEASE ABSTAIN FROM (1506) (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6 DO .1 <- :1~#65535 PLEASE DO .2 <- :2~#65535 DO (1009) NEXT DO .5 <- .3 PLEASE DO .6 <- .4 DO .1 <- :1~'#65280$#65280' DO .2 <- :2~'#65280$#65280' DO (1009) NEXT DO .1 <- .3 PLEASE DO (1503) NEXT DO .6 <- .4 DO .2 <- #1 DO (1009) NEXT DO .1 <- .3 DO (1501) NEXT (1504) PLEASE RESUME .6 (1503) DO (1504) NEXT (1501) DO .2 <- .5 DO .5 <- '?"'&.6$.4'~#1"$#2'~#3 DO (1505) NEXT (1506) DO (1502) NEXT PLEASE DO (1999) NEXT (1505) DO (1001) NEXT (1502) DO :4 <- .5 DO (1520) NEXT DO :3 <- :1 PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6 DO REINSTATE (1502) DO REINSTATE (1506) PLEASE RESUME #3 (1510) DO STASH :1 + :2 + :4 DO :1 <- "'?":2~'#65535$#0'"$#65535'~'#0$#65535'"$ "'?":2~'#0$#65535'"$#65535'~'#0$#65535'" DO :2 <- #1 DO (1509) NEXT PLEASE RETRIEVE :1 DO :2 <- :3 PLEASE DO (1509) NEXT DO RETRIEVE :2 + :4 PLEASE RESUME #1 (1520) PLEASE STASH .3 + .4 DO .3 <- .1~#43690 DO (1525) NEXT PLEASE DO .4 <- 'V.3$".2~#43690"'~'#0$#65535' DO .3 <- .1~#21845 PLEASE DO (1525) NEXT DO :1 <- .4$"'V.3$".2~#21845"'~'#0$#65535'" PLEASE RETRIEVE .3 + .4 DO RESUME #1 (1525) DO .3 <- '"'"'"!3$#0'~'#32767$#1'"$#0'~'#32767$ #1'"$#0'~'#16383$#3'"$#0'~'#4095$#15' PLEASE RESUME #1 (1530) DO STASH :2 + :3 + .3 + .5 DO :1 <- #0 DO :2 <- .2 DO .3 <- #1 DO (1535) NEXT (1535) PLEASE FORGET #1 DO .5 <- "?!1~.3'$#1"~#3 DO (1531) NEXT DO (1500) NEXT DO :1 <- :3 PLEASE DO (1533) NEXT (1531) PLEASE DO (1001) NEXT (1533) DO FORGET #1 DO .3 <- !3$#0'~'#32767$#1' DO :2 <- ":2~'#0$#65535'"$"'":2~'#32767$#0'"$ #0'~'#32767$#1'" PLEASE DO .5 <- "?!3~.3'$#1"~#3 DO (1532) NEXT DO (1535) NEXT (1532) DO (1001) NEXT PLEASE RETRIEVE :2 + :3 + .3 + .5 DO RESUME #2 (1540) PLEASE ABSTAIN FROM (1541) DO ABSTAIN FROM (1542) (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5 DO .1 <- :1~#65535 PLEASE DO .2 <- :2~'#65280$#65280' DO .5 <- :1~'#65280$#65280' DO (1530) NEXT DO :3 <- :1 DO .2 <- :2~#65535 PLEASE DO (1530) NEXT DO :5 <- :1 DO .1 <- .5 DO (1530) NEXT DO :4 <- :1 PLEASE DO :1 <- ":3~'#65280$#65280'"$":4~'#65280$ #65280'" DO .5 <- ':1~:1'~#1 DO .2 <- :2~'#65280$#65280' DO (1530) NEXT PLEASE DO .5 <- '"':1~:1'~#1"$.5'~#3 DO .1 <- :3~#65535 DO .2 <- #0 DO (1520) NEXT PLEASE DO :2 <- :1 PLEASE DO .1 <- :4~#65535 DO (1520) NEXT DO (1509) NEXT DO .5 <- !5$":4~#3"'~#15 DO :1 <- :3 DO :2 <- :5 DO (1509) NEXT PLEASE DO .5 <- !5$":4~#3"'~#172 DO .5 <- '?"!5~.5'~#1"$#1'~#3 PLEASE RETRIEVE :4 (1541) DO :4 <- .5 DO (1543) NEXT (1542) DO (1544) NEXT PLEASE DO (1999) NEXT (1543) DO (1001) NEXT (1544) DO REINSTATE (1541) PLEASE REINSTATE (1542) PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5 DO RESUME #2 (1550) DO STASH :1 + :4 + :5 + .5 DO :3 <- #0 DO .5 <- '?"':2~:2'~#1"$#1'~#3 PLEASE DO (1551) NEXT DO :4 <- #1 PLEASE DO (1553) NEXT (1553) DO FORGET #1 DO .5 <- '?":2~'#32768$#0'"$#2'~#3 DO (1552) NEXT DO :2 <- ":2~'#0$#65535'"$"'":2~'#32767$#0'"$# 0'~'#32767$#1'" PLEASE DO :4 <- ":4~'#0$#65535'"$"'":4~'#32767 $#0'"$#0'~'#32767$#1'" DO (1553) NEXT (1552) DO (1001) NEXT (1556) PLEASE FORGET #1 DO :5 <- "'?":1~'#65535$#0'"$":2~'#65535$#0'"' ~'#0$#65535'"$"'?":1~'#0$#65535'"$":2~'#0$ #65535'"'~'#0$#65535'" DO .5 <- '?"'&"':2~:5'~'"'?"'?":5~:5"~"#65535$ #65535"'~'#65535$#0'"$#32768'~'#0$#65535'" $"'?":5~:5"~"#65535$#65535"'~'#0$#65535'"' "$"':5~:5'~#1"'~#1"$#2'~#3 DO (1554) NEXT DO :5 <- :3 DO (1510) NEXT PLEASE DO :1 <- :3 DO :3 <- "'V":4~'#65535$#0'"$":5~'#65535$#0'"' ~'#0$#65535'"$"'V":4~'#0$#65535'"$":5~'#0$ #65535'"'~'#0$#65535'" DO (1555) NEXT (1554) PLEASE DO (1001) NEXT (1555) DO FORGET #1 DO .5 <- "?':4~#1'$#2"~#3 DO (1551) NEXT DO :2 <- ":2~'#0$#65534'"$":2~'#65535$#0'" DO :4 <- ":4~'#0$#65534'"$":4~'#65535$#0'" PLEASE DO (1556) NEXT (1551) DO (1001) NEXT PLEASE RETRIEVE :1 + :4 + :5 + .5 PLEASE RESUME #2 (1900) DO STASH .2 + .3 + .5 DO .1 <- #0 DO .2 <- #1 PLEASE DO (1901) NEXT (1901) DO FORGET #1 DO %50 .1 <- 'V.1$.2'~'#0$#65535' DO .2 <- !2$#0'~'#32767$#1' PLEASE DO .5 <- "?!2~.2'$#1"~#3 DO (1902) NEXT DO (1901) NEXT (1902) DO (1001) NEXT DO RETRIEVE .2 + .3 + .5 PLEASE RESUME #2 (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3 DO .3 <- #65524 DO :1 <- #6 DO (1911) NEXT PLEASE NOTE THAT YOU CAN'T GET THERE FROM HERE (1912) DO (1001) NEXT (1911) DO FORGET #1 PLEASE DO (1900) NEXT DO :2 <- .1 DO (1500) NEXT PLEASE DO :1 <- :3 DO .1 <- .3 DO (1020) NEXT PLEASE DO .3 <- .1 DO .5 <- '?"!3~.3'~#1"$#2'~#3 DO (1912) NEXT DO .1 <- #12 PLEASE DO (1050) NEXT DO RETRIEVE .1 DO (1530) NEXT DO :2 <- #32768 DO (1500) NEXT PLEASE DO .2 <- :3~'#65280$#65280' PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3 DO RESUME #1 intercal-0.30/pit/lib/PaxHeaders.27456/numio.doc0000644000000000000000000000007411437550756016203 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.578945723 intercal-0.30/pit/lib/numio.doc0000644000175000017500000001174211437550756016103 0ustar00esresr00000000000000Summary of routines in numio.i: (3000) .1 <- character from input (3001) Prints .2 as a character (3010) ,1 <- a string of input from the user, no longer than .1, and excluding the terminating newline. .2 <- the real length of the user input. .3 <- #1 if .2 <= .1 (i.e., no characters were lost). Otherwise, .3 <- #2. (3020) ,1 <- a string of input from the user, no longer than .1, translated (where possible) into indices into ,2 .3 <- the real length of the user input. .4 <- #1 if .3 <= .1 and all characters in the input are listed in ,2. Otherwise, .4 <- #2. (3080) .1 <- a 16-bit number from the user (3089) .1 <- a 16-bit number from the user, with an error message if non-digits are encountered (3090) Displays the value in .1 (3099) Displays the value in .1 and prints a newline (3180) :1 <- a 32-bit number from the user (3189) :1 <- a 32-bit number from the user, with an error message if non-digits are encountered (3190) Displays the value in :1 (3199) Displays the value in :1 and prints a newline (3990) Initializes internal arrays. numio.i reserves the use of two arrays - ,3000 and ,3001 - for input and output respectively. Each array has one dimension of one element, and they are used to provide a getchar routine, at (3000), and a putchar routine, (3001). Note that (3001) expects that the character values have already been bit-reversed. The arrays are initialized by routine (3990); this should be called before using any other routines in this library. Routines (3010) and (3020) provide line input capabilities. The routines write in characters until they see a newline (or end-of-file), and store them in ,1. They are called with .1 being the number of characters to save; any input after that is thrown away. (Already they're better than C's gets()!) (3010) returns the actual number of characters that were input in .2, and .3 is set to #2 if characters were lost (i.e., if .2 is longer than .1). I decided to add .3, even though the caller could check for this themselves, as inequal comparisons are a bit painful in INTERCAL. Or, to be accurate, they're more painful than equal comparisons. Note also that if .1 is #0, the routine becomes a press-Enter-to-continue type of function, and ,1 need not actually be defined. (3020) is a filtering, or translating, input routine. When called, the array ,2 should contain a set of "approved" characters that are expected to be in the input, and .2 should contain the number of characters in ,2. As input is retrieved, the routine tries to look up each character in ,2. If the character is found, the routine stores in ,1 the index of the character instead. (Otherwise the actual character number is stored, as with (3010).) Upon return, .3 has the number of characters that were input, and .4 is set to #2 if characters were lost OR if any characters in the input were not in the set of approved characters. The remaining routines are for doing "wimpmode"-style I/O - or in other words, the C-INTERCAL equivalent of atoi and itoa. (3080) and (3090) translate the ASCII input as a number (yes, a number as in [0-9]*), and (3090) and (3190) do the same for displaying numbers in ASCII. (By the way, the routines can also be made to support EBCDIC: simply replace #3 with #15 on lines 119, 159, and 185.) Each routine also has a "niner" variation. For itoa, (3099) and (3190) print a newline at the end of the number. In the case of atoi, (3089) and (3189) make sure that the number ends with a newline. In other words, they ensure there are no other non-numeric characters in the input line. If there are, a typically snide INTERCAL error message is displayed. (The regular versions work like C's atoi in that they return as soon as they see any non-digit.) There's not too much to note about these routines. The atoi routines use the shift-and-add trick to avoid multiplying by 10, so they should be pretty efficient (snort). itoa has no such shortcuts, and the routines use modified division routines which also returns the remainder. The 16-bit version is at (2030), and is the familiar one created by Louis Howell, copied from lib2.i. The 32-bit version is at (2530), and is just a copy of the standard library routine without the lines that throw away the remainder at the end. Note also that for these routines to work properly, they must be used more or less exclusively in regards to other array I/O. Otherwise, the getchar and putchar subroutines will get out of sync with the Turing-text character loop. If you do want to do other I/O while using these routines, you can use (3000) and (3001) as a getchar and putchar. Or, you can simply re-initialize the ,3000 and/or ,3001 values after you are done, by storing in them the bit-reversed ASCII value of the last character that you wrote in and/or read out. For example, if you READ OUT some strings and the last thing to be printed was a newline, then: DO ,3001SUB#1 <- #80 would then allow you to safely call the itoa routines. intercal-0.30/pit/lib/PaxHeaders.27456/1910.doc0000644000000000000000000000007411437550756015446 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.574945729 intercal-0.30/pit/lib/1910.doc0000644000175000017500000000174611437550756015351 0ustar00esresr00000000000000From ucbvax!bloom-beacon!eru!luth!sunic!lth.se!newsuser Thu May 17 19:51:02 PDT 1990 Sorry, but I couldn't find the (1910)-routine so I wrote one, which will do it's job, IF the (1900)-routine is as the manual says ( you know it isn't ). At least I hope it works because the manual is not very clear about this routine. (1910) PLEASE STASH .3 + :3 + :1 + :2 DO :1 <- #32768 PLEASE .2 <- #1 PLEASE (1911) NEXT (1911) DO FORGET #1 DO STASH .1 DO (1900) NEXT PLEASE :2 <- .1 DO RETRIEVE .1 DO (1500) NEXT PLEASE DO :1 <- :3 DO (1010) NEXT PLEASE .1 <- .3 DO (1912) NEXT DO (1911) NEXT (1912) PLEASE (1913) NEXT DO .2 <- :1~'#65280$#65280' PLEASE RETRIEVE :2 + .3 + :1 + :3 DO RESUME #2 (1914) PLEASE RESUME #1$"'.1~.1'~#1" (1913) PLEASE (1914) NEXT -- ---------- Hans Olsson Email: f88ho@efd.lth.se Snail: K[MN[RSV[GEN 8:118 222 45 Lund Sweden intercal-0.30/pit/lib/PaxHeaders.27456/syslib6.6i0000644000000000000000000000007411437550756016220 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.582945706 intercal-0.30/pit/lib/syslib6.6i0000644000175000017500000002266311437550756016124 0ustar00esresr00000000000000 PLEASE KNOCK THRICE TWO TIMES BEFORE ENTERING (1000) PLEASE IGNORE .4 PLEASE ABSTAIN FROM (1005) (1009) DO STASH .1 + .2 + .5 + .6 DO .4 <- #1 DO (1004) NEXT (1004) PLEASE FORGET #1 DO .3 <- '^.1$.2'~'#0$#9331' DO .6 <- '?"'V"'V"'&.1$.2'~'#0$#9331'"$"'^"'@.1$ .2'~'#0$#9331'"$#9331'~'#0$#9331'"'~'#0$ #9331'"$"'^"'2@.1$.2'~'#0$#9331'"$#18662' ~'#0$#9331'"'~'#0$#37324'"$#37324'~'#0$#9331' PLEASE DO .5 <- "?!6~#38880'$#6"~#6 DO (1002) NEXT DO .4 <- #2 (1005) DO (1006) NEXT (1999) DOUBLE OR SINGLE PRECISION OVERFLOW (1002) DO (1001) NEXT (1006) PLEASE FORGET #1 DO .5 <- '?"!6~.6'~#5"$#6'~#6 DO (1003) NEXT DO .1 <- .3 DO .2 <- !6$#0'~'#1555$#1' DO (1004) NEXT (1003) DO (1001) NEXT DO REINSTATE (1005) (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6 DO REMEMBER .4 PLEASE RESUME #2 (1001) DO RESUME .5 (1010) DO STASH .1 + .2 + .4 DO .4 <- .1 DO .1 <- '?#46655$.2'~'#0$#9331' DO (1020) NEXT PLEASE DO .2 <- .4 PLEASE DO (1009) NEXT DO RETRIEVE .1 + .2 + .4 PLEASE RESUME #1 (1020) DO STASH .2 + .3 DO .2 <- #1 PLEASE DO (1021) NEXT (1021) DO FORGET #1 DO .3 <- '?"'V".1~.2"$#4'~#1"$#3'~#1 PLEASE DO .1 <- '^.1$.2'~'#0$#9331' DO (1022) NEXT DO .2 <- !2$#0'~'#1555$#1' DO (1021) NEXT (1023) PLEASE RESUME .3 (1022) DO (1023) NEXT PLEASE RETRIEVE .2 + .3 PLEASE RESUME #2 (1030) DO ABSTAIN FROM (1033) PLEASE ABSTAIN FROM (1032) (1039) DO STASH :1 + .5 DO (1530) NEXT DO .3 <- :1~#9331 PLEASE DO .5 <- :1~'#9288$#9288' DO .5 <- '?"!5~.5'~#5"$#6'~#6 DO (1031) NEXT (1032) DO (1033) NEXT DO (1999) NEXT (1031) DO (1001) NEXT (1033) DO .4 <- .5 DO REINSTATE (1032) PLEASE REINSTATE (1033) DO RETRIEVE :1 + .5 PLEASE RESUME #2 (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3 DO .2 <- #0 DO (1520) NEXT DO STASH :1 PLEASE RETRIEVE .2 DO .1 <- .2 DO .2 <- #0 PLEASE DO (1520) NEXT DO :2 <- :1 DO RETRIEVE .1 + .2 + :1 DO (1550) NEXT PLEASE DO .3 <- :3 DO RETRIEVE :1 + :2 + :3 DO RESUME #1 (1050) PLEASE STASH :2 + :3 + .5 DO :2 <- .1 PLEASE DO (1550) NEXT DO .5 <- :3~'#9288$#9288' DO .5 <- '?"!5~.5'~#5"$#6'~#6 DO (1051) NEXT DO (1999) NEXT (1051) DO (1001) NEXT DO .2 <- :3 PLEASE RETRIEVE :2 + :3 + .5 DO RESUME #2 (1200) DO .2 <- '^.1$.1'~'#0$#9331' DO .3 <- '?"'2@.1$#0'~'#0$#9331'"$"'2@.1$#46655' ~'#0$#9331'"'~'#0$#9331' DO .2 <- '^.2$"!3$#0'~'#1555$#1'"'~'#0$#9331' DO .3 <- .3~#7776 PLEASE RESUME #1 (1210) DO .2 <- '^"'?"'@.1$#0'~'#0$#9331'"$"'@.1$#46655' ~'#0$#9331'"'~'#0$#9331'"$"'?"'3@.1$#0'~'#0$ #9331'"$"'3@.1$#46655'~'#0$#9331'"'~'#0$ #9331'"'~'#0$#9331' DO .3 <- '^"'^.1$.1'~'#0$#9331'"$.1'~'#0$#9331' DO .2 <- '^.2$".3~#9330"'~'#0$#9331' DO .3 <- .3~#1 PLEASE RESUME #1 (1500) PLEASE ABSTAIN FROM (1502) PLEASE ABSTAIN FROM (1506) (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6 DO .1 <- :1~#9331 PLEASE DO .2 <- :2~#9331 DO (1009) NEXT DO .5 <- .3 PLEASE DO .6 <- .4 DO .1 <- :1~'#9288$#9288' DO .2 <- :2~'#9288$#9288' DO (1009) NEXT DO .1 <- .3 PLEASE DO (1503) NEXT DO .6 <- .4 DO .2 <- #1 DO (1009) NEXT DO .1 <- .3 DO (1501) NEXT (1504) PLEASE RESUME .6 (1503) DO (1504) NEXT (1501) DO .2 <- .5 DO .5 <- '&.6$.4' DO (1505) NEXT (1506) DO (1502) NEXT PLEASE DO (1999) NEXT (1505) DO (1001) NEXT (1502) DO :4 <- .5 DO (1520) NEXT DO :3 <- :1 PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6 DO REINSTATE (1502) DO REINSTATE (1506) PLEASE RESUME #3 (1510) DO STASH :1 + :2 + :4 DO :1 <- "'?#46655$":2~'#9331$#0'"'~'#0$#9331'"$ "'?#46655$":2~'#0$#9331'"'~'#0$#9331'" DO :2 <- #1 DO (1509) NEXT PLEASE RETRIEVE :1 DO :2 <- :3 PLEASE DO (1509) NEXT DO RETRIEVE :2 + :4 PLEASE RESUME #1 (1520) PLEASE STASH .3 + .4 DO .3 <- .1~#7998 DO (1525) NEXT PLEASE DO .4 <- 'V.3$".2~#7998"'~'#0$#9331' DO .3 <- .1~#1333 PLEASE DO (1525) NEXT DO :1 <- .4$"'V.3$".2~#1333"'~'#0$#9331'" PLEASE RETRIEVE .3 + .4 DO RESUME #1 (1525) DO .3 <- '"!3$#0'~'#1555$#1'"$#0'~'#259$#7' PLEASE RESUME #1 (1530) DO STASH :2 + :3 + .1 + .2 + .3 DO :3 <- #0 DO :2 <- .1 DO (1535) NEXT (1535) PLEASE FORGET #1 DO .3 <- '?"!2~.2'~#5"$#6'~#6 DO (1532) NEXT DO .1 <- .2 DO (1210) NEXT DO .3 <- '?#1$".3~#5"'~#1 DO (1531) NEXT DO :1 <- :3 DO (1500) NEXT PLEASE DO (1533) NEXT (1531) PLEASE DO (1534) NEXT (1533) DO FORGET #1 DO :1 <- :2 DO (1700) NEXT DO (1535) NEXT (1534) PLEASE RESUME .3 (1532) DO (1534) NEXT DO :1 <- :3 PLEASE RETRIEVE :2 + :3 + .1 + .2 + .3 DO RESUME #2 (1540) PLEASE ABSTAIN FROM (1541) DO ABSTAIN FROM (1542) (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5 DO .1 <- :1~#9331 PLEASE DO .2 <- :2~'#9288$#9288' DO .5 <- :1~'#9288$#9288' DO (1530) NEXT DO :3 <- :1 DO .2 <- :2~#9331 PLEASE DO (1530) NEXT DO :5 <- :1 DO .1 <- .5 DO (1530) NEXT DO :4 <- :1 PLEASE DO :1 <- ":3~'#9288$#9288'"$":4 ~'#9288$#9288'" DO .5 <- ':1~:1'~#5 DO .2 <- :2~'#9288$#9288' DO (1530) NEXT PLEASE DO .5 <- '"':1~:1'~#5"$.5'~#7 DO .1 <- :3~#9331 DO .2 <- #0 DO (1520) NEXT PLEASE DO :2 <- :1 PLEASE DO .1 <- :4~#9331 DO (1520) NEXT DO (1509) NEXT DO .5 <- !5$"'^":4~#1"$#3'~#1"'~#223 DO :1 <- :3 DO :2 <- :5 DO (1509) NEXT PLEASE DO .5 <- !5$"'^":4~#1"$#3'~#1"'~#7999 DO .5 <- '?"!5~.5'~#1"$#3'~#1 PLEASE RETRIEVE :4 (1541) DO :4 <- .5 DO (1543) NEXT (1542) DO (1544) NEXT PLEASE DO (1999) NEXT (1543) DO (1001) NEXT (1544) DO REINSTATE (1541) PLEASE REINSTATE (1542) PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5 DO RESUME #2 (1550) DO STASH :1 + :1 + :4 + :5 + :6 + .1 + .5 DO :3 <- #0 DO .5 <- '?"':2~:2'~#5"$#6'~#6 PLEASE DO (1551) NEXT DO :4 <- #1 PLEASE DO (1553) NEXT (1553) DO FORGET #1 DO .5 <- '?#0$"'V"'2@":2~'#7776$#0'"$#5'~#1"$#4' ~#1"'~#1 DO (1552) NEXT DO :5 <- :2 DO :1 <- :4 PLEASE DO (1700) NEXT DO :4 <- :2 DO :1 <- :5 PLEASE DO (1700) NEXT DO (1553) NEXT (1552) DO (1001) NEXT DO RETRIEVE :1 (1556) PLEASE FORGET #1 DO :6 <- "'&":2~'#9331$#0'"$"'?#46655$":1 ~'#9331$#0'"'~'#0$#9331'"'~'#0$#9331'"$ "'&":2~'#0$#9331'"$"'?#46655$":1~'#0$ #9331'"'~'#0$#9331'"'~'#0$#9331'" DO :5 <- "'?":1~'#9331$#0'"$":2~'#9331$#0'"' ~'#0$#9331'"$"'?":1~'#0$#9331'"$":2~'#0$ #9331'"'~'#0$#9331'" DO :6 <- "'&":6~'#9331$#0'"$":5~'#9331$#0'"' ~'#0$#9331'"$"'&":6~'#0$#9331'"$":5~'#0$ #9331'"'~'#0$#9331'" DO :5 <- :5~'#46655$#46655' DO :6 <- "'?"'V":6~'#9331$#0'"$#27993'~'#0$ #9331'"$#27993'~'#0$#46655'"$"'?"'V":6 ~'#0$#9331'"$#27993'~'#0$#9331'"$#27993' ~'#0$#46655'" DO .5 <- "?'"':6~:5'~'"'"'&"':5~:5'~'#9331$#0'"$ #7776'~'#0$#9331'"$"'?:5~:5'~'#1555$#0'"' ~'#7776$#1555'"$"'?:5~:5'~'#0$#9331'"'"~#1'$ #4"~#1 DO (1554) NEXT DO :5 <- :3 DO (1510) NEXT DO :1 <- :4 DO :4 <- :2 DO :2 <- :5 DO :5 <- :3 DO (1500) NEXT DO :2 <- :4 DO :4 <- :1 DO :1 <- :5 DO (1555) NEXT (1554) PLEASE DO (1001) NEXT (1555) DO FORGET #1 DO .5 <- '?#2$"'@#0$":4~#1"'~#1"'~#1 DO (1551) NEXT DO :5 <- :1 DO :1 <- :4 DO :4 <- :2 DO (1710) NEXT DO :1 <- :4 DO :4 <- :2 DO (1710) NEXT DO :1 <- :5 PLEASE DO (1556) NEXT (1551) DO (1001) NEXT PLEASE RETRIEVE :1 + :4 + :5 + :6 + .1 + .5 PLEASE RESUME #2 (1700) PLEASE STASH .2 DO .1 <- :1~'#0$#9331' DO .2 <- :1~'#9331$#0' DO :2 <- "'^.2$.2'~'#0$#9331'"$"'^.1$.1'~'#0$ #9331'" DO .1 <- '?"'2@.1$#0'~'#0$#9331'"$"'2@.1$#46655' ~'#0$#9331'"'~'#0$#9331' DO .2 <- '?"'2@.2$#0'~'#0$#9331'"$"'2@.2$#46655' ~'#0$#9331'"'~'#0$#9331' DO :2 <- "'^":2~'#9331$#0'"$.1'~'#0$#9331'"$"'^":2 ~'#0$#9331'"$"'.2$#0'~'#1555$#1'"'~'#0$#9331'" DO .1 <- .2~#7776 PLEASE RETRIEVE .2 PLEASE RESUME #1 (1710) PLEASE STASH :1 + .2 DO .2 <- :1~'#9331$#0' DO .1 <- :1~'#0$#9331' DO :2 <- "'^"'^.2$.2'~'#0$#9331'"$.2'~'#0$ #9331'"$"'^"'^.1$.1'~'#0$#9331'"$.1'~'#0$ #9331'" DO .1 <- '^"'?"'@.1$#0'~'#0$#9331'"$"'@.1$#46655' ~'#0$#9331'"'~'#0$#9331'"$"'?"'3@.1$#0'~'#0$ #9331'"$"'3@.1$#46655'~'#0$#9331'"'~'#0$ #9331'"'~'#0$#9331' DO :1 <- "'^"'?"'@.2$#0'~'#0$#9331'"$"'@.2$#46655' ~'#0$#9331'"'~'#0$#9331'"$"'?"'3@.2$#0'~'#0$ #9331'"$"'3@.2$#46655'~'#0$#9331'"'~'#0$ #9331'"'~'#0$#9331'"$.1 DO .1 <- :2~#1 DO :2 <- "'^":1~'#9331$#0'"$":2~'#0$#9330'"' ~'#0$#9331'"$"'^":1~'#0$#9331'"$":2~'#9331$ #0'"'~'#0$#9331'" PLEASE RETRIEVE :1 + .2 PLEASE RESUME #1 (1900) DO STASH .2 + .5 DO .1 <- #0 DO .2 <- #1 PLEASE DO (1901) NEXT (1901) DO FORGET #1 DO %50 (1904) NEXT DO %50 (1901) NEXT PLEASE DO (1903) NEXT (1904) DO .1 <- '^.1$.2'~'#0$#9331' DO %50 .1 <- '^.1$.2'~'#0$#9331' (1903) PLEASE FORGET #1 DO %50 .1 <- '^.1$".2~#27993"'~'#0$#9331' DO .2 <- !2$#0'~'#1555$#1' PLEASE DO .5 <- '^".2~.2"$#1'~#1 DO (1902) NEXT DO (1901) NEXT (1902) DO (1001) NEXT DO RETRIEVE .2 + .5 PLEASE RESUME #2 (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3 DO .3 <- #46644 DO :1 <- #6 DO (1911) NEXT PLEASE NOTE THAT YOU CAN'T GET BLOOD FROM A TURNIP (1912) DO (1001) NEXT (1911) DO FORGET #1 PLEASE DO (1900) NEXT DO :2 <- .1 DO (1500) NEXT PLEASE DO :1 <- :3 DO .1 <- .3 DO (1020) NEXT PLEASE DO .3 <- .1 DO .5 <- '?"!3~.3'~#5"$#4'~#1 DO (1912) NEXT DO .1 <- #12 PLEASE DO (1050) NEXT DO RETRIEVE .1 DO (1530) NEXT DO :2 <- #23328 DO (1500) NEXT PLEASE DO .2 <- :3~'#9288$#9288' PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3 DO RESUME #1 intercal-0.30/pit/lib/PaxHeaders.27456/syslib.doc0000644000000000000000000000007411437550756016361 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.578945723 intercal-0.30/pit/lib/syslib.doc0000644000175000017500000001133211437550756016254 0ustar00esresr00000000000000 The file syslib_old.i is the version of the system library included in the original manual. RTFM for descriptions of the routines. Only minimal changes have been made in the current version, as follows: 1. Someone added PLEASE KNOCK BEFORE ENTERING as the first line, presumably to prevent programs from running off the end and into the first library routine by mistake. The other two changes are bug fixes. The bugs appear in all copies of the library that I have, including the manual from Don Woods (via Mike Ernst) with carriage controls in the first column. Unless a still more ancient copy of the library can be found (like in the Dead Sea Scrolls, perhaps?) we have to assume these bugs have been in there from the beginning, or at least since the library was converted from EBCDIC to ASCII and incorporated into the manual. 2. Jacob Mandelson found a bug in the 32-bit division routine where a select (~) had been substituted for a mingle ($) by mistake. This is at the end of line 229 of syslib_old.i. I have not checked or tested this correction, but it seems reasonable since select at that position would be pointless, but mingle is plausible. 3. I have found either two or three bugs in the 32-bit multiplication routines, depending on how you count. These only affected the overflow checking, but the effect was that every single call to (1540) or (1549) would behave as if there were an overflow. The first is straightforward. The statement PLEASE DO :1 <- ":3~'#65280$#65280'"$":5~'#652 80$#65280'" must be changed to PLEASE DO :1 <- ":3~'#65280$#65280'"$":4~'#652 80$#65280'" Not only is this the "right thing to do", but the position of this statement just after :4 has been computed suggests that it was what the original author intended. The remaining problems, however, are not so clearly due to typos. The 32-bit multiplication is done by splitting each input into its low and high 16-bit halves, computing partial products with the (1530) 16 to 32-bit multiplication routine, and then adding them together using (1509), addition with overflow check. The statements to look at are the ones where the overflow flags from successive steps are accumulated in .5, as follows: [a] DO .5 <- ':1~:1'~#1 ... [b] PLEASE DO .5 <- '"':1~:1'~#1"$.5'~#3 ... DO (1509) NEXT [c] DO .5 <- !5$":4~#3"'~#15 ... DO (1509) NEXT [d] PLEASE DO .5 <- !5$":4~#3"'~#63 DO .5 <- '?"!5~.5'~#1"$#1'~#3 .5 gets a bit if the high-high product is nonzero (wasteful to even compute this product, actually), and another if either of the high-low products overflows (that's the statement with the previous bug, above). It then gets combined with the overflow flags in :4 from the two addition calls. Each new flag is mingled with the ones already in .5, so various bits of .5 correspond to the different possible overflows. Finally, .5 is tested to see if it is nonzero, and if so an overflow results. Note the expressions ":4~#3". :4 is returned by (1509) as #2 if there is an overflow, #1 if not. It either case a bit is set in .5. This is why the routines signaled an overflow every time. Note also the ~#63 in line [d]. At this point the bit representing existence of the high-high product has shifted out to the 128-bit, so ~#63 will miss it. I see three ways out, none of which are obviously the author's intent: (1) At statement [d] the bit pattern is 101011XX, where 1's indicate overflows and X's are set by (1509) without overflow. If we replace ~#63 with ~#172 we test exactly the bits we want. This is the one I've used since it is the minimal change. (2) If we replace ":4~#3" with ":4~#2" we only have bits set on overflow, which seems cleaner. The bit pattern is 10001011 so we still can't use ~#63, we have to use ~#139 or ~#255 or something similar to get all the bits. Actually, the final selects in lines [b], [c] and [d] are all superfluous in this case since the bits discarded are all zero and the selected quantity can be safely assigned to the 16-bit .5. (3) If we replace ":4~#3" with ":4~#2" and reverse the mingles to look like '":4~#2"$.5' then the final bit pattern is 10111 and ~#63 will work, though it is not necessary. There are other solutions, of course, but I don't see any simpler ones than these. If you think ":4~#3" accomplishes nothing, so ":4~#2" must be meant, note that ":4~#3" converts :4 to 16-bit. The original compiler apparently required arguments to mingle to be 16-bit, whereas I think the C-INTERCAL compiler only requires them to be less than #0$#256. ":4$.5" would thus be technically illegal, even though it might work in C-INTERCAL. Louis Howell May 25, 1996 intercal-0.30/pit/lib/PaxHeaders.27456/syslib3.3i0000644000000000000000000000007411437550756016212 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.578945723 intercal-0.30/pit/lib/syslib3.3i0000644000175000017500000002014611437550756016110 0ustar00esresr00000000000000 PLEASE KNOCK THREE TIMES BEFORE ENTERING (1000) PLEASE IGNORE .4 PLEASE ABSTAIN FROM (1005) (1009) DO STASH .1 + .2 + .5 + .6 DO .4 <- #1 DO (1004) NEXT (1004) PLEASE FORGET #1 DO .3 <- '^.1$.2'~'#0$#29524' DO .6 <- '?"'V"'&.1$.2'~'#0$#29524'"$#29524' ~'#0$#29524'"$#29524'~'#0$#29524' PLEASE DO .5 <- 'V".6~#39366"$#1'~#1 DO (1002) NEXT DO .4 <- #2 (1005) DO (1006) NEXT (1999) DOUBLE OR SINGLE PRECISION OVERFLOW (1002) DO (1001) NEXT (1006) PLEASE FORGET #1 DO .5 <- 'V"!6~.6'~#2"$#1'~#1 DO (1003) NEXT DO .1 <- .3 DO .2 <- !6$#0'~'#9841$#1' DO (1004) NEXT (1003) DO (1001) NEXT DO REINSTATE (1005) (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6 DO REMEMBER .4 PLEASE RESUME #2 (1001) DO RESUME .5 (1010) DO STASH .1 + .2 + .4 DO .4 <- .1 DO .1 <- '?#59048$.2'~'#0$#29524' DO (1020) NEXT PLEASE DO .2 <- .4 PLEASE DO (1009) NEXT DO RETRIEVE .1 + .2 + .4 PLEASE RESUME #1 (1020) DO STASH .2 + .3 DO .2 <- #1 PLEASE DO (1021) NEXT (1021) DO FORGET #1 DO .3 <- 'V"!1~.2'$#1"'~#1 PLEASE DO .1 <- '^.1$.2'~'#0$#29524' DO (1022) NEXT DO .2 <- !2$#0'~'#9841$#1' DO (1021) NEXT (1023) PLEASE RESUME .3 (1022) DO (1023) NEXT PLEASE RETRIEVE .2 + .3 PLEASE RESUME #2 (1030) DO ABSTAIN FROM (1033) PLEASE ABSTAIN FROM (1032) (1039) DO STASH :1 + .5 DO (1530) NEXT DO .3 <- :1~#29524 PLEASE DO .5 <- :1~'#29403$#29403' DO .5 <- 'V"!5~.5'~#2"$#1'~#1 DO (1031) NEXT (1032) DO (1033) NEXT DO (1999) NEXT (1031) DO (1001) NEXT (1033) DO .4 <- .5 DO REINSTATE (1032) PLEASE REINSTATE (1033) DO RETRIEVE :1 + .5 PLEASE RESUME #2 (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3 DO .2 <- #0 DO (1520) NEXT DO STASH :1 PLEASE RETRIEVE .2 DO .1 <- .2 DO .2 <- #0 PLEASE DO (1520) NEXT DO :2 <- :1 DO RETRIEVE .1 + .2 + :1 DO (1550) NEXT PLEASE DO .3 <- :3 DO RETRIEVE :1 + :2 + :3 DO RESUME #1 (1050) PLEASE STASH :2 + :3 + .5 DO :2 <- .1 PLEASE DO (1550) NEXT DO .5 <- :3~'#29403$#29403' DO .5 <- 'V"!5~.5'~#2"$#1'~#1 DO (1051) NEXT DO (1999) NEXT (1051) DO (1001) NEXT DO .2 <- :3 PLEASE RETRIEVE :2 + :3 + .5 DO RESUME #2 (1500) PLEASE ABSTAIN FROM (1502) PLEASE ABSTAIN FROM (1506) (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6 DO .1 <- :1~#29524 PLEASE DO .2 <- :2~#29524 DO (1009) NEXT DO .5 <- .3 PLEASE DO .6 <- .4 DO .1 <- :1~'#29403$#29403' DO .2 <- :2~'#29403$#29403' DO (1009) NEXT DO .1 <- .3 PLEASE DO (1503) NEXT DO .6 <- .4 DO .2 <- #1 DO (1009) NEXT DO .1 <- .3 DO (1501) NEXT (1504) PLEASE RESUME .6 (1503) DO (1504) NEXT (1501) DO .2 <- .5 DO .5 <- '&.6$.4' DO (1505) NEXT (1506) DO (1502) NEXT PLEASE DO (1999) NEXT (1505) DO (1001) NEXT (1502) DO :4 <- .5 DO (1520) NEXT DO :3 <- :1 PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6 DO REINSTATE (1502) DO REINSTATE (1506) PLEASE RESUME #3 (1510) DO STASH :1 + :2 + :4 DO :1 <- "'?#59048$":2~'#29524$#0'"'~'#0$#29524'" $"'?#59048$":2~'#0$#29524'"'~'#0$#29524'" DO :2 <- #1 DO (1509) NEXT PLEASE RETRIEVE :1 DO :2 <- :3 PLEASE DO (1509) NEXT DO RETRIEVE :2 + :4 PLEASE RESUME #1 (1520) PLEASE STASH .3 + .4 DO .3 <- .1~#22143 DO (1525) NEXT PLEASE DO .4 <- 'V.3$".2~#22143"'~'#0$#29524' DO .3 <- .1~#7381 PLEASE DO (1525) NEXT DO :1 <- .4$"'V.3$".2~#7381"'~'#0$#29524'" PLEASE RETRIEVE .3 + .4 DO RESUME #1 (1525) DO .3 <- '"'"!3$#0'~'#9841$#1'"$#0'~'#3280$#4'" $#0'~'#3280$#4' PLEASE RESUME #1 (1530) DO STASH :2 + :3 + .3 + .5 DO :1 <- #0 DO :2 <- .2 DO .3 <- #1 DO (1535) NEXT (1535) PLEASE FORGET #1 DO .5 <- '@"'^".1~.3"$#7'~#4"$#2'~#10 DO (1534) NEXT DO (1500) NEXT DO :1 <- :3 DO (1536) NEXT (1534) DO (1531) NEXT (1536) DO (1500) NEXT DO :1 <- :3 PLEASE DO (1533) NEXT (1531) PLEASE DO (1001) NEXT (1533) DO FORGET #2 DO .3 <- !3$#0'~'#9841$#1' DO :2 <- ":2~'#0$#29524'"$"'":2~'#9841$#0'"$#0' ~'#9841$#1'" PLEASE DO .5 <- 'V"!3~.3'~#2"$#1'~#1 DO (1532) NEXT DO (1535) NEXT (1532) DO (1001) NEXT PLEASE RETRIEVE :2 + :3 + .3 + .5 DO RESUME #2 (1540) PLEASE ABSTAIN FROM (1541) DO ABSTAIN FROM (1542) (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5 DO .1 <- :1~#29524 PLEASE DO .2 <- :2~'#29403$#29403' DO .5 <- :1~'#29403$#29403' DO (1530) NEXT DO :3 <- :1 DO .2 <- :2~#29524 PLEASE DO (1530) NEXT DO :5 <- :1 DO .1 <- .5 DO (1530) NEXT DO :4 <- :1 PLEASE DO :1 <- ":3~'#29403$#29403'"$":4~'#29403 $#29403'" DO .5 <- ':1~:1'~#2 DO .2 <- :2~'#29403$#29403' DO (1530) NEXT PLEASE DO .5 <- '"':1~:1'~#2"$.5'~#4 DO .1 <- :3~#29524 DO .2 <- #0 DO (1520) NEXT PLEASE DO :2 <- :1 PLEASE DO .1 <- :4~#29524 DO (1520) NEXT DO (1509) NEXT DO .5 <- !5$":4~#1"'~#31 DO :1 <- :3 DO :2 <- :5 DO (1509) NEXT PLEASE DO .5 <- !5$":4~#1"'~#274 DO .5 <- !5~.5'~#1 PLEASE RETRIEVE :4 (1541) DO :4 <- .5 DO (1543) NEXT (1542) DO (1544) NEXT PLEASE DO (1999) NEXT (1543) DO (1001) NEXT (1544) DO REINSTATE (1541) PLEASE REINSTATE (1542) PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5 DO RESUME #2 (1550) DO STASH :1 + :4 + :5 + :6 + .5 DO :3 <- #0 DO .5 <- 'V"':2~:2'~#2"$#1'~#1 PLEASE DO (1551) NEXT DO :4 <- #1 PLEASE DO (1553) NEXT (1553) DO FORGET #1 DO .5 <- '?"':2~"#39366$#0"'"$#1'~#1 DO (1552) NEXT DO :2 <- ":2~'#0$#29524'"$"'":2~'#9841$#0'"$#0' ~'#9841$#1'" PLEASE DO :4 <- ":4~'#0$#29524'"$"'":4~'#9841 $#0'"$#0'~'#9841$#1'" DO (1553) NEXT (1552) DO (1001) NEXT (1556) PLEASE FORGET #1 DO :6 <- "'&":2~'#29524$#0'"$"'?#59048$":1 ~'#29524$#0'"'~'#0$#29524'"'~'#0$#29524'"$ "'&":2~'#0$#29524'"$"'?#59048$":1~'#0$ #29524'"'~'#0$#29524'"'~'#0$#29524'" DO :5 <- "'?":1~'#29524$#0'"$":2~'#29524$#0'"' ~'#0$#59048'"$"'?":1~'#0$#29524'"$":2~'#0$ #29524'"'~'#0$#59048'" DO .5 <- "?'"':6~:5'~'"'"'&"':5~:5'~'#29524$#0'"$ #19683'~'#0$#29524'"$"'?:5~:5'~'#9841$#0'"' ~'#19683$#9841'"$"'?:5~:5'~'#0$#29524'"'" ~#1'$#1"~#1 DO (1554) NEXT DO :5 <- :3 DO (1510) NEXT PLEASE DO :1 <- :3 DO :6 <- "'&":2~'#29524$#0'"$"'?#59048$":1 ~'#29524$#0'"'~'#0$#29524'"'~'#0$#29524'"$ "'&":2~'#0$#29524'"$"'?#59048$":1~'#0$ #29524'"'~'#0$#29524'"'~'#0$#29524'" DO :3 <- "'?":1~'#29524$#0'"$":2~'#29524$#0'"' ~'#0$#59048'"$"'?":1~'#0$#29524'"$":2~'#0$ #29524'"'~'#0$#59048'" DO .5 <- "?'"':6~:3'~'"'"'&"':3~:3'~'#29524$#0'"$ #19683'~'#0$#29524'"$"'?:3~:3'~'#9841$#0'"' ~'#19683$#9841'"$"'?:3~:3'~'#0$#29524'"'" ~#1'$#1"~#1 DO (1557) NEXT DO (1510) NEXT PLEASE DO :1 <- :3 DO :3 <- "'V":4~'#59048$#0'"$":5~'#29524$#0'"' ~'#0$#29524'"$"'V":4~'#0$#59048'"$":5~'#0$ #29524'"'~'#0$#29524'" PLEASE DO (1555) NEXT (1557) PLEASE DO (1001) NEXT PLEASE FORGET #1 DO :3 <- "'V":4~'#29524$#0'"$":5~'#29524$#0'"' ~'#0$#29524'"$"'V":4~'#0$#29524'"$":5~'#0$ #29524'"'~'#0$#29524'" PLEASE DO (1555) NEXT (1554) PLEASE DO (1001) NEXT (1555) PLEASE FORGET #1 DO .5 <- "?':4~#2'$#1"~#1 DO (1551) NEXT DO :2 <- :2~'#29524$#29523' DO :4 <- :4~'#29524$#29523' PLEASE DO (1556) NEXT (1551) DO (1001) NEXT PLEASE RETRIEVE :1 + :4 + :5 + :6 + .5 PLEASE RESUME #2 (1900) DO STASH .2 + .5 DO .1 <- #0 DO .2 <- #1 PLEASE DO (1901) NEXT (1901) DO FORGET #1 DO %50 (1904) NEXT DO %50 (1901) NEXT PLEASE DO (1903) NEXT (1904) DO .1 <- '^.1$.2'~'#0$#29524' DO %50 .1 <- '^.1$.2'~'#0$#29524' (1903) PLEASE FORGET #1 DO .2 <- !2$#0'~'#9841$#1' PLEASE DO .5 <- 'V"!2~.2'~#2"$#1'~#1 DO (1902) NEXT DO (1901) NEXT (1902) DO (1001) NEXT DO RETRIEVE .2 + .5 PLEASE RESUME #2 (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3 DO .3 <- #59037 DO :1 <- #6 DO (1911) NEXT PLEASE NOTE THAT YOU CAN'T GET THREE FROM HERE (1912) DO (1001) NEXT (1911) DO FORGET #1 PLEASE DO (1900) NEXT DO :2 <- .1 DO (1500) NEXT PLEASE DO :1 <- :3 DO .1 <- .3 DO (1020) NEXT PLEASE DO .3 <- .1 DO .5 <- '?"!3~.3'~#2"$#1'~#1 DO (1912) NEXT DO .1 <- #12 PLEASE DO (1050) NEXT DO RETRIEVE .1 DO (1530) NEXT DO :2 <- #29524 DO (1500) NEXT PLEASE DO .2 <- :3~'#29403$#29403' PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3 DO RESUME #1 intercal-0.30/pit/lib/PaxHeaders.27456/syslib7.7i0000644000000000000000000000007411437550756016222 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.582945706 intercal-0.30/pit/lib/syslib7.7i0000644000175000017500000002476211437550756016130 0ustar00esresr00000000000000 PLEASE KNOCK "SHAVE-AND-A-HAIRCUT-TWO-PLEASE" BEFORE ENTERING (1000) PLEASE IGNORE .4 PLEASE ABSTAIN FROM (1005) (1009) DO STASH .1 + .2 + .5 + .6 DO .4 <- #1 DO (1004) NEXT (1004) PLEASE FORGET #1 DO .3 <- '^.1$.2'~'#0$#2801' DO .6 <- '?"'V"'V"'&.1$.2'~'#0$#2801'"$"'^"'@.1$ .2'~'#0$#2801'"$#2801'~'#0$#2801'"'~'#0$ #2801'"$"'^"'2@.1$.2'~'#0$#2801'"$#5602' ~'#0$#2801'"'~'#0$#14005'"$#14005'~'#0$#2801' PLEASE DO .5 <- "?!6~#14406'$#7"~#7 DO (1002) NEXT DO .4 <- #2 (1005) DO (1006) NEXT (1999) DOUBLE OR SINGLE PRECISION OVERFLOW (1002) DO (1001) NEXT (1006) PLEASE FORGET #1 DO .5 <- '?"!6~.6'~#6"$#7'~#7 DO (1003) NEXT DO .1 <- .3 DO .2 <- !6$#0'~'#400$#1' DO (1004) NEXT (1003) DO (1001) NEXT DO REINSTATE (1005) (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6 DO REMEMBER .4 PLEASE RESUME #2 (1001) DO RESUME .5 (1010) DO STASH .1 + .2 + .4 DO .4 <- .1 DO .1 <- '?#16806$.2'~'#0$#2801' DO (1020) NEXT PLEASE DO .2 <- .4 PLEASE DO (1009) NEXT DO RETRIEVE .1 + .2 + .4 PLEASE RESUME #1 (1020) DO STASH .2 + .3 DO .2 <- #1 PLEASE DO (1021) NEXT (1021) DO FORGET #1 DO .3 <- '?"'V".1~.2"$#5'~#1"$#4'~#1 PLEASE DO .1 <- '^.1$.2'~'#0$#2801' DO (1022) NEXT DO .2 <- !2$#0'~'#400$#1' DO (1021) NEXT (1023) PLEASE RESUME .3 (1022) DO (1023) NEXT PLEASE RETRIEVE .2 + .3 PLEASE RESUME #2 (1030) DO ABSTAIN FROM (1033) PLEASE ABSTAIN FROM (1032) (1039) DO STASH :1 + .5 DO (1530) NEXT DO .3 <- :1~#2801 PLEASE DO .5 <- :1~'#2793$#2744' DO .5 <- '?"!5~.5'~#6"$#7'~#7 DO (1031) NEXT (1032) DO (1033) NEXT DO (1999) NEXT (1031) DO (1001) NEXT (1033) DO .4 <- .5 DO REINSTATE (1032) PLEASE REINSTATE (1033) DO RETRIEVE :1 + .5 PLEASE RESUME #2 (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3 DO .2 <- #0 DO (1520) NEXT DO STASH :1 PLEASE RETRIEVE .2 DO .1 <- .2 DO .2 <- #0 PLEASE DO (1520) NEXT DO :2 <- :1 DO RETRIEVE .1 + .2 + :1 DO (1550) NEXT PLEASE DO .3 <- :3 DO RETRIEVE :1 + :2 + :3 DO RESUME #1 (1050) PLEASE STASH :2 + :3 + .5 DO :2 <- .1 PLEASE DO (1550) NEXT DO .5 <- :3~'#2793$#2744' DO .5 <- '?"!5~.5'~#6"$#7'~#7 DO (1051) NEXT DO (1999) NEXT (1051) DO (1001) NEXT DO .2 <- :3 PLEASE RETRIEVE :2 + :3 + .5 DO RESUME #2 (1500) PLEASE ABSTAIN FROM (1502) PLEASE ABSTAIN FROM (1506) (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6 DO .1 <- :1~#2801 PLEASE DO .2 <- :2~#2801 DO (1009) NEXT DO .5 <- .3 PLEASE DO .6 <- .4 DO .1 <- :1~'#2793$#2744' DO .2 <- :2~'#2793$#2744' DO (1009) NEXT DO .1 <- .3 PLEASE DO (1503) NEXT DO .6 <- .4 DO .2 <- #1 DO (1009) NEXT DO .1 <- .3 DO (1501) NEXT (1504) PLEASE RESUME .6 (1503) DO (1504) NEXT (1501) DO .2 <- .5 DO .5 <- '&.6$.4' DO (1505) NEXT (1506) DO (1502) NEXT PLEASE DO (1999) NEXT (1505) DO (1001) NEXT (1502) DO :4 <- .5 DO (1520) NEXT DO :3 <- :1 PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6 DO REINSTATE (1502) DO REINSTATE (1506) PLEASE RESUME #3 (1510) DO STASH :1 + :2 + :4 DO :1 <- "'?#16806$":2~'#2801$#0'"'~'#0$#2801'"$ "'?#16806$":2~'#0$#2801'"'~'#0$#2801'" DO :2 <- #1 DO (1509) NEXT PLEASE RETRIEVE :1 DO :2 <- :3 PLEASE DO (1509) NEXT DO RETRIEVE :2 + :4 PLEASE RESUME #1 (1520) PLEASE STASH .3 + .4 DO .3 <- .1~#2451 DO (1525) NEXT PLEASE DO .4 <- 'V.3$".2~#350"'~'#0$#2801' DO .3 <- .1~#350 PLEASE DO (1526) NEXT DO :1 <- .4$"'V.3$".2~#2451"'~'#0$#2801'" PLEASE RETRIEVE .3 + .4 DO RESUME #1 (1525) DO .3 <- '"!3$#0'~'#400$#1'"$#0'~'#400$#1' PLEASE RESUME #1 (1526) DO .3 <- '"!3$#0'~'#400$#1'"$#0'~'#57$#8' PLEASE RESUME #1 (1530) DO STASH :2 + :3 + :4 + .1 + .2 + .5 DO :3 <- #0 DO :4 <- .2 DO (1535) NEXT (1535) PLEASE FORGET #1 DO .5 <- '?".1~#6"$#7'~#7 DO (1531) NEXT DO :1 <- :4 DO (1720) NEXT DO :1 <- :3 DO (1500) NEXT PLEASE DO (1533) NEXT (1531) PLEASE DO (1001) NEXT (1533) DO FORGET #1 DO .1 <- .1~#2800 DO :4 <- ":4~'#0$#2801'"$"'":4~'#400$#0'"$#0' ~'#400$#1'" PLEASE DO .5 <- '?"!1~.1'~#6"$#7'~#7 DO (1532) NEXT DO (1535) NEXT (1532) DO (1001) NEXT DO :1 <- :3 PLEASE RETRIEVE :2 + :3 + :4 + .1 + .2 + .5 DO RESUME #2 (1540) PLEASE ABSTAIN FROM (1541) DO ABSTAIN FROM (1542) (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5 DO .1 <- :1~#2801 PLEASE DO .2 <- :2~'#2793$#2744' DO .5 <- :1~'#2793$#2744' DO (1530) NEXT DO :3 <- :1 DO .2 <- :2~#2801 PLEASE DO (1530) NEXT DO :5 <- :1 DO .1 <- .5 DO (1530) NEXT DO :4 <- :1 PLEASE DO :1 <- ":3~'#2793$#2744'"$":4 ~'#2793$#2744'" DO .5 <- ':1~:1'~#6 DO .2 <- :2~'#2793$#2744' DO (1530) NEXT PLEASE DO .5 <- '"':1~:1'~#6"$.5'~#8 DO .1 <- :3~#2801 DO .2 <- #0 DO (1520) NEXT PLEASE DO :2 <- :1 PLEASE DO .1 <- :4~#2801 DO (1520) NEXT DO (1509) NEXT DO .5 <- !5$"'^":4~#1"$#4'~#1"'~#351 DO :1 <- :3 DO :2 <- :5 DO (1509) NEXT PLEASE DO .5 <- !5$"'^":4~#1"$#4'~#1"'~'#57$#1' DO .5 <- '?"!5~.5'~#1"$#4'~#1 PLEASE RETRIEVE :4 (1541) DO :4 <- .5 DO (1543) NEXT (1542) DO (1544) NEXT PLEASE DO (1999) NEXT (1543) DO (1001) NEXT (1544) DO REINSTATE (1541) PLEASE REINSTATE (1542) PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5 DO RESUME #2 (1550) DO STASH :1 + :4 + :5 + :6 + .1 + .5 DO :5 <- #0 DO .5 <- '?"':2~:2'~#6"$#7'~#7 PLEASE DO (1551) NEXT DO :4 <- #1 PLEASE DO (1553) NEXT (1553) DO FORGET #1 DO .5 <- '?"':2~"#14406$#0"'"$#5'~#1 DO (1552) NEXT DO :2 <- ":2~'#0$#2801'"$"'":2~'#400$#0'"$#0' ~'#400$#1'" PLEASE DO :4 <- ":4~'#0$#2801'"$"'":4~'#400 $#0'"$#0'~'#400$#1'" DO (1553) NEXT (1552) DO (1001) NEXT DO .1 <- #0 (1556) PLEASE FORGET #1 DO :6 <- "'&":2~'#2801$#0'"$"'?#16806$":1 ~'#2801$#0'"'~'#0$#2801'"'~'#0$#2801'"$ "'&":2~'#0$#2801'"$"'?#16806$":1~'#0$ #2801'"'~'#0$#2801'"'~'#0$#2801'" DO :3 <- "'?":1~'#2801$#0'"$":2~'#2801$#0'"' ~'#0$#2801'"$"'?":1~'#0$#2801'"$":2~'#0$ #2801'"'~'#0$#2801'" DO :6 <- "'&":6~'#2801$#0'"$":3~'#2801$#0'"' ~'#0$#2801'"$"'&":6~'#0$#2801'"$":3~'#0$ #2801'"'~'#0$#2801'" DO :3 <- :3~'#16806$#16806' DO :6 <- "'?"'V":6~'#2801$#0'"$#11204'~'#0$ #2801'"$#11204'~'#0$#16806'"$"'?"'V":6 ~'#0$#2801'"$#11204'~'#0$#2801'"$#11204' ~'#0$#16806'" DO .5 <- "?'"':6~:3'~'"'"'&"':3~:3'~'#2801$#0'"$ #2401'~'#0$#2801'"$"'?:3~:3'~'#400$#0'"' ~'#2401$#400'"$"'?:3~:3'~'#0$#2801'"'"~#1'$ #5"~#1 PLEASE DO (1557) NEXT DO (1510) NEXT DO :1 <- :3 DO .5 <- '?#0$"'V.1$#5'~#1"'~#1 DO (1557) NEXT DO .1 <- '^.1$#2801'~'#0$#2801' DO (1556) NEXT (1557) PLEASE DO (1001) NEXT PLEASE FORGET #1 DO :5 <- "'V":4~'.1$#0'"$":5~'#2801$#0'"' ~'#0$#2801'"$"'V":4~'#0$.1'"$":5~'#0$ #2801'"'~'#0$#2801'" DO .5 <- "?#2$':4~#1'"~#1 DO (1551) NEXT DO :2 <- :2~'#2801$#2800' DO :4 <- :4~'#2801$#2800' DO .1 <- #0 PLEASE DO (1556) NEXT (1551) DO (1001) NEXT DO :3 <- :5 PLEASE RETRIEVE :1 + :4 + :5 + :6 + .1 + .5 PLEASE RESUME #2 (1720) PLEASE STASH :1 + :3 + :4 + .1 + .5 DO :2 <- #0 DO .2 <- #0 DO .5 <- '?".1~#6"$#7'~#7 DO (1729) NEXT DO .5 <- .1~#1 DO .2 <- :1~'#2801$#0' DO .1 <- :1~'#0$#2801' PLEASE DO (1726) NEXT DO :1 <- '"?#0$.2"~"#0$#2801"'$'"?#0$.1"~"#0$ #2801"' DO :2 <- '"?'"V.2$#2801"~"#0$#2801"'$#2801" ~"#0$#2801"'$'"?'"V.1$#2801"~"#0$#2801"'$ #2801"~"#0$#2801"' DO (1728) NEXT (1726) PLEASE DO (1725) NEXT DO :1 <- '"?#0$'"^.2$.2"~"#0$#2801"'"~"#0$ #2801"'$'"?#0$'"^.1$.1"~"#0$#2801"'"~"#0$ #2801"' DO .2 <- "^'"V'"2@.2$#11204"~"#0$#2801"'$ #5602"~"#0$#2801"'$'"2@.2$#2801"~"#0$ #2801"'"~"#0$#2801" DO .1 <- "^'"V'"2@.1$#11204"~"#0$#2801"'$ #5602"~"#0$#2801"'$'"2@.1$#2801"~"#0$ #2801"'"~"#0$#2801" DO :2 <- '"?.2$#8403"~"#0$#2801"'$'"?.1$#8403" ~"#0$#2801"' (1728) DO .2 <- :2~'#2401$#0' DO :2 <- ':2~"#0$#2801"'$'"':2~"#400$#0"'$#0" ~"#400$#1"' DO (1509) NEXT DO :2 <- :3 DO .2 <- '^.2$"'?":4~#1"$#1'~#1"'~#1 DO (1721) NEXT (1725) PLEASE DO (1724) NEXT DO :2 <- '"?'"V'"?'"3@.2$#14005"~"#0$#2801"'$ '"@.2$#0"~"#0$#2801"'"~"#0$#11204"'$#8403" ~"#0$#2801"'$#8403"~"#0$#2801"'$ '"?'"V'"?'"3@.1$#14005"~"#0$#2801"'$'"@.1$ #0"~"#0$#2801"'"~"#0$#11204"'$#8403"~"#0$ #2801"'$#8403"~"#0$#2801"' DO .2 <- '^.2$.2'~'#0$#2801' DO .1 <- '^.1$.1'~'#0$#2801' DO :1 <- '"^.2$.2"~"#0$#2801"'$'"^.1$.1"~"#0$ #2801"' PLEASE FORGET #2 DO (1728) NEXT (1724) PLEASE DO (1723) NEXT DO :1 <- '"^'"^.2$.2"~"#0$#2801"'$.2"~"#0$ #2801"'$'"^'"^.1$.1"~"#0$#2801"'$.1" ~"#0$#2801"' DO .2 <- "^'"V'"2@.2$#16806"~"#0$#2801"'$ #14005"~"#0$#2801"'$'"V'"4@.2$#16806" ~"#0$#2801"'$#14005"~"#0$#2801"'"~"#0$ #2801" DO .1 <- "^'"V'"2@.1$#16806"~"#0$#2801"'$ #14005"~"#0$#2801"'$'"V'"4@.1$#16806" ~"#0$#2801"'$#14005"~"#0$#2801"'"~"#0$ #2801" DO :2 <- '"?.2$#8403"~"#0$#2801"'$'"?.1$#8403" ~"#0$#2801"' PLEASE FORGET #3 DO (1728) NEXT (1723) PLEASE DO (1722) NEXT DO :1 <- '"^.2$.2"~"#0$#2801"'$'"^.1$.1"~"#0$ #2801"' DO :2 <- '"?'"V'"3@.2$#16806"~"#0$#2801"'$ #14005"~"#0$#2801"'$#14005"~"#0$#2801"'$ '"?'"V'"3@.1$#16806"~"#0$#2801"'$#14005" ~"#0$#2801"'$#14005"~"#0$#2801"' PLEASE FORGET #4 DO (1728) NEXT (1729) DO (1001) NEXT DO (1721) NEXT (1722) PLEASE DO (1001) NEXT DO :2 <- :1 DO .2 <- #0 DO FORGET #3 (1721) PLEASE RETRIEVE :1 + :3 + :4 + .1 + .5 PLEASE RESUME #3 (1900) DO STASH .2 + .5 DO .1 <- #0 DO .2 <- #1 PLEASE DO (1901) NEXT (1901) DO FORGET #1 DO %50 (1905) NEXT DO %50 (1904) NEXT DO %50 (1901) NEXT PLEASE DO (1903) NEXT (1905) DO FORGET #1 DO .1 <- '^.1$".2~#8403"'~'#0$#2801' PLEASE DO %50 .1 <- '^.1$".2~#5602"'~'#0$#2801' DO (1906) NEXT (1904) DO .1 <- '^.1$.2'~'#0$#2801' (1906) DO %50 .1 <- '^.1$.2'~'#0$#2801' (1903) PLEASE FORGET #1 DO .2 <- !2$#0'~'#400$#1' PLEASE DO .5 <- '^".2~.2"$#1'~#1 DO (1902) NEXT DO (1901) NEXT (1902) DO (1001) NEXT DO RETRIEVE .2 + .5 PLEASE RESUME #2 (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3 DO .3 <- #16795 DO :1 <- #6 DO (1911) NEXT PLEASE NOTE THAT YOU CAN'T GET SENSE FROM INTERCAL (1912) DO (1001) NEXT (1911) DO FORGET #1 PLEASE DO (1900) NEXT DO :2 <- .1 DO (1500) NEXT PLEASE DO :1 <- :3 DO .1 <- .3 DO (1020) NEXT PLEASE DO .3 <- .1 DO .5 <- '?"!3~.3'~#6"$#5'~#1 DO (1912) NEXT DO .1 <- #12 PLEASE DO (1050) NEXT DO RETRIEVE .1 DO (1530) NEXT DO :2 <- #8403 DO (1500) NEXT PLEASE DO .2 <- :3~'#2793$#2744' PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3 DO RESUME #1 intercal-0.30/pit/lib/PaxHeaders.27456/syslib-orig.i0000644000000000000000000000007411437550756017002 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.578945723 intercal-0.30/pit/lib/syslib-orig.i0000644000175000017500000001575611437550756016713 0ustar00esresr00000000000000 PLEASE KNOCK BEFORE ENTERING (1000) PLEASE IGNORE .4 PLEASE ABSTAIN FROM (1005) (1009) DO STASH .1 + .2 + .5 + .6 DO .4 <- #1 DO (1004) NEXT (1004) PLEASE FORGET #1 DO .3 <- '?.1$.2'~'#0$#65535' DO .6 <- '&.1$.2'~'#0$#65535' PLEASE DO .5 <- "?!6~#32768'$#1"~#3 DO (1002) NEXT DO .4 <- #2 (1005) DO (1006) NEXT (1999) DOUBLE OR SINGLE PRECISION OVERFLOW (1002) DO (1001) NEXT (1006) PLEASE FORGET #1 DO .5 <- '?"!6~.6'~#1"$#1'~#3 DO (1003) NEXT DO .1 <- .3 DO .2 <- !6$#0'~'#32767$#1' DO (1004) NEXT (1003) DO (1001) NEXT DO REINSTATE (1005) (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6 DO REMEMBER .4 PLEASE RESUME #2 (1001) DO RESUME .5 (1010) DO STASH .1 + .2 + .4 DO .4 <- .1 DO .1 <- '?.2$#65535'~'#0$#65535' DO (1020) NEXT PLEASE DO .2 <- .4 PLEASE DO (1009) NEXT DO RETRIEVE .1 + .2 + .4 PLEASE RESUME #1 (1020) DO STASH .2 + .3 DO .2 <- #1 PLEASE DO (1021) NEXT (1021) DO FORGET #1 DO .3 <- "?!1~.2'$#1"~#3 PLEASE DO .1 <- '?.1$.2'~'#0$#65535' DO (1022) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (1021) NEXT (1023) PLEASE RESUME .3 (1022) DO (1023) NEXT PLEASE RETRIEVE .2 + .3 PLEASE RESUME #2 (1030) DO ABSTAIN FROM (1033) PLEASE ABSTAIN FROM (1032) (1039) DO STASH :1 + .5 DO (1530) NEXT DO .3 <- :1~#65535 PLEASE DO .5 <- :1~'#65280$#65280' DO .5 <- '?"!5~.5'~#1"$#1'~#3 DO (1031) NEXT (1032) DO (1033) NEXT DO (1999) NEXT (1031) DO (1001) NEXT (1033) DO .4 <- .5 DO REINSTATE (1032) PLEASE REINSTATE (1033) DO RETRIEVE :1 + .5 PLEASE RESUME #2 (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3 DO .2 <- #0 DO (1520) NEXT DO STASH :1 PLEASE RETRIEVE .2 DO .1 <- .2 DO .2 <- #0 PLEASE DO (1520) NEXT DO :2 <- :1 DO RETRIEVE .1 + .2 + :1 DO (1550) NEXT PLEASE DO .3 <- :3 DO RETRIEVE :1 + :2 + :3 DO RESUME #1 (1050) PLEASE STASH :2 + :3 + .5 DO :2 <- .1 PLEASE DO (1550) NEXT DO .5 <- :3~'#65280$#65280' DO .5 <- '?"!5~.5'~#1"$#1'~#3 DO (1051) NEXT DO (1999) NEXT (1051) DO (1001) NEXT DO .2 <- :3 PLEASE RETRIEVE :2 + :3 + .5 DO RESUME #2 (1500) PLEASE ABSTAIN FROM (1502) PLEASE ABSTAIN FROM (1506) (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6 DO .1 <- :1~#65535 PLEASE DO .2 <- :2~#65535 DO (1009) NEXT DO .5 <- .3 PLEASE DO .6 <- .4 DO .1 <- :1~'#65280$#65280' DO .2 <- :2~'#65280$#65280' DO (1009) NEXT DO .1 <- .3 PLEASE DO (1503) NEXT DO .6 <- .4 DO .2 <- #1 DO (1009) NEXT DO .1 <- .3 DO (1501) NEXT (1504) PLEASE RESUME .6 (1503) DO (1504) NEXT (1501) DO .2 <- .5 DO .5 <- '?"'&.6$.4'~#1"$#2'~#3 DO (1505) NEXT (1506) DO (1502) NEXT PLEASE DO (1999) NEXT (1505) DO (1001) NEXT (1502) DO :4 <- .5 DO (1520) NEXT DO :3 <- :1 PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6 DO REINSTATE (1502) DO REINSTATE (1506) PLEASE RESUME #3 (1510) DO STASH :1 + :2 + :4 DO :1 <- "'?":2~'#65535$#0'"$#65535'~'#0$#6553 5'"$"'?":2~'#0$#65535'"$#65535'~'#0$#65535 '" DO :2 <- #1 DO (1509) NEXT PLEASE RETRIEVE :1 DO :2 <- :3 PLEASE DO (1509) NEXT DO RETRIEVE :2 + :4 PLEASE RESUME #1 (1520) PLEASE STASH .3 + .4 DO .3 <- .1~#43690 DO (1525) NEXT PLEASE DO .4 <- 'V.3$".2~#43690"'~'#0$#65535' DO .3 <- .1~#21845 PLEASE DO (1525) NEXT DO :1 <- .4$"'V.3$".2~#21845"'~'#0$#65535'" PLEASE RETRIEVE .3 + .4 DO RESUME #1 (1525) DO .3 <- '"'"'"!3$#0'~'#32767$#1'"$#0'~'#32767 $#1'"$#0'~'#16383$#3'"$#0'~'#4095$#15' PLEASE RESUME #1 (1530) DO STASH :2 + :3 + .3 + .5 DO :1 <- #0 DO :2 <- .2 DO .3 <- #1 DO (1535) NEXT (1535) PLEASE FORGET #1 DO .5 <- "?!1~.3'$#1"~#3 DO (1531) NEXT DO (1500) NEXT DO :1 <- :3 PLEASE DO (1533) NEXT (1531) PLEASE DO (1001) NEXT (1533) DO FORGET #1 DO .3 <- !3$#0'~'#32767$#1' DO :2 <- ":2~'#0$#65535'"$"'":2~'#32767$#0'"$# 0'~'#32767$#1'" PLEASE DO .5 <- "?!3~.3'$#1"~#3 DO (1532) NEXT DO (1535) NEXT (1532) DO (1001) NEXT PLEASE RETRIEVE :2 + :3 + .3 + .5 DO RESUME #2 (1540) PLEASE ABSTAIN FROM (1541) DO ABSTAIN FROM (1542) (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5 DO .1 <- :1~#65535 PLEASE DO .2 <- :2~'#65280$#65280' DO .5 <- :1~'#65280$#65280' DO (1530) NEXT DO :3 <- :1 DO .2 <- :2~#65535 PLEASE DO (1530) NEXT DO :5 <- :1 DO .1 <- .5 DO (1530) NEXT DO :4 <- :1 PLEASE DO :1 <- ":3~'#65280$#65280'"$":5~'#652 80$#65280'" DO .5 <- ':1~:1'~#1 DO .2 <- :2~'#65280$#65280' DO (1530) NEXT PLEASE DO .5 <- '"':1~:1'~#1"$.5'~#3 DO .1 <- :3~#65535 DO .2 <- #0 DO (1520) NEXT PLEASE DO :2 <- :1 PLEASE DO .1 <- :4~#65535 DO (1520) NEXT DO (1509) NEXT DO .5 <- !5$":4~#3"'~#15 DO :1 <- :3 DO :2 <- :5 DO (1509) NEXT PLEASE DO .5 <- !5$":4~#3"'~#63 DO .5 <- '?"!5~.5'~#1"$#1'~#3 PLEASE RETRIEVE :4 (1541) DO :4 <- .5 DO (1543) NEXT (1542) DO (1544) NEXT PLEASE DO (1999) NEXT (1543) DO (1001) NEXT (1544) DO REINSTATE (1541) PLEASE REINSTATE (1542) PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5 DO RESUME #2 (1550) DO STASH :1 + :4 + :5 + .5 DO :3 <- #0 DO .5 <- '?"':2~:2'~#1"$#1'~#3 PLEASE DO (1551) NEXT DO :4 <- #1 PLEASE DO (1553) NEXT (1553) DO FORGET #1 DO .5 <- '?":2~'#32768$#0'"$#2'~#3 DO (1552) NEXT DO :2 <- ":2~'#0$#65535'"$"'":2~'#32767$#0'"$# 0'~'#32767$#1'" PLEASE DO :4 <- ":4~'#0$#65535'"$"'":4~'#32767 $#0'"$#0'~'#32767$#1'" DO (1553) NEXT (1552) DO (1001) NEXT (1556) PLEASE FORGET #1 DO :5 <- "'?":1~'#65535$#0'"$":2~'#65535$#0'"' ~'#0$#65535'"$"'?":1~'#0$#65535'"$":2~'#0$ #65535'"'~'#0$#65535'" DO .5 <- '?"'&"':2~:5'~'"'?"'?":5~:5"~"#65535~ #65535"'~'#65535$#0'"$#32768'~'#0$#65535'" $"'?":5~:5"~"#65535$#65535"'~'#0$#65535'"' "$"':5~:5'~#1"'~#1"$#2'~#3 DO (1554) NEXT DO :5 <- :3 DO (1510) NEXT PLEASE DO :1 <- :3 DO :3 <- "'V":4~'#65535$#0'"$":5~'#65535$#0'"' ~'#0$#65535'"$"'V":4~'#0$#65535'"$":5~'#0$ #65535'"'~'#0$#65535'" DO (1555) NEXT (1554) PLEASE DO (1001) NEXT (1555) DO FORGET #1 DO .5 <- "?':4~#1'$#2"~#3 DO (1551) NEXT DO :2 <- ":2~'#0$#65534'"$":2~'#65535$#0'" DO :4 <- ":4~'#0$#65534'"$":4~'#65535$#0'" PLEASE DO (1556) NEXT (1551) DO (1001) NEXT PLEASE RETRIEVE :1 + :4 + :5 + .5 PLEASE RESUME #2 (1900) DO STASH .2 + .3 + .5 DO .1 <- #0 DO .2 <- #1 PLEASE DO (1901) NEXT (1901) DO FORGET #1 DO %50 .1 <- 'V.1$.2'~'#0$#65535' DO .2 <- !2$#0'~'#32767$#1' PLEASE DO .5 <- "?!2~.2'$#1"~#3 DO (1902) NEXT DO (1901) NEXT (1902) DO (1001) NEXT DO RETRIEVE .2 + .3 + .5 PLEASE RESUME #2 (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3 DO .3 <- #65524 DO :1 <- #6 DO (1911) NEXT PLEASE NOTE THAT YOU CAN'T GET THERE FROM HERE (1912) DO (1001) NEXT (1911) DO FORGET #1 PLEASE DO (1900) NEXT DO :2 <- .1 DO (1500) NEXT PLEASE DO :1 <- :3 DO .1 <- .3 DO (1020) NEXT PLEASE DO .3 <- .1 DO .5 <- '?"!3~.3'~#1"$#2'~#3 DO (1912) NEXT DO .1 <- #12 PLEASE DO (1050) NEXT DO RETRIEVE .1 DO (1530) NEXT DO :2 <- #32768 DO (1500) NEXT PLEASE DO .2 <- :3~'#65280$#65280' PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3 DO RESUME #1 intercal-0.30/pit/lib/PaxHeaders.27456/floatlib.i0000644000000000000000000000007411437550756016333 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.574945729 intercal-0.30/pit/lib/floatlib.i0000644000175000017500000014011611437550756016231 0ustar00esresr00000000000000 PLEASE USE A DESIGNATED ENTRY POINT (5000) PLEASE ABSTAIN FROM (5005) (5010) PLEASE STASH .1 + .2 + .3 + :1 + :2 + :4 + :6 DO :4 <- :1 (5005) PLEASE DO :2 <- '"?':2~"#65535$#0"'$#32768"~"#0$#65535"'$ ':2~"#0$#65535"' DO :6 <- '"?':1~"#32767$#0"'$':2~"#32767$#0"'"~"#0$#32767"'$ '"?':1~"#0$#65535"'$':2~"#0$#65535"'"~"#0$#65535"' DO .5 <- '?"':2~:6'~'"?:6~:6"~"#32767$#65535"'"$#1'~#3 DO (5001) NEXT DO :1 <- :2 DO :2 <- :4 DO :4 <- :1 DO (5002) NEXT (5001) DO (1001) NEXT (5002) PLEASE FORGET #1 DO .5 <- '?"':2~":2~'#32767$#65535'"'~#1"$#1'~#3 DO (5006) NEXT DO .5 <- '?"'?":1~'#32768$#0'"$":2~'#32768$#0'"'~#1"$#1'~#3 PLEASE DO .1 <- '"'":1~'#63488$#61440'"$#256'~'#511$#256'"$ #0'~'#1023$#256' DO :1 <- '"':1~"#2047$#0"'$#2048"~"#2047$#2048"'$':1~"#0$#4095"' DO .2 <- :2~'#30720$#61440' DO :3 <- '"':2~"#2047$#0"'$#2048"~"#2047$#2048"'$':2~"#0$#4095"' DO (5003) NEXT DO :2 <- :1 DO :1 <- '"?':3~"#65535$#0"'$#65535"~"#0$#65535"'$'"?':3~"#0$ #65535"'$#65535"~"#0$#65535"' DO :6 <- #1 DO (5510) NEXT DO :3 <- :1 DO :1 <- :2 DO (5004) NEXT (5003) DO (1001) NEXT (5004) PLEASE FORGET #1 DO .5 <- .1 DO .1 <- .1~#255 DO (1010) NEXT DO .1 <- .5 PLEASE DO .5 <- .3~#65504 DO .5 <- '?"'V"!5~.5'~#1"$"'V.3~#6'~'".3~#16"~".3~#8"'"'~#1"$ #2'~#3 DO (5006) NEXT DO :4 <- #0 DO (5580) NEXT DO :2 <- :3 DO :6 <- :4 DO (1509) NEXT DO :1 <- :3 DO :2 <- :6 PLEASE DO (5600) NEXT DO :3 <- :1 DO (5007) NEXT (5006) DO (1001) NEXT DO :3 <- :4 (5007) PLEASE RETRIEVE .1 + .2 + .3 + :1 + :2 + :4 + :6 PLEASE REINSTATE (5005) PLEASE RESUME #2 (5020) PLEASE STASH .1 + .2 + .3 + .5 + :1 DO .1 <- #150 DO .2 <- :1~'#30720$#61440' DO (1010) NEXT DO .5 <- '?"!3~.3'~#1"$#1'~#3 DO (5022) NEXT DO .5 <- '?".3~#32768"$#2'~#3 DO (5022) NEXT DO :2 <- #0 DO :3 <- :1 PLEASE DO .5 <- '?"'V"'V"V.V3"'~#32"$".&3~#8"'~#1"$#2'~#3 DO (5021) NEXT DO .1 <- .3 DO :2 <- #1 DO (5023) NEXT (5024) DO (1001) NEXT (5023) PLEASE FORGET #1 DO :2 <- :V2 DO (5520) NEXT DO .5 <- '?"!1~.1'~#1"$#2'~#3 DO (5024) NEXT PLEASE DO :2 <- :2~:&2 DO :2 <- '"&':1~"#65535$#0"'$':2~"#65535$#0"'"~"#0$#65535"'$ '"&':1~"#0$#65535"'$':2~"#0$#65535"'"~"#0$#65535"' DO .5 <- '?"':2~:2'~#1"$#1'~#3 DO (5022) NEXT DO :3 <- '"?':1~"#65535$#0"'$':2~"#65535$#0"'"~"#0$#65535"'$ '"?':1~"#0$#65535"'$':2~"#0$#65535"'"~"#0$#65535"' PLEASE DO .1 <- '":1~'#65535$#0'"$"'#512$.2'~'#768$ #255'"'~'#32768$#1023' DO :1 <- :2 DO :2 <- #0 DO (5590) NEXT DO :2 <- :3 PLEASE DO :3 <- '"'"'"'".1$':1~#32768'"~"#1109$#1"'$ ':1~#128'"~#2735'$':1~"#546$#0"'"~"#43679"'$':1~"#1365$ #0"'"~"#1023$#63"'$'"'"'".1$#0"~#34959'$':1~"#0$ #1170"'"~#11007'$':1~"#0$#2925"'"~"#2005$#255"' DO (5025) NEXT (5022) DO (1001) NEXT PLEASE FORGET #1 DO :2 <- :1 DO :3 <- #0 DO (5025) NEXT (5021) DO (1001) NEXT (5025) PLEASE RETRIEVE .1 + .2 + .3 + .5 + :1 PLEASE RESUME #2 (5030) DO :3 <- #0 DO .5 <- '?"'":1~':1~"#32767$#65535"'"~":2~':2~"#32767$ #65535"'"'~#1"$#1'~#3 DO (5041) NEXT PLEASE STASH .1 + .2 + .3 + :1 + :2 + :4 + :5 PLEASE DO .1 <- '"'":1~'#63488$#61440'"$#256'~'#511$#256'"$ #0'~'#1023$#256' DO :4 <- '"':1~"#2047$#0"'$#2048"~"#2047$#2048"'$':1~"#0$#4095"' PLEASE DO .2 <- '"'":2~'#63488$#61440'"$#0'~'#511$#256'"$ #0'~'#1023$#256' DO :5 <- '"':2~"#2047$#0"'$#2048"~"#2047$#2048"'$':2~"#0$#4095"' DO (1000) NEXT DO .1 <- .3~#2047 DO .2 <- #126 DO (1010) NEXT PLEASE DO .1 <- '":4~'#3855$#3855'"$#0'~'#65280$#255' DO .2 <- '":5~'#3855$#3855'"$#0'~'#65280$#255' DO (1530) NEXT DO :3 <- :1 DO .1 <- .1~#65280 DO .2 <- :5~#65535 DO (1530) NEXT DO :2 <- :1 DO .1 <- :4~#65535 DO (1530) NEXT DO .2 <- :5~'#3840$#3840' DO :4 <- '"':3~"#65535$#0"'$':1~"#65280$#0"'"~"#65280$#255"'$ '"':3~"#0$#65535"'$':1~"#0$#65280"'"~"#65280$#255"' DO :5 <- :1~#65535 DO (1530) NEXT DO (1500) NEXT DO :1 <- :3 DO :2 <- :4 DO (1500) NEXT DO :1 <- :3~'#65520$#65520' PLEASE DO :2 <- '"'&"V:3~#128"'$'":5~:5"~#1'"~"#32768$#32767"'$ '"'&"V:3~#64"'$':3~#63'"~"#32768$#32767"' DO .1 <- .3 PLEASE DO (5600) NEXT DO :3 <- :1 PLEASE RETRIEVE .1 + .2 + .3 + :1 + :2 + :4 + :5 PLEASE RESUME #1 (5040) DO :3 <- #0 PLEASE DO .5 <- '?#1$"':2~":2~'#32767$#65535'"'~#1"'~#3 DO (5041) NEXT DO .5 <- '?"':1~":1~'#32767$#65535'"'~#1"$#1'~#3 DO (5041) NEXT PLEASE STASH .1 + .2 + .3 + :1 + :2 + :4 PLEASE DO .1 <- '"'":1~'#63488$#61440'"$#256'~'#511$#256'"$ #0'~'#1023$#256' DO .2 <- '"'":2~'#63488$#61440'"$#0'~'#511$#256'"$#0'~'#1023$ #256' DO (1010) NEXT DO :1 <- '"'"':1~"#2047$#1"'$#4096"~"#4094$#4099"'$#0"~"#16383$ #3"'$'"'"'"':1~"#0$#4095"'$#0"~"#4095$#1"'$#0"~"#8191$ #1"'$#0"~"#16383$#3"' PLEASE DO :3 <- '"'"':2~"#0$#4095"'$#0"~"#4095$#1"'$#0"~"#8191$ #3"'$'"'"':2~"#2047$#1"'$#32768"~"#4094$#32771"'$ #0"~"#16383$#3"' DO :2 <- #0 DO :4 <- #0 DO (5540) NEXT DO .2 <- .3 DO (1000) NEXT DO .1 <- .3 DO :2 <- '&"V:1~#64"'$'"':1~#63'$.5"~#2735' DO :1 <- :1~'#65528$#65520' PLEASE DO (5600) NEXT DO :3 <- :1 PLEASE RETRIEVE .1 + .2 + .3 + :1 + :2 + :4 PLEASE RESUME #1 (5041) DO (1001) NEXT PLEASE RESUME #2 (5050) DO :3 <- #0 PLEASE DO .5 <- '?#1$"':2~":2~'#32767$#65535'"'~#1"'~#3 DO (5051) NEXT DO .5 <- '?"':1~":1~'#32767$#65535'"'~#1"$#1'~#3 DO (5051) NEXT PLEASE STASH .1 + .2 + .3 + :1 + :2 + :4 PLEASE DO .1 <- '"'":1~'#63488$#61440'"$#256'~'#511$#256'"$ #0'~'#1023$#256' DO :1 <- '"':1~"#2047$#0"'$#2048"~"#2047$#2048"'$':1~"#0$#4095"' DO .2 <- :2~'#30720$#61440' DO :2 <- '"':2~"#2047$#0"'$#2048"~"#2047$#2048"'$':2~"#0$#4095"' DO (5052) NEXT (5053) DO (1001) NEXT (5052) PLEASE FORGET #1 DO .5 <- '?.1$.2'~'#0$#255' DO .5 <- '?"!2~.5'~'"?.5~.5"~#255'"$#2'~#3 DO (5054) NEXT DO (1510) NEXT DO .5 <- '?":3~'#32768$#0'"$#2'~#3 DO (5056) NEXT DO :1 <- :3 DO (5055) NEXT (5056) DO (1001) NEXT (5055) PLEASE FORGET #1 DO .5 <- '?":1~'#32768$#0'"$#1'~#3 DO (5057) NEXT DO :2 <- :2~'#65535$#65534' DO .5 <- '?"':2~:2'~#1"$#1'~#3 DO (5054) NEXT DO .3 <- .1 DO .1 <- .2 DO (1020) NEXT DO .2 <- .1 DO .1 <- .3 DO (5052) NEXT (5057) DO (1001) NEXT PLEASE FORGET #1 DO :1 <- ':1~"#0$#65535"'$'"':1~"#32767$#0"'$#0"~"#32767$#1"' DO (5520) NEXT DO (5052) NEXT (5054) DO (1001) NEXT DO :2 <- #0 PLEASE DO (5600) NEXT DO :3 <- :1 PLEASE RETRIEVE .1 + .2 + .3 + :1 + :2 + :4 PLEASE RESUME #2 (5051) DO (1001) NEXT PLEASE RESUME #2 (5060) PLEASE STASH .1 + .5 + :1 DO :2 <- #0 DO .5 <- '?":1~'#32768$#0'"$#1'~#3 DO (5061) NEXT DO .1 <- #1686 DO (5560) NEXT DO (5062) NEXT (5061) DO (1001) NEXT DO .1 <- #662 (5062) PLEASE DO (5600) NEXT DO :2 <- :1 PLEASE RETRIEVE .1 + .5 + :1 PLEASE RESUME #2 (5070) PLEASE STASH .1 + .2 + .3 + :1 + :3 + :4 + :6 DO .1 <- #157 DO .2 <- :1~'#30720$#61440' DO (1010) NEXT DO .5 <- '?".3~#32768"$#2'~#3 DO (5071) NEXT PLEASE DO :3 <- '"'"':1~"#0$#4095"'$#0"~"#4095$#1"'$#0"~"#8191$ #3"'$'"'"':1~"#2047$#1"'$#32768"~"#4094$#32771"'$ #0"~"#16383$#3"' DO (5580) NEXT DO .5 <- '?":1~'#32768$#0'"$#1'~#3 DO (5072) NEXT DO :1 <- '"?':3~"#65535$#0"'$#65535"~"#0$#65535"'$'"?':3~"#0$ #65535"'$#65535"~"#0$#65535"' DO :6 <- #1 DO (5510) NEXT DO :2 <- :1 DO (5073) NEXT (5071) DO (1001) NEXT PLEASE FORGET #1 DO :6 <- :1~'#32768$#0' DO :1 <- #32767$#65535 DO (5510) NEXT DO :2 <- :1 PLEASE DO .5 <- #3 DO (5073) NEXT (5072) DO (1001) NEXT DO :2 <- :3 (5073) PLEASE RETRIEVE .1 + .2 + .3 + :1 + :3 + :4 + :6 PLEASE RESUME #2 (5080) PLEASE STASH .1 + .2 + .3 + .4 + .5 + .6 + .7 + .8 + :1 + :3 + :4 + :5 + :6 + ,1 + ;1 DO .5 <- '?"':1~":1~'#32767$#65535'"'~#1"$#1'~#3 DO (5088) NEXT PLEASE DO (5690) NEXT DO :5 <- :1~'#32767$#65535' DO .5 <- '?":1~'#32768$#0'"$#1'~#3 DO (5081) NEXT PLEASE DO .6 <- #65535 DO (5082) NEXT (5081) DO (1001) NEXT PLEASE DO .6 <- #1 (5082) PLEASE FORGET #1 DO .1 <- :5~'#30720$#61440' DO .2 <- #65409 DO (1009) NEXT DO .5 <- '?".3~#32768"$#1'~#3 DO (5083) NEXT PLEASE DO .7 <- #65535 DO .1 <- '?.3$#65535'~'#0$#65535' DO (1020) NEXT DO (5084) NEXT (5083) DO (1001) NEXT PLEASE DO .7 <- #1 DO .1 <- .3 (5084) PLEASE FORGET #1 PLEASE DO .2 <- #39457 DO (1530) NEXT DO .1 <- :1~'#65280$#65024' DO .2 <- .7~#32768 DO (1000) NEXT DO .8 <- .3 DO (5019) NEXT (5087) DO (1001) NEXT DO .1 <- .8 DO .2 <- .7 DO (1009) NEXT DO .8 <- .3 (5019) PLEASE FORGET #1 DO :1 <- '"'"':5~"#2047$#1"'$#4096"~"#4094$#4099"'$#0"~"#16383$ #3"'$'"'"'"':5~"#0$#4095"'$#0"~"#4095$#1"'$#0"~"#8191$ #1"'$#0"~"#16383$#3"' DO :2 <- #0 DO .1 <- :5~'#30720$#61440' DO .5 <- '?"!8~.8'~#1"$#1'~#3 DO (5018) NEXT DO :3 <- ';1SUB.8'~'#65535$#65534' DO :4 <- '&"V';1SUB.8'~#1"'$#0 DO .2 <- ,1SUB.8 DO .5 <- '?".7~#32768"$#1'~#3 DO (5085) NEXT DO (1020) NEXT DO (1009) NEXT PLEASE DO (5530) NEXT DO (5086) NEXT (5085) DO (1001) NEXT PLEASE FORGET #1 DO (1010) NEXT PLEASE DO (5540) NEXT DO :2 <- '&"V:1~#1"' DO :1 <- :1~'#65535$#65534' DO .2 <- .3 DO (1009) NEXT DO .1 <- .3 DO .2 <- #65410 DO (1009) NEXT DO (5086) NEXT (5018) DO (1001) NEXT DO :2 <- '&"V:1~#1"' DO :1 <- :1~'#65535$#65534' DO .3 <- .1 (5086) PLEASE FORGET #1 DO :3 <- :1 DO :4 <- :2 DO .1 <- #157 DO .2 <- .3 DO (1010) NEXT DO (5580) NEXT PLEASE DO .5 <- '?"'V":3~#16"$"&':3~#8'$':V3~#2'"'~#1"$#2'~#3 DO (5087) NEXT DO :1 <- :3 DO :2 <- :4 DO :3 <- #0 PLEASE DO :4 <- #784$#904 DO (5530) NEXT DO :1 <- :3 DO :6 <- :4~'#32768$#0' DO (5510) NEXT DO :2 <- #100 DO (1540) NEXT DO .1 <- .8 PLEASE DO .2 <- #50~.7 DO (1000) NEXT DO :1 <- :3 DO :2 <- .3 DO (1500) NEXT DO :1 <- :3 PLEASE DO :2 <- '#31664$#21632'~!6$.6' DO (1500) NEXT DO :2 <- :3 DO (5089) NEXT (5088) DO (1001) NEXT DO :2 <- #0 (5089) PLEASE FORGET #1 PLEASE RETRIEVE .1 + .2 + .3 + .4 + .5 + .6 + .7 + .8 + :1 + :3 + :4 + :5 + :6 + ,1 + ;1 PLEASE RESUME #1 (5090) PLEASE DO :2 <- '"?':1~"#65535$#0"'$#21660"~"#0$#65535"'$ '"?':1~"#0$#65535"'$#63326"~"#0$#65535"' PLEASE DO .5 <- #1$"#3~'"'":1~:2"~"'?:2~:2'~'#32767$ #65535'"'~#1"$"'":1~'#32768$#0'"~"':2~:2'~'#32768$ #0'"'~#1"'" DO :2 <- #0 DO (5091) NEXT PLEASE STASH .1 + .2 + .3 + .4 + .6 + .7 + .8 + :1 + :3 + :4 + :5 + :6 + :7 + :8 + :9 + ,1 + ;1 PLEASE DO (5690) NEXT PLEASE DO :2 <- #33872$#43872 DO (1509) NEXT DO .5 <- :4 DO (5091) NEXT DO :1 <- :3 DO .7 <- #65535 DO (5092) NEXT (5091) DO (1001) NEXT DO .7 <- #1 (5092) PLEASE FORGET #1 DO :6 <- #0 DO :7 <- #0 PLEASE DO :5 <- #38368$#10099 PLEASE DO :4 <- #63085$#14998 PLEASE DO :8 <- #20480$#16384 DO :9 <- :1 DO (5093) NEXT (5094) DO (1001) NEXT (5093) PLEASE FORGET #1 DO :1 <- :9 DO :2 <- :8 DO (1510) NEXT DO .5 <- '?":3~'#32768$#0'"$#2'~#3 DO (5095) NEXT DO :9 <- :3 DO :1 <- :6 DO :2 <- :7 DO :3 <- :5 DO (5500) NEXT DO :6 <- :1 DO :7 <- :2 DO (5096) NEXT (5095) DO (1001) NEXT (5096) PLEASE FORGET #1 DO :4 <- '"'V:5~#1'$':4~"#0$#65534"'"~"#32768$#32767"'$ ':4~"#65535$#0"' DO :5 <- :5~'#65535$#65534' DO :8 <- :8~'#65535$#65534' DO .5 <- '?":8~#2"$#1'~#3 DO (5094) NEXT DO :1 <- :6 DO :2 <- :7 DO .1 <- :9 PLEASE DO .5 <- '?"'V".1~#64"$".&1~#16"'~#1"$#1'~#3 DO (5097) NEXT DO .8 <- #65535 DO .2 <- #65486 DO (1009) NEXT DO .1 <- .3 DO (5098) NEXT (5097) DO (1001) NEXT DO .8 <- #1 (5098) PLEASE FORGET #1 DO .5 <- '?.1$#38'~'#0$#65535' DO .5 <- '?"'.1~.5'~'"?.5~.5"~#32767'"$#2'~#3 DO (5015) NEXT DO .5 <- '?"!1~.1'~#1"$#1'~#3 DO (5014) NEXT DO .2 <- ,1SUB.1 DO .5 <- '?".8~#32768"$#1'~#3 DO (5017) NEXT DO :3 <- ';1SUB.1'~'#65535$#65534' DO :4 <- '&"V';1SUB.1'~#1"'$#0 DO (5540) NEXT PLEASE DO :2 <- .V5$#0 DO (1010) NEXT DO .1 <- .3 DO .2 <- #508 DO (1000) NEXT DO (5016) NEXT (5017) DO (1001) NEXT PLEASE FORGET #1 DO :3 <- ;1SUB.1 DO :4 <- #0 DO (5530) NEXT DO .1 <- #635 DO (1000) NEXT DO (5016) NEXT (5014) DO (1001) NEXT DO .3 <- #634 (5016) PLEASE FORGET #1 DO .1 <- !7$.3'~'#1024$#1023' PLEASE DO (5600) NEXT DO :2 <- :1 DO (5099) NEXT (5015) DO (1001) NEXT PLEASE FORGET #1 DO :2 <- #0 PLEASE DO .5 <- #1$'"?!8~#32768'$#1"~#1' DO (5099) NEXT (5099) PLEASE RETRIEVE .1 + .2 + .3 + .4 + .6 + .7 + .8 + :1 + :3 + :4 + :5 + :6 + :7 + :8 + :9 + ,1 + ;1 PLEASE RESUME #2 (5100) DO :2 <- #0 PLEASE DO .5 <- #1$':1~"#32768$#0"' DO (5107) NEXT DO .5 <- '?"':1~:1'~#1"$#1'~#3 DO (5107) NEXT PLEASE STASH .1 + .2 + .3 + :1 + :3 + :4 + :6 DO .1 <- :1~'#30720$#61440' DO :1 <- '"':1~"#2047$#0"'$#2048"~"#2047$#2048"'$':1~"#0$#4095"' DO .2 <- #897 DO (1000) NEXT DO .5 <- '?".3~#1"$#1'~#3 DO (5101) NEXT DO :1 <- ':1~"#0$#65535"'$'"':1~"#32767$#0"'$#0"~"#32767$#1"' DO (5102) NEXT (5101) DO (1001) NEXT (5102) PLEASE FORGET #1 DO .1 <- .3~#65534 DO :6 <- :1 DO :4 <- #0 DO :1 <- #0 DO .2 <- #4096 DO (5104) NEXT (5103) DO (1001) NEXT (5104) PLEASE FORGET #1 DO :1 <- '"':1~"#32767$#0"'$':6~"#0$.2"'"~"#32767$#1"'$ '"':1~"#0$#32767"'$':6~"'.2~#65534'$#0"'"~"#32767$#1"' DO :2 <- '"':4~"#32767$#0"'$#0"~"#32767$#1"'$'"':4~"#0$ #32767"'$#1"~"#32767$#1"' PLEASE DO (1510) NEXT DO .5 <- '?":3~'#32768$#0'"$#1'~#3 DO (5105) NEXT DO :3 <- :1 DO (5106) NEXT (5105) DO (1001) NEXT (5106) PLEASE FORGET #1 DO :1 <- :3 DO :4 <- ':4~"#0$#65535"'$'"':4~"#32767$#0"'$.5"~"#32767$#1"' DO .2 <- .2~#65534 DO (1020) NEXT PLEASE DO .5 <- '?":4~'#0$#4096'"$#1'~#3 DO (5103) NEXT DO .2 <- #102 DO (1000) NEXT DO :1 <- :4 DO :6 <- #1 DO (5510) NEXT DO :2 <- :1~'#65535$#65534' PLEASE DO :2 <- '"'"'"'".3$':2~#32768'"~"#1109$#1"'$ ':2~#128'"~#2735'$':2~"#546$#0"'"~"#43679"'$':2~"#1365$ #0"'"~"#1023$#63"'$'"'"'".3$#0"~#34959'$':2~"#0$ #1170"'"~#11007'$':2~"#0$#2925"'"~"#2005$#255"' DO .5 <- #1 PLEASE RETRIEVE .1 + .2 + .3 + :1 + :3 + :4 + :6 PLEASE RESUME #1 (5107) DO (1001) NEXT PLEASE RESUME #2 (5110) DO :2 <- #32678$#0 PLEASE DO .5 <- '?"?'?"':1~:1'~#1"$"#1$'":1~'#32768$ #0'"~#1'"'"'~#5 DO (5121) NEXT PLEASE STASH .1 + :1 DO .1 <- :1~'#30720$#61440' DO :1 <- '"':1~"#2047$#0"'$#2048"~"#2047$#2048"'$':1~"#0$#4095"' DO :2 <- #0 DO (5610) NEXT PLEASE DO (5600) NEXT DO :2 <- :1 PLEASE RETRIEVE .1 + :1 DO RESUME #1 (5120) PLEASE STASH .1 + .4 + :1 DO :2 <- #30720$#28672 DO .4 <- #1 DO .5 <- '?"':1~":1~'#32767$#65535'"'~#1"$#1'~#3 DO (5121) NEXT DO .1 <- :1~'#30720$#61440' DO .5 <- '?.1$#100'~'#0$#65535' DO .5 <- '?"!1~.5'~'"?.5~.5"~#32767'"$#1'~#3 DO (5121) NEXT DO :2 <- #0 DO .4 <- #1$'"?':1~"#32768$#0"'$#1"~#1' DO .5 <- '?.1$#133'~'#0$#65535' DO .5 <- '?"!1~.5'~'"?.5~.5"~#32767'"$#2'~#3 DO (5121) NEXT PLEASE DO .1 <- '"'":1~'#63488$#61440'"$#256'~'#511$#256'"$ #0'~'#1023$#256' PLEASE DO :1 <- '"'"':1~"#0$#4095"'$#0"~"#4095$#1"'$#0"~"#8191$ #3"'$'"'"':1~"#2047$#1"'$#32768"~"#4094$#32771"'$ #0"~"#16383$#3"' DO :2 <- #0 DO (5620) NEXT PLEASE DO (5600) NEXT DO :2 <- :1 DO (5122) NEXT (5121) DO (1001) NEXT DO .5 <- .4 (5122) PLEASE RETRIEVE .1 + .4 + :1 PLEASE RESUME #2 (5130) PLEASE STASH .3 + :1 + :2 DO :3 <- #0 DO .3 <- #1$'"?'":2~':2~"#32767$#65535"'"~#1'$#1"~#1' DO .5 <- '?"':1~":1~'#32767$#65535'"'~#1"$#1'~#3 DO (5131) NEXT DO :3 <- #30720$#28672 DO .5 <- '?".3~#1"$#2'~#3 DO .3 <- #1 DO (5131) NEXT PLEASE DO .5 <- '?"&'?"'#127~":1~'#30720$#28672'"'~#64"$ "'"#4095$#8191"~":1~'#34815$#36863'"'~#1"'~#3"$#2'~#3 DO (5131) NEXT DO (5650) NEXT DO :3 <- #0 DO .3 <- #3 DO (5131) NEXT PLEASE DO (5600) NEXT DO :3 <- :1 DO (5132) NEXT (5131) DO (1001) NEXT DO .5 <- .3 (5132) PLEASE RETRIEVE .3 + :1 + :2 PLEASE RESUME #2 (5200) PLEASE STASH .1 + :1 + :3 + :4 DO (5670) NEXT DO (5680) NEXT DO .5 <- '?":1~'#32768$#0'"$#1'~#3 DO (5201) NEXT DO (5560) NEXT DO .1 <- #1656 DO (5202) NEXT (5201) DO (1001) NEXT DO .1 <- #632 (5202) PLEASE DO (5600) NEXT DO :2 <- :1 PLEASE RETRIEVE .1 + :1 + :3 + :4 PLEASE RESUME #2 (5210) PLEASE STASH .1 + :1 + :3 + :4 DO (5670) NEXT DO (5680) NEXT DO :1 <- :3 DO :2 <- :4 DO .5 <- '?":1~'#32768$#0'"$#1'~#3 DO (5211) NEXT DO (5560) NEXT DO .1 <- !1$#632'~'#2048$#1023' DO (5212) NEXT (5211) DO (1001) NEXT DO .1 <- !1$#632'~'#1024$#1023' (5212) PLEASE DO (5600) NEXT DO :2 <- :1 PLEASE RETRIEVE .1 + :1 + :3 + :4 PLEASE RESUME #2 (5220) PLEASE STASH .1 + .2 + .3 + :1 + :3 + :4 DO (5670) NEXT DO (5680) NEXT DO .2 <- #3 DO .5 <- '?"'V"':3~:3'~#1"$"':4~:4'~#1"'~#1"$#1'~#3 DO (5225) NEXT DO .2 <- #1 DO .5 <- '?"'V"':1~:1'~#1"$"':2~:2'~#1"'~#1"$#1'~#3 DO (5225) NEXT DO .2 <- .1 DO .5 <- '?":1~'#32768$#0'"$#1'~#3 DO (5221) NEXT DO (5560) NEXT DO .1 <- #1536 DO (5222) NEXT (5221) DO (1001) NEXT DO .1 <- #512 (5222) DO (5570) NEXT PLEASE STASH .1 + :1 + :2 DO :1 <- :3 DO :2 <- :4 DO .5 <- '?":1~'#32768$#0'"$#1'~#3 DO (5223) NEXT DO (5560) NEXT DO .1 <- .2~#3071 DO (5224) NEXT (5223) DO (1001) NEXT DO .1 <- .2~#2047 (5224) PLEASE FORGET #2 DO (5570) NEXT DO :3 <- :1~'#65535$#65534' PLEASE DO :4 <- '"'V:1~#1'$':2~"#0$#65534"'"~"#32768$#32767"'$ ':2~"#65535$#0"' DO .2 <- .1 PLEASE RETRIEVE .1 + :1 + :2 DO (1010) NEXT DO .2 <- .3 DO (5540) NEXT PLEASE DO :2 <- '&"V:1~#64"'$'"':1~#63'$.5"~#2735' DO :1 <- :1~'#65528$#65520' DO (1009) NEXT DO .1 <- .3~#2047 PLEASE DO (5600) NEXT DO :2 <- :1 DO (5226) NEXT (5225) DO (1001) NEXT PLEASE DO :2 <- '&"V'?"!1~#3072'~'"?':3~"#32768$#0"'$#1"~#3'"$ ":1~'#32768$#0'"'~#1"'$#0 DO .5 <- .2 (5226) PLEASE RETRIEVE .1 + .2 + .3 + :1 + :3 + :4 PLEASE RESUME #2 (5400) PLEASE STASH .5 + :2 + :6 DO :2 <- #0$#2048 DO :1 <- #28672$#28672 DO (5401) NEXT (5403) DO (1001) NEXT (5401) PLEASE FORGET #1 DO %50 (5402) NEXT DO :6 <- #2048$#0 PLEASE DO (5519) NEXT DO .5 <- '?"':1~:1'~#1"$#2'~#3 DO (5403) NEXT DO (5402) NEXT (5404) DO (1001) NEXT (5402) PLEASE FORGET #1 DO %50 :1 <- '"V':1~"#65535$#0"'$':2~"#65535$#0"'"~"#0$#65535"'$ '"V':1~"#0$#65535"'$':2~"#0$#65535"'"~"#0$#65535"' DO :2 <- :2~'#65535$#65534' DO .5 <- '?":2~:2"$#2'~#3 DO (5404) NEXT PLEASE RETRIEVE .5 + :2 + :6 PLEASE RESUME #1 (5419) PLEASE ABSTAIN FROM (5411) (5410) DO STASH .1 + :1 + :3 + :4 DO .1 <- '"'":1~'#63488$#61440'"$#256'~'#511$#256'"$#0'~'#1023$ #256' DO :1 <- '"':1~"#2047$#0"'$#2048"~"#2047$#2048"'$':1~"#0$#4095"' DO :2 <- #0 PLEASE DO :3 <- #46058$#46446 PLEASE DO :4 <- #64627$#29537 (5411) DO :3 <- :3~'#32767$#65535' DO (5530) NEXT DO (1020) NEXT PLEASE DO (5600) NEXT DO :2 <- :1 PLEASE REINSTATE (5411) DO RETRIEVE .1 + :1 + :3 + :4 DO RESUME #1 (5500) PLEASE STASH :1 + :3 + :4 + :5 + :6 DO :1 <- :4 DO (1509) NEXT DO :5 <- :3 PLEASE RETRIEVE :1 + :3 DO :2 <- :3 DO .5 <- :4 DO (5501) NEXT DO :6 <- #1 DO (5510) NEXT DO .5 <- '?"':1~:1'~#1"$#2'~#3 DO (5501) NEXT PLEASE DO :4 <- #1 DO (5502) NEXT (5501) DO (1001) NEXT DO (1509) NEXT (5502) DO :1 <- :3 DO :3 <- :2 DO :2 <- :5 DO .5 <- :4 PLEASE RETRIEVE :4 + :5 + :6 PLEASE RESUME #2 (5510) PLEASE ABSTAIN FROM (5513) (5519) DO STASH .5 DO (5511) NEXT (5511) PLEASE FORGET #1 DO .5 <- '?":1~:6"$#1'~#3 DO :1 <- '"?':1~"#65535$#0"'$':6~"#65535$#0"'"~"#0$#65535"'$ '"?':1~"#0$#65535"'$':6~"#0$#65535"'"~"#0$#65535"' (5513) DO .5 <- '?":1~:6"$#1'~#3 DO (5512) NEXT DO :6 <- ':6~"#0$#65535"'$'"':6~"#32767$#0"'$#0"~"#32767$#1"' DO (5511) NEXT (5512) DO (1001) NEXT DO RETRIEVE .5 PLEASE REINSTATE (5513) PLEASE RESUME #2 (5520) PLEASE STASH .2 + .5 DO .2 <- #1 DO (5521) NEXT (5521) PLEASE FORGET #1 DO .1 <- '?.1$.2'~'#0$#65535' DO .5 <- '?".1~.2"$#1'~#3 DO (5522) NEXT DO .2 <- !2$#0'~'#32767$#1' DO (5521) NEXT (5522) DO (1001) NEXT PLEASE RETRIEVE .2 + .5 PLEASE RESUME #2 (5530) PLEASE STASH .1 + .5 + :6 + :7 + :8 + :9 + :10 + :11 + :12 + :13 + :14 DO .1 <- #0 DO :6 <- #0 PLEASE DO :7 <- :1 DO :8 <- :2 DO :9 <- :3 DO :10 <- :4 PLEASE DO :11 <- #0 DO :12 <- #0 DO :13 <- #0 DO :14 <- #0 DO (5534) NEXT (5533) DO (1001) NEXT (5534) PLEASE FORGET #1 DO .5 <- '?":10~#1"$#1'~#3 DO (5536) NEXT PLEASE DO :1 <- :13 DO :2 <- :14 DO :3 <- :7 DO :4 <- :8 DO (5500) NEXT PLEASE DO (5532) NEXT DO (1020) NEXT DO (5531) NEXT (5532) DO (1001) NEXT (5531) PLEASE FORGET #1 DO :13 <- :1 DO :14 <- :2 PLEASE DO :1 <- :11 DO :2 <- :12 DO :3 <- #0 DO :4 <- :6 DO (5500) NEXT DO :11 <- :1 DO :12 <- :2 DO (5537) NEXT (5536) DO (1001) NEXT (5537) PLEASE FORGET #1 DO .5 <- '?":9~#1"$#1'~#3 DO (5538) NEXT DO :1 <- :12 DO :2 <- :13 DO :3 <- :7 DO :4 <- :8 DO (5500) NEXT DO :12 <- :1 DO :13 <- :2 PLEASE DO :1 <- :11 DO :2 <- :6 DO :6 <- .5~#2 DO (5510) NEXT DO (1500) NEXT DO :11 <- :3 DO :6 <- :2 DO (5539) NEXT (5538) DO (1001) NEXT (5539) PLEASE FORGET #1 DO :6 <- ':6~"#0$#65535"'$'"':6~"#32767$#0"'$':7~"#32768$ #0"'"~"#32767$#1"' DO :7 <- ':7~"#0$#65535"'$'"':7~"#32767$#0"'$':8~"#32768$ #0"'"~"#32767$#1"' DO :8 <- ':8~"#0$#65535"'$'"':8~"#32767$#0"'$#0"~"#32767$#1"' PLEASE DO :9 <- :9~'#65535$#65534' DO :10 <- :10~'#65535$#65534' DO .5 <- '?"'V"':9~:9'~#1"$"':10~:10'~#1"'~#1"$#2'~#3 DO (5533) NEXT PLEASE DO :1 <- :11 DO :2 <- :12 DO :3 <- #0 DO :4 <- .1 DO (5500) NEXT DO :3 <- :13 DO :4 <- :14 PLEASE RETRIEVE .1 + .5 + :6 + :7 + :8 + :9 + :10 + :11 + :12 + :13 + :14 PLEASE RESUME #1 (5540) PLEASE STASH :2 + :3 + :4 + :5 + :6 DO :5 <- :1 DO :6 <- :2 PLEASE DO :1 <- :3 DO :2 <- :4 DO (5560) NEXT DO :3 <- :1 DO :4 <- :2 DO :2 <- :6 DO :6 <- #0 DO .1 <- #156 DO (5543) NEXT (5543) PLEASE FORGET #1 DO .5 <- '?":6~'#0$#32768'"$#2'~#3 DO (5544) NEXT DO .5 <- '?":5~'#32768$#0'"$#1'~#3 DO (5545) NEXT DO :1 <- :5 DO (5500) NEXT DO :5 <- :1 DO :1 <- :6 DO :6 <- #1 DO (5510) NEXT DO :6 <- :1 DO (5543) NEXT (5545) DO (1001) NEXT PLEASE FORGET #1 PLEASE DO :5 <- ':5~"#0$#65535"'$'"':5~"#32767$#0"'$':2~"#32768$ #0"'"~"#32767$#1"' DO :2 <- ':2~"#0$#65535"'$'"':2~"#32767$#0"'$#0"~"#32767$#1"' DO :6 <- ':6~"#0$#65535"'$'"':6~"#32767$#0"'$#0"~"#32767$#1"' DO (5520) NEXT DO (5543) NEXT (5544) DO (1001) NEXT (5546) PLEASE FORGET #1 PLEASE DO .5 <- '?"'V"':5~:5'~#1"$"':2~:2'~#1"'~#1"$#1'~#3 DO (5541) NEXT DO :1 <- :5 DO (5500) NEXT DO :5 <- :1 PLEASE DO :1 <- :6 DO (5547) NEXT DO :6 <- #1 DO (5510) NEXT DO :6 <- :1 DO (5546) NEXT (5541) DO (1001) NEXT PLEASE DO .5 <- #0 DO (5549) NEXT (5547) DO (1001) NEXT DO :6 <- '"?':5~"#32767$#0"'$':3~"#0$#65534"'"~"#0$#32767"'$ '"?':5~"#0$#65535"'$':3~"#65535$#0"'"~"#0$#65535"' DO .5 <- '?"':6~:6'~#1"$#1'~#3 DO (5548) NEXT DO .5 <- '":5~:6"~"'?:6~:6'~'#32767$#65535'"'$#1 DO (5549) NEXT (5548) DO (1001) NEXT PLEASE DO :4 <- '"'V:3~#1'$':4~"#0$#65534"'"~"#32768$#32767"'$ ':4~"#65535$#0"' DO :6 <- '"?':2~"#65535$#0"'$':4~"#65535$#0"'"~"#0$#65535"'$ '"?':2~"#0$#65535"'$':4~"#0$#65535"'"~"#0$#65535"' DO .5 <- '?"':6~:6'~#1"$#1'~#3 PLEASE DO .5 <- '"V'#3~"'"':2~:6'~'"?:6~:6"~"#32767$ #65535"'"~#1'$'"':2~"#32768$#0"'~'":6~:6"~"#32768$ #0"'"~#1'"'$!5~#1'"~#1'$!5~#2' (5549) PLEASE RETRIEVE :2 + :3 + :4 + :5 + :6 PLEASE RESUME #3 (5550) PLEASE STASH .5 + :1 + :2 + :3 + :4 + :5 + :6 + :7 DO :5 <- :3 DO :6 <- :4 PLEASE DO :1 <- :3 DO :2 <- :4 DO (5560) NEXT DO :3 <- :1 DO :4 <- :2 PLEASE RETRIEVE :1 + :2 DO (1020) NEXT DO (5551) NEXT (5554) DO (1001) NEXT (5552) PLEASE FORGET #1 DO :7 <- '"?':5~"#65535$#0"'$':1~"#65535$#0"'"~"#0$#65535"'$ '"?':5~"#0$#65535"'$':1~"#0$#65535"'"~"#0$#65535"' DO .5 <- '?"':7~:7'~#1"$#2'~#3 DO (5558) NEXT DO :7 <- '"?':6~"#65535$#0"'$':2~"#65535$#0"'"~"#0$#65535"'$ '"?':6~"#0$#65535"'$':2~"#0$#65535"'"~"#0$#65535"' DO .5 <- '?"#3~'"'":6~:7"~"'?:7~:7'~'#32767$#65535'"'~#1"$ "'":7~'#32768$#0'"~"':7~:7'~'#32768$#0'"'~#1"'"$#2'~#3 DO (5559) NEXT (5558) DO (1001) NEXT DO .5 <- '?"#3~'"'":5~:7"~"'?:7~:7'~'#32767$#65535'"'~#1"$ "'":7~'#32768$#0'"~"':7~:7'~'#32768$#0'"'~#1"'"$#2'~#3 (5559) PLEASE FORGET #1 DO (5555) NEXT DO (5500) NEXT DO (5552) NEXT (5555) DO (1001) NEXT (5557) PLEASE FORGET #1 DO :1 <- ':1~"#0$#65535"'$'"':1~"#32767$#0"'$':2~"#32768$ #0"'"~"#32767$#1"' DO :2 <- ':2~"#0$#65535"'$'"':2~"#32767$#0"'$#0"~"#32767$#1"' DO (5520) NEXT (5551) DO .5 <- '?"'#65535~"'?.1$.2'~#21845"'~#1"$#2'~#3 DO (5554) NEXT PLEASE RETRIEVE .5 + :3 + :4 + :5 + :6 + :7 PLEASE RESUME #2 (5560) PLEASE STASH .5 + :3 + :6 DO .5 <- '?"':2~:2'~#1"$#1'~#3 DO :6 <- #1 DO (5561) NEXT DO :3 <- '"?':1~"#65535$#0"'$#65535"~"#0$#65535"'$'"?':1~"#0$ #65535"'$#65535"~"#0$#65535"' DO :1 <- '"?':2~"#65535$#0"'$#65535"~"#0$#65535"'$'"?':2~"#0$ #65535"'$#65535"~"#0$#65535"' DO (5510) NEXT DO :2 <- :1 DO :1 <- :3 DO (5562) NEXT (5561) DO (1001) NEXT DO :1 <- '"?':1~"#65535$#0"'$#65535"~"#0$#65535"'$'"?':1~"#0$ #65535"'$#65535"~"#0$#65535"' DO (5510) NEXT (5562) PLEASE RETRIEVE .5 + :3 + :6 PLEASE RESUME #2 (5570) DO .5 <- '?"'V"':1~:1'~#1"$"':2~:2'~#1"'~#1"$#2'~#3 DO (1001) NEXT DO (5571) NEXT (5572) DO (1001) NEXT PLEASE FORGET #1 PLEASE DO :1 <- ':1~"#0$#65535"'$'"':1~"#32767$#0"'$ ':2~"#32768$#0"'"~"#32767$#1"' DO :2 <- ':2~"#0$#65535"'$'"':2~"#32767$#0"'$#0"~"#32767$#1"' DO (5520) NEXT (5571) DO .5 <- '?":1~'#32768$#0'"$#1'~#3 DO (5572) NEXT DO .5 <- #1 PLEASE RESUME #2 (5580) PLEASE STASH .1 + .5 DO .1 <- .3 DO (5581) NEXT (5581) PLEASE FORGET #1 DO .5 <- '?"!1~.1'~#1"$#1'~#3 DO (5582) NEXT DO :4 <- '"'V:3~#1'$':4~"#0$#65534"'"~"#32768$#32767"'$ ':4~"#65535$#0"' DO :3 <- '"':3~"#65535$#0"'$':3~"#0$#65534"'"~"#32768$#32767"'$ ':3~"#65535$#0"' DO (5520) NEXT DO (5581) NEXT (5582) DO (1001) NEXT PLEASE RETRIEVE .1 + .5 PLEASE RESUME #2 (5590) PLEASE STASH .2 DO .2 <- #0 DO .5 <- '?"'#255~":1~'#61440$#61440'"'~#1"$#2'~#3 DO (5593) NEXT DO (5591) NEXT (5591) PLEASE FORGET #1 DO .5 <- '?":1~'#2048$#0'"$#2'~#3 DO (5592) NEXT DO :1 <- ':1~"#0$#65535"'$'"':1~"#32767$#0"'$':2~"#32768$ #0"'"~"#32767$#1"' DO :2 <- ':2~"#0$#65535"'$'"':2~"#32767$#0"'$#0"~"#32767$#1"' DO (5520) NEXT DO (5591) NEXT (5593) DO (1001) NEXT PLEASE FORGET #1 DO .2 <- '"V:2~#1"$.2'~'#32768$#32767' DO :2 <- '"'V:1~#1'$':2~"#0$#65534"'"~"#32768$#32767"'$ ':2~"#65535$#0"' DO :1 <- :1~'#65535$#65534' DO (1020) NEXT DO .5 <- '?"'#255~":1~'#61440$#61440'"'~#1"$#2'~#3 DO (5593) NEXT DO (5594) NEXT (5592) DO (1001) NEXT (5594) DO .5 <- .2 PLEASE RETRIEVE .2 PLEASE RESUME #2 (5600) PLEASE DO .5 <- '?"'V"':1~:1'~#1"$"':2~:2'~#1"'~#1"$#1'~#3 DO (5601) NEXT DO STASH :6 DO (5590) NEXT DO :6 <- :2~'#32767$#65535' PLEASE DO :6 <- 'V"'V"':6~:6'~#1"$"'.5~.5'~#1"'~#1"$ ":1~#1"'~':2~"#32768$#0"' DO (5510) NEXT DO .5 <- '?"':1~"#61440$#61440"'~#1"$#1'~#3 DO (5606) NEXT PLEASE DO :1 <- #2048$#0 DO (1020) NEXT DO (5607) NEXT (5601) DO (1001) NEXT PLEASE RESUME #2 (5606) DO (1001) NEXT (5607) DO :2 <- #0 PLEASE DO :1 <- '"'"'"'".1$':1~#32768'"~"#1109$#1"'$ ':1~#128'"~#2735'$':1~"#546$#0"'"~"#43679"'$':1~"#1365$ #0"'"~"#1023$#63"'$'"'"'".1$#0"~#34959'$':1~"#0$ #1170"'"~#11007'$':1~"#0$#2925"'"~"#2005$#255"' DO .5 <- !1~#256'$!1~#512' DO RETRIEVE :6 PLEASE RESUME #2 (5610) PLEASE STASH .2 + .3 + :3 + :4 + :5 + :6 + :7 + :8 + :9 + :10 + :11 + :12 + ;1 PLEASE DO (5691) NEXT PLEASE DO :5 <- #4096$#0 DO .2 <- .1~#255 DO :7 <- :1 DO :8 <- :2 DO :1 <- #0 DO :2 <- #0 DO .1 <- #1 DO (5612) NEXT (5611) DO (1001) NEXT PLEASE FORGET #1 DO :3 <- '"?':7~"#65535$#0"'$#65535"~"#0$#65535"'$ '"?':7~"#0$#65535"'$#65535"~"#0$#65535"' DO :4 <- '"?':8~"#65535$#0"'$#65535"~"#0$#65535"'$ '"?':8~"#0$#65535"'$#65535"~"#0$#65535"' DO .3 <- .1 DO (5580) NEXT DO :9 <- :3 DO :10 <- :4 DO :11 <- :1 DO :12 <- :2 DO (5615) NEXT (5616) DO (1001) NEXT PLEASE FORGET #1 DO (1020) NEXT DO :5 <- :5~'#65535$#65534' DO .5 <- '?":5~:5"$#2'~#3 DO (5617) NEXT DO :5 <- #0$#16384 PLEASE ABSTAIN FROM (5638) PLEASE ABSTAIN FROM (5639) DO (5615) NEXT (5617) DO (1001) NEXT (5615) PLEASE FORGET #1 DO :10 <- '"'V:9~#1'$':10~"#0$#65534"'"~"#32768$#32767"'$ ':10~"#65535$#0"' DO :9 <- '"':9~"#0$#65535"'$':9~"#0$#65534"'"~"#32768$#32767"'$ ':9~"#65535$#0"' DO :6 <- #1 PLEASE DO .5 <- '?"':10~:10'~'#32768$#0'"$#2'~#3 DO (5613) NEXT DO :3 <- :9 DO :1 <- :10 DO (5510) NEXT DO :4 <- :1 DO (5614) NEXT (5613) DO (1001) NEXT DO :1 <- :9 DO (5510) NEXT DO :3 <- :1 DO :4 <- #0 (5614) PLEASE FORGET #1 DO :1 <- :7 DO :2 <- :8 DO (5500) NEXT DO .5 <- '?":1~'#2048$#0'"$#1'~#3 DO (5616) NEXT DO :7 <- :1 DO :8 <- :2 PLEASE DO :1 <- :11 DO :2 <- :12 DO :3 <- #0 DO :4 <- :5 (5638) PLEASE DO :3 <- ;1SUB.1#1 (5639) PLEASE DO :4 <- ;1SUB.1#2 DO (5500) NEXT (5612) DO .5 <- '?"'V"':7~":7~'#2047$#4095'"'~#1"$"':8~:8'~#1"'~#1"$ #2'~#3 DO (5611) NEXT DO .1 <- #638 DO .5 <- '?"'#65535~"'?.2$#127'~#21845"'~#1"$#1'~#3 DO (5619) NEXT DO :11 <- :1 DO :12 <- :2 DO .1 <- .2 DO .2 <- #127 DO (1010) NEXT DO .2 <- !3~#65280'$!3~#65280' DO :1 <- '".2$.3"~"#65280$#61610"'$'".2$.3"~"#65280$#61525"' PLEASE DO :2 <- #1479$#6307 DO (1549) NEXT DO :6 <- :3 PLEASE DO :2 <- #4059$#2839 DO (1549) NEXT DO :1 <- :6 DO :2 <- '".2$':3~"#61440$#0"'"~"#65520$#15"'$'".2$':3~"#0$ #61440"'"~"#65520$#15"' DO :6 <- '"'"'"':3~"#4095$#0"'$#0"~"#4095$#1"'$#0"~"#8191$#1"'$ #0"~"#16383$#3"'$'"'"'"':3~"#0$#4095"'$#0"~"#4095$#1"'$ #0"~"#8191$#1"'$#0"~"#16383$#3"' DO (1509) NEXT DO :4 <- '"'V:3~#1'$':6~"#0$#65534"'"~"#32768$#32767"'$ ':6~"#65535$#0"' PLEASE DO :3 <- '".2$':3~"#0$#65534"'"~"#32768$#32767"'$ ':3~"#65535$#0"' DO :1 <- :11 DO :2 <- :12 DO (5500) NEXT DO .1 <- #638 DO .5 <- '?".2~#1"$#1'~#3 DO (5619) NEXT DO .1 <- #1662 DO (5560) NEXT DO (5618) NEXT (5619) DO (1001) NEXT (5618) PLEASE REINSTATE (5638) PLEASE REINSTATE (5639) PLEASE RETRIEVE .2 + .3 + :3 + :4 + :5 + :6 + :7 + :8 + :9 + :10 + :11 + :12 + ;1 PLEASE RESUME #3 (5620) PLEASE STASH .2 + .3 + :3 + :4 + :6 + :7 + :8 + :9 + :10 + ;1 PLEASE DO (5692) NEXT PLEASE DO :3 <- #61302$#16465 PLEASE DO :4 <- #8654$#59334 DO (5530) NEXT DO :3 <- :1 DO :4 <- :2 DO .4 <- !1~#1024'$#1 DO .2 <- .1~#1023 DO .1 <- #636 DO (1010) NEXT DO .1 <- .3 DO .2 <- #0 DO .5 <- '?".1~#32768"$#1'~#3 DO (5635) NEXT DO (5624) NEXT (5625) DO (1001) NEXT (5624) PLEASE FORGET #1 DO .2 <- !2$":3~'#32768$#0'"'~'#32767$#1' DO :3 <- ':3~"#0$#65535"'$'"':3~"#32767$#0"'$':4~"#32768$ #0"'"~"#32767$#1"' DO :4 <- ':4~"#0$#65535"'$'"':4~"#32767$#0"'$#0"~"#32767$#1"' DO (1020) NEXT DO .5 <- '?"!1~.1'~#1"$#2'~#3 DO (5625) NEXT DO (5623) NEXT (5635) DO (1001) NEXT DO (5580) NEXT (5623) PLEASE FORGET #1 PLEASE DO .5 <- .?4~#3 DO .4 <- .2 DO (5626) NEXT PLEASE DO .4 <- '?.4$#65535'~'#0$#65535' DO :6 <- #1 DO .5 <- '?"':4~:4'~#1"$#1'~#3 DO (5627) NEXT DO :1 <- '"?':4~"#65535$#0"'$#65535"~"#0$#65535"'$'"?':4~"#0$ #65535"'$#65535"~"#0$#65535"' DO (5510) NEXT DO :4 <- :1 DO :3 <- '"?':3~"#65535$#0"'$#65535"~"#0$#65535"'$'"?':3~"#0$ #65535"'$#65535"~"#0$#65535"' DO (5628) NEXT (5627) DO (1001) NEXT PLEASE DO .5 <- '?"':3~:3'~#1"$#1'~#3 DO (5622) NEXT PLEASE FORGET #1 DO :1 <- '"?':3~"#65535$#0"'$#65535"~"#0$#65535"'$'"?':3~"#0$ #65535"'$#65535"~"#0$#65535"' DO (5510) NEXT DO :3 <- :1 DO :4 <- #0 DO (5628) NEXT (5622) DO (1001) NEXT PLEASE FORGET #2 DO .1 <- .4 PLEASE DO (1020) NEXT DO .4 <- .1 DO :3 <- #0 DO :4 <- #0 DO (5628) NEXT (5626) DO (1001) NEXT (5628) PLEASE FORGET #1 PLEASE DO :1 <- #50461$#23679 PLEASE DO :2 <- #35694$#56274 DO (5530) NEXT DO :7 <- :1 DO :8 <- :2 PLEASE DO :9 <- #2048$#0 DO :10 <- #0 DO :6 <- #0 DO .1 <- #1 DO :1 <- :9 DO :2 <- :10 DO (5621) NEXT (5629) DO (1001) NEXT PLEASE FORGET #1 DO .5 <- '?":6~:6"$#1'~#3 DO (5631) NEXT DO :2 <- :6 DO :1 <- :8 PLEASE DO (5519) NEXT DO .5 <- '?":6~:6"$#1'~#3 DO :6 <- :2~'#65535$#65534' DO :2 <- :1 DO :1 <- #0 DO (5632) NEXT (5631) DO (1001) NEXT DO .5 <- '?".1~#32"$#1'~#3 DO (5633) NEXT DO :6 <- #32768$#0 DO (5634) NEXT (5633) DO (1001) NEXT (5634) PLEASE FORGET #1 DO :1 <- :7 DO :2 <- :8 DO :3 <- ;1SUB.1#1 DO :4 <- ;1SUB.1#2 DO (5500) NEXT (5632) PLEASE FORGET #1 DO .3 <- .1 DO (1020) NEXT DO (5629) NEXT DO :7 <- :1 DO :8 <- :2 PLEASE DO :1 <- :9 DO :2 <- :10 DO :3 <- :1 DO :4 <- :2 DO (5580) NEXT DO (5500) NEXT DO :9 <- :1 DO :10 <- :2 (5621) DO .5 <- '?"'V"':7~:7'~#1"$"':8~:8'~#1"'~#1"$#2'~#3 DO (5629) NEXT PLEASE DO .1 <- .4 DO .2 <- #639 DO (1009) NEXT DO .1 <- .3 PLEASE RETRIEVE .2 + :3 + :4 + :6 + :7 + :8 + :9 + :10 + ;1 PLEASE RESUME #2 (5640) PLEASE STASH .2 + .3 + .4 + .7 + .8 + :3 + :4 + :5 + :6 + :7 + :8 + :9 DO :5 <- :3 DO :7 <- :1 DO :8 <- :2 DO .5 <- '?":5~'#32768$#0'"$#1'~#3 PLEASE DO .8 <- !5$"V':5~".1~#1024"'~#1"'~'#1023$#32768' DO .1 <- .1~#511 DO .2 <- #65410 DO (1009) NEXT DO .4 <- .3 DO (5643) NEXT DO :1 <- '"?':5~"#65535$#0"'$#65535"~"#0$#65535"'$'"?':5~"#0$ #65535"'$#65535"~"#0$#65535"' DO :6 <- #1 DO (5510) NEXT DO :5 <- :1 DO (5644) NEXT (5643) DO (1001) NEXT (5644) PLEASE FORGET #1 PLEASE DO :6 <- #32768$#0 DO :9 <- #0 DO .7 <- #631 DO (5642) NEXT (5642) PLEASE FORGET #1 DO .5 <- '?":5~#1"$#1'~#3 DO (5645) NEXT DO .5 <- .2 PLEASE DO .1 <- .7 DO .2 <- .4 DO (1009) NEXT DO .1 <- .3 DO .4 <- .2 DO .2 <- .5 PLEASE DO :1 <- :6 DO :2 <- :9 DO :3 <- :7 DO :4 <- :8 PLEASE DO (5530) NEXT DO (5570) NEXT DO .7 <- .1 DO :6 <- :1 DO :9 <- :2 DO .5 <- '?".5~#2"$#2'~#3 DO (5646) NEXT PLEASE DO .5 <- .7~#64512 DO .5 <- '?"!5~.5'~#1"$#1'~#3 DO (5645) NEXT PLEASE DO .7 <- '"'?"V.8~#1"$.7'~'#0$#33279'"$#256'~'#767$#256' DO (5649) NEXT (5645) DO (1001) NEXT (5647) PLEASE FORGET #1 DO :5 <- :5~'#65535$#65534' DO .5 <- '?"':5~:5'~#1"$#1'~#3 DO (5646) NEXT PLEASE DO :1 <- :7 DO :2 <- :8 DO :3 <- :7 DO :4 <- :8 DO .1 <- !4$#0'~'#32767$#1' PLEASE DO (5530) NEXT DO :4 <- :3~'#32768$#0' DO :3 <- #0 DO (5500) NEXT DO (5570) NEXT DO :7 <- :1 DO :8 <- :2 DO .4 <- .1 DO (5642) NEXT (5646) DO (1001) NEXT PLEASE FORGET #1 DO .5 <- .8~#3 DO (5648) NEXT DO .1 <- #119 DO .2 <- .7 DO (1010) NEXT DO :3 <- :6~'#65535$#65534' PLEASE DO :4 <- '"':9~"#0$#65534"'$'V:6~#1'"~"#32767$#1"'$ ':9~"#65535$#0"' DO :1 <- #32768$#0 DO :2 <- #0 PLEASE DO (5540) NEXT DO :2 <- '"'"'"'"'"'":1~#127"$#0'~#10923"$.5'~#43693"$#0'~'#511$ #1'"$#0'~'#1023$#3'"$#0'~'#4095$#15'"$#0'~'#65535$#31' PLEASE DO :2 <- ':2~"#31$#2047"'$':2~"#1023$#63"' DO :1 <- :1~'#65528$#65520' DO .2 <- .3 DO (1009) NEXT DO .7 <- .3 DO (5649) NEXT (5648) DO (1001) NEXT DO :1 <- :6 DO :2 <- :9 (5649) DO .1 <- !8$.7'~'#1024$#1023' PLEASE RETRIEVE .2 + .3 + .4 + .7 + .8 + :3 + :4 + :5 + :6 + :7 + :8 + :9 PLEASE RESUME #2 (5650) PLEASE STASH .2 + .3 + .4 + .6 + .7 + .8 + :4 + :5 + :6 + :7 + :8 DO :5 <- :1 DO .7 <- :2~'#32768$#0' PLEASE DO .4 <- '"'":2~'#63488$#61440'"$#256'~'#511$#256'"$ #0'~'#1023$#256' DO .2 <- :2~'#30720$#61440' DO :1 <- '"'"':2~"#2047$#1"'$#4096"~"#4094$#4099"'$#0"~"#16383$ #3"'$'"'"'"':2~"#0$#4095"'$#0"~"#4095$#1"'$#0"~"#8191$ #1"'$#0"~"#16383$#3"' DO .1 <- #158 DO (1010) NEXT DO .1 <- .3 PLEASE DO :3 <- '".V7$#32767"~"#32768$#32767"'$#65535 DO :4 <- #0 DO .5 <- '?".1~#32768"$#2'~#3 DO (5665) NEXT DO :3 <- #0 DO :4 <- :2 PLEASE DO .5 <- '?"'#65535~".1~#65504"'~#1"$#2'~#3 DO (5665) NEXT DO :4 <- #1 DO (5662) NEXT (5667) DO (1001) NEXT PLEASE DO :4 <- :V4 DO (5520) NEXT (5662) PLEASE FORGET #1 DO .5 <- '?"!1~.1'~#1"$#2'~#3 DO (5667) NEXT DO :4 <- ':4~"#65535$#65534"'~':4~"#65535$#65534"' DO :3 <- :1~'"'?":4~'#65535$#0'"$#65535'~'#0$#65535'"$ "'?":4~'#0$#65535'"$#65535'~'#0$#65535'"' DO :1 <- ':1~:4'~'#65520$#65520' DO :2 <- #0 DO .1 <- '"!V7$#512'~'#32768$#1023'"$.2'~'#1536$#511' DO (5600) NEXT DO :4 <- :1 DO (5656) NEXT (5665) DO (1001) NEXT (5656) PLEASE FORGET #1 DO .5 <- '?"':5~"#32768$#0"'~'":4~:4"~#1'"$#2'~#3 DO (5655) NEXT DO .1 <- .2 DO .5 <- '?"':3~:3'~#1"$#1'~#3 DO (5651) NEXT DO .6 <- #1 PLEASE DO .1 <- '"'":5~'#63488$#61440'"$#256'~'#511$#256'" $#0'~'#1023$#256' DO :1 <- '"'"':5~"#2047$#1"'$#4096"~"#4094$#4099"'$#0"~"#16383$ #3"'$'"'"'"':5~"#0$#4095"'$#0"~"#4095$#1"'$#0"~"#8191$ #1"'$#0"~"#16383$#3"' DO :2 <- #0 PLEASE DO (5640) NEXT DO (5570) NEXT DO :7 <- :1 DO :8 <- :2 DO .8 <- .1 DO (5652) NEXT (5651) DO (1001) NEXT DO .6 <- #0 (5652) PLEASE FORGET #1 DO .5 <- '?"':4~:4'~#1"$#1'~#3 DO (5653) NEXT DO .6 <- #1$.6 DO .1 <- :5~'#30720$#61440' DO :1 <- '"':5~"#2047$#0"'$#2048"~"#2047$#2048"'$':5~"#0$#4095"' DO :2 <- #0 PLEASE DO (5610) NEXT DO (5570) NEXT PLEASE DO .2 <- '"'":4~'#63488$#61440'"$#0'~'#511$#256'"$ #0'~'#1023$#256' DO :3 <- '"'"':4~"#2047$#1"'$#4096"~"#4094$#4099"'$#0"~"#16383$ #3"'$'"'"'"':4~"#0$#4095"'$#0"~"#4095$#1"'$#0"~"#8191$ #1"'$#0"~"#16383$#3"' DO :4 <- #0 PLEASE DO (5530) NEXT DO .5 <- '?":1~'#32768$#0'"$#1'~#3 DO (5663) NEXT PLEASE DO :2 <- '"'V:1~#1'$':2~"#0$#65534"'"~"#32768$#32767"'$ ':2~"#65535$#0"' DO :1 <- :1~'#65535$#65534' DO (1020) NEXT DO (5664) NEXT (5663) DO (1001) NEXT (5664) PLEASE FORGET #1 DO (1000) NEXT DO .1 <- .3 DO .2 <- #119 DO (1010) NEXT DO .1 <- .3 PLEASE DO (5620) NEXT DO (5570) NEXT DO (5654) NEXT (5653) DO (1001) NEXT (5654) PLEASE FORGET #1 DO .5 <- .6 PLEASE DO (5659) NEXT DO .5 <- '?.7$#1'~#3 DO (5657) NEXT DO .2 <- .8 DO (1010) NEXT DO .2 <- .3~#2047 DO :3 <- :7~'#65535$#65534' PLEASE DO :4 <- '"'V:7~#1'$':8~"#0$#65534"'"~"#32768$#32767"'$ ':8~"#65535$#0"' PLEASE DO (5540) NEXT DO (1009) NEXT DO .1 <- .3 PLEASE DO :2 <- '&"V:1~#64"'$'"':1~#63'$.5"~#2735' DO :1 <- :1~'#65528$#65520' DO .5 <- #2 DO (5658) NEXT (5657) DO (1001) NEXT PLEASE FORGET #1 DO :3 <- :7 DO :4 <- :8 PLEASE DO (5530) NEXT DO .2 <- #630 DO (1010) NEXT DO .1 <- .3 DO .2 <- .8 DO (1009) NEXT DO .1 <- .3~#2047 DO .5 <- #2 DO (5658) NEXT (5661) DO (1001) NEXT PLEASE FORGET #2 DO .5 <- '?.7$#1'~#3 DO (5666) NEXT DO .1 <- #1399 DO .2 <- .8 DO (1010) NEXT DO .2 <- .3~#2047 DO :1 <- #32768$#0 DO :2 <- #0 DO :3 <- :7~'#65535$#65534' DO :4 <- '"'V:7~#1'$':8~"#0$#65534"'"~"#32768$#32767"'$ ':8~"#65535$#0"' PLEASE DO (5540) NEXT DO (1009) NEXT DO .1 <- .3 PLEASE DO :2 <- '&"V:1~#64"'$'"':1~#63'$.5"~#2735' DO :1 <- :1~'#65528$#65520' DO .5 <- #2 DO (5658) NEXT (5666) DO (1001) NEXT PLEASE FORGET #1 DO :1 <- :7 DO :2 <- :8 DO .1 <- .8 PLEASE DO .5 <- #2 DO (5658) NEXT (5655) DO (1001) NEXT PLEASE FORGET #1 DO (5658) NEXT (5659) DO (5661) NEXT (5658) PLEASE RETRIEVE .2 + .3 + .4 + .6 + .7 + .8 + :4 + :5 + :6 + :7 + :8 PLEASE RESUME #2 (5670) PLEASE STASH .2 + .3 + .5 + :3 + :4 DO .1 <- :1~'#30720$#61440' DO .5 <- '?.1$#128'~#21845 DO .5 <- '?"!1~.5'~'"?.5~.5"~#255'"$#1'~#3 DO (5677) NEXT DO .5 <- :1~'#32768$#0' PLEASE DO :1 <- '"'"':1~"#0$#4095"'$#0"~"#4095$#1"'$#0"~"#8191$ #3"'$'"'"':1~"#2047$#1"'$#32768"~"#4094$#32771"'$ #0"~"#16383$#3"' DO :2 <- #0 DO .2 <- #129 PLEASE DO :3 <- #18912$#41917 PLEASE DO :4 <- #3139$#18068 DO (5550) NEXT DO .2 <- .5 DO (5678) NEXT (5677) DO (1001) NEXT DO .2 <- .1 DO .1 <- #129 DO (1010) NEXT DO .2 <- :1~'#32768$#0' PLEASE DO :3 <- '"'"':1~"#0$#4095"'$#0"~"#4095$#1"'$#0"~"#8191$ #3"'$'"'"':1~"#2047$#1"'$#32768"~"#4094$#32771"'$ #0"~"#16383$#3"' DO :4 <- #0 DO (5580) NEXT DO :1 <- ':3~"#0$#65535"'$'"':3~"#32767$#0"'$':4~"#32768$ #0"'"~"#32767$#1"' DO :2 <- ':4~"#0$#65535"'$'"':4~"#32767$#0"'$#0"~"#32767$#1"' (5678) PLEASE FORGET #1 PLEASE DO :3 <- '"?':1~"#65535$#0"'$#18912"~"#0$#65535"'$ '"?':1~"#0$#65535"'$#41917"~"#0$#65535"' DO .5 <- '?"#3~'"'":1~:3"~"'?:3~:3'~'#32767$#65535'"'~#1"$ "'":1~'#32768$#0'"~"':3~:3'~'#32768$#0'"'~#1"'"$#1'~#3 DO (5671) NEXT DO (5560) NEXT PLEASE DO :3 <- #41917$#37824 PLEASE DO :4 <- #18068$#6279 DO (5500) NEXT DO .2 <- '?.2$#1'~#1 DO (5672) NEXT (5671) DO (1001) NEXT (5672) PLEASE FORGET #1 PLEASE DO :3 <- '"?':1~"#32767$#0"'$#20958"~"#0$#32767"'$ '"?':1~"#0$#65535"'$#18913"~"#0$#65535"' DO .5 <- '?"':1~:3'~'"?:3~:3"~"#32767$#65535"'"$#1'~#3 DO (5673) NEXT DO (5560) NEXT PLEASE DO :3 <- #18912$#41917 PLEASE DO :4 <- #3139$#18068 DO (5500) NEXT DO .1 <- #1024 DO (5674) NEXT (5673) DO (1001) NEXT DO .1 <- #2048 (5674) PLEASE FORGET #1 DO :1 <- ':1~"#0$#65535"'$'"':1~"#32767$#0"'$':2~"#32768$ #0"'"~"#32767$#1"' DO :2 <- ':2~"#0$#65535"'$'"':2~"#32767$#0"'$#0"~"#32767$#1"' DO .5 <- '?.2$#1'~#3 DO (5675) NEXT DO (5560) NEXT DO (5676) NEXT (5675) DO (1001) NEXT (5676) PLEASE RETRIEVE .2 + .3 + .5 + :3 + :4 PLEASE RESUME #2 (5680) PLEASE STASH .1 + .2 + .3 + .5 + :5 + :6 + :7 + :8 + :9 + :10 + :11 + ;1 DO .5 <- ':2~"#32768$#32768"'$'":1~:1"~"#32768$#1"' PLEASE DO .5 <- '?"'?".5~.5"~#9'~#1"$#1'~#3 DO (5681) NEXT PLEASE DO (5693) NEXT DO :5 <- :1 DO :6 <- :2 DO :7 <- #0 DO :8 <- #0 PLEASE DO :9 <- #23159$#12120 PLEASE DO :10 <- #2459$#20324 DO :11 <- #32768$#0 DO .1 <- #0 DO (5685) NEXT (5685) PLEASE FORGET #1 DO .3 <- .1 DO (1020) NEXT DO .5 <- '?".1~#32"$#1'~#3 DO (5688) NEXT DO :1 <- #0 DO :2 <- :11 DO :11 <- :11~'#65535$#65534' PLEASE DO .5 <- '?"'V":1~:1"$":2~:2"'~':11~:11'"$#1'~#3 DO (5683) NEXT DO (5687) NEXT (5688) DO (1001) NEXT DO :1 <- ;1SUB.1#1 DO :2 <- ;1SUB.1#2 (5687) PLEASE FORGET #1 DO :3 <- :5 DO :4 <- :6 DO .5 <- '?":5~'#32768$#0'"$#1'~#3 DO (5684) NEXT DO (5500) NEXT DO :5 <- :1 DO :6 <- :2 PLEASE DO :1 <- :9 DO :2 <- :10 DO (5560) NEXT DO :3 <- :1 DO :4 <- :2 PLEASE STASH :3 + :4 DO :3 <- :7 DO :4 <- :8 DO (5686) NEXT (5684) DO (1001) NEXT DO (5560) NEXT DO (5500) NEXT DO :5 <- :1 DO :6 <- :2 DO :3 <- :9 DO :4 <- :10 PLEASE STASH :3 + :4 DO :1 <- :7 DO :2 <- :8 DO (5560) NEXT DO :3 <- :1 DO :4 <- :2 (5686) PLEASE FORGET #1 PLEASE DO :1 <- :9 DO :2 <- :10 DO (5580) NEXT DO (5500) NEXT DO :9 <- :1 DO :10 <- :2 PLEASE RETRIEVE :3 + :4 PLEASE DO :1 <- :7 DO :2 <- :8 DO (5580) NEXT DO (5500) NEXT DO :7 <- :1 DO :8 <- :2 DO .5 <- '?".1~#32"$#1'~#3 DO (5685) NEXT (5683) DO (1001) NEXT PLEASE DO :1 <- :7 DO :2 <- :8 DO :3 <- :9 DO :4 <- :10 DO (5682) NEXT (5681) DO (1001) NEXT DO :3 <- #0$#32768 DO :4 <- #0 DO (5682) NEXT (5682) PLEASE RETRIEVE .1 + .2 + .3 + .5 + :5 + :6 + :7 + :8 + :9 + :10 + :11 + ;1 PLEASE RESUME #3 (5690) PLEASE DO ;1 <- #39 PLEASE DO ,1 <- #39 DO ;1SUB#1 <- #49152$#0 DO ,1SUB#1 <- #3 PLEASE DO ;1SUB#2 <- #40960$#32768 DO ,1SUB#2 <- #6 DO ;1SUB#3 <- #61440$#49152 DO ,1SUB#3 <- #9 PLEASE DO ;1SUB#4 <- #40960$#26624 DO ,1SUB#4 <- #13 DO ;1SUB#5 <- #36864$#39936 DO ,1SUB#5 <- #16 PLEASE DO ;1SUB#6 <- #50176$#57856 DO ,1SUB#6 <- #19 DO ;1SUB#7 <- #43392$#17920 DO ,1SUB#7 <- #23 PLEASE DO ;1SUB#8 <- #65088$#26112 DO ,1SUB#8 <- #26 DO ;1SUB#9 <- #63328$#43264 DO ,1SUB#9 <- #29 PLEASE DO ;1SUB#10 <- #33248$#28880 DO ,1SUB#10 <- #33 DO ;1SUB#11 <- #61904$#18808 DO ,1SUB#11 <- #36 PLEASE DO ;1SUB#12 <- #59584$#36404 DO ,1SUB#12 <- #39 DO ;1SUB#13 <- #35031$#21168 DO ,1SUB#13 <- #43 PLEASE DO ;1SUB#14 <- #52556$#31247 DO ,1SUB#14 <- #46 DO ;1SUB#15 <- #54245$#40724 DO ,1SUB#15 <- #49 PLEASE DO ;1SUB#16 <- #45999$#9623 DO ,1SUB#16 <- #53 DO ;1SUB#17 <- #52711$#20579 DO ,1SUB#17 <- #56 PLEASE DO ;1SUB#18 <- #45943$#57748 DO ,1SUB#18 <- #59 DO ;1SUB#19 <- #47440$#2835 DO ,1SUB#19 <- #63 PLEASE DO ;1SUB#20 <- #59129$#15514 DO ,1SUB#20 <- #66 DO ;1SUB#21 <- #43357$#53031 DO ,1SUB#21 <- #69 PLEASE DO ;1SUB#22 <- #39269$#12996 DO ,1SUB#22 <- #73 DO ;1SUB#23 <- #58903$#6247 DO ,1SUB#23 <- #76 PLEASE DO ;1SUB#24 <- #39227$#55387 DO ,1SUB#24 <- #79 DO ;1SUB#25 <- #33284$#11737 DO ,1SUB#25 <- #83 PLEASE DO ;1SUB#26 <- #51151$#15156 DO ,1SUB#26 <- #86 DO ;1SUB#27 <- #48054$#43312 DO ,1SUB#27 <- #89 PLEASE DO ;1SUB#28 <- #34662$#5981 DO ,1SUB#28 <- #93 DO ;1SUB#29 <- #51993$#4927 DO ,1SUB#29 <- #96 PLEASE DO ;1SUB#30 <- #44458$#40091 DO ,1SUB#30 <- #99 DO ;1SUB#31 <- #59232$#60392 DO ,1SUB#31 <- #102 PLEASE DO ;1SUB#32 <- #43246$#31536 DO ,1SUB#32 <- #106 DO ;1SUB#33 <- #34081$#46932 DO ,1SUB#33 <- #109 PLEASE DO ;1SUB#34 <- #55473$#58111 DO ,1SUB#34 <- #112 DO ;1SUB#35 <- #45369$#17686 DO ,1SUB#35 <- #116 PLEASE DO ;1SUB#36 <- #35254$#34734 DO ,1SUB#36 <- #119 DO ;1SUB#37 <- #52883$#51077 DO ,1SUB#37 <- #122 PLEASE DO ;1SUB#38 <- #38304$#28253 DO ,1SUB#38 <- #126 DO ;1SUB#39 <- #57468$#26227 DO ,1SUB#39 <- #129 PLEASE RESUME #1 (5691) PLEASE DO ;1 <- #26 BY #2 DO ;1SUB#1#1 <- #714$#2352 DO ;1SUB#1#2 <- #2418$#44457 PLEASE DO ;1SUB#2#1 <- #1394$#55 DO ;1SUB#2#2 <- #943$#11147 DO ;1SUB#3#1 <- #138$#1076 DO ;1SUB#3#2 <- #52079$#30302 PLEASE DO ;1SUB#4#1 <- #591$#2 DO ;1SUB#4#2 <- #36307$#44292 DO ;1SUB#5#1 <- #32$#519 DO ;1SUB#5#2 <- #38032$#25317 PLEASE DO ;1SUB#6#1 <- #273$#0 DO ;1SUB#6#2 <- #64569$#9562 DO ;1SUB#7#1 <- #8$#256 DO ;1SUB#7#2 <- #2221$#63237 PLEASE DO ;1SUB#8#1 <- #32800 DO ;1SUB#8#2 <- #16352$#554 DO ;1SUB#9#1 <- #16392 DO ;1SUB#9#2 <- #133$#8056 PLEASE DO ;1SUB#10#1 <- #8194 DO ;1SUB#10#2 <- #2047$#33 DO ;1SUB#11#1 <- #4096 DO ;1SUB#11#2 <- #32776$#1015 PLEASE DO ;1SUB#12#1 <- #2048 DO ;1SUB#12#2 <- #16639$#2 DO ;1SUB#13#1 <- #1024 DO ;1SUB#13#2 <- #8192$#127 PLEASE DO ;1SUB#14#1 <- #512 DO ;1SUB#14#2 <- #4127$#0 DO ;1SUB#15#1 <- #256 DO ;1SUB#15#2 <- #2048$#15 PLEASE DO ;1SUB#16#1 <- #128 DO ;1SUB#16#2 <- #1027$#0 DO ;1SUB#17#1 <- #64 DO ;1SUB#17#2 <- #512$#1 PLEASE DO ;1SUB#18#1 <- #32 DO ;1SUB#18#2 <- #256$#0 DO ;1SUB#19#1 <- #16 DO ;1SUB#19#2 <- #32768 PLEASE DO ;1SUB#20#1 <- #8 DO ;1SUB#20#2 <- #8192 DO ;1SUB#21#1 <- #4 DO ;1SUB#21#2 <- #2048 PLEASE DO ;1SUB#22#1 <- #2 DO ;1SUB#22#2 <- #512 DO ;1SUB#23#1 <- #1 DO ;1SUB#23#2 <- #128 PLEASE DO ;1SUB#24#1 <- #0 DO ;1SUB#24#2 <- #32772$#0 DO ;1SUB#25#1 <- #0 DO ;1SUB#25#2 <- #2$#32768 PLEASE DO ;1SUB#26#1 <- #0 DO ;1SUB#26#2 <- #16385$#0 PLEASE RESUME #1 (5692) PLEASE DO ;1 <- #32 BY #2 DO ;1SUB#1#1 <- #42306$#17867 DO ;1SUB#1#2 <- #2944$#5824 PLEASE DO ;1SUB#2#1 <- #39940$#43084 DO ;1SUB#2#2 <- #48096$#35184 DO ;1SUB#3#1 <- #51944$#40133 DO ;1SUB#3#2 <- #33328$#62272 PLEASE DO ;1SUB#4#1 <- #51163$#52407 DO ;1SUB#4#2 <- #54240$#64048 DO ;1SUB#5#1 <- #58150$#51158 DO ;1SUB#5#2 <- #19712$#40320 PLEASE DO ;1SUB#6#1 <- #57854$#58249 DO ;1SUB#6#2 <- #51072$#36640 DO ;1SUB#7#1 <- #61666$#57853 DO ;1SUB#7#2 <- #16016$#44336 PLEASE DO ;1SUB#8#1 <- #61567$#61680 DO ;1SUB#8#2 <- #62928$#36608 DO ;1SUB#9#1 <- #63548$#61567 DO ;1SUB#9#2 <- #8672$#56672 PLEASE DO ;1SUB#10#1 <- #63519$#63550 DO ;1SUB#10#2 <- #65456$#2144 DO ;1SUB#11#1 <- #64527$#63519 DO ;1SUB#11#2 <- #33280$#65008 PLEASE DO ;1SUB#12#1 <- #64519$#64527 DO ;1SUB#12#2 <- #65520$#49296 DO ;1SUB#13#1 <- #65027$#64519 DO ;1SUB#13#2 <- #61472$#65488 PLEASE DO ;1SUB#14#1 <- #65025$#65027 DO ;1SUB#14#2 <- #65520$#63504 DO ;1SUB#15#1 <- #65280$#65025 DO ;1SUB#15#2 <- #65024$#65520 PLEASE DO ;1SUB#16#1 <- #65280$#65280 DO ;1SUB#16#2 <- #32752$#65296 DO ;1SUB#17#1 <- #65408$#65280 DO ;1SUB#17#2 <- #16320$#32752 PLEASE DO ;1SUB#18#1 <- #65408$#65408 DO ;1SUB#18#2 <- #8176$#16368 DO ;1SUB#19#1 <- #65472$#65408 DO ;1SUB#19#2 <- #4096$#0 PLEASE DO ;1SUB#20#1 <- #65472$#65472 DO ;1SUB#20#2 <- #2048$#0 DO ;1SUB#21#1 <- #65504$#65472 DO ;1SUB#21#2 <- #1024$#0 PLEASE DO ;1SUB#22#1 <- #65504$#65504 DO ;1SUB#22#2 <- #512$#0 DO ;1SUB#23#1 <- #65520$#65504 DO ;1SUB#23#2 <- #256$#0 PLEASE DO ;1SUB#24#1 <- #65520$#65520 DO ;1SUB#24#2 <- #32768 DO ;1SUB#25#1 <- #65528$#65520 DO ;1SUB#25#2 <- #8192 PLEASE DO ;1SUB#26#1 <- #65528$#65528 DO ;1SUB#26#2 <- #2048 DO ;1SUB#27#1 <- #65532$#65528 DO ;1SUB#27#2 <- #512 PLEASE DO ;1SUB#28#1 <- #65532$#65532 DO ;1SUB#28#2 <- #0 DO ;1SUB#29#1 <- #65534$#65532 DO ;1SUB#29#2 <- #0 PLEASE DO ;1SUB#30#1 <- #65534$#65534 DO ;1SUB#30#2 <- #0 DO ;1SUB#31#1 <- #65535$#65534 DO ;1SUB#31#2 <- #0 PLEASE DO ;1SUB#32#1 <- #65535$#65535 DO ;1SUB#32#2 <- #0 PLEASE RESUME #1 (5693) PLEASE DO ;1 <- #31 BY #2 DO ;1SUB#1#1 <- #20958$#18912 DO ;1SUB#1#2 <- #41802$#3139 PLEASE DO ;1SUB#2#1 <- #11856$#29363 DO ;1SUB#2#2 <- #20278$#38329 DO ;1SUB#3#1 <- #16126$#13134 DO ;1SUB#3#2 <- #36988$#26789 PLEASE DO ;1SUB#4#1 <- #7293$#16290 DO ;1SUB#4#2 <- #62389$#4572 DO ;1SUB#5#1 <- #8181$#7710 DO ;1SUB#5#2 <- #52198$#46965 PLEASE DO ;1SUB#6#1 <- #3971$#8189 DO ;1SUB#6#2 <- #63827$#18313 DO ;1SUB#7#1 <- #4095$#4032 DO ;1SUB#7#2 <- #43913$#64878 PLEASE DO ;1SUB#8#1 <- #2032$#4095 DO ;1SUB#8#2 <- #8178$#60047 DO ;1SUB#9#1 <- #2047$#2040 DO ;1SUB#9#2 <- #64855$#2042 PLEASE DO ;1SUB#10#1 <- #1022$#2047 DO ;1SUB#10#2 <- #254$#65366 DO ;1SUB#11#1 <- #1023$#1023 DO ;1SUB#11#2 <- #65515$#62 PLEASE DO ;1SUB#12#1 <- #511$#1023 DO ;1SUB#12#2 <- #49159$#65531 DO ;1SUB#13#1 <- #511$#511 DO ;1SUB#13#2 <- #65535$#57345 PLEASE DO ;1SUB#14#1 <- #255$#511 DO ;1SUB#14#2 <- #63488$#65535 DO ;1SUB#15#1 <- #65535 DO ;1SUB#15#2 <- #65535$#64513 PLEASE DO ;1SUB#16#1 <- #32767 DO ;1SUB#16#2 <- #65280$#65535 DO ;1SUB#17#1 <- #16383 DO ;1SUB#17#2 <- #65535$#65409 PLEASE DO ;1SUB#18#1 <- #8191 DO ;1SUB#18#2 <- #65504$#65535 DO ;1SUB#19#1 <- #4095 DO ;1SUB#19#2 <- #65535$#65521 PLEASE DO ;1SUB#20#1 <- #2047 DO ;1SUB#20#2 <- #65532$#65535 DO ;1SUB#21#1 <- #1023 DO ;1SUB#21#2 <- #65535$#65535 PLEASE DO ;1SUB#22#1 <- #512 DO ;1SUB#22#2 <- #0 DO ;1SUB#23#1 <- #256 DO ;1SUB#23#2 <- #0 PLEASE DO ;1SUB#24#1 <- #128 DO ;1SUB#24#2 <- #0 DO ;1SUB#25#1 <- #64 DO ;1SUB#25#2 <- #0 PLEASE DO ;1SUB#26#1 <- #32 DO ;1SUB#26#2 <- #0 DO ;1SUB#27#1 <- #16 DO ;1SUB#27#2 <- #0 PLEASE DO ;1SUB#28#1 <- #8 DO ;1SUB#28#2 <- #0 DO ;1SUB#29#1 <- #4 DO ;1SUB#29#2 <- #0 PLEASE DO ;1SUB#30#1 <- #2 DO ;1SUB#30#2 <- #0 DO ;1SUB#31#1 <- #1 DO ;1SUB#31#2 <- #0 PLEASE RESUME #1 intercal-0.30/pit/lib/PaxHeaders.27456/floatlib.doc0000644000000000000000000000007411437550756016650 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.574945729 intercal-0.30/pit/lib/floatlib.doc0000644000175000017500000003023611437550756016547 0ustar00esresr00000000000000* Summary of routines in floatlib.i: (5000) :3 <- :1 plus :2 (5010) :3 <- :1 minus :2 (5020) :2 <- the integer part of :1 :3 <- the fractional part of :1 (5030) :3 <- :1 times :2 (5040) :3 <- :1 divided by :2 (5050) :3 <- :1 modulo :2 (5060) :2 <- :1 cast from a two's-complement integer into a floating-point number (5070) :2 <- :1 cast from a floating-point number into the nearest two's-complement integer (5080) :2 <- :1 cast from a floating-point number into a decimal representation in scientific notation (5090) :2 <- :1 cast from a decimal representation in scientific notation into a floating-point number (5100) :2 <- the square root of :1 (5110) :2 <- the natural logarithm of :1 (5120) :2 <- e to the power of :1 (the exponential function) (5130) :3 <- :1 to the power of :2 (5200) :2 <- sin :1 (5210) :2 <- cos :1 (5220) :2 <- tan :1 (5400) :1 <- uniform random number between zero and one exclusive (5410) :2 <- :1 times phi (5419) :2 <- :1 divided by phi Note: All of the above routines except (5020), (5060), (5080), (5200), (5210), and (5400) also modify .5 as follows: .5 will contain #3 if the result overflowed or if the arguments were out of domain, #2 if the result underflowed, #1 otherwise. (See below.) * Description of floatlib.i: The INTERCAL floating-point library uses the IEEE format for 32-bit floating-point numbers, which uses bit 31 as a sign bit (1 being negative), bits 30 through 23 hold the exponent with a bias of 127, and bits 22 through 0 contain the fractional part of the mantissa with an implied leading 1. In mathematical notation: N = (1.0 + fraction) * 2^(exponent - 127) * -1^sign Thus the range of floating-point magnitudes is, roughly, from 5.877472*10^-39 up to 6.805647*10^38, positive and negative. Zero is specially defined as all bits 0. (Actually, to be precise, zero is defined as bits 30 through 0 as being 0. Bit 31 can be 1 to represent negative zero, which the library generally treats as equivalent to zero, though don't hold me to that.) Note that, contrary to the IEEE standard, exponents 0 and 255 are not given special treatment (besides the representation for zero). Thus there is no representation for infinity or not-a-numbers, and there is no gradual underflow capability. Conformance with widely-accepted standards was not considered to be a priority for an INTERCAL library. (The fact that the general format conforms to IEEE at all is due to sheer pragmatism.) Here, for easy reference, are some common values as they would be directly represented within an INTERCAL program: Zero: #0 One: #30720$#28672 Two: #0$#32768 One million: #9280$#40480 One-half: #28672$#28672 Square root of two: #31757$#30509 e: #1760$#33742 Pi: #571$#35133 However, a more human-accessible representation of floating-point numbers is made possible by the routines (5080) and (5090). For this representation, scientific notation is used with six digits of precision after the decimal point. The seven digits of the mantissa are suffixed with the two digits of the exponent. If the number is negative, a one is prefixed (in the billions' place), so there can be ten decimal digits in all. Finally, if the exponent is negative, fifty is added. As is the usually the case with scientific notation, the digit to the left of the decimal point must be nonzero except for the case of zero itself. The above may sound convoluted, but it is not nearly as confusing as it perhaps should be. As an example, if you wished to enter the value of the speed of light measured in centimeters per seconds squared, you would type TWO NINE NINE SEVEN NINE TWO FIVE ONE OH. The INTERCAL program would then call (5080) to transform this into the floating-point number 2.997925e+10. The same value printed out with _____ the help of (5090) would appear as ccxcixDCCXCMMDX. Similarly, the value -1.602189e-19 (the charge of an electron measured in Coulombs) would be represented respectively as ONE ONE SIX ZERO TWO ONE EIGHT _______ NINE SIX NINE and mclxCCXVIIICMLXIX. Note that the negative sign on the exponent always translates to an L between the fraction and the exponent when output. The 16-bit variable .5 is used by the floating-point library as an error indicator. Upon return from most of the functions, .5 will normally be set to #1 if the return value is valid. If .5 is set to #2, this indicates that the result of the function underflowed (that is, the magnitude of the result is less than 2^-127). If .5 is set to #3, this indicates either that the result overflowed (magnitude greater than 2^128), or that the arguments to the function were illegal. The latter can occur for the following situations: division by zero (either via division or modulus), negative root (either via square root or a fractional power), and non-positive logarithm. Also, (5070) will set .5 to #3 if the magnitude of the argument is greater than 2^31, and (5080) will do likewise if given a bad number (e.g., if it is greater than two billion). It may be worth nothing that there are some cases in which an under- or overflow can be recovered from with tolerable grace. The sign and fraction bits of such a value will usually still be correct, and the exponent bits will just be the lower eight bits of the true exponent: that is, the true exponent plus or minus 256 as appropriate. If such a value is passed to another function as is, and the return value from that over- or underflows in the opposite direction, it is likely that the final result can be trusted. Of course, this depends entirely on the nature of the operations involved, and this paragraph should not be taken as advice to pursue such approaches in general, just as this document should not be taken as advice to make use of this library at all. Note also that in the case of (5110), the exponential function, and (5130), the power function, it is quite easy to request a massively under- and/or overflowed result. In these cases the functions in question exit early, and attempting to salvage something from such results, with the possible exception of the sign bit, is pretty much guaranteed to be fruitless. (5020) is the integral partition function (referred to as modf in the C library). Both return values are floating-point numbers, and both have the same sign as the argument, such that :2 + :3 = :1 while keeping the magnitude of :3 less than 1. (5060) and (5070) are the "type-casting" functions. They translate values to and from 32-bit two's-complement integers. (5070) truncates any fractional amounts from its argument, and will signal an error if the magnitude of the value requires more than 32 bits. The trigonometric functions (5200), (5210), and (5220) will return erroneous results when given very large arguments. At magnitudes around 8 million or so, the result is occasionally off by one bit. The errors get progressively worse, so that with magnitudes in the neighborhood of the quintillions and higher, the number is wholly inaccurate. However, at magnitudes around 8 million, there is already a difference of over 20pi between consecutive floating-point numbers, so it is hard to conceive of a purpose for which improved accuracy would be useful. In the descriptions for (5410) and (5419), phi refers to the golden ratio. * Internal routines in floatlib.i: A floating-point library involves a fair amount of mathematical functionality to begin with, something that INTERCAL is not generally mistaken for having. The floating-point library therefore has a number of internal functions to provide it with some 64-bit arithmetic, among other things. While these routines were designed specifically for internal use, and in many cases one would be hard-pressed to find other uses for them in their current form, it was felt that they were nonetheless worth documenting. Besides providing a guide for anyone so foolish as to examine the actual code, it provides a sort of "itemized bill" that helps to justify the inordinate size of the library. In the following list, the notation :1:2 simply indicates that two 32-bit variables, in this example :1 and :2, are being used to hold a single 64-bit integer value. The notation :1:2.1, on the other hand, indicates a kind of double-precision floating-point value, a format that the library uses frequently when storing intermediate values. The two 32-bit variables hold the fraction bits, with no implied bits, and ideally with the highest 1 bit at bit 55. The 16-bit variable holds the exponent, but with a bias of 639 instead of 127. This is done so that underflows do not affect the sign, which is also stored in the 16-bit variable in bit 10. These intermediate values are rounded (to even), truncated, and stored in a single 32-bit variable by the floating-point normalization function, (5600). Finally, note that the numbers in the tables accessed by routines (5690) through (5693) are generally tailored for the function that applies them, and all of them use slightly different representations for the values they encode. Here are brief descriptions of the internal routines: (5500) :1:2 <- :1:2 plus :3:4 .5 <- #0 if no overflow, #1 otherwise (5510) :1 <- :1 plus :6, where :6 has at most one 1 bit :6 <- #0 on overflow, nonzero otherwise (5519) :1 <- :1 minus :6, where :6 has at most one 1 bit :6 <- #0 on underflow, nonzero otherwise (5520) .1 <- .1 minus #1 (5530) :1:2:3:4 <- :1:2 times :3:4 (5540) :1 <- :1:2 divided by :3:4, with :1:2 aligned on bit 63, :3:4 aligned on bit 62, and the result aligned on bit 31 .1 <- the exponent of the quotient plus #126 .5 <- #1 if the result should be rounded up, #0 otherwise (5550) :1:2.1 <- :1:2.1 modulo :3:4.2 (5560) :1:2 <- two's complement of :1:2 (5570) :1:2 <- :1:2 left-shifted logically so that bit 63 is 1 .1 <- .1 minus the no. of bits shifted out (5580) :3:4 <- :3:4 shifted right arithmetically .3 bits (5590) :1:2 <- :1:2 shifted so that bit 55 is the highest 1 bit .1 <- .1 plus or minus the no. of bits shifted .5 <- the bits right-shifted out of :1:2, if any (5600) :1 <- the normalization of :1:2.1 (5610) :1:2.1 <- the natural logarithm of :1:2.1 (5620) :1:2.1 <- e to the power of :1:2.1 (5640) :1:2.1 <- :1:2.1 to the power of the two's-complement integer in :3 (5650) :1:2.1 <- :1 to the power of :2 .5 <- #1 if the power is not real, #2 otherwise (5670) :1:2 <- an angle between -pi/2 and pi/2 that has the same value for sine as :1, and stored in two's-complement, fixed-point form, with the one's position at bit 62 .1 <- #1024 if the cosine of :1:2 will have the opposite sign as the cosine of :1, #2048 otherwise (5680) :1:2 <- the sine of :1:2 in two's-complement, fixed-point :3:4 <- the cosine of :1:2 (5690) ;1 <- a table of 32 significant bits of the numbers 10^i, where i ranges from 1 to 39 ,1 <- a table of exponents for the above powers of ten (5691) ;1 <- a table of bit patterns representing ln(1 + 1/(2^i - 1)), where i ranges from -1 to -26 (5692) ;1 <- a table of bit patterns representing -ln(1 + 2^i), where i ranges from -1 to -32 (5693) ;1 <- a table of bit patterns representing arctan(2^i), where i ranges from 0 to -30 * Bibliography: Knuth, Donald E. "The Art of Computer Programming: Vol. 2 (Seminumerical Algorithms)", 2nd edition. Addison-Wesley, 1981. This book provided the essential background as well as algorithms for the basic arithmetic operations. Mention should also be made of Vol. 1, which provided an algorithm for the natural logarithm as a side note. Koren, Israel. "Computer Arithmetic Algorithms". Prentice-Hall, 1993. In addition to information on the IEEE standard, this book provided the algorithms used for the exponential and trigonometric functions. Plauger, P. J. "The Standard C Library". Prentice-Hall, 1992. This book provided assistance in designing the modulus and power functions, as well as other miscellaneous contributions. intercal-0.30/pit/lib/PaxHeaders.27456/lib2.doc0000644000000000000000000000007411437550756015704 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.574945729 intercal-0.30/pit/lib/lib2.doc0000644000175000017500000000346211437550756015604 0ustar00esresr00000000000000 lib2.i contains general-purpose library routines that are not included in the standard library. The first section, with entry at lines (2000), (2010) and (2020), was written for the Life program. Line (2000) is the entry point for a decrement routine setting .1 <- .1 minus #1. This is very similar to the increment routine (1020) in the system library, which I also use. Line (2010) is the decrement and branch on zero operation. It decrements .1, then if .1 is not zero returns to the calling point, but if .1 is zero pops an additional entry off the RESUME stack and returns to that point instead. Line (2020) is an alternative entry point to the (1020) routine which performs an add bit operation. It sets .1 <- .1 plus .2, where .2 is already known to be either #0 or #1. For the pi and primes programs I added the (2030) routine, which performs a 16-bit division with remainder. It is faster than the (1040) routine for two reasons: First, it is a true 16-bit version, whereas the (1040) routine just shifts over its operands and then calls the 32-bit division routine (1550). Second, the (1550) routine generates a remainder as part of the computation, but then simply throws it away. I needed the remainder, so I have my (2030) routine return it in .4 and the quotient in .3. In other respects this is just a 16-bit translation of the (1550) routine. (2040) and (2049) are entry points to an exponentiation routine that raises .1 to the .2 power and returns the answer in :1. If entered through (2040) the routine dies with an error on overflow. If entered through (2049) then .4 is set to #2 if there is an overflow, otherwise .4 is set to #1. There is a more detailed description of how this routine works on the web page. Louis Howell May 27, 1996 intercal-0.30/pit/lib/PaxHeaders.27456/syslib4.4i0000644000000000000000000000007411437550756016214 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.578945723 intercal-0.30/pit/lib/syslib4.4i0000644000175000017500000002163411437550756016115 0ustar00esresr00000000000000 PLEASE KNOCK TWICE TWO TIMES BEFORE ENTERING (1000) PLEASE IGNORE .4 PLEASE ABSTAIN FROM (1005) (1009) DO STASH .1 + .2 + .5 + .6 DO .4 <- #1 DO (1004) NEXT (1004) PLEASE FORGET #1 DO .3 <- '^.1$.2'~'#0$#21845' DO .6 <- '?"'V"'&.1$.2'~'#0$#21845'"$"'^"'@.1$ .2'~'#0$#21845'"$#21845'~'#0$#43690'"' ~'#0$#21845'"$#43690'~'#0$#21845' PLEASE DO .5 <- '?".6~#49152"$#4'~#4 DO (1002) NEXT DO .4 <- #2 (1005) DO (1006) NEXT (1999) DOUBLE OR SINGLE PRECISION OVERFLOW (1002) DO (1001) NEXT (1006) PLEASE FORGET #1 DO .5 <- '?"!6~.6'~#3"$#4'~#4 DO (1003) NEXT DO .1 <- .3 DO .2 <- !6$#0'~'#5461$#1' DO (1004) NEXT (1003) DO (1001) NEXT DO REINSTATE (1005) (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6 DO REMEMBER .4 PLEASE RESUME #2 (1001) DO RESUME .5 (1010) DO STASH .1 + .2 + .4 DO .4 <- .1 DO .1 <- '?#65535$.2'~'#0$#21845' DO (1020) NEXT PLEASE DO .2 <- .4 PLEASE DO (1009) NEXT DO RETRIEVE .1 + .2 + .4 PLEASE RESUME #1 (1020) DO STASH .2 + .3 DO .2 <- #1 PLEASE DO (1021) NEXT (1021) DO FORGET #1 DO .3 <- '?"'V".1~.2"$#2'~#1"$#1'~#1 PLEASE DO .1 <- '^.1$.2'~'#0$#21845' DO (1022) NEXT DO .2 <- !2$#0'~'#5461$#1' DO (1021) NEXT (1023) PLEASE RESUME .3 (1022) DO (1023) NEXT PLEASE RETRIEVE .2 + .3 PLEASE RESUME #2 (1030) DO ABSTAIN FROM (1033) PLEASE ABSTAIN FROM (1032) (1039) DO STASH :1 + .5 DO (1530) NEXT DO .3 <- :1~#21845 PLEASE DO .5 <- :1~'#21760$#21760' DO .5 <- '?"!5~.5'~#3"$#4'~#4 DO (1031) NEXT (1032) DO (1033) NEXT DO (1999) NEXT (1031) DO (1001) NEXT (1033) DO .4 <- .5 DO REINSTATE (1032) PLEASE REINSTATE (1033) DO RETRIEVE :1 + .5 PLEASE RESUME #2 (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3 DO .2 <- #0 DO (1520) NEXT DO STASH :1 PLEASE RETRIEVE .2 DO .1 <- .2 DO .2 <- #0 PLEASE DO (1520) NEXT DO :2 <- :1 DO RETRIEVE .1 + .2 + :1 DO (1550) NEXT PLEASE DO .3 <- :3 DO RETRIEVE :1 + :2 + :3 DO RESUME #1 (1050) PLEASE STASH :2 + :3 + .5 DO :2 <- .1 PLEASE DO (1550) NEXT DO .5 <- :3~'#21760$#21760' DO .5 <- '?"!5~.5'~#3"$#4'~#4 DO (1051) NEXT DO (1999) NEXT (1051) DO (1001) NEXT DO .2 <- :3 PLEASE RETRIEVE :2 + :3 + .5 DO RESUME #2 (1200) DO .2 <- '^.1$.1'~'#0$#21845' DO .3 <- '?"'@.1$#0'~'#0$#21845'"$"'@.1$#65535' ~'#0$#21845'"'~'#0$#21845' DO .2 <- '^.2$"!3$#0'~'#5461$#1'"'~'#0$#21845' DO .3 <- .3~#16384 PLEASE RESUME #1 (1210) DO .2 <- '?"'@.1$#0'~'#0$#21845'"$"'@.1$#65535' ~'#0$#21845'"'~'#0$#21845' DO .3 <- '^.1$.1'~'#0$#21845' DO .2 <- '^.2$".3~#21844"'~'#0$#21845' DO .3 <- .3~#1 PLEASE RESUME #1 (1500) PLEASE ABSTAIN FROM (1502) PLEASE ABSTAIN FROM (1506) (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6 DO .1 <- :1~#21845 PLEASE DO .2 <- :2~#21845 DO (1009) NEXT DO .5 <- .3 PLEASE DO .6 <- .4 DO .1 <- :1~'#21760$#21760' DO .2 <- :2~'#21760$#21760' DO (1009) NEXT DO .1 <- .3 PLEASE DO (1503) NEXT DO .6 <- .4 DO .2 <- #1 DO (1009) NEXT DO .1 <- .3 DO (1501) NEXT (1504) PLEASE RESUME .6 (1503) DO (1504) NEXT (1501) DO .2 <- .5 DO .5 <- '&.6$.4' DO (1505) NEXT (1506) DO (1502) NEXT PLEASE DO (1999) NEXT (1505) DO (1001) NEXT (1502) DO :4 <- .5 DO (1520) NEXT DO :3 <- :1 PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6 DO REINSTATE (1502) DO REINSTATE (1506) PLEASE RESUME #3 (1510) DO STASH :1 + :2 + :4 DO :1 <- "'?#65535$":2~'#21845$#0'"'~'#0$#21845'"$ "'?#65535$":2~'#0$#21845'"'~'#0$#21845'" DO :2 <- #1 DO (1509) NEXT PLEASE RETRIEVE :1 DO :2 <- :3 PLEASE DO (1509) NEXT DO RETRIEVE :2 + :4 PLEASE RESUME #1 (1520) PLEASE STASH .3 + .4 DO .3 <- .1~#17476 DO (1525) NEXT PLEASE DO .4 <- 'V.3$".2~#17476"'~'#0$#21845' DO .3 <- .1~#4369 PLEASE DO (1525) NEXT DO :1 <- .4$"'V.3$".2~#4369"'~'#0$#21845'" PLEASE RETRIEVE .3 + .4 DO RESUME #1 (1525) DO .3 <- '"'"!3$#0'~'#5461$#1'"$#0'~'#5461$#1'"$ #0'~'#1365$#5' PLEASE RESUME #1 (1530) DO STASH :2 + :3 + .1 + .2 + .3 DO :3 <- #0 DO :2 <- .1 DO (1535) NEXT (1535) PLEASE FORGET #1 DO .3 <- '?"!2~.2'~#3"$#4'~#4 DO (1532) NEXT DO .1 <- .2 DO (1210) NEXT DO .3 <- 'V.3$#1'~#1 DO (1531) NEXT DO :1 <- :3 DO (1500) NEXT PLEASE DO (1533) NEXT (1531) PLEASE DO (1534) NEXT (1533) DO FORGET #1 DO :1 <- :2 DO (1700) NEXT DO (1535) NEXT (1534) PLEASE RESUME .3 (1532) DO (1534) NEXT DO :1 <- :3 PLEASE RETRIEVE :2 + :3 + .1 + .2 + .3 DO RESUME #2 (1540) PLEASE ABSTAIN FROM (1541) DO ABSTAIN FROM (1542) (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5 DO .1 <- :1~#21845 PLEASE DO .2 <- :2~'#21760$#21760' DO .5 <- :1~'#21760$#21760' DO (1530) NEXT DO :3 <- :1 DO .2 <- :2~#21845 PLEASE DO (1530) NEXT DO :5 <- :1 DO .1 <- .5 DO (1530) NEXT DO :4 <- :1 PLEASE DO :1 <- ":3~'#21760$#21760'"$":4 ~'#21760$#21760'" DO .5 <- ':1~:1'~#3 DO .2 <- :2~'#21760$#21760' DO (1530) NEXT PLEASE DO .5 <- '"':1~:1'~#3"$.5'~#5 DO .1 <- :3~#21845 DO .2 <- #0 DO (1520) NEXT PLEASE DO :2 <- :1 PLEASE DO .1 <- :4~#21845 DO (1520) NEXT DO (1509) NEXT DO .5 <- !5$"'^":4~#1"$#1'~#1"'~#69 DO :1 <- :3 DO :2 <- :5 DO (1509) NEXT PLEASE DO .5 <- !5$"'^":4~#1"$#1'~#1"'~#1093 DO .5 <- '?"!5~.5'~#1"$#1'~#1 PLEASE RETRIEVE :4 (1541) DO :4 <- .5 DO (1543) NEXT (1542) DO (1544) NEXT PLEASE DO (1999) NEXT (1543) DO (1001) NEXT (1544) DO REINSTATE (1541) PLEASE REINSTATE (1542) PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5 DO RESUME #2 (1550) DO STASH :1 + :1 + :4 + :5 + :6 + .1 + .5 DO :3 <- #0 DO .5 <- '?"':2~:2'~#3"$#4'~#4 PLEASE DO (1551) NEXT DO :4 <- #1 PLEASE DO (1553) NEXT (1553) DO FORGET #1 DO .5 <- '?#0$"'V"'@":2~'#16384$#0'"$#3'~#1"$#2' ~#1"'~#1 DO (1552) NEXT DO :5 <- :2 DO :1 <- :4 PLEASE DO (1700) NEXT DO :4 <- :2 DO :1 <- :5 PLEASE DO (1700) NEXT DO (1553) NEXT (1552) DO (1001) NEXT DO RETRIEVE :1 (1556) PLEASE FORGET #1 DO :6 <- "'&":2~'#21845$#0'"$"'?#65535$":1 ~'#21845$#0'"'~'#0$#21845'"'~'#0$#21845'"$ "'&":2~'#0$#21845'"$"'?#65535$":1~'#0$ #21845'"'~'#0$#21845'"'~'#0$#21845'" DO :6 <- "'?"'V":6~'#21845$#0'"$#21845'~'#0$ #21845'"$#21845'~'#0$#65535'"$"'?"'V":6 ~'#0$#21845'"$#21845'~'#0$#21845'"$#21845' ~'#0$#65535'" DO :5 <- "'?":1~'#21845$#0'"$":2~'#21845$#0'"' ~'#0$#65535'"$"'?":1~'#0$#21845'"$":2~'#0$ #21845'"'~'#0$#65535'" DO .5 <- "?'"':6~:5'~'"'"'&"':5~:5'~'#21845$#0'"$ #16384'~'#0$#21845'"$"'?:5~:5'~'#5461$#0'"' ~'#16384$#5461'"$"'?:5~:5'~'#0$#21845'"'" ~#1'$#2"~#1 DO (1554) NEXT DO :5 <- :3 DO (1510) NEXT PLEASE DO :1 <- :3 DO :3 <- "'^":4~'#21845$#0'"$":5~'#21845$#0'"' ~'#0$#21845'"$"'^":4~'#0$#21845'"$":5~'#0$ #21845'"'~'#0$#21845'" DO (1555) NEXT (1554) PLEASE DO (1001) NEXT (1555) DO FORGET #1 DO .5 <- 'V":4~#1"$"'?#2$":4~#1"'~#1"'~#1 DO (1551) NEXT DO :5 <- :1 DO :1 <- :4 DO :4 <- :2 DO (1710) NEXT DO :1 <- :4 DO :4 <- :2 DO (1710) NEXT DO :1 <- :5 PLEASE DO (1556) NEXT (1551) DO (1001) NEXT PLEASE RETRIEVE :1 + :4 + :5 + :6 + .1 + .5 PLEASE RESUME #2 (1700) PLEASE STASH .2 DO .1 <- :1~'#0$#21845' DO .2 <- :1~'#21845$#0' DO :2 <- "'^.2$.2'~'#0$#21845'"$"'^.1$.1'~'#0$ #21845'" DO .1 <- '?"'@.1$#0'~'#0$#21845'"$"'@.1$#65535' ~'#0$#21845'"'~'#0$#21845' DO .2 <- '?"'@.2$#0'~'#0$#21845'"$"'@.2$#65535' ~'#0$#21845'"'~'#0$#21845' DO :2 <- "'^":2~'#21845$#0'"$.1'~'#0$#21845'"$ "'^":2~'#0$#21845'"$"'.2$#0'~'#5461$#1'"' ~'#0$#21845'" DO .1 <- .2~#16384 PLEASE RETRIEVE .2 PLEASE RESUME #1 (1710) PLEASE STASH :1 + .2 DO .1 <- :1~'#0$#21845' DO .2 <- :1~'#21845$#0' DO :2 <- "'^.2$.2'~'#0$#21845'"$"'^.1$.1'~'#0$ #21845'" DO :1 <- "'?"'@.2$#0'~'#0$#21845'"$"'@.2$#65535' ~'#0$#21845'"'~'#0$#21845'"$"'?"'@.1$#0' ~'#0$#21845'"$"'@.1$#65535'~'#0$#21845'"' ~'#0$#21845'" DO .1 <- :2~#1 DO :2 <- "'^":1~'#21845$#0'"$":2~'#0$#21844'"' ~'#0$#21845'"$"'^":1~'#0$#21845'"$":2 ~'#21845$#0'"'~'#0$#21845'" PLEASE RETRIEVE :1 + .2 PLEASE RESUME #1 (1900) DO STASH .2 + .5 DO .1 <- #0 DO .2 <- #1 PLEASE DO (1901) NEXT (1901) PLEASE FORGET #1 DO %50 .1 <- 'V.1$.2'~'#0$#21845' DO %50 .1 <- '^.1$".2~#43690"'~'#0$#21845' DO .2 <- !2$#0'~'#5461$#1' PLEASE DO .5 <- '^".2~.2"$#1'~#1 DO (1902) NEXT DO (1901) NEXT (1902) DO (1001) NEXT DO RETRIEVE .2 + .5 PLEASE RESUME #2 (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3 DO .3 <- #65524 DO :1 <- #6 DO (1911) NEXT PLEASE NOTE THAT YOU CAN'T GET ANYWHERE FROM HERE (1912) DO (1001) NEXT (1911) DO FORGET #1 PLEASE DO (1900) NEXT DO :2 <- .1 DO (1500) NEXT PLEASE DO :1 <- :3 DO .1 <- .3 DO (1020) NEXT PLEASE DO .3 <- .1 DO .5 <- '?"!3~.3'~#3"$#2'~#1 DO (1912) NEXT DO .1 <- #12 PLEASE DO (1050) NEXT DO RETRIEVE .1 DO (1530) NEXT DO :2 <- #32768 DO (1500) NEXT PLEASE DO .2 <- :3~'#21760$#21760' PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3 DO RESUME #1 intercal-0.30/pit/PaxHeaders.27456/pow.i0000644000000000000000000000007411437550756014576 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.566945757 intercal-0.30/pit/pow.i0000644000175000017500000000200711437550756014470 0ustar00esresr00000000000000 PLEASE WRITE IN .2 DO .1 <- #0 PLEASE COME FROM (1) DO (2040) NEXT DO NOT (2049) NEXT DO READ OUT :1 DO NOT READ OUT .4 (1) DO (1020) NEXT PLEASE GIVE UP (2040) PLEASE STASH .4 DO ABSTAIN FROM (2047) (2049) DO STASH .1 + .2 + :2 + :3 + :4 + :5 + :6 PLEASE DO .4 <- #1 DO :5 <- .1 DO :6 <- #1 DO (2044) NEXT (2047) DO (2048) NEXT DO .1 <- .4 DO (2046) NEXT DO (1999) NEXT (2046) DO (2042) NEXT PLEASE REINSTATE (2047) PLEASE RETRIEVE .4 (2048) DO :1 <- :6 DO RETRIEVE .1 + .2 + :2 + :3 + :4 + :5 + :6 PLEASE RESUME #2 (2044) DO (2045) NEXT (2045) PLEASE FORGET #1 DO .1 <- "?!2~#1'$#1"~#3 DO (2041) NEXT PLEASE DO :1 <- :6 PLEASE DO :2 <- :5 DO (1549) NEXT DO :6 <- :3 DO .4 <- '?"'V.4$":4~#3"'~#4"$#1'~#3 DO (2043) NEXT (2042) PLEASE RESUME .1 (2041) DO (2042) NEXT (2043) PLEASE FORGET #1 DO .2 <- .2~#65534 DO .1 <- '?"!2~.2'~#1"$#2'~#3 DO (2042) NEXT PLEASE DO :1 <- :5 PLEASE DO :2 <- :5 DO (1549) NEXT DO :5 <- :3 DO .4 <- '?"'V.4$":4~#3"'~#4"$#1'~#3 DO (2045) NEXT intercal-0.30/pit/PaxHeaders.27456/icat.i0000644000000000000000000000007411437550756014711 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/icat.i0000644000175000017500000000066511437550756014613 0ustar00esresr00000000000000 PLEASE DO ,1 <- #1 DO .4 <- #0 DO .5 <- #0 DO COME FROM (30) DO WRITE IN ,1 DO .1 <- ,1SUB#1 DO (10) NEXT PLEASE GIVE UP (20) PLEASE RESUME '?.1$#256'~'#256$#256' (10) DO (20) NEXT DO FORGET #1 PLEASE DO .2 <- .4 DO (1000) NEXT DO .4 <- .3~#255 PLEASE DO .3 <- !3~#15'$!3~#240' DO .3 <- !3~#15'$!3~#240' DO .2 <- !3~#15'$!3~#240' PLEASE DO .1 <- .5 DO (1010) NEXT DO .5 <- .2 DO ,1SUB#1 <- .3 (30) PLEASE READ OUT ,1 intercal-0.30/pit/PaxHeaders.27456/fft-tophat.tst0000644000000000000000000000007411437550756016427 xustar0030 atime=1427954558.351140876 30 ctime=1427992235.558945776 intercal-0.30/pit/fft-tophat.tst0000644000175000017500000000334211437550756016324 0ustar00esresr00000000000000ONE ONE TWO EIGHT ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO ONE TWO FIVE OH OH OH OH FIVE ONE ZERO intercal-0.30/pit/PaxHeaders.27456/rot13b.doc0000644000000000000000000000007411437550756015420 xustar0030 atime=1427954558.363140833 30 ctime=1427992235.570945739 intercal-0.30/pit/rot13b.doc0000644000175000017500000000574611437550756015327 0ustar00esresr00000000000000 Newsgroups: alt.folklore.computers,alt.lang.intercal From: clmeier@lili6.lili.uni-bielefeld.de (Clemens Meier) Subject: Re: Duplicated programming language names? Message-ID: Date: Fri, 22 Dec 1995 13:11:11 GMT Organization: Universitaet Bielefeld, Linguistik und Literaturwissenschaft, Germany > Mahlzeit Wohl bekomm's! > > Programming Language (someone wrote an INTERCAL ROT-13 program which > > takes about 4 pages of completely indecipherable code). > > Where can I get it???!!! What? INTERCAL? At the Retrocomputing Museum: http://www.ccil.org/retro/retromuseum.html The ROT-13 program? Exercise is left to the reader. My solution is only slightly bigger than one page and could be further shortened. It is, of course, ROT-13 encoded and has a kind of Welsh touch, IMHO. Happy Chrismas and New Year, or, for Kenneth: Chrismas Year New and Happy! Clemens ---------------------------------------------------------->8--------- QB ,1 <- #1 QB .4 <- #0 QB .5 <- #0 QB PBZR SEBZ (30) QB JEVGR VA ,1 QB .1 <- ,1FHO#1 QB (10) ARKG CYRNFR TVIR HC (20) CYRNFR ERFHZR '?.1$#256'~'#256$#256' (10) QB (20) ARKG QB SBETRG #1 QB .2 <- .4 QB (1000) ARKG QB .4 <- .3~#255 QB (50) ARKG QB .3 <- !3~#15'$!3~#240' QB .3 <- !3~#15'$!3~#240' QB .2 <- !3~#15'$!3~#240' QB .1 <- .5 QB (1010) ARKG QB .5 <- .2 CYRNFR QB ,1FHO#1 <- .3 (30) CYRNFR ERNQ BHG ,1 (50) CYRNFR FGNFU .1 + .2 + .4 + .5 + .11+.12+.13+.14+.15+.16+.17+.18 CYRNFR QB .5 <- .4 CYRNFR QB .1 <- .5 QB .2 <- #65 QB (500) ARKG QB .11 <- .3~#2 QB .2 <- #78 QB (500) ARKG QB .12 <- .3~#2 QB .2 <- #97 QB (500) ARKG QB .13 <- .3~#2 QB .2 <- #110 QB (500) ARKG QB .14 <- .3~#2 CYRNFR QB .2 <- .5 QB .1 <- #77 QB (500) ARKG QB .15 <- .3~#2 QB .1 <- #90 QB (500) ARKG QB .16 <- .3~#2 QB .1 <- #109 QB (500) ARKG QB .17 <- .3~#2 QB .1 <- #122 QB (500) ARKG QB .18 <- .3~#2 CYRNFR QB .1 <- ' "'"!12$.11'~#3"$"!14$.13'~#3"'~#15" $"'"!16$.15'~#3"$"!18$.17'~#3"'~#15" '~#255 CYRNFR QB .1 <- 'I"!&1'~#85"'~#5 QB .2 <- "!1~#2'$!1~#2'"~#3 QB .1 <- !2$.1'~#15 QB .2 <- !2$.2'~#15 QB .2 <- "!1$.2'$!1$"'"I!2$.1'"~#15'"'"~#65535 QB .1 <- .5 CYRNFR QB (1009) ARKG CYRNFR ERGEVRIR .1 + .2 + .4 + .5 + .11+.12+.13+.14+.15+.16+.17+.18 CYRNFR ERFHZR #1 (500) CYRNFR FGNFU .4 QB .3 <- "?!1$.2'"~"#0$#65535" QB .4 <- .3~.3 QB .4 <- '&"!?4'$.4"'~'#0$#65535' QB .3 <- '"'&"!1~.3'$.4"'~'#0$#65535'"~.4' $'"'&"!2~.3'$.4"'~'#0$#65535'"~.4' QB .3 <- "?'"!3~#1'$!3~#2'"$"#1$!3~#1'"'"~#5 CYRNFR ERGEVRIR .4 QB ERFHZR #1 ---------------------------------------------------------->8--------- > I LOVE MY PDP-11/34A! Then you'll be right at home in this group. -- ---------------------------------------------------------------------------- > Wo ist denn der Objoke ??? Clemens Meier Bei Clemens? Nie!! Ok, ok, aber fast nie. clmeier@lili.uni-bielefeld.de GO C+ UL P- L+>++>+++ 3$ E++>+++ N++ R+>+++ G'''' !tv b++ D f? TWERPS+++ intercal-0.30/pit/PaxHeaders.27456/tpk.doc0000644000000000000000000000007411437550756015104 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.574945729 intercal-0.30/pit/tpk.doc0000644000175000017500000000175611437550756015010 0ustar00esresr00000000000000I have made my TPK program available on http://www-cs-faculty.stanford.edu/~knuth/programs.html and I have no objection if you or other people with INTERCAL sites add it to their collection. If you have time to check it out (at least a little), I think you'll see that it introduces a few new hacks that work only on INTERCAL, including DON'T RESUME #1 and REINSTATE NEXTING. Also a way to avoid simple branching by using an array: Suppose you want to set x<-y if and only if z is true. Then keep x in ;X SUB#1 and "shadow x" in ;X SUB#2 and convert z to .Z = 1 if true, 2 if false; then set ;X SUB .Z <- y (no branching). If you have time to look at only a little bit of the program, I recommend the last two subroutines, "CMP" (which is teleprinter code for 23438) and "TIX" (29904). Someday I'll publish clues about what is going on, in my Fun and Games book; the code is filled with jokes that only a true hacker can appreciate.... and I think I've used every non-newfangled feature of the language. intercal-0.30/pit/PaxHeaders.27456/interfunge.tst0000644000000000000000000000007411440130756016505 xustar0030 atime=1427954558.355140857 30 ctime=1427992235.562945764 intercal-0.30/pit/interfunge.tst0000644000175000017500000000350711440130756016405 0ustar00esresr000000000000000#@>. 1#@v>#@,55+"skrow , :DOOG",,,,,,,,,,,,,,1#v:$v>"pud t'nseod : DAB",,,,,,,v v"@.4"@#<.+@,,,,,,,,,,,,,,,,"BAD: : reflects"+55$#v5#.< #5 >:#,_$v#"GGGOOD: : duplicates"+730$<>"OOG">:#,_22#v-#v_19+"0 = 2"v >3.#@$ .^@5v"ro"+820_28+"orez spop kcats ytpme :D"^v"-2 != 0"+550 "eznon spop kcats ytpme :DAB"v "BAD: - reflects"+55< >:#,_v >v v.6_5.@>7.^>+"stcelfer \">" :DAB">:#,_@#:< "BAD: 2"< v"GOOD: | works"+<>#v|>0v >80#@+#^_@ ^55>#0< >:#,_ v#:"GOOD: 8*0 = 0"+5# $< >:#,_v ^550< 5 v"D: # < jumps into <"+5<^ "8*0 != 0"+55< 5v"BAD: | goes the wrong way"5#+5< >"OOG">:#,_12#^\1-#v_8+v5^ "* reflects"+550<^_^>:#,_@#:<"BAD: | reflects"+5< v "GOOD: \ swaps"0# <^ ># <46+"< rev"v>#^*^>" :DAB">:#,_@>#v!1-#v_55+"1 = "v >:#,_1#v`v >"r `" 5> $ ^ "# < jumps o"<^8<> ^"! reflects"+64055+"stce"v>5+"paws t'nseod "v>:#,_^^"7! != 0"+_v#!773<>+"1 =! !0 :DAB"v * v_^#$< ^"23fl"]>^ $<0 "BAD: \"<^ "GOOD: 7! = 0"+<>:#,_^#"GGOO"<>:#,_@#:< >055+"0 =! `10"^>1\`1-#v_55+"1 = `01 :DOOG">:#,_900#vp#vg9-v ^"BAD: "< >" = `10 :DOOG">:#,_^ >55+"1 =! `01 :DAB" 0^ >055+ "stcelfer p" ^ v"difies space"+># 5# < ^00 "900pg doesn't get 9"+55<>5+0 \"stcelfer g" ^ >"om p :DOOG"vv5 5p:+88"^"_,#! #:<"GOOD: 900pg gets 9"+55_^#! < $_,#! #:<>+"ecaps yfidom t'nseod p :DAB">:#,_@v"GOOD: wraparound works"v### # " column 80",:+55_,#! #:"arw :DAB">:#,_@ v"skips"< v "BAD: SGML spaces in Funge-93"+55_^#$\`" !"_,#! #:<"UNDEF: edge # "< "hits"< >:#,_55+"...gnittiuQ"55+".enod si etius tset ygolocyM eht fo noisrev 39-egnufe"v @,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"The B"< intercal-0.30/pit/PaxHeaders.27456/tpk.chk0000644000000000000000000000007411474464744015106 xustar0030 atime=1427954558.371140802 30 ctime=1427992235.574945729 intercal-0.30/pit/tpk.chk0000644000175000017500000000045411474464744015004 0ustar00esresr00000000000000 X cmxcix IX ______ cccxcixCMXCIXDCCCXCVIII VIII cmxcix VII _ VI ______ MMMCXLMDXCI V ____ clviDCCCMMMDCCCLXXXVIII IV ____ clviDCCCMMMDCCXL III cmxcix II __ cccxxMM I ____ CXXVXIX _ M intercal-0.30/pit/PaxHeaders.27456/pass.i0000644000000000000000000000007411437550756014737 xustar0030 atime=1427954558.359140842 30 ctime=1427992235.566945757 intercal-0.30/pit/pass.i0000644000175000017500000001031111437550756014626 0ustar00esresr00000000000000(10) DO NOTHING PLEASE NOTE: Process 1 reads from stdin & copies to the channel PLEASE COME FROM (10) PLEASE COME FROM (20) (20) PLEASE (100) NEXT PLEASE NOTE: Process 2 reads from the channel & copies to stdout PLEASE COME FROM (10) PLEASE COME FROM (30) (30) PLEASE (200) NEXT (100) PLEASE NOTE: Write a message to the message box. DO STASH .1 + .2 DO (101) NEXT PLEASE COME FROM (104) (101) DO FORGET #1 DO .2 <- #1 (102) DO .2 <- #2 ONCE (103) DO (104) NEXT (104) DO (105) NEXT (105) DO RESUME .2 PLEASE COME FROM (103) DO WRITE IN .1 PLEASE NOTE: If .1 is zero, kill both threads DO .2 <- '?"'#0$.1'~'#0$.1'"$#1'~#3 (1) DO (2) NEXT (2) DO (105) NEXT PLEASE COME FROM (1) DO .2 <- '?"'&.1$#1'~'#0$#1'"$#1'~#3 DO (106) NEXT DO REINSTATE (210) DO (107) NEXT (106) DO (105) NEXT DO ABSTAIN FROM (210) (107) DO .2 <- '?"'&.1$#2'~'#0$#2'"$#1'~#3 DO (108) NEXT DO REINSTATE (211) DO (109) NEXT (108) DO (105) NEXT PLEASE ABSTAIN FROM (211) (109) DO .2 <- '?"'&.1$#4'~'#0$#4'"$#1'~#3 DO (110) NEXT DO REINSTATE (212) DO (111) NEXT (110) DO (105) NEXT PLEASE ABSTAIN FROM (212) (111) DO .2 <- '?"'&.1$#8'~'#0$#8'"$#1'~#3 DO (112) NEXT DO REINSTATE (213) DO (113) NEXT (112) DO (105) NEXT PLEASE ABSTAIN FROM (213) (113) DO .2 <- '?"'&.1$#16'~'#0$#16'"$#1'~#3 DO (114) NEXT DO REINSTATE (214) DO (115) NEXT (114) DO (105) NEXT PLEASE ABSTAIN FROM (214) (115) DO .2 <- '?"'&.1$#32'~'#0$#32'"$#1'~#3 DO (116) NEXT DO REINSTATE (215) DO (117) NEXT (116) DO (105) NEXT PLEASE ABSTAIN FROM (215) (117) DO .2 <- '?"'&.1$#64'~'#0$#64'"$#1'~#3 DO (118) NEXT DO REINSTATE (216) DO (119) NEXT (118) DO (105) NEXT PLEASE ABSTAIN FROM (216) (119) DO .2 <- '?"'&.1$#128'~'#0$#128'"$#1'~#3 DO (120) NEXT DO REINSTATE (217) DO (121) NEXT (120) DO (105) NEXT PLEASE ABSTAIN FROM (217) (121) DO .2 <- '?"'&.1$#256'~'#0$#256'"$#1'~#3 DO (122) NEXT DO REINSTATE (218) DO (123) NEXT (122) DO (105) NEXT PLEASE ABSTAIN FROM (218) (123) DO .2 <- '?"'&.1$#512'~'#0$#512'"$#1'~#3 DO (124) NEXT DO REINSTATE (219) DO (125) NEXT (124) DO (105) NEXT PLEASE ABSTAIN FROM (219) (125) DO .2 <- '?"'&.1$#1024'~'#0$#1024'"$#1'~#3 DO (126) NEXT DO REINSTATE (220) DO (127) NEXT (126) DO (105) NEXT PLEASE ABSTAIN FROM (220) (127) DO .2 <- '?"'&.1$#2048'~'#0$#2048'"$#1'~#3 DO (128) NEXT DO REINSTATE (221) DO (129) NEXT (128) DO (105) NEXT PLEASE ABSTAIN FROM (221) (129) DO .2 <- '?"'&.1$#4096'~'#0$#4096'"$#1'~#3 DO (130) NEXT DO REINSTATE (222) DO (131) NEXT (130) DO (105) NEXT PLEASE ABSTAIN FROM (222) (131) DO .2 <- '?"'&.1$#8192'~'#0$#8192'"$#1'~#3 DO (132) NEXT DO REINSTATE (223) DO (133) NEXT (132) DO (105) NEXT PLEASE ABSTAIN FROM (223) (133) DO .2 <- '?"'&.1$#16384'~'#0$#16384'"$#1'~#3 DO (134) NEXT DO REINSTATE (224) DO (135) NEXT (134) DO (105) NEXT PLEASE ABSTAIN FROM (224) (135) DO .2 <- '?"'&.1$#32768'~'#0$#32768'"$#1'~#3 DO (136) NEXT DO REINSTATE (225) DO (137) NEXT (136) DO (105) NEXT PLEASE ABSTAIN FROM (225) (137) DO REINSTATE (202) DO RETRIEVE .1 + .2 PLEASE RESUME #17 (200) PLEASE NOTE: Read from a message box DO STASH .1 + .2 DO (201) NEXT PLEASE COME FROM (204) (201) DO FORGET #1 DO .2 <- #1 (202) DO NOT .2 <- #2 AGAIN (203) DO (204) NEXT (204) DO (205) NEXT (205) DO RESUME .2 PLEASE COME FROM (203) DO .1 <- #0 (210) DO .1 <- 'V.1$#1'~'#0$#65535' (211) DO .1 <- 'V.1$#2'~'#0$#65535' (212) DO .1 <- 'V.1$#4'~'#0$#65535' (213) DO .1 <- 'V.1$#8'~'#0$#65535' (214) DO .1 <- 'V.1$#16'~'#0$#65535' (215) DO .1 <- 'V.1$#32'~'#0$#65535' (216) DO .1 <- 'V.1$#64'~'#0$#65535' (217) DO .1 <- 'V.1$#128'~'#0$#65535' (218) DO .1 <- 'V.1$#256'~'#0$#65535' (219) DO .1 <- 'V.1$#512'~'#0$#65535' (220) DO .1 <- 'V.1$#1024'~'#0$#65535' (221) DO .1 <- 'V.1$#2048'~'#0$#65535' (222) DO .1 <- 'V.1$#4096'~'#0$#65535' (223) DO .1 <- 'V.1$#8192'~'#0$#65535' (224) DO .1 <- 'V.1$#16384'~'#0$#65535' (225) DO .1 <- 'V.1$#32768'~'#0$#65535' DO READ OUT .1 DO RETRIEVE .1 + .2 DO REINSTATE (102) PLEASE RESUME #1 PLEASE NOTE: Giving up PLEASE COME FROM (2) DO REINSTATE (3) (3) DO NOT COME FROM (202) PLEASE GIVE UP intercal-0.30/PaxHeaders.27456/README0000644000000000000000000000007411474545570013702 xustar0030 atime=1427954558.343140896 30 ctime=1427992235.482945984 intercal-0.30/README0000644000175000017500000003545411474545570013610 0ustar00esresr00000000000000= README for C-INTERCAL = == Discredits == This package is an implementation of the language INTERCAL designed by Don Woods and James Lyon, who have since spent decades trying to live it down. This implementation was created by Eric S. Raymond during a fit of lunacy from which he has since mostly recovered. It has been considerably hacked upon and improved by Steve Swales, Michael Ernst, Louis Howell, Brian Raiter, Joris Huizer and others. Alex Smith took over as maintainer from version 0.25 onwards; this release, 0.29, is a unified deforking of C-INTERCAL with Alex Smith and Eric S. Raymond as comaintainers. For detailed credits see NEWS. == Files == The compiler itself is in the src directory. You can choose where to install it with the --prefix argument to configure, or by setting DESTDIR in the Makefile. The doc directory contains (surprise!) documentation, and pit contains various examples of INTERCAL source code, writhing in agony. The files included are: |======================================================================== |README | this file |BUGS | current bug and to-do list |NEWS | info on features and fixes new in this release |HISTORY | Longer-form history of the code tree |COPYING | copyright and licence information |MANIFEST | a list of all files in the distribution |doc/READ.ME | historical notes on the docs |doc/ick.txi | the Revamped Manual sources, a newer manual |doc/fdl-1-2.txi | the GNU FDL version 1.2 in Texinfo format |doc/ick.txt | the Revamped Manual in plain text format |doc/ick.info* | the Revamped Manual in Info format |doc/ickstyle.css | styling rules for the Revamped Manual in HTML |doc/tidy.cfg | HTML tidying rules for the Revamped Manual |doc/fix83.pl | script to fixup the HTML output for 8.3 systems |doc/fixtoc.pl | script to format the manual table of contents |doc/intercal.mm | the old manual in groffable form |doc/Makefile | makefile to build old and new manuals |doc/THEORY.txt | some notes on the internals of the INTERCAL compiler |doc/chipspec.txt | plans for an INTERCAL-based microprocessor |doc/ick.1 | man page for ick |doc/convickt.1 | man page for convickt |src/abcessh.in | template interface to functions linked with programs |src/arrgghh.c | option argument parsing for generated programs |src/bin2c.c | creates C code representations of binary files |src/cesspool.c | the INTERCAL runtime support code |src/clc-cset.c | compatibility code for CLC-INTERCAL character sets |src/convickt.c | command line character set converter |src/cooptsh.in | template for script to help out the -F optimizer |src/dekludge.c | INTERCAL optimizer wrapper and utility functions |src/feh.h | interface to INTERCAL-to-C code generator |src/feh2.c | INTERCAL-to-C code generator |src/fiddle.[ch] | the INTERCAL operators |src/ick-wrap.c | the driver for generated C-from-INTERCAL code |src/ick.h | compilation types and defines |src/ick_bool.h | unified boolean handling |src/ick_ec.[ch] | external call support for INTERCAL |src/ick_lose.[ch] | INTERCAL compile- and run-time error handling |src/idiotism.oil | list of INTERCAL idioms to optimize |src/lexer.l | the lexical analyzer specification (in LEX) |src/numerals.c | numerals table for INTERCAL input |src/oil.y | compiler to translate idiotism.oil into C |src/oil.h | name mangling for OIL files |src/parser.y | the grammar specification (in YACC) |src/perpet.c | main routine for compiler |src/pick1.h | template for compiler-dependent PIC C headers |src/pick2.h | runtime support for compiled PIC-INTERCAL |src/pickwrap.c | the driver for generated PIC C-from-INTERCAL code |src/sizes.h | variables defining the numeric base |src/uncommon.[ch] | code common to the compiler and debugger |src/unravel.c | multithreading functions |src/yuk.[ch] | INTERCAL debugger and profiler |src/*.bin | character set definitions for clc-cset and convickt |prebuilt/parser.[ch] | Prebuilt parser (for systems without bison) |prebuilt/lexer.c | Prebuilt lexer (for systems without flex) |prebuilt/oil-oil.c | Prebuilt OIL compiler (again, for bisonless systems) |etc/intercal.el | elisp for editing INTERCAL code under GNU Emacs |etc/intercal.vim | INTERCAL syntax higlighting information for vim |etc/interfuzz.pl | fuzz-tester for the optimiser |etc/cftoec.sh | script to convert cfunge to a library (see below) |etc/IFFI* | input to that script |etc/cfunge.patch | more input to that script |configure | GNU Autoconf script that generates a Makefile |configure.ac | autoconf source for configure |Makefile.in | template Makefile for compiling C-INTERCAL |Makefile.am | automake source for Makefile.in |buildaux/* | helper scripts and templates used by the build |aclocal.m4 | helper file needed to build the build system itself |pit/* | sample INTERCAL code; see pit/CATALOG |pit/tests/* | INTERCAL code provided specifically for testing |pit/explib/* | source code for expansion libraries |pit/lib/*.i | sample INTERCAL libraries |pit/lib/syslib*.*i | source code for the system libraries |pit/*.doc | documentation for sample INTERCAL code |pit/*.tst | sample inputs for sample INTERCAL code |pit/*.chk | sample outputs for sample INTERCAL code |======================================================================== == How to Get Started == First, note that there is a much fuller manual than this file available. For full information about C-INTERCAL, including extensive installation and usage instructions, see that one; run `info -f doc/ick.info', or failing that read the plain text version at doc/ick.txt. (You can build a variety of other formats as well, such as HTML and PDF, using the Makefile in the doc directory.) After C-INTERCAL is installed, the manual is also available with just `info ick' for information about running ick, the compiler, or `info C-INTERCAL' for the available information about ick and C-INTERCAL. (If you installed C-INTERCAL in a directory that did not contain the main Info documentation tree, instead `info ick' will do what `info C-INTERCAL' should do, and `info C-INTERCAL' will not work at all.) You want a man page? Man pages are for wimps. (However, Debian wrote one anyway, and it's available in the distribution as doc/ick.1.) To compile an INTERCAL program `foo.i' to executable code, just do ick foo.i There are many other useful options available, which used to be listed in this README but it eventually became several long unreadable run-on sentences; interested readers are referred to the Revamped Manual, or to ick -@ (which prints a usage message). Every compiled INTERCAL program also accepts certain options at runtime (code by Steve Swales). These include 'help', 'traditional', and 'wimpmode'. The help option (with either + or -) triggers a usage message. The +traditional option is presently a no-op. Also available are 'printflow', which gives information that may or may not be helpful for debugging a program, and 'mystery', which is deliberately undocumented. Steve writes: "The wimpmode option is the most interesting. I found myself always running my test programs with filters on both ends to work around the \'nifty' INTERCAL number representations. This was so painful that I decided it would be LESS painful (and a lot less code) if I added a \'wimp' option. With the +wimpmode option, the user is subjected to a humiliating message about what a wimp he or she is to use this mode, but after that is allowed to use conventional numerical notation. While such a mode doubtless violates to some extent the INTERCAL philosophy, the fact that a \'unbutcher' command has been posted clearly indicates the need for it. Anyway... if you don't like it, don't use it... the default is -wimpmode (i.e. NOT wimp mode)." == Spreading the Blame == There is an INTERCAL Resource Page at http://www.catb.org/intercal, and another at http://intercal.freeshell.org; http://c.intercal.org.uk contains a few bare-bones details about this compiler in particular. All point at the same C-INTERCAL repository, which lives at git://gitorious.org/intercal/intercal.git; the freeshell page also distributes CLC-INTERCAL, a variant implementation. There is, in addition, an occasionally active USENET newsgroup devoted to the language: alt.lang.intercal. (It is a somewhat unusual newsgroup, as although large numbers of people are known to read it hardly anyone ever writes in it; occasionally someone asks if the newsgroup is dead and gets several responses claiming it isn't. Mostly it's full of C-INTERCAL release notices, and is thus a good way to determine the most recent version of C-INTERCAL.) == Building C-INTERCAL == C-INTERCAL now uses a GNU Autotools-based build system, this is something like the fourth build system that has been tried for it, and hopefully it now works (we've given the build system several interesting twists, of course; for instance, automake dumps things like the prebuilt parser in the root of the distribution by default, which is ugly, so we moved them to the prebuilt directory.) It is possible to build with the straightforward configure/make/ make install routine, just as most other distributed software does; however, this dumps all the generated files into the root of the distribution, which violates the author's sense of aesthetics, and so the recommended approach is to build out-of-tree; create a directory anywhere you like, and run configure from that directory, then make and install there. You can give configure arguments (see configure --help for details); probably the only one you'll want to use is --prefix, which selects the directory to install C-INTERCAL into (--prefix=/usr and --prefix=/usr/local (the default) are both likely choices, but you may want to install into a subdirectory of your home directory to avoid the need for root priveleges). Some previous versions of C-INTERCAL required various information to be specified by the user; the build system now figures this all out for itself, so you can relax and not need to worry (in theory). Building on Windows (via Cygwin) works fine much the same way as builds on POSIX-like systems like Linux, Mac OS X, and BSD; to build on DOS, via DJGPP, use bash as your shell, cd to the buildaux directory, and run the script build-dj.sh, which will set things up appropriately for a DJGPP build, then do the build itself (into a subdirectory "build" of the main build tree); you should use the makefile build/makefile to rebuild from then on, though, rather than rerun the script. I have come across lexes whose default limits for various things aren't high enough to handle INTERCAL's various lexing conundrums. In this case, pay attention to the error messages they give you, and alter the source file src/lexer.l accordingly. This should not happen on most modern systems, as most modern lexers allocate memory dynamically and so can handle source files of any length. If you don't have a lex-like lexer generator or yacc-like parser generator at all, prebuilt versions of the parsers and lexers will be used rather than compiling from scratch. The build now uses your default compiler and compiler options; you can change either of these by specifying them as options to configure (for instance, configure CC=gcc CFLAGS=-O3 -funroll-loops). (You can also set the appropriate environment variables instead.) The default options are -g on all compilers, and also -O2 if you're using gcc, and the default compiler is calculated automatically by configure; note in particular that if you're using a non-gcc compiler you'll have to request optimisation yourself by setting the CFLAGS if you want an optimising build. Although the build system tries to find a good high-resolution timing function to use for profiling, such functions are often system-specific; you may be able to get better profiling output by tinkering with yuk.h to specify a different method of profiling. == Notes on compiling PIC-INTERCAL == PIC C compilers tend to differ substantially in the way they handle various language constructs. As a result, this compiler will only compile to C (not to hex or asm) when compiling a PIC-INTERCAL program. There are two header files, pick1.h and pick2.h in the /src directory; these need to be placed somewhere your compiler can find them, and pick1.h will need to be modified to contain compiler-specific data (like the names of data types and the syntax for specifying the device type, fuses, and various commands). == Notes on the C-INTERCAL / Cfunge external calls system == Code is provided to allow linking of Funge-98 programs to INTERCAL programs; however, this requires a Funge-98 interpreter, which is not present in this distribution. Therefore, in order to do this, a Funge-98 interpreter must first be downloaded and prepared for use with C-INTERCAL. At present, code is only available for linking with 'cfunge', a Funge-98 interpreter written in C. You can get the latest sources for that interpreter from the Internet via the bzr version-control system by running this command: bzr branch lp:cfunge Once you have the source code to cfunge, you can compile it into a library suitable for use by C-INTERCAL by changing to the /etc directory of the C-INTERCAL distribution, and running the cftoec.sh shell script in that directory with the path to the cfunge distribution as an argument. The script will make a copy of cfunge, modify it as required, and then place the resulting library (libick_ecto_b98.a) in the /prebuilt directory of the C-INTERCAL distribution; installing (or reinstalling) C-INTERCAL after that will copy that library into the correct location in your filesystem. For information on actually using this system once you've set it up, consult the Revamped Manual. == Licensing == C-INTERCAL is now distributed under the GNU General Public License version 2 (or at your choice any later version), except for the C skeleton file which is explicitly *not* GPLed in order to avoid the (possibly mythical) "license virus" effect, and the Revamped Manual, which is licenced under the GNU Free Documentation Licence version 1.2. See the file COPYING for details on the General Public License, and the file doc/fdl-1-2.txi (which is also included as a chapter in each of the compiled versions of the documentation, in case you don't feel like reading Texinfo) for information on the GNU Free Documentation Licence.