public Fraction evaluate(String expression) {

		IEvaluable ev;


		try {
			TokenList tl = tokenizer.tokenize(expression);

			if (debug) System.out.println("\nBuilding syntax tree...");

			ev = tl.parse();
		} catch (ParseError e) {
			throw e;
		} catch (NumberFormatException e) {
			throw new ParseError("Invalid number format.");
		} catch (Exception e) {
			throw new ParseError(e);
		}

		if (debug) System.out.println("\nSyntax tree:\n" + ev + "\n");

		Fraction out = ev.evaluate();
		return out;
	}