uk.ac.man.cs.rainbow.simulator.rasm
Class Insert

java.lang.Object
  |
  +--uk.ac.man.cs.rainbow.simulator.Instruction
        |
        +--uk.ac.man.cs.rainbow.simulator.rasm.Insert
All Implemented Interfaces:
Serializable

public class Insert
extends Instruction

Assign to a list value. Creates a new list that is a copy of list except the index'th item has been updated to value. Itended for use during (partial) assignment to array and tuple variables.

Where multiple indices are present, this instruction copes with nested lists, making assignment to complex variables much easier. The indices nearest to the top of the stack are used on the outer layers of the nested structure, so a reference to ary[1][2][3] would need an index list of 3 2 1.

value list index newlist
value list indexn ... index1 newlist

See Also:
Project, Serialized Form

Inner classes inherited from class uk.ac.man.cs.rainbow.simulator.Instruction
Instruction.MACRO
 
Constructor Summary
Insert()
           
Insert(RASMCode code)
           
 
Method Summary
protected  boolean execute(RASMThread thread)
          Make this instruction execute in the given context.
 String toString()
           
 
Methods inherited from class uk.ac.man.cs.rainbow.simulator.Instruction
addClass, getInstruction, getInstruction, getInstruction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Insert

public Insert()

Insert

public Insert(RASMCode code)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

execute

protected boolean execute(RASMThread thread)
                   throws RainbowException
Description copied from class: Instruction
Make this instruction execute in the given context.
Overrides:
execute in class Instruction
Following copied from class: uk.ac.man.cs.rainbow.simulator.Instruction
Throws:
RainbowException - All sorts of things can go wrong during execution...