Parse a RADL document.

    Args:
    - data(str): filepath to a RADL content or a string with content.

    Return: RADL object.

def parse_radl(data):
    """
    Parse a RADL document.

    Args:
    - data(str): filepath to a RADL content or a string with content.

    Return: RADL object.
    """

    if data is None:
        return None
    elif os.path.isfile(data):
        f = open(data)
        data = "".join(f.readlines())
        f.close()
    elif data.strip() == "":
        return RADL()
    data = data + "\n"

    parser = RADLParser(lextab='radl')
    return parser.parse(data)