def _tgrep_node_label_pred_use_action(_s, _l, tokens):
 assert (len(tokens) == 1)
 assert tokens[0].startswith(u'=')
 node_label = tokens[0][1:]
 def node_label_use_pred(n, m=None, l=None):
  if ((l is None) or (node_label not in l)):
   raise TgrepException(u'node_label ={0} not bound in pattern'.format(node_label))
  node = l[node_label]
  return (n is node)
 return node_label_use_pred

def _tgrep_node_label_pred_use_action ( _s , _l , tokens ) : assert ( len ( tokens ) == 1 ) assert tokens [ 0 ] . startswith ( u'=' ) node_label = tokens [ 0 ] [ 1 : ] def node_label_use_pred ( n , m = None , l = None ) : if ( ( l is None ) or ( node_label not in l ) ) : raise TgrepException ( u'node_label ={0} not bound in pattern' . format ( node_label ) ) node = l [ node_label ] return ( n is node ) return node_label_use_pred
builds a lambda function representing a predicate on a tree node which describes the use of a previously bound node label .