Combine TSParser and TSStateMachine objects
My original thought was to decouple the runtime from the LR parser generator by making TSParser a generic interface that LR parsers implement. I think this was more trouble than it was worth.
This commit is contained in:
parent
1c7d2d2d03
commit
9da7663e99
18 changed files with 586 additions and 645 deletions
|
|
@ -41,17 +41,12 @@ typedef struct {
|
|||
size_t bytes_removed;
|
||||
} TSInputEdit;
|
||||
|
||||
typedef struct {
|
||||
const TSTree * (* parse_fn)(void *data, TSInput input, TSInputEdit *edit);
|
||||
void (* free_fn)(void *data);
|
||||
const char **symbol_names;
|
||||
void *data;
|
||||
} TSParser;
|
||||
typedef struct TSParser TSParser;
|
||||
|
||||
typedef struct TSDocument TSDocument;
|
||||
TSDocument * ts_document_make();
|
||||
void ts_document_free(TSDocument *doc);
|
||||
void ts_document_set_parser(TSDocument *doc, TSParser parser);
|
||||
void ts_document_set_parser(TSDocument *doc, TSParser *parser);
|
||||
void ts_document_set_input(TSDocument *doc, TSInput input);
|
||||
void ts_document_set_input_string(TSDocument *doc, const char *text);
|
||||
void ts_document_edit(TSDocument *doc, TSInputEdit edit);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue