Class GenericWhitespaceState
java.lang.Object
org.pipservices3.expressions.tokenizers.generic.GenericWhitespaceState
- All Implemented Interfaces:
ITokenizerState
,IWhitespaceState
A whitespace state ignores whitespace (such as blanks and tabs), and returns the tokenizer's
next token. By default, all characters from 0 to 32 are whitespace.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a whitespace state with a default idea of what characters are, in fact, whitespace. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears definitions of whitespace characters.nextToken
(IScanner scanner, ITokenizer tokenizer) Ignore whitespace (such as blanks and tabs), and return the tokenizer's next token.void
setWhitespaceChars
(int fromSymbol, int toSymbol, boolean enable) Establish the given characters as whitespace to ignore.
-
Constructor Details
-
GenericWhitespaceState
Constructs a whitespace state with a default idea of what characters are, in fact, whitespace.- Throws:
Exception
-
-
Method Details
-
nextToken
Ignore whitespace (such as blanks and tabs), and return the tokenizer's next token.- Specified by:
nextToken
in interfaceITokenizerState
- Parameters:
scanner
- A textual string to be tokenized.tokenizer
- A tokenizer class that controls the process.- Returns:
- The next token from the top of the stream.
- Throws:
Exception
-
setWhitespaceChars
Establish the given characters as whitespace to ignore.- Specified by:
setWhitespaceChars
in interfaceIWhitespaceState
- Parameters:
fromSymbol
- First character index of the interval.toSymbol
- Last character index of the interval.enable
-true
if this state should ignore characters in the given range.- Throws:
Exception
-
clearWhitespaceChars
public void clearWhitespaceChars()Clears definitions of whitespace characters.- Specified by:
clearWhitespaceChars
in interfaceIWhitespaceState
-