// Path: src/main/java/com/orgzly/org/OrgFile.java
// public class OrgFile {
// 
//     /** In-buffer settings. */
//     private OrgFileSettings settings;
// 
//     /** Text before the first heading. */
//     private String preface;
// 
//     public OrgFile() {
// 	}
// 
//     public OrgFileSettings getSettings() {
//         if (settings == null) {
//             settings = new OrgFileSettings();
//         }
//         return settings;
//     }
// 
//     /**
//      * @return Text before first {@link OrgHead} in the file.
//      */
//     public String getPreface() {
//         return preface != null ? preface : "";
//     }
// 
//     public void setPreface(String str) {
//         preface = str;
//     }
// 
//     public String toString() {
// 		return OrgFile.class.getSimpleName() + "[" + preface.length() + "]";
// 	}
// }


import com.orgzly.org.OrgFile;
import java.io.IOException;
import java.io.Reader;
package com.orgzly.org.parser;



/**
 * Parse complete input and return it as {@link OrgParsedFile}.
 */
class OrgDomyParser extends OrgParser {
    private Reader reader;

    public OrgDomyParser(OrgParserSettings settings, Reader reader) {
        this.settings = settings;
        this.reader = reader;
    }

    @Override
    public OrgParsedFile parse() throws IOException {
        final OrgParsedFile parsedFile = new OrgParsedFile();

        OrgParser parser = new Builder(settings)
                .setInput(reader)
                .setListener(new OrgSaxyParserListener() {
                    @Override
                    public void onHead(OrgNodeInList nodeInList) throws IOException {
                        parsedFile.addHead(nodeInList);
                    }

                    @Override
// Path: src/main/java/com/orgzly/org/OrgFile.java
// public class OrgFile {
// 
//     /** In-buffer settings. */
//     private OrgFileSettings settings;
// 
//     /** Text before the first heading. */
//     private String preface;
// 
//     public OrgFile() {
// 	}
// 
//     public OrgFileSettings getSettings() {
//         if (settings == null) {
//             settings = new OrgFileSettings();
//         }
//         return settings;
//     }
// 
//     /**
//      * @return Text before first {@link OrgHead} in the file.
//      */
//     public String getPreface() {
//         return preface != null ? preface : "";
//     }
// 
//     public void setPreface(String str) {
//         preface = str;
//     }
// 
//     public String toString() {
// 		return OrgFile.class.getSimpleName() + "[" + preface.length() + "]";
// 	}
// }


// Path: src/main/java/com/orgzly/org/parser/OrgDomyParser.java
import com.orgzly.org.OrgFile;
import java.io.IOException;
import java.io.Reader;

package com.orgzly.org.parser;



/**
 * Parse complete input and return it as {@link OrgParsedFile}.
 */
class OrgDomyParser extends OrgParser {
    private Reader reader;

    public OrgDomyParser(OrgParserSettings settings, Reader reader) {
        this.settings = settings;
        this.reader = reader;
    }

    @Override
    public OrgParsedFile parse() throws IOException {
        final OrgParsedFile parsedFile = new OrgParsedFile();

        OrgParser parser = new Builder(settings)
                .setInput(reader)
                .setListener(new OrgSaxyParserListener() {
                    @Override
                    public void onHead(OrgNodeInList nodeInList) throws IOException {
                        parsedFile.addHead(nodeInList);
                    }

                    @Override
                    public void onFile(OrgFile file) throws IOException {