Implemented multi-file input.
This commit is contained in:
@@ -22,7 +22,7 @@ class Description
|
||||
{
|
||||
public:
|
||||
static Description fromStream(std::istream &istream);
|
||||
static Description fromFile(const boost::filesystem::path &path);
|
||||
static Description fromFiles(const std::vector<std::string> &paths);
|
||||
|
||||
public:
|
||||
const Domain &domain() const;
|
||||
|
@@ -30,9 +30,11 @@ class Domain
|
||||
|
||||
bool isDeclared() const;
|
||||
|
||||
void setName(std::string name);
|
||||
const std::string &name() const;
|
||||
|
||||
const Requirements &requirements() const;
|
||||
bool hasRequirement(Requirement::Type requirementType) const;
|
||||
|
||||
expressions::PrimitiveTypes &types();
|
||||
const expressions::PrimitiveTypes &types() const;
|
||||
@@ -52,7 +54,6 @@ class Domain
|
||||
void parseSection();
|
||||
|
||||
void parseRequirementSection();
|
||||
bool hasRequirement(Requirement::Type requirementType) const;
|
||||
void computeDerivedRequirements();
|
||||
|
||||
void parseTypeSection();
|
||||
|
@@ -44,6 +44,8 @@ class Problem
|
||||
bool hasRequirement(Requirement::Type requirementType) const;
|
||||
void computeDerivedRequirements();
|
||||
|
||||
void parseDomainSection();
|
||||
|
||||
void parseObjectSection();
|
||||
|
||||
Context &m_context;
|
||||
|
@@ -21,6 +21,11 @@ class Parser
|
||||
public:
|
||||
explicit Parser(std::istream &istream);
|
||||
|
||||
void setFileName(std::string fileName);
|
||||
const std::string &fileName() const;
|
||||
|
||||
void resetPosition();
|
||||
|
||||
size_t row() const;
|
||||
size_t column() const;
|
||||
|
||||
@@ -60,6 +65,7 @@ class Parser
|
||||
uint64_t parseIntegerBody();
|
||||
|
||||
std::istream &m_istream;
|
||||
std::string m_fileName;
|
||||
std::istreambuf_iterator<char> m_position;
|
||||
|
||||
size_t m_row;
|
||||
@@ -67,7 +73,7 @@ class Parser
|
||||
|
||||
bool m_isCaseSensitive;
|
||||
|
||||
bool m_endOfFile;
|
||||
bool m_atEndOfFile;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@@ -31,7 +31,7 @@ class ParserException: public std::exception
|
||||
}
|
||||
|
||||
explicit ParserException(const utils::Parser &parser, const std::string &message)
|
||||
: m_message{std::to_string(parser.row()) + ":" + std::to_string(parser.column()) + "\t" + message}
|
||||
: m_message{parser.fileName() + ":" + std::to_string(parser.row()) + ":" + std::to_string(parser.column()) + " " + message}
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ class ParserWarning: public std::exception
|
||||
}
|
||||
|
||||
explicit ParserWarning(const utils::Parser &parser, const std::string &message)
|
||||
: m_message{std::to_string(parser.row()) + ":" + std::to_string(parser.column()) + "\t" + message}
|
||||
: m_message{parser.fileName() + ":" + std::to_string(parser.row()) + ":" + std::to_string(parser.column()) + " " + message}
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user