diff options
author | Nao Pross <naopross@thearcway.org> | 2017-11-26 23:36:26 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2017-11-26 23:36:26 +0100 |
commit | 7f7e6fe30ef4f9ba4507b89174676f57c42c0000 (patch) | |
tree | d6fc1ae62972568a1021c940f372903cda57cceb /src/diagram/Statement.cpp | |
parent | First commit (diff) | |
download | OrbitingYeti-7f7e6fe30ef4f9ba4507b89174676f57c42c0000.tar.gz OrbitingYeti-7f7e6fe30ef4f9ba4507b89174676f57c42c0000.zip |
Implementation for Structogram iterator and Statement type
The interator is not (yet) aware of the scope in which it is iterating.
Diffstat (limited to '')
-rw-r--r-- | src/diagram/Statement.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/diagram/Statement.cpp b/src/diagram/Statement.cpp index 75770db..60be094 100644 --- a/src/diagram/Statement.cpp +++ b/src/diagram/Statement.cpp @@ -5,8 +5,21 @@ * Author: naopross */ -#include "../diagram/Statement.h" +#include "Statement.hpp" namespace samb { +Statement::pointer Statement::makeStatement(Statement::Type t) { + return std::make_shared<Statement>(Statement(t, "", nullptr, nullptr)); +} + +bool Statement::operator==(const Statement& other) { + return (this->type == other.type) && (this->text == other.text) && + (this->next == other.next) && (this->scope == other.scope); +} + + +Statement::Statement(Type t, std::string txt, Statement::pointer p, Statement::pointer s): type(t), text(txt), next(p), scope(s) {} +Statement::~Statement() {} + } /* namespace samb */ |