Implementacao dos prints
[toypasc.git] / ast.h
blob972cec6ec9f1351ea616acdb16c05b521191c79d
1 #ifndef AST_H
2 #define AST_H
4 #include "base.h"
5 #include "parser.h"
6 #include "symbol_table.h"
8 struct AstNode {
9 char *name;
10 int kind;
11 Type type;
12 Value value;
13 Symbol *symbol;
14 int linenum;
15 struct AstNode* children;
16 struct AstNode* sibling;
19 struct AstNode *ast_node_new(const char* name, int kind, int type,
20 int linenum, Symbol *symbol);
21 void ast_node_destroy(struct AstNode *node);
22 void ast_node_add_child(struct AstNode *node, struct AstNode *child);
23 void ast_node_add_sibling(struct AstNode *node, struct AstNode *sibling);
24 void ast_node_print(struct AstNode *node);
25 void ast_node_print_graph(struct AstNode *node);
27 #endif // AST_H