diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-11-12 12:36:27 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-11-12 12:36:27 (GMT) |
commit | 8202b54c5d3ce1fbc4f079918551f2f076a221cb (patch) | |
tree | 20ba167c6d87e66e2e2b13e62bde1c92a9925175 /src/uscxml/transform/FlatStateIdentifier.h | |
parent | c66fa34eb48f81da05966b947a2e37067318a09f (diff) | |
download | uscxml-8202b54c5d3ce1fbc4f079918551f2f076a221cb.zip uscxml-8202b54c5d3ce1fbc4f079918551f2f076a221cb.tar.gz uscxml-8202b54c5d3ce1fbc4f079918551f2f076a221cb.tar.bz2 |
More work on PROMELA transformation
Diffstat (limited to 'src/uscxml/transform/FlatStateIdentifier.h')
-rw-r--r-- | src/uscxml/transform/FlatStateIdentifier.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/uscxml/transform/FlatStateIdentifier.h b/src/uscxml/transform/FlatStateIdentifier.h index 92e6e8a..011888a 100644 --- a/src/uscxml/transform/FlatStateIdentifier.h +++ b/src/uscxml/transform/FlatStateIdentifier.h @@ -110,6 +110,7 @@ public: if (closingBracketPos != std::string::npos) { state = state.substr(0, closingBracketPos); } + boost::trim(state); if (state.length() > 0) { active.push_back(state); } @@ -123,6 +124,7 @@ public: if (closingBracketPos != std::string::npos) { state = state.substr(0, closingBracketPos); } + boost::trim(state); if (state.length() > 0) { visited.push_back(state); } @@ -150,7 +152,11 @@ public: if (closingBracketPos != std::string::npos) { state = state.substr(0, closingBracketPos); } - histories[histName].push_back(state); + boost::trim(state); + if (state.length() > 0) { + histories[histName].push_back(state); + } + } start = end + 2; @@ -171,6 +177,10 @@ public: return flatActive; } + const std::string& getFlatHistory() { + return flatHistories; + } + const std::list<std::string>& getVisited() { return visited; } @@ -181,8 +191,15 @@ public: const std::map<std::string, std::list<std::string> > & getHistory() { return histories; } - const std::string& getFlatHistory() { - return flatHistories; + + const std::map<std::string, std::set<std::string> > getHistorySets() { + std::map<std::string, std::set<std::string> > histSet; + std::map<std::string, std::list<std::string> >::const_iterator histIter = histories.begin(); + while(histIter != histories.end()) { + histSet[histIter->first].insert(histIter->second.begin(), histIter->second.end()); + histIter++; + } + return histSet; } protected: |