tree-sitter/src/runtime/parser.h

32 lines
616 B
C
Raw Normal View History

#ifndef RUNTIME_PARSER_H_
#define RUNTIME_PARSER_H_
#ifdef __cplusplus
extern "C" {
#endif
2015-09-18 18:04:52 -07:00
#include "runtime/stack.h"
#include "runtime/vector.h"
typedef struct {
TSLexer lexer;
2015-09-18 18:04:52 -07:00
Stack *stack;
const TSLanguage *language;
Vector lookahead_states;
2015-11-20 00:01:53 -08:00
Vector reduce_parents;
2015-12-24 22:04:20 -08:00
TSTree *finished_tree;
bool is_split;
} TSParser;
TSParser ts_parser_make();
void ts_parser_destroy(TSParser *);
TSDebugger ts_parser_debugger(const TSParser *);
void ts_parser_set_debugger(TSParser *, TSDebugger);
TSTree *ts_parser_parse(TSParser *, TSInput, TSTree *);
#ifdef __cplusplus
}
#endif
#endif // RUNTIME_PARSER_H_