Exemple #1
0
        public override void Execute(EpsInterpreter interpreter)
        {
            var operandStack = interpreter.OperandStack;

            var operand2 = operandStack.Pop();
            var operand1 = operandStack.Pop();

            var isEqual = OperandComparator.IsEqual(operand1, operand2);

            var boolean = new BooleanOperand(isEqual);

            operandStack.Push(boolean);
        }
        /// <summary>
        /// Find a key and return its key/value pair
        /// </summary>
        private int FindKeyValue(Operand key)
        {
            int ret = -1;

            for (int i = 0; i < list.Count; i++)
            {
                KeyValue kv = list[i];

                if (OperandComparator.IsEqual(key, kv.Key))
                {
                    ret = i;
                    break;
                }
            }

            return(ret);
        }