Class ContextStack

java.lang.Object
net.ssehub.easy.varModel.cstEvaluation.ContextStack

class ContextStack extends Object
Realizes a context stack for evaluating nested self expressions.
Author:
Holger Eichelberger
  • Field Details

  • Constructor Details

    • ContextStack

      ContextStack()
  • Method Details

    • push

      void push(EvaluationAccessor ex)
      Pushes a context frame for the given expression.
      Parameters:
      ex - the expression (will not be released
    • push

      void push()
      Pushes an empty frame.
    • push

      void push(ContainerInitializer init)
      Pushes a frame with given initializer.
      Parameters:
      init - the initializer
      See Also:
    • setVariable

      void setVariable(DecisionVariableDeclaration var)
      Sets the (top-level) variable in the actual frame. Requires push() before.
      Parameters:
      var - the variable
    • setContainerInitializer

      void setContainerInitializer(ContainerInitializer init)
      Sets the container initializer in the actual frame. Requires push() before.
      Parameters:
      init - the initializer
      See Also:
    • setContainerIndex

      void setContainerIndex(int index)
      Sets the container index in the actual frame. Requires push() before.
      Parameters:
      index - the index value
      See Also:
    • setCompoundSlot

      void setCompoundSlot(String slot)
      Sets the compound slot in the actual frame. Requires push() before.
      Parameters:
      slot - the new slot
      See Also:
    • pop

      void pop()
      Pops a context frame.
    • clear

      void clear()
      Clears the whole stack.
    • getSelfValue

      Value getSelfValue()
      Returns the value for self in the current context.
      Returns:
      the expression for self
    • ensureCapacity

      private void ensureCapacity(IDecisionVariable var, ContextStack.StackFrame frame)
      Ensures the capacity of a container variable.
      Parameters:
      var - the variable
      frame - the stack frame with the access index to ensure fore