|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.tools.javac.parser.Scanner
com.sun.tools.javac.parser.DocCommentScanner
public class DocCommentScanner
An extension to the base lexical analyzer that captures and processes the contents of doc comments. It does so by translating Unicode escape sequences and by stripping the leading whitespace and starts from each line of the comment.
This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
| Nested Class Summary | |
|---|---|
static class |
DocCommentScanner.Factory
A factory for creating scanners. |
| Nested classes/interfaces inherited from class com.sun.tools.javac.parser.Scanner |
|---|
Scanner.CommentStyle |
| Field Summary | |
|---|---|
private int |
bp
|
private char[] |
buf
The comment input buffer, index of next chacter to be read, index of one past last character in buffer. |
private int |
buflen
|
private char |
ch
The current character. |
private int |
col
The column number position of the current character. |
private java.lang.String |
docComment
Translated and stripped contents of doc comment |
private char[] |
docCommentBuffer
Buffer for doc comment. |
private int |
docCommentCount
Number of characters in doc comment buffer. |
private int |
pos
Starting position of the comment in original source |
private int |
unicodeConversionBp
The buffer index of the last converted Unicode character |
| Fields inherited from class com.sun.tools.javac.parser.Scanner |
|---|
deprecatedFlag, surrogatesSupported |
| Constructor Summary | |
|---|---|
protected |
DocCommentScanner(DocCommentScanner.Factory fac,
char[] input,
int inputLength)
Create a scanner from the input array. |
protected |
DocCommentScanner(DocCommentScanner.Factory fac,
java.nio.CharBuffer buffer)
Create a scanner from the input buffer. |
| Method Summary | |
|---|---|
private void |
convertUnicode()
Convert Unicode escape; bp points to initial '\' character (Spec 3.3). |
private int |
digit(int base)
Convert an ASCII digit from its base (8, 10, or 16) to its value. |
java.lang.String |
docComment()
Returns the documentation string of the current token. |
private void |
expandCommentBuffer()
Unconditionally expand the comment buffer. |
Position.LineMap |
getLineMap()
Build a map for translating between line numbers and positions in the input. |
void |
nextToken()
Read token. |
protected void |
processComment(Scanner.CommentStyle style)
Process a doc comment and make the string content available. |
private void |
scanChar()
Read next character. |
private void |
scanDocCommentChar()
Read next character in doc comment, skipping over double '\' characters. |
| Methods inherited from class com.sun.tools.javac.parser.Scanner |
|---|
deprecatedFlag, endPos, errPos, errPos, getRawCharacters, getRawCharacters, name, pos, prevEndPos, processLineTerminator, processWhiteSpace, radix, resetDeprecatedFlag, stringVal, token, token |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int pos
private char[] buf
private int bp
private int buflen
private char ch
private int col
private int unicodeConversionBp
private char[] docCommentBuffer
private int docCommentCount
private java.lang.String docComment
| Constructor Detail |
|---|
protected DocCommentScanner(DocCommentScanner.Factory fac,
java.nio.CharBuffer buffer)
protected DocCommentScanner(DocCommentScanner.Factory fac,
char[] input,
int inputLength)
| Method Detail |
|---|
private void expandCommentBuffer()
private int digit(int base)
private void convertUnicode()
private void scanChar()
private void scanDocCommentChar()
public void nextToken()
Scanner
nextToken in interface LexernextToken in class Scannerpublic java.lang.String docComment()
docComment in interface LexerdocComment in class Scannerprotected void processComment(Scanner.CommentStyle style)
processComment in class Scannerpublic Position.LineMap getLineMap()
getLineMap in interface LexergetLineMap in class Scanner
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||