private void initFormatterCommentParser() { if (this.formatterCommentParser == null) { this.formatterCommentParser = new FormatterCommentParser(this.scanner.sourceLevel); } this.formatterCommentParser.scanner.setSource(this.scanner.source); this.formatterCommentParser.source = this.scanner.source; this.formatterCommentParser.scanner.lineEnds = this.lineEnds; this.formatterCommentParser.scanner.linePtr = this.maxLines; this.formatterCommentParser.parseHtmlTags = this.formatter.preferences.comment_format_html; }
public boolean parse(int start, int end) { // Init this.javadocStart = start; this.javadocEnd = end; this.firstTagPosition = this.javadocStart; // Need to flush html tags stack in case of unclosed ones in previous javadoc comments // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=239941 this.htmlTagsPtr = -1; // parse comment boolean valid = commentParse(); return valid && this.docComment != null; }
protected boolean parseReturn() { createTag(); return true; }
int ptr = this.htmlTagsPtr; while (ptr >= 0) { if (getHtmlTagIndex(this.htmlTags[ptr--]) == JAVADOC_CODE_TAGS_ID) { if (this.textStart == -1) this.textStart = this.inlineTagStarted ? this.inlineTagStart : previousPosition; this.inlineTagStarted = false; this.tagSourceStart = previousPosition; this.scanner.startPosition = this.index; this.scanner.currentCharacter = readChar(); switch (this.scanner.currentCharacter) { case ' ': while (currentChar != ' ' && currentChar != '*' && currentChar != '}' && !ScannerHelper.isWhitespace(currentChar)) { currentPosition = this.index; currentChar = readChar(); if (length == TAG_CATEGORY_LENGTH && CharOperation.equals(TAG_CATEGORY, tagName)) { this.tagValue = TAG_CATEGORY_VALUE; valid = parseIdentifierTag(false); // TODO (frederic) reconsider parameter value when @category will be significant in spec } else if (length == TAG_CODE_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_CODE, tagName)) { this.tagValue = TAG_CODE_VALUE; if (length == TAG_EXCEPTION_LENGTH && CharOperation.equals(TAG_EXCEPTION, tagName)) { this.tagValue = TAG_EXCEPTION_VALUE; valid = parseThrows(); if (length == TAG_INHERITDOC_LENGTH && CharOperation.equals(TAG_INHERITDOC, tagName)) { if (this.reportProblems) { recordInheritedPosition((((long) this.tagSourceStart) << 32) + this.tagSourceEnd);
int currentPosition = start; int htmlPtr = this.htmlTagsPtr; char firstChar = peekChar(); boolean hasWhitespaces = firstChar == ' ' || ScannerHelper.isWhitespace(firstChar); try { int token = readTokenAndConsume(); char[] htmlTag; int htmlIndex; htmlIndex = getHtmlTagIndex(htmlTag); if (htmlIndex == JAVADOC_TAGS_ID_MASK) return false; if (htmlPtr >= 0) { int lastHtmlTagIndex = getHtmlTagIndex(this.htmlTags[htmlPtr]); if ((lastHtmlTagIndex & JAVADOC_TAGS_ID_MASK) == JAVADOC_IMMUTABLE_TAGS_ID) { if (readToken() == TerminalTokens.TokenNameDIVIDE) { consumeToken(); if ((token = readTokenAndConsume()) != TerminalTokens.TokenNameIdentifier) { htmlIndex = getHtmlTagIndex(identifier); if (htmlIndex == JAVADOC_TAGS_ID_MASK) return false; int ptr = this.htmlTagsPtr; switch (readTokenAndConsume()) { case TerminalTokens.TokenNameLESS: case TerminalTokens.TokenNameLESS_EQUAL: switch (readChar()) {
if (! this.formatterCommentParser.parse(start, end-1)) {
int ptr = this.htmlTagsPtr; while (ptr >= 0) { if (getHtmlTagIndex(this.htmlTags[ptr--]) == JAVADOC_CODE_TAGS_ID) { if (this.textStart == -1) this.textStart = this.inlineTagStarted ? this.inlineTagStart : previousPosition; this.inlineTagStarted = false; this.tagSourceStart = previousPosition; this.scanner.startPosition = this.index; this.scanner.currentCharacter = readChar(); switch (this.scanner.currentCharacter) { case ' ': while (currentChar != ' ' && currentChar != '*' && currentChar != '}' && !ScannerHelper.isWhitespace(currentChar)) { currentPosition = this.index; currentChar = readChar(); if (length == TAG_CATEGORY_LENGTH && CharOperation.equals(TAG_CATEGORY, tagName)) { this.tagValue = TAG_CATEGORY_VALUE; valid = parseIdentifierTag(false); // TODO (frederic) reconsider parameter value when @category will be significant in spec } else if (length == TAG_CODE_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_CODE, tagName)) { this.tagValue = TAG_CODE_VALUE; if (length == TAG_EXCEPTION_LENGTH && CharOperation.equals(TAG_EXCEPTION, tagName)) { this.tagValue = TAG_EXCEPTION_VALUE; valid = parseThrows(); if (length == TAG_INHERITDOC_LENGTH && CharOperation.equals(TAG_INHERITDOC, tagName)) { if (this.reportProblems) { recordInheritedPosition((((long) this.tagSourceStart) << 32) + this.tagSourceEnd);
int currentPosition = start; int htmlPtr = this.htmlTagsPtr; char firstChar = peekChar(); boolean hasWhitespaces = firstChar == ' ' || ScannerHelper.isWhitespace(firstChar); try { int token = readTokenAndConsume(); char[] htmlTag; int htmlIndex; htmlIndex = getHtmlTagIndex(htmlTag); if (htmlIndex == JAVADOC_TAGS_ID_MASK) return false; if (htmlPtr >= 0) { int lastHtmlTagIndex = getHtmlTagIndex(this.htmlTags[htmlPtr]); if ((lastHtmlTagIndex & JAVADOC_TAGS_ID_MASK) == JAVADOC_IMMUTABLE_TAGS_ID) { if (readToken() == TerminalTokens.TokenNameDIVIDE) { consumeToken(); if ((token = readTokenAndConsume()) != TerminalTokens.TokenNameIdentifier) { htmlIndex = getHtmlTagIndex(identifier); if (htmlIndex == JAVADOC_TAGS_ID_MASK) return false; int ptr = this.htmlTagsPtr; switch (readTokenAndConsume()) { case TerminalTokens.TokenNameLESS: case TerminalTokens.TokenNameLESS_EQUAL: switch (readChar()) {
if (! this.formatterCommentParser.parse(start, end-1)) {
int ptr = this.htmlTagsPtr; while (ptr >= 0) { if (getHtmlTagIndex(this.htmlTags[ptr--]) == JAVADOC_CODE_TAGS_ID) { if (this.textStart == -1) this.textStart = this.inlineTagStarted ? this.inlineTagStart : previousPosition; this.inlineTagStarted = false; this.tagSourceStart = previousPosition; this.scanner.startPosition = this.index; this.scanner.currentCharacter = readChar(); switch (this.scanner.currentCharacter) { case ' ': while (currentChar != ' ' && currentChar != '*' && currentChar != '}' && !ScannerHelper.isWhitespace(currentChar)) { currentPosition = this.index; currentChar = readChar(); if (length == TAG_CATEGORY_LENGTH && CharOperation.equals(TAG_CATEGORY, tagName)) { this.tagValue = TAG_CATEGORY_VALUE; valid = parseIdentifierTag(false); // TODO (frederic) reconsider parameter value when @category will be significant in spec } else if (length == TAG_CODE_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_CODE, tagName)) { this.tagValue = TAG_CODE_VALUE; if (length == TAG_EXCEPTION_LENGTH && CharOperation.equals(TAG_EXCEPTION, tagName)) { this.tagValue = TAG_EXCEPTION_VALUE; valid = parseThrows(); if (length == TAG_INHERITDOC_LENGTH && CharOperation.equals(TAG_INHERITDOC, tagName)) { if (this.reportProblems) { recordInheritedPosition((((long) this.tagSourceStart) << 32) + this.tagSourceEnd);
int currentPosition = start; int htmlPtr = this.htmlTagsPtr; char firstChar = peekChar(); boolean hasWhitespaces = firstChar == ' ' || ScannerHelper.isWhitespace(firstChar); try { int token = readTokenAndConsume(); char[] htmlTag; int htmlIndex; htmlIndex = getHtmlTagIndex(htmlTag); if (htmlIndex == JAVADOC_TAGS_ID_MASK) return false; if (htmlPtr >= 0) { int lastHtmlTagIndex = getHtmlTagIndex(this.htmlTags[htmlPtr]); if ((lastHtmlTagIndex & JAVADOC_TAGS_ID_MASK) == JAVADOC_IMMUTABLE_TAGS_ID) { if (readToken() == TerminalTokens.TokenNameDIVIDE) { consumeToken(); if ((token = readTokenAndConsume()) != TerminalTokens.TokenNameIdentifier) { htmlIndex = getHtmlTagIndex(identifier); if (htmlIndex == JAVADOC_TAGS_ID_MASK) return false; int ptr = this.htmlTagsPtr; switch (readTokenAndConsume()) { case TerminalTokens.TokenNameLESS: case TerminalTokens.TokenNameLESS_EQUAL: switch (readChar()) {
protected boolean parseReturn() { createTag(); return true; }
private void initFormatterCommentParser() { if (this.formatterCommentParser == null) { this.formatterCommentParser = new FormatterCommentParser(this.scanner.sourceLevel); } this.formatterCommentParser.scanner.setSource(this.scanner.source); this.formatterCommentParser.source = this.scanner.source; this.formatterCommentParser.scanner.lineEnds = this.lineEnds; this.formatterCommentParser.scanner.linePtr = this.maxLines; this.formatterCommentParser.parseHtmlTags = this.formatter.preferences.comment_format_html; }
public boolean parse(int start, int end) { // Init this.javadocStart = start; this.javadocEnd = end; this.firstTagPosition = this.javadocStart; // Need to flush html tags stack in case of unclosed ones in previous javadoc comments // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=239941 this.htmlTagsPtr = -1; // parse comment boolean valid = commentParse(); return valid && this.docComment != null; }
if (! this.formatterCommentParser.parse(start, end-1)) {
protected boolean parseReturn() { createTag(); return true; }
private void initFormatterCommentParser() { if (this.formatterCommentParser == null) { this.formatterCommentParser = new FormatterCommentParser(this.scanner.sourceLevel); } this.formatterCommentParser.scanner.setSource(this.scanner.source); this.formatterCommentParser.source = this.scanner.source; this.formatterCommentParser.scanner.lineEnds = this.lineEnds; this.formatterCommentParser.scanner.linePtr = this.maxLines; this.formatterCommentParser.parseHtmlTags = this.formatter.preferences.comment_format_html; }
public boolean parse(int start, int end) { // Init this.javadocStart = start; this.javadocEnd = end; this.firstTagPosition = this.javadocStart; // Need to flush html tags stack in case of unclosed ones in previous javadoc comments // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=239941 this.htmlTagsPtr = -1; // parse comment boolean valid = commentParse(); return valid && this.docComment != null; }
protected boolean parseIdentifierTag(boolean report) { if (super.parseIdentifierTag(report)) { createTag(); this.index = this.tagSourceEnd+1; this.scanner.resetTo(this.index, this.javadocEnd); return true; } this.tagValue = TAG_OTHERS_VALUE; // tag is invalid, do not keep the parsed tag value return false; }
protected boolean parseIdentifierTag(boolean report) { if (super.parseIdentifierTag(report)) { createTag(); this.index = this.tagSourceEnd+1; this.scanner.resetTo(this.index, this.javadocEnd); return true; } this.tagValue = TAG_OTHERS_VALUE; // tag is invalid, do not keep the parsed tag value return false; }