tree-sitter/src/compiler/compile.cpp

14 lines
506 B
C++
Raw Normal View History

#include "tree_sitter/compiler.h"
#include "prepare_grammar/prepare_grammar.h"
#include "build_tables/build_tables.h"
2014-01-11 15:14:17 -08:00
#include "generate_code/c_code.h"
#include "prepared_grammar.h"
2014-01-11 15:14:17 -08:00
namespace tree_sitter {
std::string compile(const Grammar &grammar, std::string name) {
auto grammars = prepare_grammar::prepare_grammar(grammar);
auto tables = build_tables::build_tables(grammars.first, grammars.second);
return generate_code::c_code(name, tables.first, tables.second);
2014-01-11 15:14:17 -08:00
}
}