Another batch especially on C ANSI frontend

This commit is contained in:
Godzil
2013-03-18 02:25:39 +01:00
committed by Manoël Trapier
parent 369ec26b03
commit c0cd8650a6
42 changed files with 413 additions and 310 deletions

View File

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