private void _locateToken() {
      if (myTokenEndOffset == myBufferEndOffset) {
        myTokenType = null;
        myBufferIndex = myBufferEndOffset;
        return;
      }

      myBufferIndex = myTokenEndOffset;

      if (myAfterLineBreak) {
        myAfterLineBreak = false;
        while (myTokenEndOffset < myBufferEndOffset
            && myBuffer.charAt(myTokenEndOffset) == '*'
            && (myTokenEndOffset + 1 >= myBufferEndOffset
                || myBuffer.charAt(myTokenEndOffset + 1) != '/')) {
          myTokenEndOffset++;
        }

        myInLeadingSpace = true;
        if (myBufferIndex < myTokenEndOffset) {
          myTokenType = GroovyDocTokenTypes.mGDOC_ASTERISKS;
          return;
        }
      }

      if (myInLeadingSpace) {
        myInLeadingSpace = false;
        boolean lf = false;
        while (myTokenEndOffset < myBufferEndOffset
            && Character.isWhitespace(myBuffer.charAt(myTokenEndOffset))) {
          if (myBuffer.charAt(myTokenEndOffset) == '\n') lf = true;
          myTokenEndOffset++;
        }

        final int state = myFlexLexer.yystate();
        if (state == _GroovyDocLexer.COMMENT_DATA
            || myTokenEndOffset < myBufferEndOffset
                && (myBuffer.charAt(myTokenEndOffset) == '@'
                    || myBuffer.charAt(myTokenEndOffset) == '{'
                    || myBuffer.charAt(myTokenEndOffset) == '\"'
                    || myBuffer.charAt(myTokenEndOffset) == '<')) {
          myFlexLexer.yybegin(_GroovyDocLexer.COMMENT_DATA_START);
        }

        if (myBufferIndex < myTokenEndOffset) {
          myTokenType =
              lf
                      || state == _GroovyDocLexer.PARAM_TAG_SPACE
                      || state == _GroovyDocLexer.TAG_DOC_SPACE
                      || state == _GroovyDocLexer.INLINE_TAG_NAME
                      || state == _GroovyDocLexer.DOC_TAG_VALUE_IN_PAREN
                  ? TokenType.WHITE_SPACE
                  : GroovyDocTokenTypes.mGDOC_COMMENT_DATA;

          return;
        }
      }

      flexLocateToken();
    }
 private void flexLocateToken() {
   try {
     myState = myFlexLexer.yystate();
     myFlexLexer.goTo(myBufferIndex);
     myTokenType = myFlexLexer.advance();
     myTokenEndOffset = myFlexLexer.getTokenEnd();
   } catch (IOException e) {
     // Can't be
   }
 }
 @Override
 public final void start(
     @NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) {
   myBuffer = buffer;
   myBufferIndex = startOffset;
   myBufferEndOffset = endOffset;
   myTokenType = null;
   myTokenEndOffset = startOffset;
   myFlexLexer.reset(myBuffer, startOffset, endOffset, initialState);
 }