my version (CJ)

This commit is contained in:
ceriel
1987-02-25 16:56:31 +00:00
parent cf04776017
commit a5d96ae90f
9 changed files with 146 additions and 55 deletions

View File

@@ -271,9 +271,9 @@ char *tokenname(tk, inst) register tk, inst;
static char c[7];
if (' '<tk && tk<='~')
sprintf(c, "'%c'", tk);
sprint(c, "'%c'", tk);
else
sprintf(c, "'*#%02x'", tk);
sprint(c, "'*#%02x'", tk);
return c;
} else {
switch (tk) {
@@ -284,7 +284,7 @@ char *tokenname(tk, inst) register tk, inst;
return keyname(tk);
case IDENTIFIER:
if (inst) {
sprintf(fake_id, "_%d", ++fake_cnt);
sprint(fake_id, "_%d", ++fake_cnt);
token.t_sval=strcpy(malloc(strlen(fake_id)+1),
fake_id);
return "IDENTIFIER";
@@ -315,7 +315,7 @@ char *tokenname(tk, inst) register tk, inst;
static char qopc[5];
for (i=0; op[i]!=tk; i++) ;
sprintf(qopc, "'%s'", opc[i]);
sprint(qopc, "'%s'", opc[i]);
return qopc;
}
}