package absyn;

import java.io.FileWriter;

import types.Type;
import semantical.TypeChecker;
import translate.Translator;

/**
 * A node of abstract syntax representing a conditional expression.
 *
 * @author  <A HREF="mailto:fausto.spoto@univr.it">Fausto Spoto</A>
 */

public class Conditional extends SUPERCLASSE {

    CAMPI;

    /**
     * Constructs the abstract syntax of an expression.
     *
     * @param pos the position in the source file where it starts
     *            the concrete syntax represented by this abstract syntax
     */

    public Conditional(int pos, ALTRI PARAMETRI) {
	super(pos);
    }

    /**
     * Adds abstract syntax class-specific information in the dot file
     * representing the abstract syntax.
     *
     * @param where the file where the dot representation must be written
     */

    protected void toDot$0(FileWriter where) throws java.io.IOException {
    }

    /**
     * Performs the type-checking of this expression by using a given
     * type-checker.
     *
     * @param checker the type-checker to be used for type-checking
     * @return ??
     */

    protected Type typeCheck$0(TypeChecker checker) {
	return Type.INT;
    }

    /**
     * Translates this expression into its intermediate Kitten code.
     * The result is a piece of code which pushes onto the stack
     * the value of the expression. The original stack elements are not
     * modified.
     *
     * @param translator the translator to be used to translate this expression
     * @return the translator which can be used to translate what precedes
     *         this expression
     */

    protected Translator translate(Translator translator) {
	return translator;
    }
}

