/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ /** * test fuer Expr Klasse */ //-------------------- public class Test { public static void main(String[] argv) { Expr drei = new Const(3); Expr e1 = new BinaryPlus( new Const(48), new UnaryMinus( new BinaryPlus(drei,drei))); Expr e2 = new BinaryMinus( new Mult( new Const(15), drei), drei); System.out.println(e1 + " = " + e1.eval()); System.out.println(e2 + " = " + e2.eval()); } } //--------------------