diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-17 01:33:05 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-17 01:33:05 -0600 |
commit | 62178e370f21ddf80766b8e1075c55e0d3945493 (patch) | |
tree | 13fcfc0d7177e578020366e905b71ca48e0857f0 /vaporize/library/Node.java | |
parent | f08708ee07931db592ffb76c073bd80bcf6cf060 (diff) |
CFG Skeleton Files
Diffstat (limited to 'vaporize/library/Node.java')
-rw-r--r-- | vaporize/library/Node.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/vaporize/library/Node.java b/vaporize/library/Node.java new file mode 100644 index 0000000..203f931 --- /dev/null +++ b/vaporize/library/Node.java @@ -0,0 +1,38 @@ +package vaporize.library; + +import cs132.vapor.ast.*; +import java.util.ArrayList; + +class Node { + + private VInstr instruction; + private ArrayList<Node> sources; + private ArrayList<Node> dests; + + protected Node(VInstr instruction) { + this.instruction = instruction; + this.sources = new ArrayList<>(); + this.dests = new ArrayList<>(); + } + + protected void addSource(Node node) { + this.sources.add(node); + } + + protected void addDest(Node node) { + this.dests.add(node); + } + + protected VInstr getInstruction() { + return this.instruction; + } + + protected ArrayList<Node> getSources() { + return this.sources; + } + + protected ArrayList<Node> getDests() { + return this.dests; + } + +} |