org.skunk.swing.text.syntax
Class Flexicizer

java.lang.Object
  |
  +--org.skunk.swing.text.syntax.Flexicizer
All Implemented Interfaces:
SyntaxTokenizer

public class Flexicizer
extends java.lang.Object
implements SyntaxTokenizer


Inner Class Summary
static class Flexicizer.Test
           
 
Field Summary
static int DEFAULT_REPARSE_DISTANCE
           
 
Constructor Summary
Flexicizer()
           
 
Method Summary
 int getReparseDistance()
          how many characters around the insertion point should be reparsed.
protected static FlexScanner getScanner(FileMode fileMode, java.io.Reader r)
          obtain a scanner from the pool which matches the given file mode, installing the given reader.
 void tokenize(SyntaxDocument document, int offset, int nInserted, int nRemoved)
          callback to tokenizer, which then tokenizes the necessary area around the indicated change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_REPARSE_DISTANCE

public static final int DEFAULT_REPARSE_DISTANCE
Constructor Detail

Flexicizer

public Flexicizer()
Method Detail

getScanner

protected static final FlexScanner getScanner(FileMode fileMode,
                                              java.io.Reader r)
obtain a scanner from the pool which matches the given file mode, installing the given reader.
Parameters:
fileMode - the FileMode of the scanner
r - the Reader which gives access to the text to be lexed
Returns:
the scanner, or null if no scanner can be found for the file mode.

tokenize

public void tokenize(SyntaxDocument document,
                     int offset,
                     int nInserted,
                     int nRemoved)
callback to tokenizer, which then tokenizes the necessary area around the indicated change.
Specified by:
tokenize in interface SyntaxTokenizer
Parameters:
document - the document
offset - the offset of the change to the document
nInserted - the numbers of characters inserted
nRemoved - the number of characters removed

getReparseDistance

public int getReparseDistance()
how many characters around the insertion point should be reparsed.