cinc/ast.h

27 lines
494 B
C
Raw Normal View History

2018-09-09 17:31:02 -05:00
//
// ast.h
// cinc
//
// Created by Peter Terpstra on 9/9/18.
// Copyright © 2018 Peter Terpstra. All rights reserved.
//
#ifndef ast_h
#define ast_h
struct _astnode {
const char* data;
int num_children;
int max_children;
struct _astnode** children;
};
typedef struct _astnode AstNode;
AstNode* make_node(const char* data);
void add_child(AstNode* parent,AstNode* child);
2018-09-09 18:08:00 -05:00
void print_tree(AstNode* root,int tabLevel);
2018-09-09 17:31:02 -05:00
void free_tree(AstNode* root);
#endif /* ast_h */