def nonterminal(self, nt, args):
    has_len = hasattr(args, '__len__')
    collect = ('tokens',)
    if (nt in collect):
        rv = args[0]
        for arg in args[1:]:
            rv.append(arg)
    if (has_len and (len(args) == 1) and hasattr(args[0], '__len__') and (len(args[0]) == 1)):
        rv = GenericASTBuilder.nonterminal(self, nt, args[0])
        del args[0]
    else:
        rv = GenericASTBuilder.nonterminal(self, nt, args)
    return rv
def nonterminal(self, nt, args):
    has_len = hasattr(args, '__len__')
    collect = ('tokens',)
    if (nt in collect):
        rv = args[0]
        for arg in args[1:]:
            rv.append(arg)
    if (has_len and (len(args) == 1) and hasattr(args[0], '__len__') and (len(args[0]) == 1)):
        rv = GenericASTBuilder.nonterminal(self, nt, args[0])
        del args[0]
    else:
        rv = GenericASTBuilder.nonterminal(self, nt, args)
    return rv