package tsp.ast;

public abstract class Operation implements Node {
    private Node[] ops;

    public Operation(Node... ops) {
        this.ops = ops;
    }

    protected int nbOps() {
        return ops.length;
    }

    protected Node op(int n) {
        return ops[n];
    }
}

public class Add extends Operation {
    public Add(Node left, Node right) {
        super(left, right);
        this.left = left;
        this.right = right;
    }
    //...
}