Class ExpressionStack


  • public class ExpressionStack
    extends Object
    This class stores the stack of symbolic values corresponding to the order of expression evaluation. Each ProgramState has corresponding instance of ExpressionStack. Note that this class is immutable.
    • Method Detail

      • execute

        public ExpressionStack execute​(ExpressionTree expression,
                                       ProgramStateConstraints constraints)
        This method executes expression: it pushes to the stack a new symbolic value based (if required) on popped symbolic values. Note that as ExpressionStack is an immutable class, this method will return new resulting instance of ExpressionStack while the calling this method instance will not be changed.
        Parameters:
        expression - to be executed
        constraints -
        Returns:
        resulting ExpressionStack
      • size

        public int size()
      • isEmpty

        public boolean isEmpty()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • apply

        public ExpressionStack apply​(Consumer<Deque<SymbolicValue>> action)
        This method allows to perform one or more operations on a copy of the internal stack. It thus guarantees ExpressionStack immutability.
        Parameters:
        action - the operation to perform on the internal stack
        Returns:
        a new instance of ExpressionStack containing the copy of the internal stack modified by the operation