// 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;


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;
                treeConstructor.popCurrentNode();
                if (!treeConstructor.isHtmlFragmentParsing() && !Common.isHtmlNS(treeConstructor.getCurrentNode(), "frameset")) {
                    treeConstructor.setInsertionMode(TreeConstructionInsertionMode.AFTER_FRAMESET);
                }
            }
        } else if (Common.isStartTagNamed(tokenType, "frame", tagName)) {
            treeConstructor.insertHtmlElementToken();
            treeConstructor.popCurrentNode();
            treeConstructor.ackSelfClosingTagIfSet();
        } else if (Common.isStartTagNamed(tokenType, "noframes", tagName)) {
            TreeConstructorAftersBeforeInitialInHead.inHead(tokenType, tagName, treeConstructor);
        } else if (tokenType == EOF) {
            if (!Common.isHtmlNS(treeConstructor.getCurrentNode(), "html")) {
                treeConstructor.emitParseError();
            }
            treeConstructor.stopParsing();
        } else {
            treeConstructor.emitParseError();
            // ignore token
        }
    }
    
    static void inSelect(byte tokenType, String tagName, TreeConstructor treeConstructor) {
        if (tokenType == CHARACTER && treeConstructor.getChr() == Characters.NULL) {
            treeConstructor.emitParseError();
            // ignore
        } else if (tokenType == CHARACTER) {
            treeConstructor.insertCharacter();
        } else if (tokenType == COMMENT) {
            treeConstructor.insertComment();
// 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/TreeConstructorInFramesetSelectTemplate.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;

                treeConstructor.popCurrentNode();
                if (!treeConstructor.isHtmlFragmentParsing() && !Common.isHtmlNS(treeConstructor.getCurrentNode(), "frameset")) {
                    treeConstructor.setInsertionMode(TreeConstructionInsertionMode.AFTER_FRAMESET);
                }
            }
        } else if (Common.isStartTagNamed(tokenType, "frame", tagName)) {
            treeConstructor.insertHtmlElementToken();
            treeConstructor.popCurrentNode();
            treeConstructor.ackSelfClosingTagIfSet();
        } else if (Common.isStartTagNamed(tokenType, "noframes", tagName)) {
            TreeConstructorAftersBeforeInitialInHead.inHead(tokenType, tagName, treeConstructor);
        } else if (tokenType == EOF) {
            if (!Common.isHtmlNS(treeConstructor.getCurrentNode(), "html")) {
                treeConstructor.emitParseError();
            }
            treeConstructor.stopParsing();
        } else {
            treeConstructor.emitParseError();
            // ignore token
        }
    }
    
    static void inSelect(byte tokenType, String tagName, TreeConstructor treeConstructor) {
        if (tokenType == CHARACTER && treeConstructor.getChr() == Characters.NULL) {
            treeConstructor.emitParseError();
            // ignore
        } else if (tokenType == CHARACTER) {
            treeConstructor.insertCharacter();
        } else if (tokenType == COMMENT) {
            treeConstructor.insertComment();
        } else if (tokenType == DOCTYPE) {