diff --git a/include/anthem/BodyLiteralVisitor.h b/include/anthem/BodyLiteralVisitor.h deleted file mode 100644 index 0b86cb3..0000000 --- a/include/anthem/BodyLiteralVisitor.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef __ANTHEM__BODY_LITERAL_VISITOR_H -#define __ANTHEM__BODY_LITERAL_VISITOR_H - -#include - -namespace anthem -{ - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// -// BodyLiteralVisitor -// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -void throwErrorUnsupportedBodyLiteral(const char *statementType, const Clingo::AST::BodyLiteral &bodyLiteral) -{ - const auto errorMessage = std::string("“") + statementType + "” body literals currently not supported"; - - throwErrorAtLocation(bodyLiteral.location, errorMessage.c_str()); - - throw std::runtime_error(errorMessage); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -struct BodyLiteralVisitor -{ - void visit(const Clingo::AST::Literal &, const Clingo::AST::BodyLiteral &) - { - std::cout << "[literal]" << std::endl; - } - - void visit(const Clingo::AST::ConditionalLiteral &, const Clingo::AST::BodyLiteral &bodyLiteral) - { - throwErrorUnsupportedBodyLiteral("conditional literal", bodyLiteral); - } - - void visit(const Clingo::AST::Aggregate &, const Clingo::AST::BodyLiteral &bodyLiteral) - { - throwErrorUnsupportedBodyLiteral("aggregate", bodyLiteral); - } - - void visit(const Clingo::AST::BodyAggregate &, const Clingo::AST::BodyLiteral &bodyLiteral) - { - throwErrorUnsupportedBodyLiteral("body aggregate", bodyLiteral); - } - - void visit(const Clingo::AST::TheoryAtom &, const Clingo::AST::BodyLiteral &bodyLiteral) - { - throwErrorUnsupportedBodyLiteral("theory atom", bodyLiteral); - } - - void visit(const Clingo::AST::Disjoint &, const Clingo::AST::BodyLiteral &bodyLiteral) - { - throwErrorUnsupportedBodyLiteral("disjoint", bodyLiteral); - } -}; - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -} - -#endif diff --git a/include/anthem/HeadLiteralVisitor.h b/include/anthem/HeadLiteralVisitor.h deleted file mode 100644 index 7da0f60..0000000 --- a/include/anthem/HeadLiteralVisitor.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef __ANTHEM__HEAD_LITERAL_VISITOR_H -#define __ANTHEM__HEAD_LITERAL_VISITOR_H - -#include -#include - -namespace anthem -{ - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// -// HeadLiteralVisitor -// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -void throwErrorUnsupportedHeadLiteral(const char *statementType, const Clingo::AST::HeadLiteral &headLiteral) -{ - const auto errorMessage = std::string("“") + statementType + "” head literals currently unsupported"; - - throwErrorAtLocation(headLiteral.location, errorMessage.c_str()); - - throw std::runtime_error(errorMessage); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -struct HeadLiteralVisitor -{ - void visit(const Clingo::AST::Literal &literal, const Clingo::AST::HeadLiteral &) - { - if (literal.sign != Clingo::AST::Sign::None) - throwErrorAtLocation(literal.location, "only positive literals currently supported"); - - literal.data.accept(LiteralVisitor(), literal); - } - - void visit(const Clingo::AST::Disjunction &, const Clingo::AST::HeadLiteral &headLiteral) - { - // TODO: implement - throwErrorUnsupportedHeadLiteral("disjunction", headLiteral); - } - - void visit(const Clingo::AST::Aggregate &, const Clingo::AST::HeadLiteral &headLiteral) - { - throwErrorUnsupportedHeadLiteral("aggregate", headLiteral); - } - - void visit(const Clingo::AST::HeadAggregate &, const Clingo::AST::HeadLiteral &headLiteral) - { - throwErrorUnsupportedHeadLiteral("head aggregate", headLiteral); - } - - void visit(const Clingo::AST::TheoryAtom &, const Clingo::AST::HeadLiteral &headLiteral) - { - throwErrorUnsupportedHeadLiteral("theory", headLiteral); - } -}; - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -} - -#endif diff --git a/include/anthem/LiteralVisitor.h b/include/anthem/LiteralVisitor.h deleted file mode 100644 index ee631e4..0000000 --- a/include/anthem/LiteralVisitor.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef __ANTHEM__LITERAL_VISITOR_H -#define __ANTHEM__LITERAL_VISITOR_H - -#include -#include - -namespace anthem -{ - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// -// LiteralVisitor -// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -void throwErrorUnsupportedLiteral(const char *statementType, const Clingo::AST::Literal &literal) -{ - const auto errorMessage = std::string("“") + statementType + "” literals currently unsupported"; - - throwErrorAtLocation(literal.location, errorMessage.c_str()); - - throw std::runtime_error(errorMessage); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -struct LiteralVisitor -{ - void visit(const Clingo::AST::Boolean &boolean, const Clingo::AST::Literal &) - { - if (boolean.value == true) - std::cout << "#true"; - else - std::cout << "#false"; - } - - void visit(const Clingo::AST::Term &term, const Clingo::AST::Literal &) - { - term.data.accept(TermVisitor(), term); - } - - void visit(const Clingo::AST::Comparison &, const Clingo::AST::Literal &literal) - { - throwErrorUnsupportedLiteral("comparison", literal); - } - - void visit(const Clingo::AST::CSPLiteral &, const Clingo::AST::Literal &literal) - { - throwErrorUnsupportedLiteral("CSP literal", literal); - } -}; - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -} - -#endif diff --git a/include/anthem/TermVisitor.h b/include/anthem/TermVisitor.h deleted file mode 100644 index 3c96e8f..0000000 --- a/include/anthem/TermVisitor.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __ANTHEM__TERM_VISITOR_H -#define __ANTHEM__TERM_VISITOR_H - -#include - -namespace anthem -{ - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// -// TermVisitor -// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -struct TermVisitor -{ - void visit(const Clingo::Symbol &symbol, const Clingo::AST::Term &) - { - std::cout << symbol; - } - - void visit(const Clingo::AST::Variable &, const Clingo::AST::Term &term) - { - throwErrorAtLocation(term.location, "“variable” terms currently unsupported"); - } - - void visit(const Clingo::AST::UnaryOperation &, const Clingo::AST::Term &term) - { - throwErrorAtLocation(term.location, "“unary operation” terms currently unsupported"); - } - - void visit(const Clingo::AST::BinaryOperation &, const Clingo::AST::Term &term) - { - throwErrorAtLocation(term.location, "“binary operation” terms currently unsupported"); - } - - void visit(const Clingo::AST::Interval &, const Clingo::AST::Term &term) - { - throwErrorAtLocation(term.location, "“interval” terms currently unsupported"); - } - - void visit(const Clingo::AST::Function &function, const Clingo::AST::Term &term) - { - std::cout << "[" << function.name << "]"; - - throwErrorAtLocation(term.location, "“function” terms currently unsupported"); - } - - void visit(const Clingo::AST::Pool &, const Clingo::AST::Term &term) - { - throwErrorAtLocation(term.location, "“pool” terms currently unsupported"); - } -}; - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -} - -#endif