#define DEBUG_PARSEDUMP 1
#define DEBUG_CHECKDUMP 2
-#define DEBUG_ALLOCATE 3
+#define DEBUG_EXECUTE 3
+#define DEBUG_ALLOCATE 4
/* cupl.h ends here */
Also, by default, we wrap after three 20-char fields rather than 6, so
as to fit on an 80-column line. Command-line options to change the
line and field widths are available.
+.P
+.H 1 "Command-line options"
+.P
+The -w options sets the line width (default 80).
+.P
+The -f option sets the field width (default 20).
+.P
+The -v option enables debugging output. At level 1, the parse tree is
+prettyprinted. At level 2, definition/reference counts for each
+variable and label are printed after each run. At level 3, an
+execution trace is displayed as the parse tree is printed. At level
+4, each token intern and cons-cell allocation during parsing is also
+dumped.
+
+
+
static void display_return(node *tree, node *left, node *right, value v)
/* display the returned value of a node (for tracing purposes) */
{
- if (verbose >= DEBUG_ALLOCATE)
+ if (verbose >= DEBUG_EXECUTE)
{
(void) printf("eval returns: %x (%-10s of %9x, %9x) ",
tree, tokdump(tree->type), left, right);
int n;
jmp_buf jmpperf;
- if (verbose >= DEBUG_ALLOCATE)
+ if (verbose >= DEBUG_EXECUTE)
(void) printf("eval begins: %x (%-10s of %9x, %9x)\n",
tree, tokdump(tree->type), tree->car, tree->cdr);
/* first, make a pointer from each label to its destination statement */
for_cdr(np, tree)
if (np->car->type == LABEL)
- np->car->car->syminf->target = np;
+ switch (np->car->cdr->type)
+ {
+ case END:
+ break;
+
+ case BLOCK:
+ np->car->car->syminf->target = np;
+ break;
+
+ default:
+ np->car->car->syminf->target = np;
+ break;
+ }
/* figure end addresses */
for_cdr(np, tree)