class Bytecode
pri next : Bytecode;
pri previous : Bytecode;
pri code : Int;
meth SetNext =^ ( val n: Bytecode ·
next:= n;
)
end
meth GetNext =^ ( res n: Bytecode ·
n:= next;
)
end
meth SetPrevious =^ ( val p: bytecode ·
Previous:= p;
)
end
meth GetPrevious =^ ( res p: bytecode ·
p:= previous;
)
end
meth Setcode =^ ( val c: Int ·
code:= c;
)
end
meth Getcode =^ ( res c: Int ·
c:= code;
)
end
meth GetOp =^ (res op: Int ·
op:= code;
)
end
meth GetNextBytecode =^ (res n: bytecode ·
n:= next;
)
end
meth Branch =^ (vres bc: Bytecode; val branchoffset: Int ·
If [] branchoffset > 0 ®
bc.GetNext(bc);
bc.Branch(bc, branchoffset 1);
[] branchoffset < 0 ®
bc.GetPrevious(bc);
bc.Branch(bc, branchoffset +1);
[] branchoffset = 0 ® skip;
fi
)
end
end