Exemplo n.º 1
0
 public override void Visit(MultiplicationExpression me)
 {
     _sb.Append("(");
     me.LHS.Accept(this);
     _sb.Append("*");
     me.RHS.Accept(this);
     _sb.Append(")");
 }
Exemplo n.º 2
0
        // change to Main to run.
        public static void Main(string[] args)
        {
            var simpleAddition = new AdditionExpression6(new Value(2), new Value(3));
            var ep             = new ExpressionPrinter5();

            ep.Visit(simpleAddition);
            Console.WriteLine(ep.ToString());

            var simpleMultiplication = new MultiplicationExpression(new Value(7), new Value(7));
            var ep2 = new ExpressionPrinter5();

            ep2.Visit(simpleMultiplication);
            Console.WriteLine(ep2.ToString());
        }
Exemplo n.º 3
0
 public abstract void Visit(MultiplicationExpression me);