1 /* N O D E O F A N A B S T R A C T P A R S E T R E E */
15 MkNode(class, left, right, token)
16 struct node *left, *right;
19 /* Create a node and initialize it with the given parameters
21 register struct node *nd = new_node();
25 nd->nd_token = *token;
27 nd->nd_type = error_type;
35 register struct node *nd = new_node();
37 nd->nd_left = nd->nd_right = NULLNODE;
38 nd->nd_token = *token;
39 nd->nd_type = error_type;
45 register struct node *nd;
47 /* Put nodes that are no longer needed back onto the free list
50 FreeNode(nd->nd_left);
51 FreeNode(nd->nd_right);
58 crash("Illegal node %d", expp->nd_class);
63 extern char *symbol2str();
72 register struct node *nd;
75 print("Class: %d; Symbol: %s\n", nd->nd_class, symbol2str(nd->nd_symb));
79 DumpType(nd->nd_type);
85 register struct node *nd;
88 indnt(lvl); print("<nilnode>\n");
91 PrNode(nd->nd_left, lvl + 1);
93 PrNode(nd->nd_right, lvl + 1);