BranchLocation.java
package edu.udel.cis.vsl.tass.model.impl.location;
import edu.udel.cis.vsl.tass.model.IF.SyntaxException;
import edu.udel.cis.vsl.tass.model.IF.expression.ExpressionIF;
import edu.udel.cis.vsl.tass.model.IF.location.BranchLocationIF;
import edu.udel.cis.vsl.tass.model.IF.location.LocationIF;
import edu.udel.cis.vsl.tass.model.IF.scope.LocalScopeIF;
public class BranchLocation extends BinaryChoiceLocation implements
BranchLocationIF {
private LocationIF exitLocation = null;
public BranchLocation(LocalScopeIF scope, ExpressionIF condition) {
super(scope, condition);
}
@Override
public LocationIF exitLocation() {
return exitLocation;
}
public void setExitLocation(LocationIF exitLocation) {
this.exitLocation = exitLocation;
}
@Override
public void complete() throws SyntaxException {
if (exitLocation == null) {
throw new SyntaxException(this,
"Exit location for branch location has not been set");
}
/* could add check that structure is what you think it is here */
super.complete();
}
}