diff --git a/src/compiler/compile.cc b/src/compiler/compile.cc index 3edcf141..a887c4fc 100644 --- a/src/compiler/compile.cc +++ b/src/compiler/compile.cc @@ -45,25 +45,4 @@ extern "C" TSCompileResult ts_compile_grammar(const char *input) { return { strdup(code.c_str()), nullptr, TSCompileErrorTypeNone }; } -pair 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 diff --git a/src/compiler/compile.h b/src/compiler/compile.h deleted file mode 100644 index 5f182bc0..00000000 --- a/src/compiler/compile.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef COMPILER_COMPILE_H_ -#define COMPILER_COMPILE_H_ - -#include -#include -#include "compiler/compile_error.h" - -namespace tree_sitter { - -struct InputGrammar; - -std::pair compile(const InputGrammar &, std::string); - -} // namespace tree_sitter - -#endif // COMPILER_COMPILE_H_