public GenericObject loadFromString(String string) {
        final long startTime = System.nanoTime();
        
        //notify about loading
        assert debug("Loading from string.", 2);
        
        openStringStream(string);
        
        GenericObject root = null;
        
        try {
            root = new GenericObject();
            
            GenericObject curr = readObject(root);
            
            while (tokenType != TokenType.EOF) {
                curr = readObject(curr);
            }
        } catch (ParserException ex) {
            if (!settings.isTryToRecover())
                root = null;
        } finally {
            closeInStream();
        }
        
        if (m_errors > 0)
            System.out.println("There were " + m_errors + " errors during loading.");
        
        if (settings.isPrintTimingInfo())
            System.out.println("Loading took " + (System.nanoTime()-startTime) + " ns.\n");
        
        assert debug("The node read was:\n" + root, 6);
        
        return root;
    }