com.intellij.lang.cacheBuilder
Class DefaultWordsScanner

java.lang.Object
  extended by com.intellij.lang.cacheBuilder.DefaultWordsScanner
All Implemented Interfaces:
WordsScanner

public class DefaultWordsScanner
extends java.lang.Object
implements WordsScanner

The default implementation of a words scanner based on a custom language lexer.


Constructor Summary
DefaultWordsScanner(Lexer lexer, TokenSet identifierTokenSet, TokenSet commentTokenSet, TokenSet literalTokenSet)
          Creates a new instance of the words scanner.
 
Method Summary
 void processWords(java.lang.CharSequence fileText, Processor<WordOccurrence> processor)
          Processes the specified text fragment and passes every word in the text to the specified processor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWordsScanner

public DefaultWordsScanner(Lexer lexer,
                           TokenSet identifierTokenSet,
                           TokenSet commentTokenSet,
                           TokenSet literalTokenSet)
Creates a new instance of the words scanner.

Parameters:
lexer - the lexer used for breaking the text into tokens.
identifierTokenSet - the set of token types which represent identifiers.
commentTokenSet - the set of token types which represent comments.
literalTokenSet - the set of token types which represent literals.
Method Detail

processWords

public void processWords(java.lang.CharSequence fileText,
                         Processor<WordOccurrence> processor)
Description copied from interface: WordsScanner
Processes the specified text fragment and passes every word in the text to the specified processor.

Specified by:
processWords in interface WordsScanner
Parameters:
fileText - the text to break into words.
processor - the processor which accepts the words in the text.