Made all visitors consistent in taking an Context object as an argument.

This commit is contained in:
2016-11-24 00:52:28 +01:00
parent 1103f5cbf1
commit 6af3b7b875
7 changed files with 171 additions and 157 deletions

View File

@@ -6,6 +6,7 @@
#include <clingo.hh>
#include <anthem/Context.h>
#include <anthem/StatementVisitor.h>
namespace anthem
@@ -35,10 +36,12 @@ void translate(const char *fileName, std::istream &stream)
auto fileContent = std::string(std::istreambuf_iterator<char>(stream), {});
Context context;
const auto translateStatement =
[](const Clingo::AST::Statement &statement)
[&context](const Clingo::AST::Statement &statement)
{
statement.data.accept(StatementVisitor(), statement);
statement.data.accept(StatementVisitor(), statement, context);
std::cout << std::endl;
};