mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-14 01:16:19 -04:00
13 lines
438 B
C++
13 lines
438 B
C++
#include "compiler.h"
|
|
#include "prepare_grammar/perform.h"
|
|
#include "build_tables/perform.h"
|
|
#include "generate_code/c_code.h"
|
|
|
|
namespace tree_sitter {
|
|
std::string compile(const Grammar &grammar, std::string name) {
|
|
auto grammars = prepare_grammar::perform(grammar);
|
|
auto tables = build_tables::perform(grammars.first, grammars.second);
|
|
return generate_code::c_code(name, tables.first, tables.second);
|
|
}
|
|
}
|