public double eval() throws EvaluationException {
		if (evaluator == null || expression == null)
			return 0;
		if (expression.startsWith("0x")) {
			try {
				return Integer.valueOf(expression.substring(2), 16);
			}
			catch (NumberFormatException e) {
				throw new EvaluationException("Evaluation exception: " + e.getMessage());
			}
		}
		if (expression.startsWith("#")) {
			try {
				return Integer.valueOf(expression.substring(1), 16);
			}
			catch (NumberFormatException e) {
				throw new EvaluationException("Evaluation exception: " + e.getMessage());
			}
		}
		synchronized (lock) {
			evaluator.parseExpression(expression);
			if (evaluator.hasError())
				throw new EvaluationException("Evaluation exception: " + evaluator.getErrorInfo());
			return evaluator.getValue();
		}
	}