Move computation of tree size/offset into tree constructor

This commit is contained in:
Max Brunsfeld 2014-06-02 13:32:36 -07:00
parent 868a09b0b0
commit baec9f2c9a
4 changed files with 70 additions and 32 deletions

View file

@ -14,7 +14,7 @@ typedef unsigned short ts_symbol;
typedef struct ts_tree ts_tree;
ts_tree * ts_tree_make_leaf(ts_symbol symbol, size_t size, size_t offset);
ts_tree * ts_tree_make_node(ts_symbol symbol, size_t child_count, size_t immediate_child_count, ts_tree **children, size_t size, size_t offset);
ts_tree * ts_tree_make_node(ts_symbol symbol, size_t child_count, size_t immediate_child_count, ts_tree **children);
ts_tree * ts_tree_make_error(char lookahead_char, size_t expected_input_count, const ts_symbol *expected_inputs, size_t size, size_t offset);
void ts_tree_retain(ts_tree *tree);
void ts_tree_release(ts_tree *tree);