// Path: kheera-testrunner/src/main/java/gherkin/ast/Location.java
// public class Location {
//     private final int line;
//     private final int column;
// 
//     public Location(int line, int column) {
//         this.line = line;
//         this.column = column;
//     }
// 
//     public int getLine() {
//         return line;
//     }
// 
//     public int getColumn() {
//         return column;
//     }
// }
// 
// Path: kheera-testrunner/src/main/java/gherkin/Parser.java
// public interface ITokenMatcher {
//     boolean match_EOF(Token token);
//     boolean match_Empty(Token token);
//     boolean match_Comment(Token token);
//     boolean match_TagLine(Token token);
//     boolean match_FeatureLine(Token token);
//     boolean match_BackgroundLine(Token token);
//     boolean match_ScenarioLine(Token token);
//     boolean match_ScenarioOutlineLine(Token token);
//     boolean match_ExamplesLine(Token token);
//     boolean match_StepLine(Token token);
//     boolean match_DocStringSeparator(Token token);
//     boolean match_TableRow(Token token);
//     boolean match_Language(Token token);
//     boolean match_Other(Token token);
//     void reset();
// }
// 
// Path: kheera-testrunner/src/main/java/gherkin/Parser.java
// public enum TokenType {
//     None,
//     EOF,
//     Empty,
//     Comment,
//     TagLine,
//     FeatureLine,
//     BackgroundLine,
//     ScenarioLine,
//     ScenarioOutlineLine,
//     ExamplesLine,
//     StepLine,
//     DocStringSeparator,
//     TableRow,
//     Language,
//     Other,
//     ;
// }


import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import gherkin.ast.Location;
import static gherkin.Parser.ITokenMatcher;
import static gherkin.Parser.TokenType;
package gherkin;




public class TokenMatcher implements ITokenMatcher {
    private static final Pattern LANGUAGE_PATTERN = Pattern.compile("^\\s*#\\s*language\\s*:\\s*([a-zA-Z\\-_]+)\\s*$");
    private final IGherkinDialectProvider dialectProvider;
    private GherkinDialect currentDialect;
    private String activeDocStringSeparator = null;
    private int indentToRemove = 0;

    public TokenMatcher(IGherkinDialectProvider dialectProvider) {
        this.dialectProvider = dialectProvider;
        reset();
    }

    @Override
    public void reset() {
        activeDocStringSeparator = null;
        indentToRemove = 0;
        currentDialect = dialectProvider.getDefaultDialect();
    }

    public GherkinDialect getCurrentDialect() {
        return currentDialect;
    }

    protected void setTokenMatched(Token token, TokenType matchedType, String text, String keyword, Integer indent, List<GherkinLineSpan> items) {
        token.matchedType = matchedType;
        token.matchedKeyword = keyword;
        token.matchedText = text;
        token.mathcedItems = items;
        token.matchedGherkinDialect = getCurrentDialect();
        token.matchedIndent = indent != null ? indent : (token.line == null ? 0 : token.line.indent());
// Path: kheera-testrunner/src/main/java/gherkin/ast/Location.java
// public class Location {
//     private final int line;
//     private final int column;
// 
//     public Location(int line, int column) {
//         this.line = line;
//         this.column = column;
//     }
// 
//     public int getLine() {
//         return line;
//     }
// 
//     public int getColumn() {
//         return column;
//     }
// }
// 
// Path: kheera-testrunner/src/main/java/gherkin/Parser.java
// public interface ITokenMatcher {
//     boolean match_EOF(Token token);
//     boolean match_Empty(Token token);
//     boolean match_Comment(Token token);
//     boolean match_TagLine(Token token);
//     boolean match_FeatureLine(Token token);
//     boolean match_BackgroundLine(Token token);
//     boolean match_ScenarioLine(Token token);
//     boolean match_ScenarioOutlineLine(Token token);
//     boolean match_ExamplesLine(Token token);
//     boolean match_StepLine(Token token);
//     boolean match_DocStringSeparator(Token token);
//     boolean match_TableRow(Token token);
//     boolean match_Language(Token token);
//     boolean match_Other(Token token);
//     void reset();
// }
// 
// Path: kheera-testrunner/src/main/java/gherkin/Parser.java
// public enum TokenType {
//     None,
//     EOF,
//     Empty,
//     Comment,
//     TagLine,
//     FeatureLine,
//     BackgroundLine,
//     ScenarioLine,
//     ScenarioOutlineLine,
//     ExamplesLine,
//     StepLine,
//     DocStringSeparator,
//     TableRow,
//     Language,
//     Other,
//     ;
// }


// Path: kheera-testrunner/src/main/java/gherkin/TokenMatcher.java
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import gherkin.ast.Location;
import static gherkin.Parser.ITokenMatcher;
import static gherkin.Parser.TokenType;

package gherkin;




public class TokenMatcher implements ITokenMatcher {
    private static final Pattern LANGUAGE_PATTERN = Pattern.compile("^\\s*#\\s*language\\s*:\\s*([a-zA-Z\\-_]+)\\s*$");
    private final IGherkinDialectProvider dialectProvider;
    private GherkinDialect currentDialect;
    private String activeDocStringSeparator = null;
    private int indentToRemove = 0;

    public TokenMatcher(IGherkinDialectProvider dialectProvider) {
        this.dialectProvider = dialectProvider;
        reset();
    }

    @Override
    public void reset() {
        activeDocStringSeparator = null;
        indentToRemove = 0;
        currentDialect = dialectProvider.getDefaultDialect();
    }

    public GherkinDialect getCurrentDialect() {
        return currentDialect;
    }

    protected void setTokenMatched(Token token, TokenType matchedType, String text, String keyword, Integer indent, List<GherkinLineSpan> items) {
        token.matchedType = matchedType;
        token.matchedKeyword = keyword;
        token.matchedText = text;
        token.mathcedItems = items;
        token.matchedGherkinDialect = getCurrentDialect();
        token.matchedIndent = indent != null ? indent : (token.line == null ? 0 : token.line.indent());
        token.location = new Location(token.location.getLine(), token.matchedIndent + 1);