internal void CopyFrom(ref EvalStack stack)
 {
     this.buffer.CopyFrom(ref stack.buffer);
     this.frames = stack.frames;
     this.stack = stack.stack;
     this.contextOnTopOfStack = stack.contextOnTopOfStack;
 }
 internal ProcessingContext()
 {
     this.valueStack = new EvalStack(2, 4);
     this.sequenceStack = new EvalStack(1, 2);
     this.nodeCount = -1;
 }
 internal void TransferPositionsTo(ref EvalStack stack)
 {
     StackFrame topArg = this.TopArg;
     stack.PushFrame();
     for (int i = topArg.basePtr; i <= topArg.endPtr; i++)
     {
         NodeSequence sequence = this.buffer.buffer[i].Sequence;
         int count = sequence.Count;
         if ((this.stack.stackPtr + count) > this.stack.bounds.end)
         {
             this.GrowStack(count);
         }
         for (int j = 0; j < count; j++)
         {
             stack.Push((double) sequence.Items[j].Position);
         }
     }
 }
 internal void TransferSequenceSizeTo(ref EvalStack stack)
 {
     StackFrame topArg = this.TopArg;
     stack.PushFrame();
     for (int i = topArg.basePtr; i <= topArg.endPtr; i++)
     {
         NodeSequence sequence = this.buffer.buffer[i].Sequence;
         int count = sequence.Count;
         if ((this.stack.stackPtr + count) > this.stack.bounds.end)
         {
             this.GrowStack(count);
         }
         for (int j = 0; j < count; j++)
         {
             stack.Push((double) NodeSequence.GetContextSize(sequence, j));
         }
     }
 }
        internal void PopSequenceFrameTo(ref EvalStack dest)
        {
            StackFrame topArg = this.TopArg;
            dest.PushFrame();
            int count = topArg.Count;
            switch (count)
            {
                case 0:
                    break;

                case 1:
                    dest.Push(this.buffer.buffer[topArg.basePtr].Sequence);
                    break;

                default:
                    dest.Push(this.buffer.buffer, topArg.basePtr, count);
                    break;
            }
            this.stack.stackPtr = topArg.basePtr - 1;
            this.frames.stackPtr--;
        }