public class LAStreamTokenizer extends AbstractStreamTokenizer
public final String lookahead (int n) throws IOExceptionwhich returns the string of n characters in the input stream including and starting with the current character.
AbstractStreamTokenizer,
StreamTokenizerCOMMENT, 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 |
|---|
LAStreamTokenizer(java.io.Reader rd)
Creates a StreamTokenizer for the specified Reader
and sets the default syntax.
|
| Modifier and Type | Method and Description |
|---|---|
void |
commentBrackets(java.lang.String left,
java.lang.String right)
Enables bracketed comments with the specified start and end strings.
|
void |
commentChar(int c)
Makes the specified character a comment start character exclusively
and enable skipping comment lines starting with this character.
|
void |
commentLine(java.lang.String s)
Enables line comments with the specified start string.
|
void |
disableComments() |
void |
enableComments() |
java.lang.String |
lookahead(int n)
Returns the string of n characters to be processed next, including and
starting with the current character.
|
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)
|
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 LAStreamTokenizer(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
nextToken in class AbstractStreamTokenizerjava.io.IOExceptionpublic final void setEscapeChar(int c)
public final void commentBrackets(java.lang.String left,
java.lang.String right)
public final void commentLine(java.lang.String s)
public void setTypePrecedence(int first,
int second,
int third,
int forth)
throws java.lang.Exception
setTypePrecedence(WORD,WHITESPACE,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.Exceptionpublic final java.lang.String lookahead(int n)
throws java.io.IOException
java.io.IOException