private int findToken(int tokenIndex, TokenType tokenType, String exactText)
    {
        while (tokenIndex < tokens.size()) {
            if (tokenIndexHighWaterMark < tokenIndex)
                tokenIndexHighWaterMark = tokenIndex;
            Token token = tokens.get(tokenIndex);
            switch (token.type) {
                case SPACE:
                case NEWLINE:
                case COMMENT:
                    tokenIndex += 1;
                    continue;
            }
            if (token.type != tokenType)
                break;
            if (exactText != null && !token.text.equals(exactText))
                break;
            return tokenIndex;
        }
        return -1;
    }