// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static final byte CHARACTER = 0;
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static final byte COMMENT = 1;
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static final byte DOCTYPE = 2;
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static final byte END_TAG = 4;
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static final byte EOF = 3;
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static final byte START_TAG = 5;
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static void genericRCDataParsing(TreeConstructor treeConstructor) {
//     treeConstructor.insertHtmlElementToken();
//     treeConstructor.tokenizer.setState(TokenizerState.RCDATA_STATE);
//     treeConstructor.originalInsertionMode = treeConstructor.insertionMode;
//     treeConstructor.insertionMode = TreeConstructionInsertionMode.TEXT;
// }
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static void genericRawTextElementParsing(TreeConstructor treeConstructor) {
//     treeConstructor.insertHtmlElementToken();
//     treeConstructor.tokenizer.setState(TokenizerState.RAWTEXT_STATE);
//     treeConstructor.originalInsertionMode = treeConstructor.insertionMode;
//     treeConstructor.insertionMode = TreeConstructionInsertionMode.TEXT;
// }


import static ch.digitalfondue.jfiveparse.TreeConstructor.CHARACTER;
import static ch.digitalfondue.jfiveparse.TreeConstructor.COMMENT;
import static ch.digitalfondue.jfiveparse.TreeConstructor.DOCTYPE;
import static ch.digitalfondue.jfiveparse.TreeConstructor.END_TAG;
import static ch.digitalfondue.jfiveparse.TreeConstructor.EOF;
import static ch.digitalfondue.jfiveparse.TreeConstructor.START_TAG;
import static ch.digitalfondue.jfiveparse.TreeConstructor.genericRCDataParsing;
import static ch.digitalfondue.jfiveparse.TreeConstructor.genericRawTextElementParsing;
    }

    private static void handleEndTagHead(String tagName, TreeConstructor treeConstructor) {
        if ((!"head".equals(tagName) && !"body".equals(tagName) && //
                !"html".equals(tagName) && !"br".equals(tagName))) {
            treeConstructor.emitParseError();
            // ignore
        } else {
            anythingElseHead(treeConstructor);
        }
    }

    private static void handleCharacterHead(TreeConstructor treeConstructor) {
        if (Common.isTabLfFfCrOrSpace(treeConstructor.getChr())) {
            // ignore
        } else {
            anythingElseHead(treeConstructor);
        }
    }

    private static void anythingElseHead(TreeConstructor treeConstructor) {
        Element head = treeConstructor.insertHtmlElementWithEmptyAttributes("head");
        treeConstructor.setHead(head);
        treeConstructor.setInsertionMode(TreeConstructionInsertionMode.IN_HEAD);
        treeConstructor.dispatch();
    }

    static void beforeHtml(byte tokenType, String tagName, TreeConstructor treeConstructor) {

        switch (tokenType) {
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static final byte CHARACTER = 0;
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static final byte COMMENT = 1;
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static final byte DOCTYPE = 2;
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static final byte END_TAG = 4;
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static final byte EOF = 3;
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static final byte START_TAG = 5;
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static void genericRCDataParsing(TreeConstructor treeConstructor) {
//     treeConstructor.insertHtmlElementToken();
//     treeConstructor.tokenizer.setState(TokenizerState.RCDATA_STATE);
//     treeConstructor.originalInsertionMode = treeConstructor.insertionMode;
//     treeConstructor.insertionMode = TreeConstructionInsertionMode.TEXT;
// }
// 
// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructor.java
// static void genericRawTextElementParsing(TreeConstructor treeConstructor) {
//     treeConstructor.insertHtmlElementToken();
//     treeConstructor.tokenizer.setState(TokenizerState.RAWTEXT_STATE);
//     treeConstructor.originalInsertionMode = treeConstructor.insertionMode;
//     treeConstructor.insertionMode = TreeConstructionInsertionMode.TEXT;
// }


// Path: src/main/java/ch/digitalfondue/jfiveparse/TreeConstructorAftersBeforeInitialInHead.java
import static ch.digitalfondue.jfiveparse.TreeConstructor.CHARACTER;
import static ch.digitalfondue.jfiveparse.TreeConstructor.COMMENT;
import static ch.digitalfondue.jfiveparse.TreeConstructor.DOCTYPE;
import static ch.digitalfondue.jfiveparse.TreeConstructor.END_TAG;
import static ch.digitalfondue.jfiveparse.TreeConstructor.EOF;
import static ch.digitalfondue.jfiveparse.TreeConstructor.START_TAG;
import static ch.digitalfondue.jfiveparse.TreeConstructor.genericRCDataParsing;
import static ch.digitalfondue.jfiveparse.TreeConstructor.genericRawTextElementParsing;

    }

    private static void handleEndTagHead(String tagName, TreeConstructor treeConstructor) {
        if ((!"head".equals(tagName) && !"body".equals(tagName) && //
                !"html".equals(tagName) && !"br".equals(tagName))) {
            treeConstructor.emitParseError();
            // ignore
        } else {
            anythingElseHead(treeConstructor);
        }
    }

    private static void handleCharacterHead(TreeConstructor treeConstructor) {
        if (Common.isTabLfFfCrOrSpace(treeConstructor.getChr())) {
            // ignore
        } else {
            anythingElseHead(treeConstructor);
        }
    }

    private static void anythingElseHead(TreeConstructor treeConstructor) {
        Element head = treeConstructor.insertHtmlElementWithEmptyAttributes("head");
        treeConstructor.setHead(head);
        treeConstructor.setInsertionMode(TreeConstructionInsertionMode.IN_HEAD);
        treeConstructor.dispatch();
    }

    static void beforeHtml(byte tokenType, String tagName, TreeConstructor treeConstructor) {

        switch (tokenType) {
        case CHARACTER: