package org.cf.smalivm.opcode;

import org.cf.smalivm.SideEffect;

public abstract class Op {

    private final int address;
    private final int[] childAddresses;
    private final String opName;

    Op(int address, String opName, int childAddress) {
        this(address, opName, new int[] { childAddress });
    }

    Op(int address, String opName, int[] childAddresses) {
        this.address = address;
        this.opName = opName;
        this.childAddresses = childAddresses;
    }

    public final int getAddress() {
        return address;
    }

    public final String getName() {
        return opName;
    }

    public final int[] getPossibleChildren() {
        return childAddresses;
    }

    public SideEffect.Level sideEffectLevel() {
        return SideEffect.Level.NONE;
    }

    @Override
    public abstract String toString();

}

@@ -100,22 +100,16 @@
 private 
-final 
 int addr
@@ -125,22 +125,16 @@
 private 
-final 
 int%5B%5D ch
@@ -783,24 +783,218 @@
 ONE;%0A    %7D%0A%0A
+    public void setAddress(int address) %7B%0A        this.address = address;%0A    %7D%0A%0A    public void setPossibleChildren(int%5B%5D childAddresses) %7B%0A        this.childAddresses = childAddresses;%0A    %7D%0A%0A
     @Overrid

Make op address and child addresses mutable