def _AppendSubtypeRec(node, subtype, force=True):
 if isinstance(node, pytree.Leaf):
  _AppendTokenSubtype(node, subtype)
  return
 for child in node.children:
  _AppendSubtypeRec(child, subtype, force=force)

def _AppendSubtypeRec ( node , subtype , force = True ) : if isinstance ( node , pytree . Leaf ) : _AppendTokenSubtype ( node , subtype ) return for child in node . children : _AppendSubtypeRec ( child , subtype , force = force )
append the leafs in the node to the given subtype .