CommonFunctionCallExpression.java
package edu.udel.cis.vsl.civl.model.common.expression;
import java.util.Set;
import edu.udel.cis.vsl.civl.model.IF.CIVLSource;
import edu.udel.cis.vsl.civl.model.IF.Scope;
import edu.udel.cis.vsl.civl.model.IF.expression.Expression;
import edu.udel.cis.vsl.civl.model.IF.expression.FunctionCallExpression;
import edu.udel.cis.vsl.civl.model.IF.statement.CallOrSpawnStatement;
import edu.udel.cis.vsl.civl.model.IF.type.CIVLType;
import edu.udel.cis.vsl.civl.model.IF.variable.Variable;
public class CommonFunctionCallExpression extends CommonExpression
implements FunctionCallExpression {
CallOrSpawnStatement callStatement;
public CommonFunctionCallExpression(CIVLSource source,
CallOrSpawnStatement callStatement) {
super(source, callStatement.statementScope(), callStatement
.lowestScope(), null);
this.callStatement = callStatement;
}
@Override
public ExpressionKind expressionKind() {
return ExpressionKind.FUNC_CALL;
}
@Override
public Set<Variable> variableAddressedOf(Scope scope) {
return callStatement.variableAddressedOf(scope);
}
@Override
public Set<Variable> variableAddressedOf() {
return callStatement.variableAddressedOf();
}
@Override
public CallOrSpawnStatement callStatement() {
return this.callStatement;
}
@Override
public String toString() {
return this.callStatement.toString();
}
@Override
public void setExpressionType(CIVLType returnType) {
this.expressionType = returnType;
}
@Override
public CIVLType getExpressionType() {
return this.callStatement.function().returnType();
}
@Override
protected boolean expressionEquals(Expression expression) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean containsHere() {
return callStatement.containsHere();
}
}