aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/Machine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/Machine.cpp')
-rw-r--r--src/engine/Machine.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/engine/Machine.cpp b/src/engine/Machine.cpp
index a6abcff..b5cfb28 100644
--- a/src/engine/Machine.cpp
+++ b/src/engine/Machine.cpp
@@ -100,6 +100,21 @@ Machine::operator=(const Machine& copy)
return *this;
}
+void
+Machine::merge(const Machine& machine)
+{
+ for (const auto& m : machine.nodes()) {
+ if (m->is_initial()) {
+ for (const auto& e : m->edges()) {
+ e->set_tail(_initial_node);
+ _initial_node->edges().insert(e);
+ }
+ } else {
+ _nodes.insert(m);
+ }
+ }
+}
+
/** Always returns a node, unless there are none */
SPtr<Node>
Machine::random_node()