diff options
author | Nao Pross <naopross@thearcway.org> | 2017-11-28 15:05:02 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2017-11-28 15:05:02 +0100 |
commit | 12e86e71ca36a58d7e2ed64f0454b65ed6f7eb56 (patch) | |
tree | 466f7d2756b0619921e2d9d061862c8443649ed3 /src/diagram/BranchStatement.hpp | |
parent | Update header ifdefs to match and clean up comments (diff) | |
download | OrbitingYeti-12e86e71ca36a58d7e2ed64f0454b65ed6f7eb56.tar.gz OrbitingYeti-12e86e71ca36a58d7e2ed64f0454b65ed6f7eb56.zip |
New data structure for Structogram and Statements
Diffstat (limited to '')
-rw-r--r-- | src/diagram/BranchStatement.hpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/diagram/BranchStatement.hpp b/src/diagram/BranchStatement.hpp new file mode 100644 index 0000000..dacf060 --- /dev/null +++ b/src/diagram/BranchStatement.hpp @@ -0,0 +1,32 @@ +/* + * BranchStatement.hpp + * + * Created on: Nov 28, 2017 + * Author: naopross + */ + +#ifndef SRC_DIAGRAM_BRANCHSTATEMENT_HPP_ +#define SRC_DIAGRAM_BRANCHSTATEMENT_HPP_ + +#include "Statement.hpp" + +namespace samb { + +class BranchStatement: public Statement { +public: + BranchStatement(Type t, const std::string& condition, pointer next); + + const std::string& condition() const { return text(); } + void condition(const std::string& condition) { return text(condition); } + + std::vector<std::string> branches(); + std::size_t branchesCount(); + +private: + std::map<std::string, pointer> m_branches; + std::size_t m_branchesCount = 0; +}; + +} /* namespace samb */ + +#endif /* SRC_DIAGRAM_BRANCHSTATEMENT_HPP_ */ |