From 12e86e71ca36a58d7e2ed64f0454b65ed6f7eb56 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 28 Nov 2017 15:05:02 +0100 Subject: New data structure for Structogram and Statements --- src/diagram/BranchStatement.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/diagram/BranchStatement.hpp (limited to 'src/diagram/BranchStatement.hpp') 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 branches(); + std::size_t branchesCount(); + +private: + std::map m_branches; + std::size_t m_branchesCount = 0; +}; + +} /* namespace samb */ + +#endif /* SRC_DIAGRAM_BRANCHSTATEMENT_HPP_ */ -- cgit v1.2.1