Method Summary |
|
public void | addTokenizer(AbstractTokenizer tokenizer) Adding an embedded tokenizer. |
protected void | adjustLineAndColumn(int type, int length) The method recomputes the line and column position of the tokenizer, if the
flag
TokenizerProperties.F_COUNT_LINES is set. |
public void | changeParseFlags(int flags, int mask) Setting the control flags of the Tokenizer . |
public void | close() Closing this tokenizer frees resources and deregisters from the
associated
TokenizerProperties object. |
protected int | comparePrefix(int offset, String prefix, boolean noCase) This method compares the characters at the given offset (from the current
read position) with the given prefix. |
protected int | completeBlockComment(TokenizerProperty prop) Completing a block comment. |
protected TokenizerProperty | completeBoundedToken(Token token) The number of characters until the next comment, whitespace, string, special
sequence or separator are determined. |
protected int | completeLineComment(TokenizerProperty prop) Completing a line comment. |
protected int | completeString(TokenizerProperty prop) Completing a string. |
protected int | completeWhitespace() After having identified a whitespace, this method continues to read data
until it detects a non-whitespace. |
public String | currentImage() Convenience method to retrieve only the token image of the
Token that
would be returned by
AbstractTokenizer.currentToken . |
public Token | currentToken() Retrieve the
Token that was found by the last call to
AbstractTokenizer.nextToken . |
public int | currentlyAvailable() Retrieving the number of the currently available characters. |
protected DataProvider | getBaseDataProvider(int startPos, int length) Returns the
de.susebox.jtopas.spi.DataProvider of the base tokenizer. |
protected AbstractTokenizer | getBaseTokenizer() Embedded tokenizers have their base tokenizer they share the input stream
with. |
public char | getChar(int pos) Returns the character at the given position. |
public int | getColumnNumber() If the flag
TokenizerProperties.F_COUNT_LINES is set, this method will
return the current column positionstarting with 0 in the input stream. |
public int | getCurrentColumn() Retrieve the current column. |
public int | getCurrentLine() Query the current row. |
abstract protected DataProvider | getDataProvider(int startPos, int length) Subclasses have to provide
de.susebox.jtopas.spi.DataProvider instances for various token type handlers. |
public de.susebox.jtopas.spi.KeywordHandler | getKeywordHandler() Retrieving the current
de.susebox.jtopas.spi.KeywordHandler . |
public int | getLineNumber() If the flag
TokenizerProperties.F_COUNT_LINES is set, this method will
return the line number starting with 0 in the input stream. |
public int | getParseFlags() Retrieving the parser control flags. |
public de.susebox.jtopas.spi.PatternHandler | getPatternHandler() Retrieving the current
de.susebox.jtopas.spi.PatternHandler . |
public int | getReadPosition() Getting the current read offset. |
public de.susebox.jtopas.spi.SeparatorHandler | getSeparatorHandler() Retrieving the current
de.susebox.jtopas.spi.SeparatorHandler . |
public de.susebox.jtopas.spi.SequenceHandler | getSequenceHandler() Retrieving the current
SequenceHandler . |
public TokenizerSource | getSource() Retrieving the
TokenizerSource of this Tokenizer . |
public String | getText(int start, int len) Retrieve text from the currently available range. |
public TokenizerProperties | getTokenizerProperties() Retrieving the current tokenizer characteristics. |
public de.susebox.jtopas.spi.WhitespaceHandler | getWhitespaceHandler() Retrieving the current
de.susebox.jtopas.spi.WhitespaceHandler . |
public boolean | hasMoreToken() Checking if there are more tokens available. |
protected boolean | isEOF(int offset) Checks the EOF condition at the given offset. |
protected boolean | isFlagSet(int flag) Checking a given flag. |
protected boolean | isFlagSet(TokenizerProperty prop, int flag) Checking if a given flag is set for the given
TokenizerProperty , for
this Tokenizer or for the used
TokenizerProperties . |
protected TokenizerProperty | isKeyword(int startingAtPos, int length) This method checks if the character sequence starting at a given position
with a given lenghth is a keyword. |
protected boolean | isPattern(int offset, boolean freePatternOnly) Testing for pattern matching. |
protected boolean | isSeparator(int offset) This method checks at the given offset if it contains a separator. |
protected boolean | isSpecialSequence(int offset) This method checks at the given offset if it contains a a special sequence. |
protected boolean | isWhitespace(char testChar) This method checks if the character is a whitespace. |
protected boolean | isWhitespace(int offset) This method checks at the given offset if it is a whitespace. |
public String | nextImage() This method is a convenience method. |
public Token | nextToken() Retrieving the next
Token . |
public void | propertyChanged(TokenizerPropertyEvent event) Event handler method. |
public int | readMore() Try to read more data into the text buffer of the tokenizer. |
abstract protected int | readMoreData() This method is called when the tokenizer runs out of data. |
protected int | readMoreDataFromBase() This method organizes the input buffer. |
protected int | readWhitespaces(int startingAtPos, int maxChars) This method detects the number of whitespace characters starting at the given
position. |
public void | setKeywordHandler(de.susebox.jtopas.spi.KeywordHandler handler) Setting a new
de.susebox.jtopas.spi.KeywordHandler or removing any
previously installed one. |
public void | setPatternHandler(de.susebox.jtopas.spi.PatternHandler handler) Setting a new
de.susebox.jtopas.spi.PatternHandler or removing any
previously installed one. |
public void | setReadPositionAbsolute(int position) This method sets the tokenizers current read position to the given absolute
read position. |
public void | setReadPositionRelative(int offset) This method sets the tokenizers new read position the given number of characters
forward (positive value) or backward (negative value) starting from the current
read position. |
public void | setSeparatorHandler(de.susebox.jtopas.spi.SeparatorHandler handler) Setting a new
de.susebox.jtopas.spi.SeparatorHandler or removing any
previously installed SeparatorHandler . |
public void | setSequenceHandler(de.susebox.jtopas.spi.SequenceHandler handler) Setting a new
de.susebox.jtopas.spi.SequenceHandler or removing any
previously installed one. |
public void | setSource(TokenizerSource source) Setting the source of data. |
public void | setSource(Reader reader) Convenience method to avoid the construction of a
TokenizerSource from the most important data source
java.io.Reader . |
public void | setTokenizerProperties(TokenizerProperties props) Setting the tokenizer characteristics. |
public void | setWhitespaceHandler(de.susebox.jtopas.spi.WhitespaceHandler handler) Setting a new
de.susebox.jtopas.spi.WhitespaceHandler or removing any
previously installed one. |
protected String[] | splitBlockComment(TokenizerProperty prop, String image) Splits a given block comment into lines. |
protected String[] | splitIntoLines(String image) Splits a given String into lines. |
protected String[] | splitString(TokenizerProperty prop, String image) Splits a given string into lines and removing string escapes. |
public void | switchTo(AbstractTokenizer tokenizer) Changing fron one tokenizer to another. |
protected void | synchronizeAll() When the method
AbstractTokenizer.readMoreData changes the contents of the input buffer
or the input buffer itself, all embedded tokenizers must be synchronized. |