Simplified handling of unsupported clingo statements.

This commit is contained in:
Patrick Lühne 2017-03-29 21:32:11 +02:00
parent f28873617d
commit 0e5ee59ea7
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -128,69 +128,10 @@ struct StatementVisitor
return formulas; return formulas;
} }
std::vector<ast::Formula> visit(const Clingo::AST::Definition &, const Clingo::AST::Statement &statement, Context &context) template<class T>
std::vector<ast::Formula> visit(const T &, const Clingo::AST::Statement &statement, Context &context)
{ {
throwErrorAtLocation(statement.location, "“definition” statements currently unsupported", context); throwErrorAtLocation(statement.location, "statement currently unsupported, expected rule", context);
return {};
}
std::vector<ast::Formula> visit(const Clingo::AST::ShowSignature &, const Clingo::AST::Statement &statement, Context &context)
{
throwErrorAtLocation(statement.location, "“show signature” statements currently unsupported", context);
return {};
}
std::vector<ast::Formula> visit(const Clingo::AST::ShowTerm &, const Clingo::AST::Statement &statement, Context &context)
{
throwErrorAtLocation(statement.location, "“show term” statements currently unsupported", context);
return {};
}
std::vector<ast::Formula> visit(const Clingo::AST::Minimize &, const Clingo::AST::Statement &statement, Context &context)
{
throwErrorAtLocation(statement.location, "“minimize” statements currently unsupported", context);
return {};
}
std::vector<ast::Formula> visit(const Clingo::AST::Script &, const Clingo::AST::Statement &statement, Context &context)
{
throwErrorAtLocation(statement.location, "“script” statements currently unsupported", context);
return {};
}
std::vector<ast::Formula> visit(const Clingo::AST::External &, const Clingo::AST::Statement &statement, Context &context)
{
throwErrorAtLocation(statement.location, "“external” statements currently unsupported", context);
return {};
}
std::vector<ast::Formula> visit(const Clingo::AST::Edge &, const Clingo::AST::Statement &statement, Context &context)
{
throwErrorAtLocation(statement.location, "“edge” statements currently unsupported", context);
return {};
}
std::vector<ast::Formula> visit(const Clingo::AST::Heuristic &, const Clingo::AST::Statement &statement, Context &context)
{
throwErrorAtLocation(statement.location, "“heuristic” statements currently unsupported", context);
return {};
}
std::vector<ast::Formula> visit(const Clingo::AST::ProjectAtom &, const Clingo::AST::Statement &statement, Context &context)
{
throwErrorAtLocation(statement.location, "“project atom” statements currently unsupported", context);
return {};
}
std::vector<ast::Formula> visit(const Clingo::AST::ProjectSignature &, const Clingo::AST::Statement &statement, Context &context)
{
throwErrorAtLocation(statement.location, "“project signature” statements currently unsupported", context);
return {};
}
std::vector<ast::Formula> visit(const Clingo::AST::TheoryDefinition &, const Clingo::AST::Statement &statement, Context &context)
{
throwErrorAtLocation(statement.location, "“theory definition” statements currently unsupported", context);
return {}; return {};
} }
}; };