#
# Utility productions for the INTERCAL distribution
#
-VERSION = 0.17
+VERSION = 0.18
tgz: intercal-$(VERSION).tar.gz
tar: intercal-$(VERSION).tar
NEW IN THIS RELEASE
+ Release 0.18 (by Eric S. Raymond) 04 April 1998
+
+(The following changes are due to John Cowan <cowan@ccil.org>)
+
+1. The source code is now POSIXly correct. By making the POSIX
+variable in the Makefile undefined, you can restore the use of
+<varargs.h>, but otherwise <stdarg.h> 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 <juphoff@tarsier.cv.nrao.edu>.
Redistribution encouraged under GPL\}
.sp
.ce 1
-(This version distributed with C-INTERCAL 0.16)
+(This version distributed with C-INTERCAL 0.18)
.AE
.MT 4
.nr % 0
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 ($).) \}
+money ($), but \*(ct can be used if encoded in Latin-1 as \e0xA2.) \}
.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
\*(no hookworm
^ shark (or simply sharkfin)
\o"#*\(sq" blotch
+.if '\*c'y' \{\
+\*(de bunghole
+\*(rg name grabber
+\*(mu andrew cross
+\*(di norwegian minus
+\*(co text grabber
+\*(sc swash
+\*(*m microscope
+\*(+- interworm
+\*(no half turn
+0xA3 quid binary mingle
+0xA4 zlotnik binary mingle
+\}
.TE \}
.el \{\
.TS
\*(no hookworm
^ shark (or simply sharkfin) unary logical XOR (TriINTERCAL)
\o"#*\(sq" blotch
+.if '\*c'y' \{\
+\*(de bunghole
+\*(rg name grabber
+\*(mu andrew cross
+\*(di norwegian minus
+\*(co text grabber
+\*(sc swash
+\*(*m microscope
+\*(+- interworm
+\*(no half turn
+0xA3 quid binary mingle
+0xA4 zlotnik binary mingle
+\}
.TE \}
.ce 1
Table 2 (top view). INTERCAL character set.
Begin3
Title: intercal
-Version: 0.17
-Entered-date: 27FEB98
+Version: 0.18
+Entered-date: 04APR98
Description: An implementation of the language INTERCAL, legendary for
its perversity and horribleness (this version adds COME FROM
for extra flavor). Comes with language manual and examples
Author: esr@snark.thyrsus.com (Eric S. Raymond)
Maintained-by: esr@snark.thyrsus.com (Eric S. Raymond)
Primary-site: locke.ccil.org /pub/esr
- 166K intercal-0.17.tar.gz
+ 166K intercal-0.18.tar.gz
Platforms: All
Copying-policy: GPL
End
# all over creation behind your back.
# (/dev/null may be another good choice :-))
-DVMT=~/WWW/intercal-0.17
+DVMT=~/WWW/intercal-0.18
#DVMT=/usr/local
+DVMT=/intercal-0.18
BINDIR = $(DVMT)/bin
INCDIR = $(DVMT)/lib
YDEBUG = -vlt
DEBUG = -g -DDEBUG
# DEBUG = -O
+
+# This version (0.18) is POSIX-compliant. You should only set the POSIX
+# variable to null if you *need* to use the old <varargs.h> support;
+# otherwise, the ANSI-compliant <stdarg.h> library will be used.
+
+# POSIX =
+POSIX = -D_POSIX_SOURCE
+
CFLAGS = -I. $(DEBUG) -DICKINCLUDEDIR=\"$(INCDIR)\" \
- -DICKLIBDIR=\"$(LIBDIR)\" -DYYDEBUG
+ -DICKLIBDIR=\"$(LIBDIR)\" -DYYDEBUG $(POSIX)
LDFLAGS =
CC = gcc -Wall -W
#LEX = lex
LEX = flex
-# You can use either yacc or bison
-#YACC = yacc
+# You should use bison, because some yaccs won't work correctly
YACC = bison -y
CSOURCES = ick.y lexer.l feh.c lose.c fiddle.c perpetrate.c
extern void binout(unsigned int type, array *a);
extern unsigned int assign(char *dest, unsigned int type, bool forget,
unsigned int value);
+
+#ifdef _POSIX_SOURCE
+extern char *aref(unsigned int type, ...);
+extern void resize(unsigned int type, ...);
+#else
extern char *aref();
extern void resize();
+#endif
+
extern void stashinit(void);
extern void stash(unsigned int type, unsigned int index, void *from);
extern void retrieve(void *to, int type, unsigned int index, bool forget);
/* LINTLIBRARY */
#include <stdio.h>
#include <stdlib.h>
+
+#ifdef _POSIX_SOURCE
+#include <stdarg.h>
+#else
#include <varargs.h>
+#endif
+
#include "sizes.h"
#include "abcess.h"
#include "lose.h"
/**********************************************************************
*
* The following functions implement the INTERCAL array model
+ * If _POSIX_SOURCE is defined, stdarg is used, otherwise varargs.
*
*********************************************************************/
+
+#ifdef _POSIX_SOURCE
+char *aref(unsigned int type, ...)
+#else
char *aref(va_alist) va_dcl
+#endif
/* return a pointer to the array location specified by args */
{
+#ifndef _POSIX_SOURCE
unsigned int type;
+#endif
array *a;
unsigned int v;
va_list ap;
int address = 0;
unsigned int i;
+#ifdef _POSIX_SOURCE
+ va_start(ap, type);
+#else
va_start(ap);
type = va_arg(ap, unsigned int);
+#endif
a = va_arg(ap, array*);
if (va_arg(ap, unsigned int) != a->rank)
return (char*)&a->data.hybrid[address];
}
+#ifdef _POSIX_SOURCE
+void resize(unsigned int type, ...)
+#else
void resize(va_alist) va_dcl
+#endif
/* resize an array to the given shape */
{
+#ifndef _POSIX_SOURCE
unsigned int type;
+#endif
array *a;
bool forget;
unsigned int i, r, v;
va_list ap;
int prod = 1;
+#ifdef _POSIX_SOURCE
+ va_start(ap, type);
+#else
va_start(ap);
type = va_arg(ap, unsigned int);
+#endif
a = va_arg(ap, array*);
forget = va_arg(ap, bool);
(void) fprintf(fp, " if (");
if (tn->exechance < 100)
(void) fprintf(fp, "roll(%d) && ", tn->exechance);
- (void) fprintf(fp, "!abstained[%d]) {\n", tn - tuples);
+ (void) fprintf(fp, "!abstained[%d]) {\n", (int)(tn - tuples));
}
void emit(tuple *tn, FILE *fp)
case NEXT:
(void) fprintf(fp,
"\tpushnext(%d); goto L%d; N%d:;\n",
- tn - tuples + 1, tn->u.target, tn - tuples + 1);
+ (int)(tn - tuples + 1), tn->u.target, (int)(tn - tuples + 1));
break;
case RESUME:
{
(void) fprintf(fp,
"\n\tfor (i = 0; i < (int)(sizeof(linetype)/sizeof(int)); i++)\n");
- (void) fprintf(fp,
- "\t if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
+ if (np->constant == ABSTAIN || np->constant == REINSTATE) {
+ (void) fprintf(fp,
+ "\t if (linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2]);
+ } else {
+ (void) fprintf(fp,
+ "\t if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
+ }
(void) fprintf(fp,
"\t\tabstained[i] = FALSE;\n");
}
{
(void) fprintf(fp,
"\n\tfor (i = 0; i < (int)(sizeof(linetype)/sizeof(int)); i++)\n");
- (void) fprintf(fp,
- "\t if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
+ if (np->constant == ABSTAIN || np->constant == REINSTATE) {
+ (void) fprintf(fp,
+ "\t if (linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2]);
+ } else {
+ (void) fprintf(fp,
+ "\t if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
+ }
(void) fprintf(fp,
"\t\tabstained[i] = TRUE;\n");
}
\# {return(MESH);}
\$ {return(MINGLE);}
+\xA2 {return(MINGLE);}
+\xA3 {return(MINGLE);}
+\xA4 {return(MINGLE);}
\~ {return(SELECT);}
\& {yylval.numval = AND; return(UNARY);}
* 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 TeX or
+ * Latin-1 format.
+ *
LICENSE TERMS
Copyright (C) 1996 Eric S. Raymond
{ "FOL", 4 },
{ "LUL", 5 },
{ "M\\\"AL", 6 },
+ { "M\0xC4L", 6 }, /* Latin-1 support */
{ "VEL", 7 },
{ "J\\\"OL", 8 },
+ { "J\0xD6L", 8 }, /* Latin-1 support */
{ "Z\\\"UL", 9 },
+ { "Z\0xDCL", 9 }, /* Latin-1 support */
};
/* numeral.c ends here */
/* function created by yacc */
extern int yyparse(void);
+/* getopt declaration */
+int getopt(int, char**, char*);
+
/* compilation options */
bool compile_only; /* just compile into C, don't run the linker */
bool traditional; /* insist on strict INTERCAL-72 conformance */
if (tp->type == NEXT)
(void) fprintf(ofp,
"\tcase %d: goto N%d; break;\n",
- tp-tuples+1, tp-tuples+1);
+ (int)(tp-tuples+1), (int)(tp-tuples+1));
(void) fprintf(ofp, " }");
}
break;