diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-10-20 07:20:16 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-10-20 07:20:16 (GMT) |
commit | 59c9ae81b4911c6458cbe8a5ed78554bdcc82861 (patch) | |
tree | aab941294ccd67c8379f2dfb71ca107236d51f05 /src/uscxml/interpreter | |
parent | 9ba649b087df2bc161759e55549facc2f8f80878 (diff) | |
download | uscxml-59c9ae81b4911c6458cbe8a5ed78554bdcc82861.zip uscxml-59c9ae81b4911c6458cbe8a5ed78554bdcc82861.tar.gz uscxml-59c9ae81b4911c6458cbe8a5ed78554bdcc82861.tar.bz2 |
SCXML -> Promela skips intermediate explicit flat SCXML for ridiculous better memory footprint
Diffstat (limited to 'src/uscxml/interpreter')
-rw-r--r-- | src/uscxml/interpreter/InterpreterDraft6.cpp | 2 | ||||
-rw-r--r-- | src/uscxml/interpreter/InterpreterRC.cpp | 23 | ||||
-rw-r--r-- | src/uscxml/interpreter/InterpreterRC.h | 3 |
3 files changed, 26 insertions, 2 deletions
diff --git a/src/uscxml/interpreter/InterpreterDraft6.cpp b/src/uscxml/interpreter/InterpreterDraft6.cpp index 7dcb768..2bab937 100644 --- a/src/uscxml/interpreter/InterpreterDraft6.cpp +++ b/src/uscxml/interpreter/InterpreterDraft6.cpp @@ -553,7 +553,7 @@ void InterpreterDraft6::handleDOMEvent(Arabica::DOM::Events::Event<std::string>& if (event.getType().compare("DOMAttrModified") == 0) // we do not care about attributes return; Node<std::string> target = Arabica::DOM::Node<std::string>(event.getTarget()); - NodeSet<std::string> transitions = InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "transition", target); + NodeSet<std::string> transitions = InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "transition", target, true); for (int i = 0; i < transitions.size(); i++) { const Element<std::string> transElem = Element<std::string>(transitions[i]); if (_transWithinParallel.find(transElem) != _transWithinParallel.end()) diff --git a/src/uscxml/interpreter/InterpreterRC.cpp b/src/uscxml/interpreter/InterpreterRC.cpp index 8f16cb0..b58a236 100644 --- a/src/uscxml/interpreter/InterpreterRC.cpp +++ b/src/uscxml/interpreter/InterpreterRC.cpp @@ -181,6 +181,7 @@ function computeExitSet(transitions) return statesToExit */ Arabica::XPath::NodeSet<std::string> InterpreterRC::computeExitSet(const Arabica::XPath::NodeSet<std::string>& transitions) { + NodeSet<std::string> statesToExit; for (unsigned int i = 0; i < transitions.size(); i++) { Element<std::string> t(transitions[i]); @@ -203,13 +204,21 @@ Arabica::XPath::NodeSet<std::string> InterpreterRC::computeExitSet(const Arabica } std::cout << std::endl; #endif + return statesToExit; } Arabica::XPath::NodeSet<std::string> InterpreterRC::computeExitSet(const Arabica::DOM::Node<std::string>& transition) { + if (_exitSet.find(transition) != _exitSet.end()) // speed up removeConflicting + return _exitSet[transition]; + Arabica::XPath::NodeSet<std::string> transitions; transitions.push_back(transition); - return computeExitSet(transitions); + + Arabica::XPath::NodeSet<std::string> exitSet = computeExitSet(transitions); + _exitSet[transition] = exitSet; + + return exitSet; } void InterpreterRC::enterStates(const Arabica::XPath::NodeSet<std::string>& enabledTransitions) { @@ -622,4 +631,16 @@ BREAK_LOOP: return findLCCA(states); } +void InterpreterRC::handleDOMEvent(Arabica::DOM::Events::Event<std::string>& event) { + InterpreterImpl::handleDOMEvent(event); + + if (event.getType().compare("DOMAttrModified") == 0) // we do not care about attributes + return; + +// Node<std::string> target = Arabica::DOM::Node<std::string>(event.getTarget()); +// NodeSet<std::string> transitions = InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "transition", target, true); +// if (transitions.size() > 0) + _exitSet.clear(); + +} }
\ No newline at end of file diff --git a/src/uscxml/interpreter/InterpreterRC.h b/src/uscxml/interpreter/InterpreterRC.h index 52b45ff..36aca3d 100644 --- a/src/uscxml/interpreter/InterpreterRC.h +++ b/src/uscxml/interpreter/InterpreterRC.h @@ -57,7 +57,10 @@ protected: Arabica::XPath::NodeSet<std::string>& statesToEnter, Arabica::XPath::NodeSet<std::string>& statesForDefaultEntry, std::map<std::string, Arabica::DOM::Node<std::string> >& defaultHistoryContent); + virtual void handleDOMEvent(Arabica::DOM::Events::Event<std::string>& event); +private: + std::map<Arabica::DOM::Node<std::string>, Arabica::XPath::NodeSet<std::string> > _exitSet; }; } |