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

package ilog.language.design.base;

/**
 * @version     Last modified on Sun Nov 03 18:17:07 2002 by hak
 * @author      <a href="mailto:hak@ilog.fr">Hassan A&iuml;t-Kaci</a>
 * @copyright   &copy; 2000-2002 <a href="http://www.ilog.fr/">ILOG, S.A.</a>
 */

import ilog.language.design.backend.Runtime;
import ilog.language.design.backend.Block;
import ilog.language.design.backend.NullValueException;

/**
 * A refinement of <a href="Enter.html"><tt>Enter</tt></tt> that carries its own block
 * as opposed of taking it from the stack.
 */
public class EnterBlock extends Enter
{
  private Block _block;

  public EnterBlock (Block block)
    {
      setName("ENTER_BLOCK");
      _block = block;
      _intArity = block.intArity();
      _realArity = block.realArity();
      _objectArity = block.objectArity();
    }

  public void execute (Runtime r) throws NullValueException
    {
      if (_block == null)
        throw new NullValueException("can't enter a null scope");
      _execute(_block,r);
    }
}
