tree-sitter/include/tree.h

29 lines
591 B
C
Raw Normal View History

2014-01-07 21:50:32 -08:00
#ifndef __tree_sitter_tree_h__
#define __tree_sitter_tree_h__
#ifdef __cplusplus
extern "C" {
#endif
2014-01-11 18:16:52 -08:00
#include <stdlib.h>
2014-01-07 21:50:32 -08:00
typedef size_t TSSymbol;
typedef struct TSTree {
TSSymbol value;
struct TSTree **children;
size_t child_count;
size_t ref_count;
} TSTree;
TSTree * TSTreeMake(TSSymbol value, size_t child_count, TSTree **children);
void TSTreeRetain(TSTree *tree);
void TSTreeRelease(TSTree *tree);
int TSTreeEquals(const TSTree *tree1, const TSTree *tree2);
char * TSTreeToString(const TSTree *tree, const char **names);
#ifdef __cplusplus
}
#endif
#endif