java.lang.Object
org.gjt.sp.jedit.syntax.DefaultTokenHandler
- All Implemented Interfaces:
TokenHandler
- Direct Known Subclasses:
DisplayTokenHandler
Builds a linked list of tokens without any additional processing.
- Since:
- jEdit 4.1pre1
- Version:
- $Id: DefaultTokenHandler.java 25244 2020-04-15 15:14:49Z kpouer $
- Author:
- Slava Pestov
-
Field Summary
Modifier and TypeFieldDescriptionprotected Token
protected Token
protected TokenMarker.LineContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addToken
(Token token, TokenMarker.LineContext context) protected Token
createToken
(byte id, int offset, int length, TokenMarker.LineContext context) The token handler can compare this object with the object previously given for this line to see if the token type at the end of the line has changed (meaning subsequent lines might need to be retokenized).protected ParserRuleSet
getParserRuleSet
(TokenMarker.LineContext context) Returns the first syntax token.void
handleToken
(Segment seg, byte id, int offset, int length, TokenMarker.LineContext context) Called by the token marker when a syntax token has been parsed.void
init()
Clears the list of tokens.void
setLineContext
(TokenMarker.LineContext lineContext) The token handler can compare this object with the object previously given for this line to see if the token type at the end of the line has changed (meaning subsequent lines might need to be retokenized).
-
Field Details
-
firstToken
-
lastToken
-
lineContext
-
-
Constructor Details
-
DefaultTokenHandler
public DefaultTokenHandler()
-
-
Method Details
-
init
public void init()Clears the list of tokens. -
getTokens
Returns the first syntax token.- Since:
- jEdit 4.1pre1
-
handleToken
public void handleToken(Segment seg, byte id, int offset, int length, TokenMarker.LineContext context) Called by the token marker when a syntax token has been parsed.- Specified by:
handleToken
in interfaceTokenHandler
- Parameters:
seg
- The segment containing the textid
- The token type (one of the constants in theToken
class).offset
- The start offset of the tokenlength
- The number of characters in the tokencontext
- The line context- Since:
- jEdit 4.2pre3
-
getLineContext
The token handler can compare this object with the object previously given for this line to see if the token type at the end of the line has changed (meaning subsequent lines might need to be retokenized).- Since:
- jEdit 4.2pre6
-
setLineContext
The token handler can compare this object with the object previously given for this line to see if the token type at the end of the line has changed (meaning subsequent lines might need to be retokenized).- Specified by:
setLineContext
in interfaceTokenHandler
- Since:
- jEdit 4.2pre6
-
getParserRuleSet
-
createToken
-
addToken
-