2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 * Author: Ceriel J.H. Jacobs
8 /* 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 */
10 /* $Id: node.c,v 1.30 1994/06/24 12:41:56 ceriel Exp $ */
25 static int nsubnodes[] = {
44 register t_node *nd = new_node();
46 if (options['R']) nd->nd_flags |= ROPTION;
47 if (options['A']) nd->nd_flags |= AOPTION;
53 dot2node(class, left, right)
56 register t_node *nd = getnode(class);
58 nd->nd_symb = dot.tk_symb;
59 nd->nd_lineno = dot.tk_lineno;
68 register t_node *nd = getnode(class);
71 switch(nsubnodes[class]) {
86 /* Put nodes that are no longer needed back onto the free
90 switch(nsubnodes[nd->nd_class]) {
92 FreeNode(nd->nd_LEFT);
93 FreeNode(nd->nd_RIGHT);
96 FreeNode(nd->nd_NEXT);
106 crash("(NodeCrash) Illegal node");
113 crash("(PNodeCrash) Illegal node");
118 extern char *symbol2str();
131 print("Class: %d; Symbol: %s; Flags: %d\n", nd->nd_class, symbol2str(nd->nd_symb), nd->nd_flags);
135 DumpType(nd->nd_type);
144 indnt(lvl); print("<nilnode>\n");
148 switch(nsubnodes[nd->nd_class]) {
150 PrNode(nd->nd_LEFT, lvl + 1);
151 PrNode(nd->nd_RIGHT, lvl + 1);
154 PrNode(nd->nd_NEXT, lvl + 1);