// Path: src/java/sizzle/compiler/TypeException.java
// public class TypeException extends RuntimeException {
// 	private static final long serialVersionUID = -5838752670934187621L;
// 
// 	/**
// 	 * Construct a TypeException.
// 	 * 
// 	 * @param text
// 	 *            A {@link String} containing the description of the error
// 	 */
// 	public TypeException(final String text) {
// 		super(text);
// 	}
// 
// 	/**
// 	 * Construct a TypeException caused by another exception.
// 	 * 
// 	 * @param text
// 	 *            A {@link String} containing the description of the error
// 	 * @param e
// 	 *            A {@link Throwable} representing the cause of this type
// 	 *            exception
// 	 */
// 	public TypeException(final String text, final Throwable e) {
// 		super(text, e);
// 	}
// }


import sizzle.compiler.TypeException;
package sizzle.types;


/**
 * Base class for the types in Sizzle.
 * 
 * @author anthonyu
 * 
 */
public abstract class SizzleType {
	/**
	 * Returns the type that results from an expression of this type and an
	 * expression of that type in an arithmetic expression. (e.g. an int plus a
	 * float results in an expression of type float).
	 * 
	 * @param that
	 *            A SizzleType representing the other expression's type
	 * 
	 * @return A SizzleType representing the type of the resulting expression
	 */
	public SizzleScalar arithmetics(final SizzleType that) {
		// by default, no types are allowed in arithmetic
		throw new TypeException("incorrect type " + this + " for arithmetic with " + that);
	}

	/**
	 * Returns true when an expression of that type may be assigned to a
	 * variable of this type.
	 * 
	 * @return A boolean representing whether an expression of that type may be
	 *         assigned to a variable of this type
	 */
	public boolean assigns(final SizzleType that) {
		// by default no types can be assigned
		return false;
	}

	/**
	 * Returns true when an expression of that type may be used as a formal
	 * parameter of this type.
	 * 
	 * @return A boolean representing whether an expression of that type may be
	 *         used as a formal parameter of this type
	 */
	public boolean accepts(final SizzleType that) {
		// by default no types will be accepted
// Path: src/java/sizzle/compiler/TypeException.java
// public class TypeException extends RuntimeException {
// 	private static final long serialVersionUID = -5838752670934187621L;
// 
// 	/**
// 	 * Construct a TypeException.
// 	 * 
// 	 * @param text
// 	 *            A {@link String} containing the description of the error
// 	 */
// 	public TypeException(final String text) {
// 		super(text);
// 	}
// 
// 	/**
// 	 * Construct a TypeException caused by another exception.
// 	 * 
// 	 * @param text
// 	 *            A {@link String} containing the description of the error
// 	 * @param e
// 	 *            A {@link Throwable} representing the cause of this type
// 	 *            exception
// 	 */
// 	public TypeException(final String text, final Throwable e) {
// 		super(text, e);
// 	}
// }


// Path: src/java/sizzle/types/SizzleType.java
import sizzle.compiler.TypeException;

package sizzle.types;


/**
 * Base class for the types in Sizzle.
 * 
 * @author anthonyu
 * 
 */
public abstract class SizzleType {
	/**
	 * Returns the type that results from an expression of this type and an
	 * expression of that type in an arithmetic expression. (e.g. an int plus a
	 * float results in an expression of type float).
	 * 
	 * @param that
	 *            A SizzleType representing the other expression's type
	 * 
	 * @return A SizzleType representing the type of the resulting expression
	 */
	public SizzleScalar arithmetics(final SizzleType that) {
		// by default, no types are allowed in arithmetic
		throw new TypeException("incorrect type " + this + " for arithmetic with " + that);
	}

	/**
	 * Returns true when an expression of that type may be assigned to a
	 * variable of this type.
	 * 
	 * @return A boolean representing whether an expression of that type may be
	 *         assigned to a variable of this type
	 */
	public boolean assigns(final SizzleType that) {
		// by default no types can be assigned
		return false;
	}

	/**
	 * Returns true when an expression of that type may be used as a formal
	 * parameter of this type.
	 * 
	 * @return A boolean representing whether an expression of that type may be
	 *         used as a formal parameter of this type
	 */
	public boolean accepts(final SizzleType that) {
		// by default no types will be accepted
		return false;