public class StreamTokenizer extends AbstractStreamTokenizer
AbstractStreamTokenizer,
LAStreamTokenizerCOMMENT, isInteger, NUMERIC, nval, ORDINARY, QUOTE, SPECIAL, sval, TT_EOF, TT_EOL, TT_NOTHING, TT_NUMBER, TT_SPECIAL, TT_WORD, ttype, WHITESPACE, WORD| Constructor and Description |
|---|
StreamTokenizer(java.io.Reader rd)
Creates a StreamTokenizer for the specified Reader
and sets the default syntax.
|
| Modifier and Type | Method and Description |
|---|---|
void |
commentChar(int c)
Makes the specified character a comment start character exclusively.
|
void |
disableComments() |
void |
enableComments() |
boolean |
isCommentChar(int c)
Checks whether this character's type is comment, among other types.
|
int |
nextToken()
Reads a token and returns its type, which is also the value of ttype.
|
void |
setEscapeChar(int c)
Sets the default escape character.
|
void |
setTypePrecedence(int first,
int second,
int third,
int forth,
int fifth)
|
void |
slashSlashComments(boolean flag)
C++-style comments will be skipped iff the argument is true.
|
void |
slashStarComments(boolean flag)
C-style comments will be skipped iff the argument is true.
|
currentChar, eolIsSignificant, getFile, getLineNumber, ignoreNonDecimals, isNumericChar, isOrdinaryChar, isQuoteChar, isWhitespaceChar, isWordChar, lineno, location, ordinaryChar, ordinaryChars, ordinaryChars, parseDigitsOnly, parseNonDecimals, parseNonDecimals, parseNumbers, parseNumbers, parsingDigitsOnly, peek, peekBack, pushBack, quoteChar, quoteChar, quotePair, quotePair, resetSyntax, setDefaultSyntax, setOrdinaryChar, setOrdinaryChars, setQuoteChar, setQuoteChar, setQuotePair, setType, setType, setType, setWhitespaceChar, setWhitespaceChars, setWordChar, setWordChars, skipChar, skipChar, spaceIsSignificant, tokenEnd, tokenStart, toString, unsetType, unsetType, unsetType, whitespaceChar, whitespaceChars, whitespaceChars, wordChar, wordChars, wordCharspublic StreamTokenizer(java.io.Reader rd)
public final void enableComments()
enableComments in class AbstractStreamTokenizerpublic final void disableComments()
disableComments in class AbstractStreamTokenizerpublic final void commentChar(int c)
commentChar in class AbstractStreamTokenizerpublic final void slashSlashComments(boolean flag)
slashSlashComments in class AbstractStreamTokenizerpublic final void slashStarComments(boolean flag)
slashStarComments in class AbstractStreamTokenizerpublic final int nextToken()
throws java.io.IOException
If the type is TT_WORD or a quote character, the value of the word read is in sval. If the type is TT_NUMBER, the value of the number is in nval. If the number read is an integer, the flag isInteger is set to true.
nextToken in class AbstractStreamTokenizerjava.io.IOExceptionpublic final boolean isCommentChar(int c)
public final void setEscapeChar(int c)
public void setTypePrecedence(int first,
int second,
int third,
int forth,
int fifth)
throws java.lang.Exception
setTypePrecedence(WORD,WHITESPACE,COMMENT,QUOTE,ORDINARY);
and this means that the WORD type is considered in priority, then WHITESPACE, etc...
The NUMERIC type is not among those that can be ordered because it is relevant only when numbers are parsed. If they are, then the full Java number format is recognized independently of the character syntax setting. This means that NUMERIC has always highest precedence if number parsing is effective, and ignored otherwise.
java.lang.Exception