// $Id: Domains.scala,v 1.1 2005/10/28 20:46:16 leavens Exp leavens $
package interp;

/** Domains for the interpreter */
object Domains {
  /** Expressed values can be the result of an expression. */
  type ExpressedValue = Long;
  
  /** Denoted values can be bound in an environment. */
  type DenotedValue = ExpressedValue;
  
  // TODO: use a TreeMap, by defining a view from Symbol to Ordered[Symbol]
  // or build ribcages

  /** Runtime environments map symbols (names) to denoted values. */
  type Environment =
      scala.collection.immutable.ListMap[Symbol, DenotedValue];
  
  /** The empty environment. */
  def emptyEnv =
     scala.collection.immutable.ListMap.Empty[Symbol, DenotedValue];

  /** Exception used for errors in the interpreter. */
  case class InterpreterError(s: String) extends RuntimeException(s);

  /** The error function */
  def error(reason: String): All = throw new InterpreterError(reason);
}
