Beispiel #1
0
        /// <summary> push into the current execution stack the execution stack that we get as parameter, but in reverse order</summary>
        /// <param name="inExecStack">- the execution stack to be pushed </param>
        internal void pushUpSideDown(ExecutionStack inExecStack)
        {
            var tmpStack = new ExecutionStack(inExecStack);
            ExecutionStackEntry tmpStackEntry;

            while (!tmpStack.empty())
            {
                tmpStackEntry = tmpStack.pop();
                _execStack.Push(tmpStackEntry);
            }
        }
Beispiel #2
0
        /// <summary> reverse the order of the entries in the current execution stack</summary>
        internal void reverse()
        {
            var tmpExecStack = new ExecutionStack(this);
            ExecutionStackEntry tmpExecStackEntry;

            clear();

            while (!tmpExecStack.empty())
            {
                tmpExecStackEntry = tmpExecStack.pop();
                push(tmpExecStackEntry);
            }
        }
Beispiel #3
0
        /// <summary> checks if two execution stacks are equal</summary>
        /// <param name="execStackCmp">- execution stack to compare to the current </param>
        /// <returns>s an indication whether the two are equal or not </returns>
        public override bool Equals(Object execStackCmp)
        {
            var  tmpExecStack    = new ExecutionStack(this);
            var  tmpExecStackCmp = new ExecutionStack((ExecutionStack)execStackCmp);
            bool equalStacks     = false;

            if (tmpExecStack.size() == tmpExecStackCmp.size())
            {
                equalStacks = true;
                while (!tmpExecStack.empty() && equalStacks)
                {
                    if (!tmpExecStack.pop().Equals(tmpExecStackCmp.pop()))
                    {
                        equalStacks = false;
                    }
                }
            }

            return(equalStacks);
        }
Beispiel #4
0
 /// <summary> constructor which copies the parameter execution stack</summary>
 /// <param name="inExecStack">- the execution stack to copy </param>
 internal ExecutionStack(ExecutionStack inExecStack)
 {
     _execStack = (Stack)inExecStack.getStack().Clone();
 }