Class SymbolicExpression

    • Constructor Detail

      • SymbolicExpression

        protected SymbolicExpression​(Type staticType,
                                     CodeLocation location)
        Builds the symbolic expression.
        Parameters:
        staticType - the static type of this expression, determined at its construction
        location - the code location of the statement that has generated this expression
    • Method Detail

      • getStaticType

        public Type getStaticType()
        Yields the static type of this expression, as provided during construction. The returned type should (but might not) be a supertype of all the runtime types determined during the analysis, with the exception of HeapLocations representing more memory locations.
        Returns:
        the static type
      • accept

        public abstract <T> T accept​(ExpressionVisitor<T> visitor,
                                     java.lang.Object... params)
                              throws SemanticException
        Accepts an ExpressionVisitor, visiting this expression recursively.
        Type Parameters:
        T - the type of value produced by the visiting callbacks
        Parameters:
        visitor - the visitor
        params - additional optional parameters to pass to each visiting callback
        Returns:
        the value produced by the visiting operation
        Throws:
        SemanticException - if an error occurs during the visiting
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

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

        public CodeLocation getCodeLocation()
        Yields the code location of the statement that has generated this symbolic expression. The code location is not used for the equality between two symbolic expressions.
        Returns:
        the code location of the statement that has generated this symbolic expression
      • toString

        public abstract java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • mightNeedRewriting

        public abstract boolean mightNeedRewriting()
        Yields whether or not this expression can be considered safe to be processed by domains that only focus on ValueExpressions, or if it might need rewriting. This is a definite answer: if this method returns true, than this expression is sure to not contain anything that deals with, or points to, the memory.
        Returns:
        whether or not this expression might need rewriting