public class JavaTokenizer extends Object
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.BasicComment<U extends UnicodeReader>
Scan a documentation comment; determine if a deprecated tag is present.
|
Modifier and Type | Field and Description |
---|---|
protected int |
errPos
The position where a lexical error occurred;
|
protected ScannerFactory |
fac |
protected Name |
name
The token's name, set by nextToken().
|
protected int |
radix
The token's radix, set by nextToken().
|
protected UnicodeReader |
reader
The Unicode reader (low-level stream reader).
|
protected Tokens.TokenKind |
tk
The token kind, set by nextToken().
|
Modifier | Constructor and Description |
---|---|
protected |
JavaTokenizer(ScannerFactory fac,
char[] buf,
int inputLength) |
protected |
JavaTokenizer(ScannerFactory fac,
CharBuffer buf)
Create a scanner from the input array.
|
protected |
JavaTokenizer(ScannerFactory fac,
UnicodeReader reader) |
Modifier and Type | Method and Description |
---|---|
int |
errPos()
Return the position where a lexical error occurred;
|
void |
errPos(int pos)
Set the position where a lexical error occurred;
|
Position.LineMap |
getLineMap()
Build a map for translating between line numbers and
positions in the input.
|
protected void |
lexError(int pos,
String key,
Object... args)
Report an error at the given position using the provided arguments.
|
protected Tokens.Comment |
processComment(int pos,
int endPos,
Tokens.Comment.CommentStyle style)
Called when a complete comment has been scanned.
|
protected void |
processLineTerminator(int pos,
int endPos)
Called when a line terminator has been processed.
|
protected void |
processWhiteSpace(int pos,
int endPos)
Called when a complete whitespace run has been scanned.
|
Tokens.Token |
readToken()
Read token.
|
protected Tokens.TokenKind tk
protected int radix
protected Name name
protected int errPos
protected UnicodeReader reader
protected ScannerFactory fac
protected JavaTokenizer(ScannerFactory fac, CharBuffer buf)
inputLength < input.length
or
input[input.length -1]
is a white space character.fac
- the factory which created this Scannerbuf
- the input, might be modified
Must be positive and less than or equal to input.length.protected JavaTokenizer(ScannerFactory fac, char[] buf, int inputLength)
protected JavaTokenizer(ScannerFactory fac, UnicodeReader reader)
protected void lexError(int pos, String key, Object... args)
public Tokens.Token readToken()
public int errPos()
public void errPos(int pos)
protected Tokens.Comment processComment(int pos, int endPos, Tokens.Comment.CommentStyle style)
protected void processWhiteSpace(int pos, int endPos)
protected void processLineTerminator(int pos, int endPos)
public Position.LineMap getLineMap()
Copyright © 2017 earcam. All rights reserved.