public class PrettyTokenizer extends net.morimekta.util.lexer.TokenizerBase<PrettyTokenType,PrettyToken>
| Constructor and Description |
|---|
PrettyTokenizer(InputStream in)
Create a pretty tokenizer that reads from the input steam.
|
PrettyTokenizer(InputStream in,
int bufferSize)
Create a pretty tokenizer that reads from the input steam.
|
PrettyTokenizer(Reader in,
int bufferSize,
boolean preLoadAll)
Create a pretty tokenizer that will read everything from the input stream and
handle it as a single multi-line buffer.
|
| Modifier and Type | Method and Description |
|---|---|
protected PrettyToken |
genericToken(char[] buffer,
int offset,
int len,
PrettyTokenType type,
int lineNo,
int linePos) |
protected PrettyToken |
identifierToken(char[] buffer,
int offset,
int len,
int lineNo,
int linePos) |
protected PrettyToken |
numberToken(char[] buffer,
int offset,
int len,
int lineNo,
int linePos) |
protected boolean |
startString() |
protected PrettyToken |
stringToken(char[] buffer,
int offset,
int len,
int lineNo,
int linePos) |
protected PrettyToken |
symbolToken(char[] buffer,
int offset,
int len,
int lineNo,
int linePos) |
allowIdentifier, currentLine, currentLineNo, currentLinePos, eofFailure, failure, identifierSeparator, isWhitespace, nextSymbol, parseNextToken, readUntil, startIdentifier, startNumber, startSymbol, toStringpublic PrettyTokenizer(InputStream in)
in - Input stream to parse from.public PrettyTokenizer(InputStream in, int bufferSize)
in - Input stream to parse from.bufferSize - The size of the char buffer. Default is 2048 chars
(4096 bytes).public PrettyTokenizer(Reader in, int bufferSize, boolean preLoadAll)
in - Reader of content to parse.bufferSize - The size of the char buffer. Default is 2048 chars
(4096 bytes).preLoadAll - Load all content up front. Handy for config and thrift
program files.protected boolean startString()
startString in class net.morimekta.util.lexer.TokenizerBase<PrettyTokenType,PrettyToken>protected PrettyToken genericToken(char[] buffer, int offset, int len, @Nonnull PrettyTokenType type, int lineNo, int linePos)
genericToken in class net.morimekta.util.lexer.TokenizerBase<PrettyTokenType,PrettyToken>protected PrettyToken identifierToken(char[] buffer, int offset, int len, int lineNo, int linePos)
identifierToken in class net.morimekta.util.lexer.TokenizerBase<PrettyTokenType,PrettyToken>protected PrettyToken stringToken(char[] buffer, int offset, int len, int lineNo, int linePos)
stringToken in class net.morimekta.util.lexer.TokenizerBase<PrettyTokenType,PrettyToken>protected PrettyToken numberToken(char[] buffer, int offset, int len, int lineNo, int linePos)
numberToken in class net.morimekta.util.lexer.TokenizerBase<PrettyTokenType,PrettyToken>protected PrettyToken symbolToken(char[] buffer, int offset, int len, int lineNo, int linePos)
symbolToken in class net.morimekta.util.lexer.TokenizerBase<PrettyTokenType,PrettyToken>Copyright © 2015–2020 morimekta.net. All rights reserved.