Fixed errors with gcc.

This commit is contained in:
Patrick Lühne 2016-06-14 16:47:11 +02:00
parent 1b83708a6d
commit 2984da773d

View File

@ -95,7 +95,7 @@ void TranslatorASP::translateTypes() const
{ {
const auto typeName = utils::escapeASP(type->name()); const auto typeName = utils::escapeASP(type->name());
printKeyword("type"); this->printKeyword("type");
m_outputStream << "(" << typeName << ")." << std::endl; m_outputStream << "(" << typeName << ")." << std::endl;
const auto &parentTypes = type->parentTypes(); const auto &parentTypes = type->parentTypes();
@ -105,24 +105,24 @@ void TranslatorASP::translateTypes() const
{ {
const auto parentTypeName = utils::escapeASP(parentType->name()); const auto parentTypeName = utils::escapeASP(parentType->name());
printKeyword("inherits"); this->printKeyword("inherits");
m_outputStream << "("; m_outputStream << "(";
printKeyword("type"); this->printKeyword("type");
m_outputStream << "(" << typeName << "), "; m_outputStream << "(" << typeName << "), ";
printKeyword("type"); this->printKeyword("type");
m_outputStream << "(" << parentTypeName << "))." << std::endl; m_outputStream << "(" << parentTypeName << "))." << std::endl;
printKeyword("hasType"); this->printKeyword("hasType");
m_outputStream << "("; m_outputStream << "(";
printVariable("X"); this->printVariable("X");
m_outputStream << ", "; m_outputStream << ", ";
printKeyword("type"); this->printKeyword("type");
m_outputStream << "(" << parentTypeName << ")) :- "; m_outputStream << "(" << parentTypeName << ")) :- ";
printKeyword("hasType"); this->printKeyword("hasType");
m_outputStream << "("; m_outputStream << "(";
printVariable("X"); this->printVariable("X");
m_outputStream << ", "; m_outputStream << ", ";
printKeyword("type"); this->printKeyword("type");
m_outputStream << "(" << typeName << "))." << std::endl; m_outputStream << "(" << typeName << "))." << std::endl;
}); });
}); });
@ -141,7 +141,7 @@ void TranslatorASP::translatePredicates() const
{ {
m_outputStream << std::endl; m_outputStream << std::endl;
printKeyword("predicate"); this->printKeyword("predicate");
m_outputStream << "(" << utils::escapeASP(predicate->name()); m_outputStream << "(" << utils::escapeASP(predicate->name());
this->translateVariablesHead(predicate->arguments()); this->translateVariablesHead(predicate->arguments());
@ -167,7 +167,7 @@ void TranslatorASP::translateActions() const
const auto printActionName = const auto printActionName =
[&](const auto &action) [&](const auto &action)
{ {
printKeyword("action"); this->printKeyword("action");
m_outputStream << "(" << utils::escapeASP(action.name()); m_outputStream << "(" << utils::escapeASP(action.name());
this->translateVariablesHead(action.parameters()); this->translateVariablesHead(action.parameters());
@ -182,7 +182,7 @@ void TranslatorASP::translateActions() const
[&](const auto &ruleHead, const auto &literal) [&](const auto &ruleHead, const auto &literal)
{ {
m_outputStream << std::endl; m_outputStream << std::endl;
printKeyword(ruleHead); this->printKeyword(ruleHead);
m_outputStream << "("; m_outputStream << "(";
printActionName(*action); printActionName(*action);
@ -275,27 +275,27 @@ void TranslatorASP::translateConstants(const std::string &heading, const express
const auto constantName = utils::escapeASP(constant->name()); const auto constantName = utils::escapeASP(constant->name());
m_outputStream << std::endl; m_outputStream << std::endl;
printKeyword("constant"); this->printKeyword("constant");
m_outputStream << "(" << constantName << ")." << std::endl; m_outputStream << "(" << constantName << ")." << std::endl;
const auto *type = constant->type(); const auto *type = constant->type();
if (type != nullptr) if (type != nullptr)
{ {
printKeyword("hasType"); this->printKeyword("hasType");
m_outputStream << "("; m_outputStream << "(";
printKeyword("constant"); this->printKeyword("constant");
m_outputStream << "(" << constantName << "), "; m_outputStream << "(" << constantName << "), ";
printKeyword("type"); this->printKeyword("type");
m_outputStream << "(" << utils::escapeASP(type->name()) << "))." << std::endl; m_outputStream << "(" << utils::escapeASP(type->name()) << "))." << std::endl;
} }
else else
{ {
printKeyword("hasType"); this->printKeyword("hasType");
m_outputStream << "("; m_outputStream << "(";
printKeyword("constant"); this->printKeyword("constant");
m_outputStream << "(" << constantName << "), "; m_outputStream << "(" << constantName << "), ";
printKeyword("type"); this->printKeyword("type");
m_outputStream << "(object))." << std::endl; m_outputStream << "(object))." << std::endl;
} }
}); });
@ -472,7 +472,7 @@ void TranslatorASP::translateInitialState() const
[&](const auto &fact) [&](const auto &fact)
{ {
m_outputStream << std::endl; m_outputStream << std::endl;
printKeyword("initialState"); this->printKeyword("initialState");
m_outputStream << "("; m_outputStream << "(";
// Translate single predicate // Translate single predicate
@ -524,7 +524,7 @@ void TranslatorASP::translateGoal() const
[&](const auto *argument) [&](const auto *argument)
{ {
m_outputStream << std::endl; m_outputStream << std::endl;
printKeyword("goal"); this->printKeyword("goal");
m_outputStream << "("; m_outputStream << "(";
this->translateLiteral(*argument); this->translateLiteral(*argument);