diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-04-04 06:33:48 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-04-04 06:33:48 (GMT) |
commit | a6dce403dd86249985c224ff3408b7bbfda95754 (patch) | |
tree | d2e9c0cb12e347b0cf1df2ea95a04d811a78e3bc | |
parent | 2c1de149e0dbbf4e542a88affa2dae391c0c5ff6 (diff) | |
download | uscxml-a6dce403dd86249985c224ff3408b7bbfda95754.zip uscxml-a6dce403dd86249985c224ff3408b7bbfda95754.tar.gz uscxml-a6dce403dd86249985c224ff3408b7bbfda95754.tar.bz2 |
Fixed a bug with transition selection
-rw-r--r-- | src/uscxml/interpreter/InterpreterDraft6.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/uscxml/interpreter/InterpreterDraft6.cpp b/src/uscxml/interpreter/InterpreterDraft6.cpp index 82785e8..c7fa45f 100644 --- a/src/uscxml/interpreter/InterpreterDraft6.cpp +++ b/src/uscxml/interpreter/InterpreterDraft6.cpp @@ -429,9 +429,25 @@ Arabica::XPath::NodeSet<std::string> InterpreterDraft6::selectEventlessTransitio } atomicStates.to_document_order(); +#if 0 + std::cout << "Atomic States: "; + for (int i = 0; i < atomicStates.size(); i++) { + std::cout << ATTR(atomicStates[i], "id") << ", "; + } + std::cout << std::endl; +#endif + for (unsigned int i = 0; i < atomicStates.size(); i++) { NodeSet<std::string> ancestors = getProperAncestors(atomicStates[i], Arabica::DOM::Node<std::string>()); ancestors.push_back(atomicStates[i]); +#if 0 + std::cout << "Ancestors: "; + for (int i = 0; i < ancestors.size(); i++) { + std::cout << ATTR(ancestors[i], "id") << ", "; + } + std::cout << std::endl; +#endif + for (unsigned int j = 0; j < ancestors.size(); j++) { NodeSet<std::string> transitions = filterChildElements(_xmlNSPrefix + "transition", ancestors[j]); for (unsigned int k = 0; k < transitions.size(); k++) { @@ -450,9 +466,9 @@ Arabica::XPath::NodeSet<std::string> InterpreterDraft6::selectEventlessTransitio } } #endif + LOOP: + ; } -LOOP: - ; } enabledTransitions = filterPreempted(enabledTransitions); @@ -463,10 +479,17 @@ Arabica::XPath::NodeSet<std::string> InterpreterDraft6::filterPreempted(const Ar Arabica::XPath::NodeSet<std::string> filteredTransitions; for (unsigned int i = 0; i < enabledTransitions.size(); i++) { Arabica::DOM::Node<std::string> t = enabledTransitions[i]; +#if 0 + std::cout << "Checking: " << std::endl << t << std::endl; +#endif + for (unsigned int j = i+1; j < enabledTransitions.size(); j++) { Arabica::DOM::Node<std::string> t2 = enabledTransitions[j]; +#if 0 + std::cout << "\tagainst: " << std::endl << t2 << std::endl; +#endif if (isPreemptingTransition(t2, t)) { -#if VERBOSE +#if 0 std::cout << "Transition preempted!: " << std::endl << t2 << std::endl << t << std::endl; #endif goto LOOP; @@ -483,7 +506,7 @@ bool InterpreterDraft6::isPreemptingTransition(const Arabica::DOM::Node<std::str assert(t1); assert(t2); -#if VERBOSE +#if 0 std::cout << "Checking preemption: " << std::endl << t1 << std::endl << t2 << std::endl; #endif |