<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_expression(clause):
 """ For a clause that could be a field, value, or expression """

    if isinstance(clause, Expression):
        return clause
    elif hasattr(clause, "getName") and clause.getName() != "field":
        if clause.getName() == "nested":
            return AttributeSelection.from_statement(clause)
        elif clause.getName() == "function":
            return SelectFunction.from_statement(clause)
        else:
            return Value(resolve(clause[0]))
    else:
        return Field(clause[0])