summaryrefslogtreecommitdiff
path: root/vaporize/library/Node.java
blob: 203f9319663d9de759e1b23fce0792ae12e0f677 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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;
    }

}