27 lines
462 B
C
27 lines
462 B
C
#ifndef lint
|
|
static char sccsid[] = "@(#)token.c 1.1 94/10/31 SMI; from UCB 4.1 82/12/24";
|
|
#endif
|
|
|
|
#include "awk.h"
|
|
struct tok
|
|
{ char *tnm;
|
|
int yval;
|
|
} tok[] = {
|
|
#include "tokendefs"
|
|
};
|
|
ptoken(n)
|
|
{
|
|
if(n<128) printf("lex: %c\n",n);
|
|
else if(n<=256) printf("lex:? %o\n",n);
|
|
else if(n<LASTTOKEN) printf("lex: %s\n",tok[n-257].tnm);
|
|
else printf("lex:? %o\n",n);
|
|
return;
|
|
}
|
|
|
|
char *tokname(n)
|
|
{
|
|
if (n<=256 || n >= LASTTOKEN)
|
|
n = 257;
|
|
return(tok[n-257].tnm);
|
|
}
|