public GenericObject load(final String filename) {
        final long startTime = System.nanoTime();
        
        if (!openInStream(filename))
            return null;
        
        //notify about loading
        if (settings.isPrintTimingInfo())
            System.out.println("Loading " + filename + ".");
        
        GenericObject root = null;
        
        try {
            root = new GenericObject();
            
            GenericObject curr = readObject(root);
            
            //reading loop (per line mainly)
            while (tokenType != TokenType.EOF) {
                curr = readObject(curr);
            }
        } catch (ParserException ex) {
            System.err.println(ex.getMessage());
            if (!settings.isTryToRecover())
                root = null;
        } finally {
            closeInStream();
        }
        
        //Tell some things about the current state:
        if (m_errors > 0)
            System.out.println("There were " + m_errors + " errors during loading.");
//        System.out.println("Read " + tokenizer.getCharsRead() + " bytes.");
        if (settings.isPrintTimingInfo())
            System.out.println("Loading took " + (System.nanoTime()-startTime) + " ns.\n");
        
        return root;
    }