BreakNode.java

package edu.udel.cis.vsl.tass.ast.impl.statement;

import edu.udel.cis.vsl.tass.ast.IF.statement.BreakNodeIF;
import edu.udel.cis.vsl.tass.ast.IF.statement.LoopNodeIF;
import edu.udel.cis.vsl.tass.ast.IF.statement.StatementNodeIF;

/**
 * A break statement.
 * 
 * @author Timothy K. Zirkel (zirkel)
 * 
 */
public class BreakNode extends StatementNode implements BreakNodeIF {

	StatementNodeIF targetLocation;
	LoopNodeIF loopLocation;

	public BreakNode(long id) {
		super(id);
	}
	
	/**
	 * A break statement. The targetLocation is the location to go after the
	 * break. The loopLocation is the location of the loop containing the break
	 * node.
	 */
	public BreakNode(long id, StatementNodeIF targetLocation,
			LoopNodeIF loopLocation) {
		super(id);
		this.targetLocation = targetLocation;
		this.loopLocation = loopLocation;
	}

	@Override
	public StatementNodeIF targetLocation() {
		return targetLocation;
	}

	@Override
	public LoopNodeIF loopLocation() {
		return loopLocation;
	}

	@Override
	public void setTargetLocation(StatementNodeIF targetLocation) {
		this.targetLocation = targetLocation;
	}

	@Override
	public void setLoopLocation(LoopNodeIF loopLocation) {
		this.loopLocation = loopLocation;
	}

}