Package jsyntaxpane
Interface Lexer
-
- All Known Implementing Classes:
BashLexer
,CLexer
,ClojureLexer
,CppLexer
,DefaultJFlexLexer
,DOSBatchLexer
,EmptyLexer
,GroovyLexer
,JavaLexer
,JavaScriptLexer
,JFlexLexer
,LuaLexer
,PropertiesLexer
,PythonLexer
,RubyLexer
,ScalaLexer
,SimpleRegexLexer
,SqlLexer
,TALLexer
,XHTMLLexer
,XmlLexer
,XPathLexer
public interface Lexer
Lexers must implement these methods. These are used in the Tokenizer A Lexer should be tied to one document.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
parse(javax.swing.text.Segment segment, int ofst, java.util.List<Token> tokens)
This is the only method a Lexer needs to implement.
-
-
-
Method Detail
-
parse
void parse(javax.swing.text.Segment segment, int ofst, java.util.List<Token> tokens)
This is the only method a Lexer needs to implement. It will be passed a Reader, and it should return non-overlapping Tokens for each recognized token in the stream.- Parameters:
segment
- Text to parse.ofst
- offset to add to start of each token (useful for nesting)tokens
- List of Tokens to be added. This is done so that the caller creates the appropriate List implementation and size. The parse method just adds to the list
-
-