ack/lang/cem/cemcom.ansi/make.tokcase
1989-11-17 11:27:26 +00:00

41 lines
595 B
Plaintext
Executable file

cat <<'--EOT--'
/* Generated by make.tokcase */
/* $Header$ */
#include "Lpars.h"
char *
symbol2str(tok)
int tok;
{
#define SIZBUF 8
/* allow for a few invocations in f.i. an argument list */
static char buf[SIZBUF];
static int index;
switch (tok) {
--EOT--
sed '
/{[A-Z]/!d
s/.*{\(.*\),.*\(".*"\).*$/ case \1 :\
return \2;/
'
cat <<'--EOT--'
default:
if (tok < 040 || tok >= 0177) {
return "bad token";
}
/* fall through */
case '\n':
case '\f':
case '\v':
case '\r':
case '\t':
index = (index+2) & (SIZBUF-1);
buf[index] = tok;
return &buf[index];
}
}
--EOT--