org.eclipse.xtext.ui.editor.syntaxcoloring
Class DefaultTokenScanner

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.syntaxcoloring.AbstractTokenScanner
      extended by org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultTokenScanner
All Implemented Interfaces:
org.eclipse.jface.text.rules.ITokenScanner

public class DefaultTokenScanner
extends AbstractTokenScanner

Author:
Sebastian Zarnekow - Initial contribution and API

Constructor Summary
DefaultTokenScanner()
           
 
Method Summary
 int getTokenLength()
          Returns the length of the last token read by this scanner.
 int getTokenOffset()
          Returns the offset of the last token read by this scanner.
 org.eclipse.jface.text.rules.IToken nextToken()
          Returns the next token in the document.
 void setRange(org.eclipse.jface.text.IDocument document, int offset, int length)
          Configures the scanner by providing access to the document range that should be scanned.
 
Methods inherited from class org.eclipse.xtext.ui.editor.syntaxcoloring.AbstractTokenScanner
getAttribute, getTextAttributeProvider, setTextAttributeProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTokenScanner

public DefaultTokenScanner()
Method Detail

getTokenLength

public int getTokenLength()
Description copied from interface: org.eclipse.jface.text.rules.ITokenScanner
Returns the length of the last token read by this scanner.

Returns:
the length of the last token read by this scanner

getTokenOffset

public int getTokenOffset()
Description copied from interface: org.eclipse.jface.text.rules.ITokenScanner
Returns the offset of the last token read by this scanner.

Returns:
the offset of the last token read by this scanner

nextToken

public org.eclipse.jface.text.rules.IToken nextToken()
Description copied from interface: org.eclipse.jface.text.rules.ITokenScanner
Returns the next token in the document.

Returns:
the next token in the document

setRange

public void setRange(org.eclipse.jface.text.IDocument document,
                     int offset,
                     int length)
Description copied from interface: org.eclipse.jface.text.rules.ITokenScanner
Configures the scanner by providing access to the document range that should be scanned.

Parameters:
document - the document to scan
offset - the offset of the document range to scan
length - the length of the document range to scan