2014-07-30 23:40:02 -07:00
|
|
|
#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"
|
2016-02-17 20:41:29 -08:00
|
|
|
#include "runtime/array.h"
|
2014-07-30 23:40:02 -07:00
|
|
|
|
2016-03-07 20:06:46 -08:00
|
|
|
typedef struct ErrorRepair ErrorRepair;
|
|
|
|
|
typedef Array(ErrorRepair) ErrorRepairArray;
|
2016-02-17 14:45:00 -08:00
|
|
|
|
2014-07-30 23:40:02 -07:00
|
|
|
typedef struct {
|
|
|
|
|
TSLexer lexer;
|
2015-09-18 18:04:52 -07:00
|
|
|
Stack *stack;
|
2014-07-30 23:40:02 -07:00
|
|
|
const TSLanguage *language;
|
2016-03-07 20:06:46 -08:00
|
|
|
ErrorRepairArray error_repairs;
|
2015-12-24 22:04:20 -08:00
|
|
|
TSTree *finished_tree;
|
2015-12-09 14:33:54 -08:00
|
|
|
bool is_split;
|
2016-02-23 11:16:50 -08:00
|
|
|
bool print_debugging_graphs;
|
2016-04-24 00:54:20 -07:00
|
|
|
TSTree scratch_tree;
|
2014-07-30 23:40:02 -07:00
|
|
|
} TSParser;
|
|
|
|
|
|
2016-01-18 10:44:49 -08:00
|
|
|
bool ts_parser_init(TSParser *);
|
2014-07-30 23:40:02 -07:00
|
|
|
void ts_parser_destroy(TSParser *);
|
2015-09-08 23:33:43 -07:00
|
|
|
TSDebugger ts_parser_debugger(const TSParser *);
|
2014-10-17 17:52:54 -07:00
|
|
|
void ts_parser_set_debugger(TSParser *, TSDebugger);
|
2015-09-18 23:20:06 -07:00
|
|
|
TSTree *ts_parser_parse(TSParser *, TSInput, TSTree *);
|
2014-07-30 23:40:02 -07:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif // RUNTIME_PARSER_H_
|