class JavaTokenizer
extends java.lang.Object
EclipseHack
to be able to scan Java
classes to find their abstract methods in order. This tokenizer can assume that the source code
is syntactically correct because the annotation processor won't run otherwise. It makes no effort
to account for Unicode escapes like \
u1234
but it is hard to imagine that
mattering. It also makes no effort to account for surrogate pairs, but again unless someone is
using such a pair in the name of one of the abstract methods we are looking for that should not
matter.Modifier and Type | Field and Description |
---|---|
private char |
c |
private static char |
EOF |
private java.io.Reader |
reader |
Constructor and Description |
---|
JavaTokenizer(java.io.Reader reader) |
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
identifier() |
private static boolean |
isAsciiDigit(int c) |
private void |
next() |
(package private) java.lang.String |
nextToken()
Returns the next token from the source code, or null if there are no more tokens.
|
private void |
skipCharacterOrStringLiteral() |
private void |
skipNumber() |
private void |
skipSlashSlashComment() |
private void |
skipSlashStarComment() |
private void |
skipSpaceAndCommentsAndSlashes() |
private final java.io.Reader reader
private char c
private static final char EOF
java.lang.String nextToken()
0
. The returned string can be null but it cannot be empty, so it is safe
to check its first character if it is not null.private static boolean isAsciiDigit(int c)
private java.lang.String identifier()
private void skipNumber()
private void skipSpaceAndCommentsAndSlashes()
private void skipSlashSlashComment()
private void skipSlashStarComment()
private void skipCharacterOrStringLiteral()
private void next()