//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
// PLEASE DO NOT EDIT WITHOUT THE EXPLICIT CONSENT OF THE AUTHOR! \\
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\

package hlt.language.design.instructions;

/**
 * @version     Last modified on Wed Jun 20 14:29:51 2012 by hak
 * @author      <a href="mailto:hak@acm.org">Hassan A&iuml;t-Kaci</a>
 * @copyright   &copy; <a href="http://www.hassan-ait-kaci.net/">by the author</a>
 */

import hlt.language.design.backend.Runtime;
import hlt.language.design.backend.RuntimeTuple;
import hlt.language.design.backend.NullValueException;

public class SetRealTupleComponent extends TupleComponentInstruction
{
  public SetRealTupleComponent (int offset)
    {
      setName("SET_TUPLE_R");
      _offset = offset;
    }

  public final void execute (Runtime r) throws NullValueException
    {
      ((RuntimeTuple)r.popObject("can't update component of a null tuple"))
        .setRealComponent(_offset,r.realResult());
      r.setRealSort();
      r.incIP();
    }
}
