public abstract class LanguageTokenizer extends TextCharacterIterator implements java.io.Serializable
LangTokenizer class is an abstract base class for all
objects that parse a text into "tokens". The text should represent a
program.| 修飾子とタイプ | フィールドと説明 |
|---|---|
static int |
COMMENT
A constant indicating that a comment token has been read.
|
static int |
CONSTANT
A constant indicating that a constant token has been read.
|
static int |
EOT
A constant indicating that the end of the array has been read.
|
boolean |
inMultiLineComment
True, if the parsing context is in the multiline comment.
|
boolean |
inMultiLineConstant
True, if the parsing context is in the multiline constant.
|
static int |
KEYWORD
A constant indicating that a keyword token has been read.
|
static int |
MULTILINE_COMMENT
A constant indicating that a multiline comment token has been read.
|
static int |
MULTILINE_CONSTANT
A constant indicating that a multiline constant token has been read.
|
static int |
OTHER
A constant indicating that a token has been read.
|
int |
tokenBegin
The beginning index of the token, inclusive.
|
int |
tokenEnd
The ending index of the token, exclusive.
|
| コンストラクタと説明 |
|---|
LanguageTokenizer(Text text,
int begin,
int end)
Construct a
LanguageTokenizer with the specified
text and range. |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
protected int |
getPosition() |
static int |
getPreferredParseBegin(Text text,
int tokenType,
int tokenBegin,
int changeBefore)
Returns the preferred beginning index to parse after the specified
text has been changed.
|
static int |
getPreferredParseEnd(Text text,
int tokenType,
int tokenEnd,
int changeAfter)
Returns the preferred ending index to parse after the specified
text has been changed.
|
protected boolean |
isDigit(int c) |
protected boolean |
isLetter(int c) |
protected boolean |
isLetterOrDigit(int c) |
protected boolean |
isLowerLetter(int c) |
abstract int |
nextToken()
Parses the next token from the text of this tokenizer.
|
protected int |
peek() |
protected void |
pushBack() |
protected int |
read() |
protected void |
setPosition(int pos) |
clone, current, equals, first, getBeginIndex, getEndIndex, getIndex, getText, hashCode, last, next, previous, setIndexpublic int tokenBegin
public int tokenEnd
public boolean inMultiLineConstant
public boolean inMultiLineComment
public static final int EOT
public static final int OTHER
public static final int KEYWORD
public static final int CONSTANT
public static final int MULTILINE_CONSTANT
public static final int COMMENT
public static final int MULTILINE_COMMENT
public LanguageTokenizer(Text text, int begin, int end)
LanguageTokenizer with the specified
text and range.text - the text to be parsed.begin - the beginning index to parse, inclusive.end - the ending index to parse, exclusive.public static int getPreferredParseBegin(Text text, int tokenType, int tokenBegin, int changeBefore)
text - the text to be parsed.tokenType - the token type.tokenBegin - the beginning index of the token.changeBefore - the index before a change has been made.public static int getPreferredParseEnd(Text text, int tokenType, int tokenEnd, int changeAfter)
text - the text to be parsed.tokenType - the token type.tokenEnd - the ending index of the token.changeAfter - the index after a change has been made.public abstract int nextToken()
tokenBegin,
tokenEnd,
EOT,
OTHER,
KEYWORD,
CONSTANT,
MULTILINE_CONSTANT,
COMMENT,
MULTILINE_COMMENTprotected final int read()
protected final int peek()
protected final void pushBack()
protected final int getPosition()
protected final void setPosition(int pos)
protected final boolean isLowerLetter(int c)
protected final boolean isLetter(int c)
protected final boolean isDigit(int c)
protected final boolean isLetterOrDigit(int c)