2014-02-16 22:13:08 -08:00
|
|
|
#include "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"
|
|
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|