2018-05-09 16:38:56 -07:00
|
|
|
#ifndef RUNTIME_TREE_CURSOR_H_
|
|
|
|
|
#define RUNTIME_TREE_CURSOR_H_
|
|
|
|
|
|
2018-05-10 15:11:14 -07:00
|
|
|
#include "runtime/subtree.h"
|
2018-05-09 16:38:56 -07:00
|
|
|
|
|
|
|
|
typedef struct {
|
2018-05-11 15:06:13 -07:00
|
|
|
const Subtree *subtree;
|
2018-05-09 16:38:56 -07:00
|
|
|
Length position;
|
|
|
|
|
uint32_t child_index;
|
|
|
|
|
uint32_t structural_child_index;
|
|
|
|
|
} TreeCursorEntry;
|
|
|
|
|
|
2018-05-16 16:05:08 -07:00
|
|
|
typedef struct {
|
2018-05-09 16:38:56 -07:00
|
|
|
Array(TreeCursorEntry) stack;
|
2018-05-16 16:05:08 -07:00
|
|
|
const TSTree *tree;
|
|
|
|
|
} TreeCursor;
|
2018-05-09 16:38:56 -07:00
|
|
|
|
2018-05-16 16:05:08 -07:00
|
|
|
void ts_tree_cursor_init(TreeCursor *, const TSTree *);
|
2018-05-09 16:38:56 -07:00
|
|
|
|
|
|
|
|
#endif // RUNTIME_TREE_CURSOR_H_
|