'Resolve the given CITDL and start scope to a
(<name>, <containing-scope>).
Note that this is a poorman\'s version of the full-on _hit_from_cidtl()
in tree_python.py. This one doesn\'t look in imports, etc. Mainly this
is okay because for the CILE\'ing we (at least I think so) only need
to resolve CITDL for assignment to class and function attributes.'

def _resolve_citdl(self, citdl, start_scope):

    DEBUG = True
    if DEBUG:
        print ('--    resolve    citdl    %r    starting    in    %r' % (citdl, start_scope))
    tokens = list(self._tokenize_citdl(citdl))
    print tokens
    first_token = tokens[0]
    scope = start_scope
    while scope:
        if DEBUG:
            print ('look    for    CITDL    token    %r    in    %r' % (first_token, scope))
        if (first_token in scope):
            break
        scope = scope.parent
    else:
        return (None, None)
    token = first_token
    for t in tokens[1:]:
        if (t not in ('()',)):
            next = scope.get(t)
            if next:
                scope = next
                token = t
            else:
                return (None, None)
        print '***    token=', token, '    scope=', scope
    return (token, scope)
