Class StrategyCallExpression

  • All Implemented Interfaces:
    IArgumentProvider

    public class StrategyCallExpression
    extends CallExpression
    Implements a strategy call.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • StrategyCallExpression

        StrategyCallExpression()
                        throws VilException
        Constructor for serialization.
        Throws:
        VilException - shall not happen
      • StrategyCallExpression

        public StrategyCallExpression​(java.lang.Object parent,
                                      java.lang.String name,
                                      Expression... arguments)
                               throws VilException
        Creates a new instantiator strategy call.
        Parameters:
        parent - the parent language unit (if given used as optional parameter during calls)
        name - the name of the call
        arguments - the parameter for the call
        Throws:
        VilException - in case that no argument is given
      • StrategyCallExpression

        public StrategyCallExpression​(java.lang.Object parent,
                                      java.lang.String name,
                                      CallArgument... arguments)
                               throws VilException
        Creates a new instantator strategy call.
        Parameters:
        parent - the parent language unit (if given used as optional parameter during calls)
        name - the name of the call
        arguments - the parameter for the call
        Throws:
        VilException - in case that no argument is given
      • StrategyCallExpression

        public StrategyCallExpression​(VariableDeclaration nameVar,
                                      Expression... arguments)
                               throws VilException
        Creates a new system execution strategy call.
        Parameters:
        nameVar - the variable holding the actual name/path of the executable
        arguments - the parameter for the call
        Throws:
        VilException - in case that no argument is given
      • StrategyCallExpression

        public StrategyCallExpression​(VariableDeclaration nameVar,
                                      CallArgument... arguments)
                               throws VilException
        Creates a new system execution strategy call.
        Parameters:
        nameVar - the variable holding the actual name/path of the executable
        arguments - the parameter for the call
        Throws:
        VilException - in case that no argument is given
    • Method Detail

      • setTypeRegistry

        public void setTypeRegistry​(TypeRegistry registry)
        Defines the type registry to be used for resolving this call. The type registry is transient and used only during resolution of instantiator calls.
        Parameters:
        registry - the type registry to use
      • getNameVariable

        public VariableDeclaration getNameVariable()
        Returns the variable declaration holding the actual name.
        Returns:
        the variable declaration holding the actual name
      • doZeroArgumentTest

        protected boolean doZeroArgumentTest()
        Returns whether the zero argument test shall be applied.
        Overrides:
        doZeroArgumentTest in class CallExpression
        Returns:
        true if the test shall be applied, false else
      • inferTypeExecute

        private TypeDescriptor<?> inferTypeExecute()
                                            throws VilException
        Resolves the expression for system call execution.
        Returns:
        the type of executing a system call
        Throws:
        VilException - in case that the operands are not compatible
      • accept

        public java.lang.Object accept​(IExpressionVisitor visitor)
                                throws VilException
        Description copied from class: Expression
        Visits the expression.
        Overrides:
        accept in class CallExpression
        Parameters:
        visitor - the visitor
        Returns:
        the result of visiting this expression (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • isPlaceholder

        public boolean isPlaceholder()
        Description copied from class: AbstractCallExpression
        Returns whether this operation is a placeholder, i.e., either the resolved operation is a placeholder, its signature or its return type does contain a placeholder type.
        Overrides:
        isPlaceholder in class CallExpression
        Returns:
        true if this operation is a placeholder and cannot be executed, false else