public void Visit(AdditionExpression5 obj) { sb.Append("("); obj.Left.Accept(this); sb.Append("+"); obj.Right.Accept(this); sb.Append(")"); }
// change to Main to run. public static void none() { var e = new AdditionExpression5( left: new DoubleExpression5(1), right: new AdditionExpression5( left: new DoubleExpression5(2), right: new DoubleExpression5(3))); var ep = new ExpressionPrinter4(); ep.Visit(e); Console.WriteLine(ep.ToString()); }