make sure imex stuff works etc

This commit is contained in:
Justin Hammond 2014-08-31 00:25:42 +08:00
parent fae1ba3c71
commit 21bebc3834
7 changed files with 26 additions and 3 deletions

View file

@ -57,6 +57,7 @@ namespace fl {
static Term* constructor();
bool hasArgs();
void setArgs(std::string param);
std::string getArgs();
private:
std::string arg;
TIME_TYPE type;

View file

@ -62,6 +62,7 @@ namespace fl {
virtual Term* copy() const = 0;
virtual bool hasArgs();
virtual void setArgs(std::string param);
virtual std::string getArgs();
};
}

View file

@ -292,6 +292,17 @@ fl::Engine* engine = new fl::Engine("simple-dimmer");
#endif
std::cout << engine->toString() << std::endl;
Exporter* exporter;
exporter = new JavaExporter;
std::cout << exporter->toString(engine) << std::endl;
#if 0
else if (to == "fld") exporter = new FldExporter(" ", 1024);
else if (to == "fcl") exporter = new FclExporter;
else if (to == "fis") exporter = new FisExporter;
else if (to == "cpp") exporter = new CppExporter;
else if (to == "java") exporter = new JavaExporter;
#endif
} catch (fl::Exception& e) {

View file

@ -188,6 +188,8 @@ namespace fl {
std::string Consequent::toString() const {
std::stringstream ss;
if (m_timer > 0)
ss << "in " << m_timer << " set ";
for (std::size_t i = 0; i < _conclusions.size(); ++i) {
ss << _conclusions.at(i)->toString();
if (i + 1 < _conclusions.size())

View file

@ -42,6 +42,8 @@ namespace fl {
if (term) { //term is NULL if hedge is any
ss << term->getName();
}
if (term->hasArgs())
ss << "(" << term->getArgs() << ")";
return ss.str();
}

View file

@ -39,11 +39,11 @@ namespace fl {
std::string DateTime::parameters() const {
switch (this->type) {
case TIME_GREATERTHAN:
return "Greater Than";
return "TIME_GREATERTHAN";
case TIME_LESSTHAN:
return "Less Than";
return "TIME_LESSTHAN";
case TIME_EQUALTO:
return "Equal To";
return "TIME_EQUALTO";
}
return "Unknown";
}
@ -103,5 +103,8 @@ namespace fl {
throw fl::Exception(ex.str(), FL_AT);
}
}
std::string DateTime::getArgs() {
return this->arg;
}
}

View file

@ -51,4 +51,7 @@ namespace fl {
/* Nothing */
(void)param;
}
std::string Term::getArgs() {
return "";
}
}