Package org.eclipse.jface.text.rules
Interface ITokenScanner
- All Known Subinterfaces:
IPartitionTokenScanner
- All Known Implementing Classes:
BufferedRuleBasedScanner
,RuleBasedPartitionScanner
,RuleBasedScanner
public interface ITokenScanner
A token scanner scans a range of a document and reports about the token it finds.
A scanner has state. When asked, the scanner returns the offset and the length of the
last found token.
Originally since 2.0, but moved to org.eclipse.text in 3.14
- Since:
- 3.14
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the length of the last token read by this scanner.int
Returns the offset of the last token read by this scanner.Returns the next token in the document.void
Configures the scanner by providing access to the document range that should be scanned.
-
Method Details
-
setRange
Configures the scanner by providing access to the document range that should be scanned.- Parameters:
document
- the document to scanoffset
- the offset of the document range to scanlength
- the length of the document range to scan
-
nextToken
IToken nextToken()Returns the next token in the document.- Returns:
- the next token in the document
-
getTokenOffset
int getTokenOffset()Returns the offset of the last token read by this scanner.- Returns:
- the offset of the last token read by this scanner
-
getTokenLength
int getTokenLength()Returns the length of the last token read by this scanner.- Returns:
- the length of the last token read by this scanner
-