#ifndef H_BINTREE #define H_BINTREE /* $Id: bintree.h,v 1.7 2005/09/03 20:58:15 joshr Exp $ */ #include "tokens.h" /* this is based on the example in Al Kelley and Ira Pohl's */ /* "A Book On C", pages 357-361 */ /* we're using it to hold a parse tree for swish-e */ typedef struct bintree { char *string; /* the string that triggered this token, or NULL */ int token; /* from jqp.tab.h's yytokentype enum, or 0 if none */ struct bintree *left; struct bintree *right; } bintree; struct bintree *init_new_node( char* str, int token, bintree * left_child, bintree * right_child); struct bintree *new_node(); struct bintree *set_string( bintree *, char *str ); struct bintree *free_string( bintree * ); void print_inorder(bintree * root, int indentlevel); #endif