Start adding code generation

This commit is contained in:
Anton Reinhard
2023-08-31 18:24:48 +02:00
parent 32fcd069d7
commit f1edce258a
6 changed files with 251 additions and 10 deletions

View File

@@ -27,3 +27,18 @@ function get_exit_node(graph::DAG)
end
@assert false "The given graph has no exit node! It is either empty or not acyclic!"
end
"""
get_entry_nodes(graph::DAG)
Return a vector of the graph's entry nodes.
"""
function get_entry_nodes(graph::DAG)
result = Vector{Node}()
for node in graph.nodes
if (is_entry_node(node))
push!(result, node)
end
end
return result
end