@Override public Scanner newScanner(char[] input, int inputLength) { return new DocCommentScanner(this, input, inputLength); } }
/** * Read next character in doc comment, skipping over double '\' characters. * If a double '\' is skipped, put in the buffer and update buffer count. */ private void scanDocCommentChar() { scanChar(); if (ch == '\\') { if (buf[bp+1] == '\\' && unicodeConversionBp != bp) { if (docCommentCount == docCommentBuffer.length) expandCommentBuffer(); docCommentBuffer[docCommentCount++] = ch; bp++; col++; } else { convertUnicode(); } } }
pos = pos(); buf = getRawCharacters(pos, endPos()); buflen = buf.length; bp = 0; scanDocCommentChar(); scanDocCommentChar(); scanDocCommentChar(); scanDocCommentChar(); firstLine = false; } else if (ch == CR) { scanDocCommentChar(); if (ch == LF) { scanDocCommentChar(); firstLine = false; switch(ch) { case ' ': scanDocCommentChar(); break; case '\t': col = ((col - 1) / TabInc * TabInc) + TabInc; scanDocCommentChar(); break; case FF: col = 0;
/** Build a map for translating between line numbers and * positions in the input. * * @return a LineMap */ public Position.LineMap getLineMap() { char[] buf = getRawCharacters(); return Position.makeLineMap(buf, buf.length, true); } }
/** Read next character. */ private void scanChar() { bp++; ch = buf[bp]; switch (ch) { case '\r': // return col = 0; break; case '\n': // newline if (bp == 0 || buf[bp-1] != '\r') { col = 0; } break; case '\t': // tab col = (col / TabInc * TabInc) + TabInc; break; case '\\': // possible Unicode col++; convertUnicode(); break; default: col++; break; } }
pos = pos(); buf = getRawCharacters(pos, endPos()); buflen = buf.length; bp = 0; scanDocCommentChar(); scanDocCommentChar(); scanDocCommentChar(); scanDocCommentChar(); firstLine = false; } else if (ch == CR) { scanDocCommentChar(); if (ch == LF) { scanDocCommentChar(); firstLine = false; switch(ch) { case ' ': scanDocCommentChar(); break; case '\t': col = ((col - 1) / TabInc * TabInc) + TabInc; scanDocCommentChar(); break; case FF: col = 0;
/** Build a map for translating between line numbers and * positions in the input. * * @return a LineMap */ public Position.LineMap getLineMap() { char[] buf = getRawCharacters(); return Position.makeLineMap(buf, buf.length, true); } }
/** Read next character. */ private void scanChar() { bp++; ch = buf[bp]; switch (ch) { case '\r': // return col = 0; break; case '\n': // newline if (bp == 0 || buf[bp-1] != '\r') { col = 0; } break; case '\t': // tab col = (col / TabInc * TabInc) + TabInc; break; case '\\': // possible Unicode col++; convertUnicode(); break; default: col++; break; } }
/** * Read next character in doc comment, skipping over double '\' characters. * If a double '\' is skipped, put in the buffer and update buffer count. */ private void scanDocCommentChar() { scanChar(); if (ch == '\\') { if (buf[bp+1] == '\\' && unicodeConversionBp != bp) { if (docCommentCount == docCommentBuffer.length) expandCommentBuffer(); docCommentBuffer[docCommentCount++] = ch; bp++; col++; } else { convertUnicode(); } } }
@Override public Scanner newScanner(char[] input, int inputLength) { return new DocCommentScanner(this, input, inputLength); } }
@Override public Scanner newScanner(CharSequence input) { if (input instanceof CharBuffer) { return new DocCommentScanner(this, (CharBuffer)input); } else { char[] array = input.toString().toCharArray(); return newScanner(array, array.length); } }
@Override public Scanner newScanner(CharSequence input) { if (input instanceof CharBuffer) { return new DocCommentScanner(this, (CharBuffer)input); } else { char[] array = input.toString().toCharArray(); return newScanner(array, array.length); } }