2016-06-04 17:10:50 +02:00
|
|
|
#ifndef __PLASP__PDDL__EXPRESSIONS__PRIMITIVE_TYPE_H
|
|
|
|
#define __PLASP__PDDL__EXPRESSIONS__PRIMITIVE_TYPE_H
|
2016-06-03 17:12:39 +02:00
|
|
|
|
2016-06-04 15:04:18 +02:00
|
|
|
#include <plasp/pddl/ConsistencyException.h>
|
2016-06-03 17:12:39 +02:00
|
|
|
#include <plasp/pddl/Expression.h>
|
|
|
|
#include <plasp/utils/ParserException.h>
|
|
|
|
|
|
|
|
namespace plasp
|
|
|
|
{
|
|
|
|
namespace pddl
|
|
|
|
{
|
|
|
|
namespace expressions
|
|
|
|
{
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// PrimitiveType
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-06-12 22:12:09 +02:00
|
|
|
class PrimitiveType: public ExpressionCRTP<PrimitiveType>
|
2016-06-03 17:12:39 +02:00
|
|
|
{
|
|
|
|
public:
|
2016-06-12 22:12:09 +02:00
|
|
|
static const Expression::Type ExpressionType = Expression::Type::PrimitiveType;
|
|
|
|
|
2016-06-07 13:26:19 +02:00
|
|
|
static void parseDeclaration(Context &context, Domain &domain);
|
|
|
|
static void parseTypedDeclaration(Context &context, Domain &domain);
|
2016-06-03 17:12:39 +02:00
|
|
|
|
2016-06-08 01:08:22 +02:00
|
|
|
static PrimitiveType *parseAndFind(Context &context, Domain &domain);
|
2016-06-03 17:12:39 +02:00
|
|
|
|
|
|
|
public:
|
2016-06-07 13:26:19 +02:00
|
|
|
PrimitiveType();
|
|
|
|
PrimitiveType(std::string name);
|
|
|
|
|
2016-06-03 17:12:39 +02:00
|
|
|
const std::string &name() const;
|
|
|
|
const std::vector<const PrimitiveType *> &parentTypes() const;
|
|
|
|
|
2016-06-04 15:04:18 +02:00
|
|
|
private:
|
2016-06-03 17:12:39 +02:00
|
|
|
void setDirty(bool isDirty = true);
|
|
|
|
bool isDirty() const;
|
|
|
|
|
|
|
|
bool m_isDirty;
|
|
|
|
|
|
|
|
std::string m_name;
|
|
|
|
|
|
|
|
std::vector<const PrimitiveType *> m_parentTypes;
|
|
|
|
};
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|