#ifdef PARSEDEBUG
if (verbose >= DEBUG_ALLOCATE)
- (void) printf("intern: %9x (IDENTIFIER: %s)\n",
+ (void) printf("intern: %p (IDENTIFIER: %s)\n",
new, str);
#endif /* PARSEDEBUG */
#ifdef PARSEDEBUG
if (verbose >= DEBUG_ALLOCATE)
- (void) printf("intern: %9x (NUMBER: %f)\n", new, numval);
+ (void) printf("intern: %p (NUMBER: %f)\n", new, numval);
#endif /* PARSEDEBUG */
return(new);
}
#ifdef PARSEDEBUG
if (verbose >= DEBUG_ALLOCATE)
- (void) printf("intern: %9x (STRING: '%s')\n",
+ (void) printf("intern: %p (STRING: '%s')\n",
new, new->u.string);
#endif /* PARSEDEBUG */
#include <stdio.h>
#include <string.h>
#include <setjmp.h>
+#include <stdlib.h>
#ifdef PARSEDEBUG
static int statement_count;
/* keywords */
%token ABS ALL ALLOCATE AND ATAN BLOCK BY COMMENT COS DEC DET DOT ELSE END EXP
%token FLOOR FOR GE GO GT IDN IF INC INV LE LET LN LOG LT MAX MIN NE OR PERFORM
-%token POSMAX POSMIN RAND READ SGM SIN SQRT STOP THEN TIMES TITLE TO TRC TRN
+%token POSMAX POSMIN RAND READ SGM SIN SQRT STOP THEN TIMES TO TRC TRN
%token UNTIL WATCH WHILE WRITE DATA
%token <node> POWER
#ifdef PARSEDEBUG
if (verbose >= DEBUG_ALLOCATE)
- (void) printf("cons: %9x -> %9x %9x (%s)\n",
+ (void) printf("cons: %p -> %p %p (%s)\n",
new, left, right, tokdump(op));
#endif /* PARSEDEBUG */
{
if (verbose >= DEBUG_EXECUTE)
{
- (void) printf("eval returns: %x (%-10s of %9x, %9x) ",
+ (void) printf("eval returns: %p (%-10s of %p, %p) ",
tree, tokdump(tree->type), left, right);
if (RELATION(tree->type))
static void cupl_assign(node *to, value from)
/* assign result of the expression at the cdr to the identifier at the cdr */
{
- static value cupl_eval(node *);
+ value cupl_eval(node *tree);
deallocate_value(&(to->syminf->value));
to->syminf->value = from;
}
}
-static value cupl_eval(node *tree)
+value cupl_eval(node *tree)
/* recursively evaluate a CUPL parse tree */
{
node *pc; /* pointer to statement being evaluated */
int n;
if (verbose >= DEBUG_EXECUTE)
- (void) printf("eval begins: %x (%-10s of %9x, %9x)\n",
+ (void) printf("eval begins: %p (%-10s of %p, %p)\n",
tree, tokdump(tree->type), tree->car, tree->cdr);
switch(tree->type)
for (pc = tree->car; pc; pc = next)
{
if (verbose >= DEBUG_EXECUTE)
- (void) printf("statement %2d: %x (%-10s of %9x, %9x)\n",
+ (void) printf("statement %2d: %p (%-10s of %p, %p)\n",
pc->number, pc, tokdump(pc->type), pc->car, pc->cdr);
switch (pc->car->type)
*****************************************************************************/
/*LINTLIBRARY*/
#include <stdio.h>
+#include <stdlib.h>
#include "cupl.h"
#include "tokens.h"
(void) printf("%-20s", tokdump(tree->type));
if (verbose >= DEBUG_EXECUTE)
- (void) printf(" (%x -> %x, %x)",
+ (void) printf(" (%p -> %p, %p)",
tree,
tree->car,
tree->cdr);