// Path: sorter/src/main/java/sortpom/logger/SortPomLogger.java
// public interface SortPomLogger {
//     /**
//      * Send a message to the log in the <b>warn</b> error level.
//      *
//      * @param content warning message
//      */
//     void warn(String content);
// 
//     /**
//      * Send a message to the log in the <b>info</b> error level.
//      *
//      * @param content info message
//      */
//     void info(String content);
// 
//     /**
//      * Send a message to the log in the <b>error</b> error level.
//      *
//      * @param content error message
//      */
//     void error(String content);
// }
// 
// Path: sorter/src/main/java/sortpom/processinstruction/InstructionType.java
// enum InstructionType {
//     IGNORE, RESUME;
// 
//     /** non-xml compliant pattern, see http://www.cs.sfu.ca/~cameron/REX.html#IV.2 */
//     static final Pattern INSTRUCTION_PATTERN = Pattern.compile("(?i)<\\?sortpom\\s+([\\w\"'*= ]*)\\s*\\?>");
//     static final Pattern IGNORE_SECTIONS_PATTERN = Pattern.compile(
//             "(?is)<\\?sortpom\\s+" + IGNORE + "\\s*\\?>.*?<\\?sortpom\\s+" + RESUME + "\\s*\\?>");
//     static final Pattern TOKEN_PATTERN = Pattern.compile("(?i)<\\?sortpom\\s+token='(\\d+)'\\s*\\?>");
// 
//     public InstructionType next() {
//         if (this == IGNORE) {
//             return RESUME;
//         }
//         return IGNORE;
//     }
// 
//     public static boolean containsType(String instruction) {
//         return IGNORE.name().equalsIgnoreCase(instruction) || RESUME.name().equalsIgnoreCase(instruction);
//     }
// 
//     public boolean matches(String instruction) {
//         return this.name().equalsIgnoreCase(instruction);
//     }
// }


import sortpom.logger.SortPomLogger;
import java.util.regex.Matcher;
import static sortpom.processinstruction.InstructionType.*;
package sortpom.processinstruction;




/**
 * Check the pom file for processing instructions and verifies that they are correct and balanced
 *
 * @author bjorn
 * @since 2013-12-28
 */
class SortpomPiScanner {
    private final SortPomLogger logger;
// Path: sorter/src/main/java/sortpom/logger/SortPomLogger.java
// public interface SortPomLogger {
//     /**
//      * Send a message to the log in the <b>warn</b> error level.
//      *
//      * @param content warning message
//      */
//     void warn(String content);
// 
//     /**
//      * Send a message to the log in the <b>info</b> error level.
//      *
//      * @param content info message
//      */
//     void info(String content);
// 
//     /**
//      * Send a message to the log in the <b>error</b> error level.
//      *
//      * @param content error message
//      */
//     void error(String content);
// }
// 
// Path: sorter/src/main/java/sortpom/processinstruction/InstructionType.java
// enum InstructionType {
//     IGNORE, RESUME;
// 
//     /** non-xml compliant pattern, see http://www.cs.sfu.ca/~cameron/REX.html#IV.2 */
//     static final Pattern INSTRUCTION_PATTERN = Pattern.compile("(?i)<\\?sortpom\\s+([\\w\"'*= ]*)\\s*\\?>");
//     static final Pattern IGNORE_SECTIONS_PATTERN = Pattern.compile(
//             "(?is)<\\?sortpom\\s+" + IGNORE + "\\s*\\?>.*?<\\?sortpom\\s+" + RESUME + "\\s*\\?>");
//     static final Pattern TOKEN_PATTERN = Pattern.compile("(?i)<\\?sortpom\\s+token='(\\d+)'\\s*\\?>");
// 
//     public InstructionType next() {
//         if (this == IGNORE) {
//             return RESUME;
//         }
//         return IGNORE;
//     }
// 
//     public static boolean containsType(String instruction) {
//         return IGNORE.name().equalsIgnoreCase(instruction) || RESUME.name().equalsIgnoreCase(instruction);
//     }
// 
//     public boolean matches(String instruction) {
//         return this.name().equalsIgnoreCase(instruction);
//     }
// }


// Path: sorter/src/main/java/sortpom/processinstruction/SortpomPiScanner.java
import sortpom.logger.SortPomLogger;
import java.util.regex.Matcher;
import static sortpom.processinstruction.InstructionType.*;

package sortpom.processinstruction;




/**
 * Check the pom file for processing instructions and verifies that they are correct and balanced
 *
 * @author bjorn
 * @since 2013-12-28
 */
class SortpomPiScanner {
    private final SortPomLogger logger;
    private InstructionType expectedNextInstruction = IGNORE;