def _collect_mexp_symbols(value):
    """Get symbols in a math expression.

    :param value: The math expression.
    :rtype : list of str
    :return: A list of symbols.
    """

    #  Get symbols.
    fsm = value.free_symbols

    #  Initialize symbol list.
    ret = []

    #  Pop symbols.
    while len(fsm) != 0:
        ret.append(fsm.pop().name)

    return ret