def parse(tokens, object):
    """ does the parse of the scanned/tokenized JSON string
        @param tokens list of JSON tokens
        @param object final dictionary or one 'node' in the tree while parsing """
    name  = None
    array = None

    while len(tokens) > 0:
        token = tokens.pop()
        if token == "{":
            if array == None:
                if not name == None:
                    object[name] = object.__class__()
                    parse(tokens, object[name])
                    name = None
            else:
                subObject = object.__class__()
                array.append(parse(tokens, subObject))
        elif token == "}":
            return object
        elif token == "[":
            array = []
        elif token == "]":
            assert not name == None
            object[name] = array
            array        = None
            name         = None
        elif token in [':', ',']:
            pass
        elif token in [True, False, None]:
            if array == None:
                assert not name == None
                object[name] = token
            else:
                array.append(token)
        elif type(token) in [type(0), type(0.0)]:
            if array == None:
                assert not name == None
                object[name] = token
            else:
                array.append(token)
        elif type(token) == type(""):
            if array == None:
                if not name == None:
                    object[name] = token
                    name = None
                else:
                    name = token
            else:
                array.append(token)
    return object
 does the parse of the scanned/tokenized JSON string
        @param tokens list of JSON tokens
        @param object final dictionary or one 'node' in the tree while parsing 
recipes/Python/578529_easyjsonpy__parsing_JSbuffer/recipe-578529.py