diff options
author | Vicente <vicente@masba.net> | 2024-04-02 21:15:25 -0300 |
---|---|---|
committer | Vicente <vicente@masba.net> | 2024-04-02 21:15:25 -0300 |
commit | 903ff13b3be1c29e35621afcef116329e2da16c8 (patch) | |
tree | e36bfa8d6632f53da73832dcfb31bfcb797c3e51 /tree.h | |
parent | f5c501f0c151079a7207ee9b06b779b39e17c55e (diff) |
Implemented left recursion descent parser
Diffstat (limited to 'tree.h')
-rw-r--r-- | tree.h | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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); |