2014-02-17 12:53:57 -08:00
|
|
|
#include "tree_sitter/compiler.h"
|
2014-01-11 15:14:17 -08:00
|
|
|
#include "prepare_grammar/perform.h"
|
|
|
|
|
#include "build_tables/perform.h"
|
|
|
|
|
#include "generate_code/c_code.h"
|
2014-02-19 13:36:38 -08:00
|
|
|
#include "prepared_grammar.h"
|
2014-01-11 15:14:17 -08:00
|
|
|
|
|
|
|
|
namespace tree_sitter {
|
2014-01-23 13:44:49 -08:00
|
|
|
std::string compile(const Grammar &grammar, std::string name) {
|
2014-01-11 15:14:17 -08:00
|
|
|
auto grammars = prepare_grammar::perform(grammar);
|
|
|
|
|
auto tables = build_tables::perform(grammars.first, grammars.second);
|
2014-01-25 20:44:02 -08:00
|
|
|
return generate_code::c_code(name, tables.first, tables.second);
|
2014-01-11 15:14:17 -08:00
|
|
|
}
|
|
|
|
|
}
|