Class Call

    • Constructor Detail

      • Call

        protected Call​(CFG cfg,
                       CodeLocation location,
                       Type staticType,
                       Expression... parameters)
        Builds a call happening at the given source location.
        Parameters:
        cfg - the cfg that this expression belongs to
        location - the location where the expression is defined within the source file. If unknown, use null
        parameters - the parameters of this call
        staticType - the static type of this call
    • Method Detail

      • getParameters

        public final Expression[] getParameters()
        Yields the parameters of this call.
        Returns:
        the parameters of this call
      • setOffset

        public final int setOffset​(int offset)
        Description copied from interface: Node
        Sets the offset of this node to the given value, and then proceeds by setting the one of its nested nodes (if any) to subsequent values. The last offset used is returned.
        Parameters:
        offset - the offset to set
        Returns:
        the last offset used while setting the offsets of nested nodes
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Expression
      • semantics

        public final <A extends AbstractState<A,​H,​V>,​H extends HeapDomain<H>,​V extends ValueDomain<V>> AnalysisState<A,​H,​V> semantics​(AnalysisState<A,​H,​V> entryState,
                                                                                                                                                                          InterproceduralAnalysis<A,​H,​V> interprocedural,
                                                                                                                                                                          StatementStore<A,​H,​V> expressions)
                                                                                                                                                                   throws SemanticException
        Semantics of a call statement is evaluated by computing the semantics of its parameters, from left to right, using the analysis state from each parameter's computation as entry state for the next one. Then, the semantics of the call itself is evaluated.

        Computes the semantics of the statement, expressing how semantic information is transformed by the execution of this statement. This method is also responsible for recursively invoking the Statement.semantics(AnalysisState, InterproceduralAnalysis, StatementStore) of each nested Expression, saving the result of each call in expressions.
        Specified by:
        semantics in class Statement
        Type Parameters:
        A - the type of AbstractState
        H - the type of the HeapDomain
        V - the type of the ValueDomain
        Parameters:
        entryState - the entry state that represents the abstract values of each program variable and memory location when the execution reaches this statement
        interprocedural - the interprocedural analysis of the program to analyze
        expressions - the cache where analysis states of intermediate expressions must be stored
        Returns:
        the AnalysisState representing the abstract result of the execution of this statement
        Throws:
        SemanticException - if something goes wrong during the computation
      • callSemantics

        public abstract <A extends AbstractState<A,​H,​V>,​H extends HeapDomain<H>,​V extends ValueDomain<V>> AnalysisState<A,​H,​V> callSemantics​(AnalysisState<A,​H,​V> entryState,
                                                                                                                                                                                 InterproceduralAnalysis<A,​H,​V> interprocedural,
                                                                                                                                                                                 AnalysisState<A,​H,​V>[] computedStates,
                                                                                                                                                                                 ExpressionSet<SymbolicExpression>[] params)
                                                                                                                                                                          throws SemanticException
        Computes the semantics of the call, after the semantics of all parameters have been computed. Meta variables from the parameters will be forgotten after this call returns.
        Type Parameters:
        A - the type of AbstractState
        H - the type of the HeapDomain
        V - the type of the ValueDomain
        Parameters:
        entryState - the entry state of this call
        interprocedural - the interprocedural analysis of the program to analyze
        computedStates - the array of states chaining the parameters' semantics evaluation starting from entryState, namely computedState[i] corresponds to the state obtained by the evaluation of params[i] in the state computedState[i-1] (params[0] is evaluated in entryState)
        params - the symbolic expressions representing the computed values of the parameters of this call
        Returns:
        the AnalysisState representing the abstract result of the execution of this call
        Throws:
        SemanticException - if something goes wrong during the computation
      • accept

        public <V> boolean accept​(GraphVisitor<CFG,​Statement,​Edge,​V> visitor,
                                  V tool)
        Description copied from interface: Node
        Accepts the given GraphVisitor. Implementors of this method are responsible for invoking GraphVisitor.visit(Object, Graph, Node) on this node after Node.accept(GraphVisitor, Object) has been invoked on all nested nodes, if any. The visiting should stop at the first of such calls that return false.
        Type Parameters:
        V - the type of auxiliary tool that visitor can use
        Parameters:
        visitor - the visitor that is visiting the Graph containing this node
        tool - the auxiliary tool that visitor can use
        Returns:
        whether or not the visiting should stop when this call returns, as decided by the visitor itself