Class ResolvableOperationCallExpression
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.expressions.Expression
-
- net.ssehub.easy.instantiation.core.model.expressions.AbstractCallExpression
-
- net.ssehub.easy.instantiation.core.model.expressions.ResolvableOperationCallExpression
-
- All Implemented Interfaces:
IArgumentProvider
public class ResolvableOperationCallExpression extends AbstractCallExpression
Represents a call to a resolvable operation, i.e., a "function pointer".- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private CallArgument[]argumentsprivate VariableDeclarationvar
-
Constructor Summary
Constructors Constructor Description ResolvableOperationCallExpression(VariableDeclaration var, CallArgument[] arguments)Creates a resolvable operation call expression, i.e., a call expression pointing to a certain operation but which is called through a (parameter) variable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectaccept(IExpressionVisitor visitor)Visits the expression.CallArgumentgetArgument(int index)Returns the specified argument.intgetArgumentsCount()Returns the number of arguments.VariableDeclarationgetVariable()Returns the variable holding the expression to the function pointer.java.lang.StringgetVilSignature()Returns the VIL signature of the resolved operation.TypeDescriptor<?>inferType()Infers the type of this expression including the type of the contained sub-expressions.booleanisPlaceholder()Returns whether this operation is a placeholder, i.e., either the resolved operation is aplaceholder, its signature or its return type does contain aplaceholder type.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.AbstractCallExpression
dynamicDispatch, getName, getParameterType, getPrefix, getQualifiedName, getSignature, getVilSignature, isIteratingCollectionOperation, isOclCompliant, isPlaceholder, resolveOperation, resolveOperation, resolveResolvableOperation
-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.Expression
getFormattingHint, replaceEmptyLine
-
-
-
-
Field Detail
-
var
private VariableDeclaration var
-
arguments
private CallArgument[] arguments
-
-
Constructor Detail
-
ResolvableOperationCallExpression
public ResolvableOperationCallExpression(VariableDeclaration var, CallArgument[] arguments) throws VilException
Creates a resolvable operation call expression, i.e., a call expression pointing to a certain operation but which is called through a (parameter) variable. This is used for resolved "function pointers".- Parameters:
var- the variable holding an expression to the resolved operationResolvableOperationExpressionarguments- the arguments for the call- Throws:
VilException- in case that no arguments are given, or the arguments do not match the parameters provided by the type ofvar
-
-
Method Detail
-
getVariable
public VariableDeclaration getVariable()
Returns the variable holding the expression to the function pointer.- Returns:
- the variable
-
isPlaceholder
public boolean isPlaceholder()
Description copied from class:AbstractCallExpressionReturns whether this operation is a placeholder, i.e., either the resolved operation is aplaceholder, its signature or its return type does contain aplaceholder type.- Specified by:
isPlaceholderin classAbstractCallExpression- Returns:
trueif this operation is a placeholder and cannot be executed,falseelse
-
getVilSignature
public java.lang.String getVilSignature()
Description copied from class:AbstractCallExpressionReturns the VIL signature of the resolved operation.- Specified by:
getVilSignaturein classAbstractCallExpression- Returns:
- the VIL signature
-
getArgumentsCount
public int getArgumentsCount()
Description copied from class:AbstractCallExpressionReturns the number of arguments.- Specified by:
getArgumentsCountin interfaceIArgumentProvider- Specified by:
getArgumentsCountin classAbstractCallExpression- Returns:
- the number of arguments
-
getArgument
public CallArgument getArgument(int index)
Description copied from class:AbstractCallExpressionReturns the specified argument.- Specified by:
getArgumentin interfaceIArgumentProvider- Specified by:
getArgumentin classAbstractCallExpression- Parameters:
index- the 0-based index of the argument to return- Returns:
- the argument
-
inferType
public TypeDescriptor<?> inferType() throws VilException
Description copied from class:ExpressionInfers the type of this expression including the type of the contained sub-expressions.- Specified by:
inferTypein classExpression- Returns:
- the type of this expression
- Throws:
VilException- in case that inferring the type fails
-
accept
public java.lang.Object accept(IExpressionVisitor visitor) throws VilException
Description copied from class:ExpressionVisits the expression.- Specified by:
acceptin classExpression- Parameters:
visitor- the visitor- Returns:
- the result of visiting this expression (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
-