Removed obsolete functionality.

This commit is contained in:
Patrick Lühne 2016-06-08 00:36:48 +02:00
parent 31fb8ba79b
commit af2f9290c6
3 changed files with 3 additions and 25 deletions

View File

@ -28,8 +28,6 @@ class Domain
public:
void readPDDL();
bool isDeclared() const;
void setName(std::string name);
const std::string &name() const;
@ -65,7 +63,6 @@ class Domain
void parseActionSection();
Context &m_context;
bool m_isDeclared;
std::string m_name;
Requirements m_requirements;

View File

@ -24,8 +24,7 @@ namespace pddl
////////////////////////////////////////////////////////////////////////////////////////////////////
Domain::Domain(Context &context)
: m_context(context),
m_isDeclared{false}
: m_context(context)
{
}
@ -38,13 +37,7 @@ void Domain::readPDDL()
m_context.parser.expect<std::string>("(");
m_context.parser.expect<std::string>("domain");
const auto domainName = m_context.parser.parseIdentifier(isIdentifier);
if (m_name.empty())
m_name = domainName;
// If the domain has previously been referenced, check that the name matches
else if (m_name != domainName)
throw utils::ParserException(m_context.parser, "Domains do not match (\"" + domainName + "\" and \"" + m_name + "\")");
m_name = m_context.parser.parseIdentifier(isIdentifier);
std::cout << "Parsing domain " << m_name << std::endl;
@ -61,15 +54,6 @@ void Domain::readPDDL()
}
computeDerivedRequirements();
m_isDeclared = true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
bool Domain::isDeclared() const
{
return m_isDeclared;
}
////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -138,12 +138,9 @@ void Problem::parseDomainSection()
const auto domainName = m_context.parser.parseIdentifier(isIdentifier);
if (m_domain.isDeclared() && m_domain.name() != domainName)
if (m_domain.name() != domainName)
throw utils::ParserException(m_context.parser, "Domains do not match (\"" + m_domain.name() + "\" and \"" + domainName + "\")");
if (!m_domain.isDeclared())
m_domain.setName(domainName);
m_context.parser.expect<std::string>(")");
}