package rebelsky.compiler.types;

/**
 * Representations of one-dimensional arrays without bounds (as
 * they typically appear as function parameters).  Not used in
 * the simplified Pascal, but included for completeness.
 *
 * These objects are intended to be immutable.
 *
 * @author Samuel A. Rebelsky
 * @version 1.0 of April 2004
 */
public class AbstractArray
  extends Type
{
  // +--------+------------------------------------------------------------
  // | Fields |
  // +--------+

  /**
   * The type of values stored in the array.
   */
  Type contents;


  // +--------------+------------------------------------------------------
  // | Constructors |
  // +--------------+

  /** 
   * Build a new type with particular contents type.
   */
  public AbstractArray(Type contents)
  {
    super("array[] of " + contents);
    this.contents = contents;
  } // AbstractArray(String)


  // +---------+-----------------------------------------------------------
  // | Methods |
  // +---------+

  /**
   * Determine  the contents type.
   */
  public Type contentsType()
  {
    return contents;
  } // contentsType()

} // class AbstractArray

