private static void AssertExpression(AlgebraicExpressions expression, string expected)
        {
            var visitor = new ToTextVisitor();

            expression.Accpet(visitor);
            string actual = visitor.GetResult();

            Assert.AreEqual(expected, actual);
        }
Example #2
0
        private static void AssertExpression(AlgebraicExpressions expression, int expected)
        {
            var visitor = new ToValueVisitor();

            expression.Accpet(visitor);
            int actual = visitor.GetResult();

            Assert.AreEqual(expected, actual);
        }
Example #3
0
        protected override void Invoke(object parameter)
        {
            switch (((parameter as System.Windows.RoutedEventArgs).Source as System.Windows.Controls.Button).Name)
            {
            case "button6":
                AlgebraicExpressions alg = new AlgebraicExpressions();
                alg.Show();
                this.Target.Hide();
                break;

            case "button4":
                AngleForm ang = new AngleForm();
                ang.Show();
                this.Target.Hide();
                break;

            case "button5":
                AutoAngleForm autoang = new AutoAngleForm();
                autoang.Show();
                this.Target.Hide();
                break;

            case "button2":
                AutoCalcForm autocalc = new AutoCalcForm();
                autocalc.Show();
                this.Target.Hide();
                break;

            case "button1":
                ManualCalcForm manual = new ManualCalcForm();
                manual.Show();
                this.Target.Hide();
                break;

            case "button3":
                MoreComplexForm more = new MoreComplexForm();
                more.Show();
                this.Target.Hide();
                break;
            }
        }
 public Negation(AlgebraicExpressions operand)
     : base(operand)
 {
 }
 protected BinaryOperator(AlgebraicExpressions leftOperand, AlgebraicExpressions rightOperand)
 {
     LeftOperand = leftOperand;
     RightOperand = rightOperand;
 }
 public Division(AlgebraicExpressions leftOperand, AlgebraicExpressions rightOperand)
     : base(leftOperand, rightOperand)
 {
 }
 public Multiplication(AlgebraicExpressions leftOperand, AlgebraicExpressions rightOperand)
     : base(leftOperand, rightOperand)
 {
 }
 public Multiplication(AlgebraicExpressions leftOperand, AlgebraicExpressions rightOperand)
     : base(leftOperand, rightOperand)
 {
 }
 public Division(AlgebraicExpressions leftOperand, AlgebraicExpressions rightOperand)
     : base(leftOperand, rightOperand)
 {
 }
Example #10
0
 protected UnaryOperator(AlgebraicExpressions operand)
 {
     Operand = operand;
 }
 public Substraction(AlgebraicExpressions leftOperand, AlgebraicExpressions rightOperand)
     : base(leftOperand, rightOperand)
 {
 }
 public Substraction(AlgebraicExpressions leftOperand, AlgebraicExpressions rightOperand)
     : base(leftOperand, rightOperand)
 {
 }
 protected BinaryOperator(AlgebraicExpressions leftOperand, AlgebraicExpressions rightOperand)
 {
     LeftOperand  = leftOperand;
     RightOperand = rightOperand;
 }
 protected UnaryOperator(AlgebraicExpressions operand)
 {
     Operand = operand;
 }
Example #15
0
 public Negation(AlgebraicExpressions operand) : base(operand)
 {
 }