public static void Print(NewAdditionExpression ae, StringBuilder sb)
 {
     sb.Append("(");
     Print((dynamic)ae.Left, sb);
     sb.Append("+");
     Print((dynamic)ae.Right, sb);
     sb.Append(")");
 }
Esempio n. 2
0
        private static void Test2()
        {
            var additionalExpression = new NewAdditionExpression(new NewDoubleExpression(1),
                                                                 new NewAdditionExpression(new NewDoubleExpression(2),
                                                                                           new NewDoubleExpression(3)));
            var sb = new StringBuilder();

            additionalExpression.Print(sb);
            Console.WriteLine(sb);
        }
Esempio n. 3
0
        private static void Test4()
        {
            NewExpression additionalExpression = new NewAdditionExpression(new NewDoubleExpression(1),
                                                                           new NewAdditionExpression(new NewDoubleExpression(2),
                                                                                                     new NewDoubleExpression(3)));
            var sb = new StringBuilder();

            DynamicExpressionPrinter.Print((dynamic)additionalExpression, sb);
            Console.WriteLine(sb);
        }