From 00ec031cb2ac7b9afda1cda97c91187a7a47e23a Mon Sep 17 00:00:00 2001 From: Pedro Souza Date: Tue, 2 Apr 2024 21:32:43 -0300 Subject: sync --- tree.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tree.h') diff --git a/tree.h b/tree.h index a58d270..8353a6d 100644 --- a/tree.h +++ b/tree.h @@ -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 -- cgit v1.2.3