summaryrefslogtreecommitdiff
path: root/tree.h
diff options
context:
space:
mode:
authorVicente <vicente@masba.net>2024-04-02 21:15:25 -0300
committerVicente <vicente@masba.net>2024-04-02 21:15:25 -0300
commit903ff13b3be1c29e35621afcef116329e2da16c8 (patch)
treee36bfa8d6632f53da73832dcfb31bfcb797c3e51 /tree.h
parentf5c501f0c151079a7207ee9b06b779b39e17c55e (diff)
Implemented left recursion descent parser
Diffstat (limited to 'tree.h')
-rw-r--r--tree.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/tree.h b/tree.h
index cf4d825..a58d270 100644
--- a/tree.h
+++ b/tree.h
@@ -1,13 +1,13 @@
enum nodeType {
- BIOP,
- UNOP,
- LTTR
+ BIOP,
+ UNOP,
+ LTTR
};
-typedef struct {
- enum nodeType type;
- char el;
- struct node *child[2];
+typedef struct node {
+ enum nodeType type;
+ char el;
+ struct node *child[2];
} node;
-
-node* parse(const char *str);
+node * parse(char *str);
+void printTree(node *root, int level);