diff options
author | Stefan Radomski <github@mintwerk.de> | 2016-10-25 11:59:18 (GMT) |
---|---|---|
committer | Stefan Radomski <github@mintwerk.de> | 2016-10-25 11:59:18 (GMT) |
commit | 954a1eb75f2abc81da1e09701d700674f0baddfb (patch) | |
tree | 873eb6412e958ecd53214ddbd6a3e17465da5100 /src/uscxml/interpreter/BasicContentExecutor.cpp | |
parent | 1a1513c6497e8818eb2a92a8fbf77d4c60bc911e (diff) | |
download | uscxml-954a1eb75f2abc81da1e09701d700674f0baddfb.zip uscxml-954a1eb75f2abc81da1e09701d700674f0baddfb.tar.gz uscxml-954a1eb75f2abc81da1e09701d700674f0baddfb.tar.bz2 |
Worked on PROMELA transformation
Diffstat (limited to 'src/uscxml/interpreter/BasicContentExecutor.cpp')
-rw-r--r-- | src/uscxml/interpreter/BasicContentExecutor.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/uscxml/interpreter/BasicContentExecutor.cpp b/src/uscxml/interpreter/BasicContentExecutor.cpp index f85e2b8..9f58b46 100644 --- a/src/uscxml/interpreter/BasicContentExecutor.cpp +++ b/src/uscxml/interpreter/BasicContentExecutor.cpp @@ -210,7 +210,7 @@ void BasicContentExecutor::processCancel(XERCESC_NS::DOMElement* content) { void BasicContentExecutor::processIf(XERCESC_NS::DOMElement* content) { bool blockIsTrue = _callbacks->isTrue(ATTR(content, "cond")); - for (auto childElem = content->getFirstElementChild(); childElem; childElem = childElem->getNextElementSibling()) { + for (auto childElem = content->getFirstElementChild(); childElem; childElem = childElem->getNextElementSibling()) { if (iequals(TAGNAME(childElem), XML_PREFIX(content).str() + "elseif")) { if (blockIsTrue) { // last block was true, break here @@ -252,7 +252,7 @@ void BasicContentExecutor::processForeach(XERCESC_NS::DOMElement* content) { for (uint32_t iteration = 0; iteration < iterations; iteration++) { _callbacks->setForeach(item, array, index, iteration); - for (auto childElem = content->getFirstElementChild(); childElem; childElem = childElem->getNextElementSibling()) { + for (auto childElem = content->getFirstElementChild(); childElem; childElem = childElem->getNextElementSibling()) { process(childElem, XML_PREFIX(content)); } } @@ -285,7 +285,7 @@ void BasicContentExecutor::process(XERCESC_NS::DOMElement* block, const X& xmlPr iequals(tagName, xmlPrefix.str() + "transition")) { try { - for (auto childElem = block->getFirstElementChild(); childElem; childElem = childElem->getNextElementSibling()) { + for (auto childElem = block->getFirstElementChild(); childElem; childElem = childElem->getNextElementSibling()) { // process any child eleents process(childElem, xmlPrefix); } @@ -404,7 +404,7 @@ void BasicContentExecutor::invoke(XERCESC_NS::DOMElement* element) { _callbacks->assign(ATTR(element, "idlocation"), Data(invokeEvent.invokeid, Data::VERBATIM)); } } - + // we need the invokeid to uninvoke char* invokeId = (char*)malloc(invokeEvent.invokeid.size() + 1); memcpy(invokeId, invokeEvent.invokeid.c_str(), invokeEvent.invokeid.size()); @@ -477,7 +477,7 @@ void BasicContentExecutor::uninvoke(XERCESC_NS::DOMElement* invoke) { _callbacks->uninvoke(invokeId); USCXML_MONITOR_CALLBACK2(_callbacks->getMonitors(), afterUninvoking, invoke, invokeId); - invoke->setUserData(X("invokeid"), NULL, NULL); + invoke->setUserData(X("invokeid"), NULL, NULL); free(invokeId); } @@ -558,7 +558,7 @@ Data BasicContentExecutor::elementAsData(XERCESC_NS::DOMElement* element) { if (HAS_ATTR(element, "expr")) { // return _callbacks->evalAsData(ATTR(element, "expr")); #if 0 - if (LOCALNAME(element) == "content") { + if (LOCALNAME(element) == "content") { // test 528 return _callbacks->evalAsData(ATTR(element, "expr")); } else { @@ -566,7 +566,7 @@ Data BasicContentExecutor::elementAsData(XERCESC_NS::DOMElement* element) { return Data(ATTR(element, "expr"), Data::INTERPRETED); } #endif - return _callbacks->evalAsData(ATTR(element, "expr")); + return _callbacks->evalAsData(ATTR(element, "expr")); } if (HAS_ATTR(element, "src")) { @@ -582,7 +582,7 @@ Data BasicContentExecutor::elementAsData(XERCESC_NS::DOMElement* element) { std::string content = url.getInContent(); // make an attempt to parse as XML - try { + try { XERCESC_NS::XercesDOMParser parser; parser.setValidationScheme(XERCESC_NS::XercesDOMParser::Val_Never); parser.setDoNamespaces(true); @@ -600,8 +600,8 @@ Data BasicContentExecutor::elementAsData(XERCESC_NS::DOMElement* element) { XERCESC_NS::DOMDocument* doc = parser.adoptDocument(); d.adoptedDoc = std::shared_ptr<XERCESC_NS::DOMDocument>(doc); d.node = doc->getDocumentElement(); - - return d; + + return d; } catch (...) { // just ignore and return as an interpreted string below |