|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gjt.sp.jedit.syntax.DefaultTokenHandler
Builds a linked list of tokens without any additional processing.
Field Summary | |
protected Token |
firstToken
|
protected Token |
lastToken
|
protected TokenMarker.LineContext |
lineContext
|
Constructor Summary | |
DefaultTokenHandler()
|
Method Summary | |
protected void |
addToken(Token token,
TokenMarker.LineContext context)
|
protected Token |
createToken(byte id,
int offset,
int length,
TokenMarker.LineContext context)
|
TokenMarker.LineContext |
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). |
protected ParserRuleSet |
getParserRuleSet(TokenMarker.LineContext context)
|
Token |
getTokens()
Returns the first syntax token. |
void |
handleToken(javax.swing.text.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). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Token firstToken
protected Token lastToken
protected TokenMarker.LineContext lineContext
Constructor Detail |
public DefaultTokenHandler()
Method Detail |
public void init()
public Token getTokens()
public void handleToken(javax.swing.text.Segment seg, byte id, int offset, int length, TokenMarker.LineContext context)
handleToken
in interface TokenHandler
seg
- The segment containing the textid
- The token type (one of the constants in the
Token
class).offset
- The start offset of the tokenlength
- The number of characters in the tokencontext
- The line contextpublic TokenMarker.LineContext getLineContext()
public void setLineContext(TokenMarker.LineContext lineContext)
setLineContext
in interface TokenHandler
protected ParserRuleSet getParserRuleSet(TokenMarker.LineContext context)
protected Token createToken(byte id, int offset, int length, TokenMarker.LineContext context)
protected void addToken(Token token, TokenMarker.LineContext context)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |