def trans2seq(r): blocks = [] func(r, blocks) tree = [] for b in blocks: btree = tree_to_index(b) tree.append(btree) return tree
def trans2seq(r): blocks = [] func(r, blocks, r) tree = [] #for b in blocks: if(len(blocks) > 0): btree = tree_to_index(blocks[0]) tree.append(btree) return tree return []
def trans_to_sequences(ast): sequence = [] func(ast, sequence, ast) return sequence