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

package ilog.language.design.kernel;

/**
 * @version     Last modified on Wed Jul 03 15:36:37 2002 by hak
 * @version          modified on Wed Jun 12 19:43:32 2002 by pviry
 * @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.types.*;
import ilog.language.design.base.*;

/**
 * This class is the class of dummy assignment expressions.
 */
public class DummyAssignment extends Assignment
{
  /**
   * Constructs a dummy assignment with the specified name and expression.
   */
  public DummyAssignment (Tables tables, String name, Expression expression)
    {
      _lhs = new Dummy(tables,name);
      _rhs = expression; 
    }

  /**
   * Sanitizes the names of all expressions in this assignment.
   */
  public final Expression sanitizeNames (ParameterStack parameters, ClassTypeHandle handle)
    {
      _lhs = _lhs.sanitizeNames(parameters, handle);
      _rhs = _rhs.sanitizeNames(parameters, handle);

      if (_lhs instanceof Local)
        return new LocalAssignment(_lhs,_rhs);
      if (_lhs instanceof Global)
        return new GlobalAssignment(_lhs,_rhs);

      throw locate(new AssignmentErrorException("unassignable location: "+_lhs));
    }

  /**
   * No-op...
   */
  public final void compile (Compiler compiler)
    {
    }
}
