// Path: language/src/com/infdot/analysis/language/expression/Expression.java
// public abstract class Expression {
// 	/**
// 	 * Unique identifier for each expression.
// 	 * @see {@link ExpressionNumberingVisitor}
// 	 */
// 	private int id = -1;
// 	
// 	public int getId() {
// 		return id;
// 	}
// 
// 	public void setId(int id) {
// 		this.id = id;
// 	}
// 
// 	/**
// 	 * Helper method to collect variables.
// 	 */
// 	public abstract void collectVariables(Set<Identifier> variables);
// 	
// 	/**
// 	 * Method to accept visitor.
// 	 */
// 	public abstract <V> V visit(AbstractExpressionVisitor<V> visitor);
// 
// 	@Override
// 	public final boolean equals(Object obj) {
// 		checkId();
// 		return obj instanceof Expression
// 			&& ((Expression) obj).id == id;
// 	}
// 
// 	@Override
// 	public final int hashCode() {
// 		checkId();
// 		return id;
// 	}
// 	
// 	private void checkId() {
// 		if (id < 0) {
// 			throw new IllegalStateException("Expression " + this + " has no id set");
// 		}
// 	}
// 
// }
// 
// Path: language/src/com/infdot/analysis/language/statement/visitor/AbstractStatementVisitor.java
// public abstract class AbstractStatementVisitor<T> {
// 
// 	public abstract T visitAssignment(Assignment assignment);
// 	
// 	public abstract T visitCompound(Compound compound, T s1, T s2);
// 	
// 	public abstract T visitDeclaration(Declaration declaration);
// 	
// 	public abstract T visitIf(If ifStatement, T body);
// 	
// 	public abstract T visitOutput(Output output);
// 	
// 	public abstract T visitWhile(While whileStatement, T body);
// }


import com.infdot.analysis.language.expression.Expression;
import com.infdot.analysis.language.statement.visitor.AbstractStatementVisitor;
package com.infdot.analysis.language.statement;


public class If implements Statement {
	private Expression condition;
	private Statement statement;
	
	public If(Expression condition, Statement statement) {
		this.condition = condition;
		this.statement = statement;
	}

	@Override
	public void toCodeString(StringBuilder builder, String ident) {
		builder.append(ident).append("if (").append(condition).append(") {\n");
		statement.toCodeString(builder, ident + "  ");
		builder.append('\n').append(ident).append("}");
	}

	@Override
	public boolean equals(Object obj) {
// Path: language/src/com/infdot/analysis/language/expression/Expression.java
// public abstract class Expression {
// 	/**
// 	 * Unique identifier for each expression.
// 	 * @see {@link ExpressionNumberingVisitor}
// 	 */
// 	private int id = -1;
// 	
// 	public int getId() {
// 		return id;
// 	}
// 
// 	public void setId(int id) {
// 		this.id = id;
// 	}
// 
// 	/**
// 	 * Helper method to collect variables.
// 	 */
// 	public abstract void collectVariables(Set<Identifier> variables);
// 	
// 	/**
// 	 * Method to accept visitor.
// 	 */
// 	public abstract <V> V visit(AbstractExpressionVisitor<V> visitor);
// 
// 	@Override
// 	public final boolean equals(Object obj) {
// 		checkId();
// 		return obj instanceof Expression
// 			&& ((Expression) obj).id == id;
// 	}
// 
// 	@Override
// 	public final int hashCode() {
// 		checkId();
// 		return id;
// 	}
// 	
// 	private void checkId() {
// 		if (id < 0) {
// 			throw new IllegalStateException("Expression " + this + " has no id set");
// 		}
// 	}
// 
// }
// 
// Path: language/src/com/infdot/analysis/language/statement/visitor/AbstractStatementVisitor.java
// public abstract class AbstractStatementVisitor<T> {
// 
// 	public abstract T visitAssignment(Assignment assignment);
// 	
// 	public abstract T visitCompound(Compound compound, T s1, T s2);
// 	
// 	public abstract T visitDeclaration(Declaration declaration);
// 	
// 	public abstract T visitIf(If ifStatement, T body);
// 	
// 	public abstract T visitOutput(Output output);
// 	
// 	public abstract T visitWhile(While whileStatement, T body);
// }


// Path: language/src/com/infdot/analysis/language/statement/If.java
import com.infdot.analysis.language.expression.Expression;
import com.infdot.analysis.language.statement.visitor.AbstractStatementVisitor;

package com.infdot.analysis.language.statement;


public class If implements Statement {
	private Expression condition;
	private Statement statement;
	
	public If(Expression condition, Statement statement) {
		this.condition = condition;
		this.statement = statement;
	}

	@Override
	public void toCodeString(StringBuilder builder, String ident) {
		builder.append(ident).append("if (").append(condition).append(") {\n");
		statement.toCodeString(builder, ident + "  ");
		builder.append('\n').append(ident).append("}");
	}

	@Override
	public boolean equals(Object obj) {
		return obj instanceof If