/* Part3Test.java */
/** A class for testing parsing of Expressions. */
public class Part3Test {
/** The following main program should read a string from the command
* line and print it and its value:
* java Part3Test "(sequence (set x 6) (* x (+ 1 x)))"
* should print
* (sequence (set x 6) (* x (+ 1 x))) = 42
* @exception BadExpressionException if the user inputs a bad expression.
*/
public static void main(String[] argv)
throws BadExpressionException {
Expression e = Expression.parse(argv[0]);
System.out.println(e.toString() + " = " + e.eval().toString());
}
}