Exemple #1
0
        /// <summary>
        /// Execute the operand
        /// </summary>
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            interpreter.LeaveProcedureCreation();

            if (interpreter.ProcedureCreationLevel == 0)
            {
                ArrayOperand array = new ArrayOperand();
                array.IsExecutable = true;
                array.LineNumber   = LineNumber;

                var op = operandStack.Pop();
                var beginProcedureOperand = op as BeginProcedureOperand;

                while (beginProcedureOperand == null || beginProcedureOperand != null && beginProcedureOperand.Level > 1)
                {
                    var proxy = new OperandProxy(op);
                    array.Values.Add(proxy);
                    op = operandStack.Pop();
                    beginProcedureOperand = op as BeginProcedureOperand;
                }

                array.Values.Reverse();
                operandStack.Push(array);
            }
            else
            {
                operandStack.Push(this);
            }
        }