Refactor parser header

Make separate lexer, stack and parser structs.
This commit is contained in:
Max Brunsfeld 2014-03-13 00:43:23 -07:00
parent 05a5f9c124
commit 0dc3a95d0c
11 changed files with 361 additions and 276 deletions

10
src/runtime/parser.c Normal file
View file

@ -0,0 +1,10 @@
#include "tree_sitter/runtime.h"
const ts_tree * ts_parser_parse(ts_parser *parser, ts_input input) {
return parser->parse_fn(parser->data, input);
}
void ts_parser_free(ts_parser *parser) {
if (parser->free_fn != NULL)
parser->free_fn(parser->data);
}