SCCS-vsn: usr.bin/pascal/pdx/tree/eval.c 1.7
/* Copyright (c) 1982 Regents of the University of California */
/* Copyright (c) 1982 Regents of the University of California */
-static char sccsid[] = "@(#)eval.c 1.6 %G%";
+static char sccsid[] = "@(#)eval.c 1.7 %G%";
/*
* Parse tree evaluation.
/*
* Parse tree evaluation.
#include "machine.h"
#include "tree.rep"
#include "machine.h"
#include "tree.rep"
+#define Boolean char /* underlying representation type for booleans */
+
/*
* Evaluate a parse tree using a stack; value is left at top.
*/
/*
* Evaluate a parse tree using a stack; value is left at top.
*/
if (!isactive(f)) {
error("\"%s\" is not active", name(f));
}
if (!isactive(f)) {
error("\"%s\" is not active", name(f));
}
- push(int, address(s, NIL));
+ push(long, address(s, NIL));
i = evalindex(p->left->nodetype, popsmall(p->right->nodetype));
i = evalindex(p->left->nodetype, popsmall(p->right->nodetype));
- push(int, n + i*size(p->nodetype));
+ push(long, n + i*size(p->nodetype));
ADDRESS addr, len;
long i;
ADDRESS addr, len;
long i;
if (addr == 0) {
error("reference through nil pointer");
}
if (addr == 0) {
error("reference through nil pointer");
}
- push(BOOLEAN, r0 < r1);
+ push(Boolean, r0 < r1);
- push(BOOLEAN, fr0 < fr1);
+ push(Boolean, fr0 < fr1);
- push(BOOLEAN, r0 <= r1);
+ push(Boolean, r0 <= r1);
- push(BOOLEAN, fr0 <= fr1);
+ push(Boolean, fr0 <= fr1);
- push(BOOLEAN, r0 > r1);
+ push(Boolean, r0 > r1);
- push(BOOLEAN, fr0 > fr1);
+ push(Boolean, fr0 > fr1);
- push(BOOLEAN, r0 == r1);
+ push(Boolean, r0 == r1);
- push(BOOLEAN, fr0 == fr1);
+ push(Boolean, fr0 == fr1);
- push(BOOLEAN, r0 != r1);
+ push(Boolean, r0 != r1);
- push(BOOLEAN, fr0 != fr1);
+ push(Boolean, fr0 != fr1);
- push(BOOLEAN, r0 && r1);
+ push(Boolean, r0 && r1);
- push(BOOLEAN, r0 || r1);
+ push(Boolean, r0 || r1);