class ConditionParser {

    public Condition parse() throws ParseException {
        parseReturnSentence();
        functionName = parseFunctionName();
        functionName = functionName.substring(KIE_FUNCTIONS.length());
        List<FunctionDef> functionDefs = FunctionsRegistry.getInstance().getFunctions(functionName);

        if (functionDefs.isEmpty()) {
            throw new ParseException(errorMessage(FUNCTION_NAME_NOT_RECOGNIZED_ERROR, functionName), parseIndex);
        }

        ParseException lastTryException = null;
        for (FunctionDef functionDef : functionDefs) {
            try {
                reset();
                return parse(functionDef);
            } catch (ParseException e) {
                lastTryException = e;
            }
        }
        throw lastTryException;
    }

    public  ConditionParser(String expression);

}