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.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/diagram/BranchStatement.cpp (limited to 'src/diagram/BranchStatement.cpp') diff --git a/src/diagram/BranchStatement.cpp b/src/diagram/BranchStatement.cpp new file mode 100644 index 0000000..d960ef9 --- /dev/null +++ b/src/diagram/BranchStatement.cpp @@ -0,0 +1,23 @@ +/* + * BranchStatement.cpp + * + * Created on: Nov 28, 2017 + * Author: naopross + */ + +#include "BranchStatement.hpp" + +namespace samb { + +BranchStatement::BranchStatement(Type t, const std::string& condition, pointer next): Statement(t, condition, next) { + switch (t) { + case Statement::Type::DECISION: + case Statement::Type::SWITCH: + break; + + default: + throw std::invalid_argument("BranchStatement can only be of type DECISION or SWITCH"); + } +} + +} /* namespace samb */ -- cgit v1.2.1