def compose_all_from_str(src_str): """ compose all AST from src_str """ pgen = parse.parse(StringIO(src_str)) return iter(partial(compose, pgen), None)
def compose_from_str(src_str): """ compose an AST from src_str """ pgen = parse.parse(StringIO(src_str)) return compose(pgen)
def compose_all_from_stream(stream): """ compose all AST from input stream """ pgen = parse.parse(stream) return iter(partial(compose, pgen), None)
def compose_from_stream(stream): """ compose an AST from an input stream """ pgen = parse.parse(stream) return compose(pgen)