Example #1
0
 def trans2seq(r):
     blocks = []
     func(r, blocks)
     tree = []
     for b in blocks:
         btree = tree_to_index(b)
         tree.append(btree)
     return tree
Example #2
0
 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 []
Example #3
0
 def trans_to_sequences(ast):
     sequence = []
     func(ast, sequence, ast)
     return sequence