/* ** GEN816.C ** ** by Toshiyasu Morita ** ** Started: 10/26/93 @ 10:56 pm */ #include #include typedef struct NODE_STRUCT_TAG { struct NODE_STRUCT_TAG *parent, *kids[2]; char text[16]; } NODE_STRUCT; /************************************* * Start tree functions *************************************/ /* ** Allocate node */ NODE_STRUCT *Allocate_Node(char *string, NODE_STRUCT *parent, int kid_num) { NODE_STRUCT *new_node; new_node = malloc(sizeof(NODE_STRUCT)); assert(new_node != 0); new_node->parent = parent; parent->kids[kid_num] = new_node; strncpy(&new_node->text, string, sizeof(new_node->text)); return new_node; } /************************************* * End tree functions *************************************/ /************************************* * Start input handling functions *************************************/ char *line_p; void Debug_Print_Op(char *text, int num) { int i; for (i=0; i