diff options
Diffstat (limited to 'tree.h')
-rw-r--r-- | tree.h | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -1,3 +1,6 @@ +#ifndef TREE_H_HG +#define TREE_H_HG + enum nodeType { BIOP, UNOP, @@ -7,7 +10,16 @@ enum nodeType { typedef struct node { enum nodeType type; char el; - struct node *child[2]; + union { + struct node *child[2]; + struct { + struct node *lhs, *rhs; + }; + struct node *value; + }; } node; + node * parse(char *str); void printTree(node *root, int level); + +#endif |