register struct nmlist *cs;
int p, ps, os, xo = 0, *xop;
/*char *svtree;*/
- static struct tconst garbage = { CON, INT, (int *)NULL, (union str *)NULL, 0 };
+ static struct cnode garbage = { CON, INT, (int *)NULL, (union str *)NULL, 0 };
/*svtree = starttree();*/
op = opst;
case FCON:
/* *cp++ = fblock(DOUBLE, copnum(cval));*/
- *cp = (union tree *)Tblock(sizeof(struct ftconst));
+ *cp = (union tree *)Tblock(sizeof(struct fnode));
(*cp)->f.op = FCON;
(*cp)->f.type = DOUBLE;
(*cp)->f.value = isn1++;
goto tand;
case LCON:
- *cp = (union tree *)Tblock(sizeof(struct lconst));
+ *cp = (union tree *)Tblock(sizeof(struct lnode));
(*cp)->l.op = LCON;
(*cp)->l.type = LONG;
(*cp)->l.lvalue = lcval;
cs->hoffset = cval;
#if 1 /* one-pass version */
/* really should change this to use nblock and fill in nmlist above better */
- *cp = (union tree *)Tblock(sizeof(struct tname));
+ *cp = (union tree *)Tblock(sizeof(struct nnode));
(*cp)->n.op = NAME;
(*cp)->n.type = unscflg? ARRAY+UNCHAR:ARRAY+CHAR;
(*cp)->n.subsp = &nchstr;
/* this would then be decoded by c1 as follows: */
/* t = geti(); */
/* if (t==EXTERN) { */
- /* tp = getblk(sizeof(struct xtname)); */
+ /* tp = getblk(sizeof(struct xnode)); */
/* tp->t.type = geti(); */
/* outname(s); */
/* tp->x.name = (char *)getblk(strlen(s) + 1); */
/* strcpy(tp->x.name, s); */
/* } else { */
- /* tp = getblk(sizeof(struct tname)); */
+ /* tp = getblk(sizeof(struct nnode)); */
/* tp->t.type = geti(); */
/* tp->n.nloc = geti(); */
/* } */
/* tp->n.offset = 0; */
union tree *tp;
if (ds->hclass == EXTERN) {
- tp = (union tree *)Tblock(sizeof(struct xtname));
+ tp = (union tree *)Tblock(sizeof(struct xnode));
/*fprintf(stderr, "nblock xtname %p\n", tp);*/
tp->x.name = Tblock((strlen(ds->name)+2+LNCPW-1) & ~(LNCPW-1));
tp->x.name[0] = '_';
strcpy(tp->x.name + 1, ds->name);
}
else {
- tp = (union tree *)Tblock(sizeof(struct tname));
+ tp = (union tree *)Tblock(sizeof(struct nnode));
/*fprintf(stderr, "nblock tname %p\n", tp);*/
tp->n.nloc = ds->hoffset;
}
register union tree *p;
/*fprintf(stderr, "cblock(0%06o)\n", v & 0177777);*/
- p = (union tree *)Tblock(sizeof(struct tconst));
+ p = (union tree *)Tblock(sizeof(struct cnode));
p->c.op = CON;
p->c.type = INT;
p->c.subsp = NULL;
/*union tree *fblock(t, string) int t; char *string; {
register union tree *p;
- p = (union tree *)Tblock(sizeof(struct ftconst));
+ p = (union tree *)Tblock(sizeof(struct fnode));
p->f.op = FCON;
p->f.type = t;
p->f.subsp = NULL;
extern char *opntab[];
extern int nstack;
extern int nfloat;
-extern struct tname sfuncr;
+extern struct nnode sfuncr;
extern char *funcbase;
extern char *curbase;
extern char *coremax;
-extern struct tconst czero, cone;
+extern struct cnode czero, cone;
extern long totspace;
extern int regpanic; /* set when SU register alg. fails */
extern int panicposs; /* set when there might be need for regpanic */
LESSEQ, GREATP, GREATQP, LESSP, LESSEQP
};
-struct tconst czero = { CON, INT, 0/*subsp*/, 0/*strp*/, 0};
-struct tconst cone = { CON, INT, 0/*subsp*/, 0/*strp*/, 1};
+struct cnode czero = { CON, INT, 0/*subsp*/, 0/*strp*/, 0};
+struct cnode cone = { CON, INT, 0/*subsp*/, 0/*strp*/, 1};
-struct tname sfuncr = { NAME, STRUCT, 0/*subsp*/, 0/*strp*/, 0/*tr1*/, STATIC, 0, 0, 0 };
+struct nnode sfuncr = { NAME, STRUCT, 0/*subsp*/, 0/*strp*/, 0/*tr1*/, STATIC, 0, 0, 0 };
struct table *cregtab;
int nreg = 3;
union tree *ncopy(p) register union tree *p; {
register union tree *q;
- q = getblk(sizeof(struct xtname));
+ q = getblk(sizeof(struct xnode));
q->n.op = p->n.op;
q->n.type = p->n.type;
q->n.class = p->n.class;
case NAME:
t = va_arg(argp, int) /*geti()*/;
if (t==EXTERN) {
- tp = getblk(sizeof(struct xtname));
+ tp = getblk(sizeof(struct xnode));
tp->t.type = va_arg(argp, int) /*geti()*/;
outname(s/*)*/, va_arg(argp, char *));
tp->x.name = (char *)getblk(strlen(s) + 1);
strcpy(tp->x.name, s);
} else {
- tp = getblk(sizeof(struct tname));
+ tp = getblk(sizeof(struct nnode));
tp->t.type = va_arg(argp, int) /*geti()*/;
tp->n.nloc = va_arg(argp, int) /*geti()*/;
}
*sp++ = tnode1(ITOL, LONG, tconst(op, INT), TNULL);
break;
}
- tp = getblk(sizeof(struct lconst));
+ tp = getblk(sizeof(struct lnode));
tp->t.op = LCON;
tp->t.type = LONG;
tp->l.lvalue = ((_LONG)t<<16) + UNS(op); /* nonportable */
case FCON:
t = va_arg(argp, int) /*geti()*/;
outname(s/*)*/, va_arg(argp, char *));
- tp = getblk(sizeof(struct ftconst));
+ tp = getblk(sizeof(struct fnode));
tp->t.op = FCON;
tp->t.type = t;
tp->f.value = isn1++;
case ITOL:
if (subtre->t.op==CON && subtre->t.type==INT && subtre->c.value<0) {
- subtre = getblk(sizeof(struct lconst));
+ subtre = getblk(sizeof(struct lnode));
subtre->t.op = LCON;
subtre->t.type = LONG;
subtre->l.lvalue = tree->t.tr1->c.value;
case LTOF:
if (subtre->t.op==LCON) {
- tree = getblk(sizeof(struct ftconst));
+ tree = getblk(sizeof(struct fnode));
tree->t.op = FCON;
tree->t.type = DOUBLE;
tree->f/*c*/.value = isn1++;
case ITOF:
if (subtre->t.op==CON) {
- tree = getblk(sizeof(struct ftconst));
+ tree = getblk(sizeof(struct fnode));
tree->t.op = FCON;
tree->t.type = DOUBLE;
tree->f.value = isn1++;
}
if (subtre->t.op==ITOL) {
if (subtre->t.tr1->t.op==CON) {
- tree = getblk(sizeof(struct lconst));
+ tree = getblk(sizeof(struct lnode));
tree->t.op = LCON;
tree->t.type = LONG;
if (uns(subtre->t.tr1))
return(subtre);
}
if (subtre->t.op==ITOL && subtre->t.tr1->t.op==CON) {
- tree = getblk(sizeof(struct lconst));
+ tree = getblk(sizeof(struct lnode));
tree->t.op = LCON;
tree->t.type = LONG;
if (uns(subtre->t.tr1))
lp->l.lvalue = l;
return(lp);
}
- lp = getblk(sizeof(struct lconst));
+ lp = getblk(sizeof(struct lnode));
lp->t.op = LCON;
lp->t.type = LONG;
lp->l.lvalue = l;
union tree *tconst(val, type) int val; int type; {
register union tree *p;
- p = getblk(sizeof(struct tconst));
+ p = getblk(sizeof(struct cnode));
p->t.op = CON;
p->t.type = type;
p->c.value = val;
/*
* tree names for locals
*/
-struct tname {
+struct nnode {
int op;
int type;
int *subsp; /* subscript list for arrays; pass 0 only */
/*
* tree names for externals
*/
-struct xtname {
+struct xnode {
int op;
int type;
int *subsp; /* subscript list for arrays; pass 0 only */
/*
* short constants
*/
-struct tconst {
+struct cnode {
int op;
int type;
int *subsp; /* subscript list for arrays; pass 0 only */
/*
* long constants
*/
-struct lconst {
+struct lnode {
int op;
int type;
int *subsp; /* subscript list for arrays; pass 0 only */
/*
* Floating constants
*/
-struct ftconst {
+struct fnode {
int op;
int type;
int *subsp; /* subscript list for arrays; pass 0 only */
union tree {
struct tnode t;
- struct tname n; /* pass 1 only */
- struct xtname x; /* pass 1 only */
- struct tconst c;
- struct lconst l;
- struct ftconst f;
+ struct nnode n; /* pass 1 only */
+ struct xnode x; /* pass 1 only */
+ struct cnode c;
+ struct lnode l;
+ struct fnode f;
struct fasgn F; /* pass 1 only */
};