Remove unused function

This commit is contained in:
Max Brunsfeld 2017-08-31 15:30:28 -07:00
parent 4a0587061e
commit f8649824fa
2 changed files with 0 additions and 37 deletions

View file

@ -45,25 +45,4 @@ extern "C" TSCompileResult ts_compile_grammar(const char *input) {
return { strdup(code.c_str()), nullptr, TSCompileErrorTypeNone };
}
pair<string, const CompileError> compile(const InputGrammar &grammar,
std::string name) {
auto prepare_grammar_result = prepare_grammar::prepare_grammar(grammar);
const SyntaxGrammar &syntax_grammar = get<0>(prepare_grammar_result);
const LexicalGrammar &lexical_grammar = get<1>(prepare_grammar_result);
CompileError error = get<2>(prepare_grammar_result);
if (error.type) return { "", error };
auto table_build_result =
build_tables::build_tables(syntax_grammar, lexical_grammar);
const ParseTable &parse_table = get<0>(table_build_result);
const LexTable &lex_table = get<1>(table_build_result);
error = get<2>(table_build_result);
if (error.type) return { "", error };
string code = generate_code::c_code(name, parse_table, lex_table,
syntax_grammar, lexical_grammar);
return { code, CompileError::none() };
}
} // namespace tree_sitter

View file

@ -1,16 +0,0 @@
#ifndef COMPILER_COMPILE_H_
#define COMPILER_COMPILE_H_
#include <string>
#include <utility>
#include "compiler/compile_error.h"
namespace tree_sitter {
struct InputGrammar;
std::pair<std::string, CompileError> compile(const InputGrammar &, std::string);
} // namespace tree_sitter
#endif // COMPILER_COMPILE_H_