Пример #1
0
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            BinaryFunction other = (BinaryFunction)obj;

            return(left.Equals(other.left) && right.Equals(other.right));
        }
Пример #2
0
        private void VisitBinaryFunction(BinaryFunction function)
        {
            int step = symbolStack.Peek().step;

            switch (step)
            {
            case 0:
                symbolStack.Push(new SymbolProgress(function.left));
                break;

            case 1:
                symbolStack.Push(new SymbolProgress(function.right));
                break;

            case 2:
                symbolStack.Pop();
                VisitTop();
                break;
            }
        }