Example #1
0
 public void Visit(AdditionExpression obj)
 {
     sb.Append("(");
     obj.Left.Accept(this);
     sb.Append("+");
     obj.Right.Accept(this);
     sb.Append(")");
 }
Example #2
0
        static void Main(string[] args)
        {
            var e = new AdditionExpression(
                new DoubleExpression(1),
                new AdditionExpression(
                    new DoubleExpression(2),
                    new DoubleExpression(3)
                    ));

            var ep = new ExpressionPrinter();

            ep.Visit(e);
            WriteLine(ep.ToString());
        }