This is NOT part of any supported API. 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.
| Modifier and Type | Class and Description |
|---|---|
| protected static class | JavaTokenizer.
Scan a documentation comment; determine if a deprecated tag is present. |
| Modifier and Type | Field and Description |
|---|---|
| protected final boolean | enableLineDocComments
Whether "///" comments are recognized as documentation comments. |
| protected int | errPos
The position where a lexical error occurred; |
| protected final ScannerFactory | fac
Origin scanner factory. |
| protected boolean | hasEscapeSequences
true if contains escape sequences, set by nextToken(). |
| protected boolean | isTextBlock
true if is a text block, set by nextToken(). |
| protected final Log | log
The log to be used for error reporting.
|
| protected Name | name
The token's name, set by nextToken(). |
| private final Names | names
The names factory. |
| private static final int | NOT_FOUND
Sentinel for non-value. |
| private final Preview | preview
The preview language setting. |
| protected int | radix
The token's radix, set by nextToken(). |
| protected final StringBuilder | sb
Buffer for building literals, used by nextToken(). |
| private static final boolean | scannerDebug
If true then prints token information after each nextToken(). |
| private final Source | source
The source language setting. |
| protected Tokens. | tk
The token kind, set by nextToken(). |
| private final Tokens | tokens
The token factory. |
| Access | Constructor and Description |
|---|---|
| protected | JavaTokenizer(ScannerFactory
the factory which created this Scanner. fac, CharBuffer the input character buffer. cb)Construct a Java token scanner from the input character buffer. |
| protected | JavaTokenizer(ScannerFactory
factory which created this Scanner fac, char[] input character array array, int length of the meaningful content in the array length)Construct a Java token scanner from the input character array. |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | Returns: true if either ch1 or ch2 matches current character.first character to match. ch1, char second character to match. ch2)If either ch1 or ch2 matches the current character then add current character to the literal buffer and then advance. |
| protected boolean | Returns: true if ch matches current character.character to match. ch)If the specified character ch matches the current character then add current character to the literal buffer and then advance. |
| pack-priv List | |
| private void | |
| protected void | checkSourceLevel(int
position in input buffer. pos, Source.feature to verify. featureCheck the source level for a lexical feature. |
| public int | Returns: position in the input buffer of where the error occurred.Return the position where a lexical error occurred. |
| public void | errPos(int
position in the input buffer of where the error occurred. pos)Set the position where a lexical error occurred. |
| public Position. | Returns: a LineMapBuild a map for translating between line numbers and positions in the input. |
| private boolean | Returns: true if ch can be part of an operator.character to check. ch)Return true if ch can be part of an operator. |
| protected void | lexError(int
position in input buffer. pos, JCDiagnostic.error key to report. keyReport an error at the given position using the provided arguments. |
| protected Tokens. | Returns: the constructed BasicComment.position of the opening / in the input buffer. pos, int position + 1 of the closing / in the input buffer. endPos, Tokens.style of comment. styleCalled when a complete comment has been scanned. |
| protected void | processLineTerminator(int
position in input buffer of first character in sequence. pos, int position + 1 in input buffer of last character in sequence. endPos)Called when a line terminator has been processed. |
| protected void | processWhiteSpace(int
position in input buffer of first whitespace character. pos, int position + 1 in input buffer of last whitespace character. endPos)Called when a complete whitespace run has been scanned. |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected char | |
| public Tokens. | |
| private void | scanDigits(int
position of the first character in literal. pos, int radix of numeric literal. digitRadix)Scan sequence of digits. |
| private void | scanFraction(int
position of the first character in literal. pos)Read fractional part of floating point number. |
| private void | scanFractionAndSuffix(int
position of the first character in literal. pos)Read fractional part and 'd' or 'f' suffix of floating point number. |
| private void | scanHexExponentAndSuffix(int
position of the first character in literal. pos)Read fractional part of hexadecimal floating point number. |
| private void | scanHexFractionAndSuffix(int
position of the first character in literal. pos, boolean seendigit)Read fractional part and 'd' or 'f' suffix of hexadecimal floating point number. |
| private void | |
| private void | scanLitChar(int
position of the first character in literal. pos, boolean true if is a string literal isString)Processes the current character and places in the literal buffer. |
| private void | scanNumber(int
position of the first character in literal. pos, int the radix of the number; one of 2, 8, 10, 16. radix)Read a number. |
| private void | |
| private void | |
| private void | |
| private void |
| enableLineDocComments | back to summary |
|---|---|
| protected final boolean enableLineDocComments Whether "///" comments are recognized as documentation comments. | |
| errPos | back to summary |
|---|---|
| protected int errPos The position where a lexical error occurred; | |
| fac | back to summary |
|---|---|
| protected final ScannerFactory fac Origin scanner factory. | |
| hasEscapeSequences | back to summary |
|---|---|
| protected boolean hasEscapeSequences true if contains escape sequences, set by nextToken(). | |
| isTextBlock | back to summary |
|---|---|
| protected boolean isTextBlock true if is a text block, set by nextToken(). | |
| log | back to summary |
|---|---|
| protected final Log log Hides com. The log to be used for error reporting. Copied from scanner factory. | |
| name | back to summary |
|---|---|
| protected Name name The token's name, set by nextToken(). | |
| names | back to summary |
|---|---|
| private final Names names The names factory. Copied from scanner factory. | |
| NOT_FOUND | back to summary |
|---|---|
| private static final int NOT_FOUND Sentinel for non-value. | |
| preview | back to summary |
|---|---|
| private final Preview preview The preview language setting. Copied from scanner factory. | |
| radix | back to summary |
|---|---|
| protected int radix The token's radix, set by nextToken(). | |
| sb | back to summary |
|---|---|
| protected final StringBuilder sb Buffer for building literals, used by nextToken(). | |
| scannerDebug | back to summary |
|---|---|
| private static final boolean scannerDebug If true then prints token information after each nextToken(). | |
| source | back to summary |
|---|---|
| private final Source source The source language setting. Copied from scanner factory. | |
| tk | back to summary |
|---|---|
| protected Tokens. The token kind, set by nextToken(). | |
| tokens | back to summary |
|---|---|
| private final Tokens tokens The token factory. Copied from scanner factory. | |
| JavaTokenizer | back to summary |
|---|---|
| protected JavaTokenizer(ScannerFactory fac, CharBuffer cb) Construct a Java token scanner from the input character buffer.
| |
| JavaTokenizer | back to summary |
|---|---|
| protected JavaTokenizer(ScannerFactory fac, char[] array, int length) Construct a Java token scanner from the input character array.
| |
| acceptOneOfThenPut | back to summary |
|---|---|
| protected boolean acceptOneOfThenPut(char ch1, char ch2) If either ch1 or ch2 matches the current character then add current character to the literal buffer and then advance.
| |
| acceptThenPut | back to summary |
|---|---|
| protected boolean acceptThenPut(char ch) If the specified character ch matches the current character then add current character to the literal buffer and then advance.
| |
| appendComment | back to summary |
|---|---|
| pack-priv List Appends a comment to the list of comments preceding the current token. | |
| checkIdent | back to summary |
|---|---|
| private void checkIdent() Determines if the sequence in the literal buffer is a token (keyword, operator.) | |
| checkSourceLevel | back to summary |
|---|---|
| protected void checkSourceLevel(int pos, Source. Check the source level for a lexical feature. | |
| errPos | back to summary |
|---|---|
| public int errPos() Return the position where a lexical error occurred.
| |
| errPos | back to summary |
|---|---|
| public void errPos(int pos) Set the position where a lexical error occurred.
| |
| getLineMap | back to summary |
|---|---|
| public Position. Build a map for translating between line numbers and positions in the input. | |
| isSpecial | back to summary |
|---|---|
| private boolean isSpecial(char ch) Return true if ch can be part of an operator.
| |
| lexError | back to summary |
|---|---|
| protected void lexError(int pos, JCDiagnostic. Report an error at the given position using the provided arguments.
| |
| processComment | back to summary |
|---|---|
| protected Tokens. Called when a complete comment has been scanned. pos and endPos will mark the comment boundary.
| |
| processLineTerminator | back to summary |
|---|---|
| protected void processLineTerminator(int pos, int endPos) Called when a line terminator has been processed.
| |
| processWhiteSpace | back to summary |
|---|---|
| protected void processWhiteSpace(int pos, int endPos) Called when a complete whitespace run has been scanned. pos and endPos will mark the whitespace boundary. (Spec 3.6)
| |
| put | back to summary |
|---|---|
| protected void put(char ch) Add a character to the literal buffer.
| |
| put | back to summary |
|---|---|
| protected void put() Add current character or codepoint to the literal buffer. | |
| put | back to summary |
|---|---|
| protected void put(String string) Add a string to the literal buffer. | |
| putCodePoint | back to summary |
|---|---|
| protected void putCodePoint(int codePoint) Add a codepoint to the literal buffer.
| |
| putThenNext | back to summary |
|---|---|
| protected char putThenNext() Add current character or codepoint to the literal buffer then return next character. | |
| readToken | back to summary |
|---|---|
| public Tokens. Read token (main entrypoint.) | |
| scanDigits | back to summary |
|---|---|
| private void scanDigits(int pos, int digitRadix) Scan sequence of digits.
| |
| scanFraction | back to summary |
|---|---|
| private void scanFraction(int pos) Read fractional part of floating point number.
| |
| scanFractionAndSuffix | back to summary |
|---|---|
| private void scanFractionAndSuffix(int pos) Read fractional part and 'd' or 'f' suffix of floating point number.
| |
| scanHexExponentAndSuffix | back to summary |
|---|---|
| private void scanHexExponentAndSuffix(int pos) Read fractional part of hexadecimal floating point number.
| |
| scanHexFractionAndSuffix | back to summary |
|---|---|
| private void scanHexFractionAndSuffix(int pos, boolean seendigit) Read fractional part and 'd' or 'f' suffix of hexadecimal floating point number.
| |
| scanIdent | back to summary |
|---|---|
| private void scanIdent() Read an identifier. (Spec. 3.8) | |
| scanLitChar | back to summary |
|---|---|
| private void scanLitChar(int pos, boolean isString) Processes the current character and places in the literal buffer. If the current character is a backslash then the next character is assumed to be a proper escape character. Actual conversion of escape sequences takes place during at the end of readToken.
| |
| scanNumber | back to summary |
|---|---|
| private void scanNumber(int pos, int radix) Read a number. (Spec. 3.10)
| |
| scanOperator | back to summary |
|---|---|
| private void scanOperator() Read longest possible sequence of special characters and convert to token. | |
| scanString | back to summary |
|---|---|
| private void scanString(int pos) Scan a string literal or text block.
| |
| skipIllegalUnderscores | back to summary |
|---|---|
| private void skipIllegalUnderscores() Skip over underscores and report as a error if found. | |
| skipLineTerminator | back to summary |
|---|---|
| private void skipLineTerminator() Skip and process a line terminator sequence. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Tokens. | cs
Style of comment |
| protected boolean | deprecatedFlag
true if comment contains @deprecated at beginning of a line. |
| pack-priv JCDiagnostic. | |
| protected boolean | scanned
true if comment has been fully scanned. |
| Access | Constructor and Description |
|---|---|
| protected | BasicComment(Tokens.
comment style cs,existing reader reader, int start of meaningful content in buffer. pos, int end of meaningful content in buffer. endPos)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv int | Returns: minimum indent to removeDetermine how much indent to remove from a JavaDoc line comment. |
| public JCDiagnostic. | Returns: diagnostic positionImplements com. Return the diagnostic position of this comment. |
| public int | Returns: buffer position in original buffer.buffer position in comment. pos)Implements com. Return buffer position in original buffer mapped from buffer position in comment. |
| public Tokens. | Returns: style of comment.Implements com. Return style of comment. |
| public String | Returns: comment body text.Implements com. Return comment body text minus comment adornments or null if not scanned. |
| public boolean | Returns: true if comment contains @deprecated.Implements com. true if comment contains @deprecated at beginning of a line. |
| protected void | |
| protected void | |
| public Tokens. | Returns: comment with removed whitespace or this commentImplements com. Return a version of this comment with incidental whitespace removed, or this comment if the operation is not supported. |
| pack-priv UnicodeReader | Returns: new line reader if detected otherwise original line reader.line reader line)Remove closing star(s) slash from comment. |
| pack-priv UnicodeReader | Returns: modified line readerline reader line)Trim the first part of the JavaDoc block comment. |
| pack-priv UnicodeReader | Returns: modified line readerline reader line, int how much indentation to remove indent)Trim the first part of a JavaDoc line comment. |
| cs | back to summary |
|---|---|
| pack-priv final Tokens. Style of comment | |
| deprecatedFlag | back to summary |
|---|---|
| protected boolean deprecatedFlag true if comment contains @deprecated at beginning of a line. | |
| pos | back to summary |
|---|---|
| pack-priv JCDiagnostic. | |
| scanned | back to summary |
|---|---|
| protected boolean scanned true if comment has been fully scanned. | |
| BasicComment | back to summary |
|---|---|
| protected BasicComment(Tokens. Constructor.
| |
| getJavadocLineCommentIndent | back to summary |
|---|---|
| pack-priv int getJavadocLineCommentIndent() Determine how much indent to remove from a JavaDoc line comment.
| |
| getPos | back to summary |
|---|---|
| public JCDiagnostic. Implements com. Return the diagnostic position of this comment.
| |
| getSourcePos | back to summary |
|---|---|
| public int getSourcePos(int pos) Implements com. Return buffer position in original buffer mapped from buffer position in comment.
| |
| getStyle | back to summary |
|---|---|
| public Tokens. Implements com. Return style of comment.
| |
| getText | back to summary |
|---|---|
| public String getText() Implements com. Return comment body text minus comment adornments or null if not scanned.
| |
| isDeprecated | back to summary |
|---|---|
| public boolean isDeprecated() Implements com. true if comment contains @deprecated at beginning of a line.
| |
| putLine | back to summary |
|---|---|
| protected void putLine(UnicodeReader line) Put the line into the buffer.
| |
| scanDocComment | back to summary |
|---|---|
| protected void scanDocComment() Scan document comment for content. | |
| stripIndent | back to summary |
|---|---|
| public Tokens. Implements com. Return a version of this comment with incidental whitespace removed, or this comment if the operation is not supported. | |
| trimEndOfComment | back to summary |
|---|---|
| pack-priv UnicodeReader trimEndOfComment(UnicodeReader line) Remove closing star(s) slash from comment.
| |
| trimJavadocComment | back to summary |
|---|---|
| pack-priv UnicodeReader trimJavadocComment(UnicodeReader line) Trim the first part of the JavaDoc block comment.
| |
| trimJavadocLineComment | back to summary |
|---|---|
| pack-priv UnicodeReader trimJavadocLineComment(UnicodeReader line, int indent) Trim the first part of a JavaDoc line comment.
| |