\r
evaluator = new ArithmeticEvaluator;\r
evaluator->setVariableMarkers("@$");\r
+\r
+ noPatterns = true;\r
}\r
\r
BlockImplementation::BlockImplementation(const QString& _xmlFile, const QString &_referenceXml, const QString &_referenceMd5) {\r
delta = "";\r
referenceXml = _referenceXml;\r
referenceMd5 = _referenceMd5;\r
+\r
+ noPatterns = true;\r
}\r
\r
void BlockImplementation::loadPatterns(QDomElement& root) throw(Exception) {\r
\r
QDomElement eltDelta = patternElt.firstChildElement("delta");\r
delta = eltDelta.attribute("value","none");\r
- \r
+ if (delta == "none") throw(Exception(IMPLFILE_CORRUPTED));\r
+\r
QDomElement eltCons = eltDelta.nextSiblingElement("consumption");\r
\r
QDomNodeList listNodeInput = eltCons.elementsByTagName("input");\r
QDomElement elt = node.toElement(); \r
QString nameStr = elt.attribute("name","none");\r
if (nameStr == "none") throw(Exception(IMPLFILE_CORRUPTED));\r
- QString patternStr = elt.attribute("pattern","none"); \r
+ QString patternStr = elt.attribute("pattern","none");\r
+ if (patternStr == "none") throw(Exception(IMPLFILE_CORRUPTED));\r
consumptionPattern.insert(nameStr,patternStr);\r
}\r
\r
QString nameStr = elt.attribute("name","none");\r
if (nameStr == "none") throw(Exception(IMPLFILE_CORRUPTED));\r
QString patternStr = elt.attribute("pattern","none"); \r
+ if (patternStr == "none") throw(Exception(IMPLFILE_CORRUPTED));\r
productionPattern.insert(nameStr,patternStr); \r
}\r
cout << "patterns summary:" << endl;\r
cout << qPrintable(iterP.key()) << " -> " << qPrintable(iterP.value()) << endl;\r
}\r
cout << "impls patterns read correctly" << endl;\r
+ noPatterns = false;\r
}\r
\r
bool BlockImplementation::checkPatterns() {\r
toWrite << impl.referenceXml;\r
toWrite << impl.referenceMd5;\r
// saving patterns\r
+ toWrite << impl.noPatterns;\r
toWrite << impl.delta;\r
toWrite << impl.consumptionPattern;\r
toWrite << impl.productionPattern;\r
in >> impl.referenceXml;\r
in >> impl.referenceMd5;\r
// loading patterns\r
+ in >> impl.noPatterns;\r
in >> impl.delta;\r
in >> impl.consumptionPattern;\r
in >> impl.productionPattern;\r