Package org.fife.rsta.ac.common
Class TokenScanner
- java.lang.Object
-
- org.fife.rsta.ac.common.TokenScanner
-
public class TokenScanner extends java.lang.ObjectReturns non-whitespace, non-comment tokens from anRSyntaxDocument, one at a time. This can be used by simplisticLanguageSupports to "parse" for simple, easily-identifiable tokens, such as curly braces andTokenTypes.VARIABLEs. For example, to identify code blocks for languages structured like C and Java, you can use this class in conjunction withCodeBlockandVariableDeclarationto create an easily-parsable model of your source code.- Version:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description TokenScanner(org.fife.ui.rsyntaxtextarea.RSyntaxDocument doc)TokenScanner(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.fife.ui.rsyntaxtextarea.RSyntaxDocumentgetDocument()Returns the document being parsed.org.fife.ui.rsyntaxtextarea.Tokennext()Returns the next non-whitespace, non-comment token in the text area.private org.fife.ui.rsyntaxtextarea.TokennextRaw()Returns the next token in the text area.
-
-
-
Method Detail
-
getDocument
public org.fife.ui.rsyntaxtextarea.RSyntaxDocument getDocument()
Returns the document being parsed.- Returns:
- The document.
-
next
public org.fife.ui.rsyntaxtextarea.Token next()
Returns the next non-whitespace, non-comment token in the text area.- Returns:
- The next token, or
nullif we are at the end of its document.
-
nextRaw
private org.fife.ui.rsyntaxtextarea.Token nextRaw()
Returns the next token in the text area.- Returns:
- The next token, or
nullif we are at the end of its document.
-
-