org.gjt.sp.jedit.syntax
Class TokenMarkerContext
java.lang.Object
org.gjt.sp.jedit.syntax.TokenMarkerContext
- public class TokenMarkerContext
- extends java.lang.Object
This class contains the Context of a Token Marker that can be passed along
nested Token Markers through a method like
markTokensImpl(MyToken token, TokenMarkerContext ctx) : MyToken
where MyToken represents the token state at the end of the marked line.
It contains useful infos such as last offset and last keyword and the pos in the marked line
It also provides utility functions that are often used in TokenMarkers such as
addTokenToPos, addTokenToEnd
doKeywordToPos, doKeywordToEnd
- Version:
- 0.6
- Author:
- Andre Kaplan
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
line
public javax.swing.text.Segment line
lineIndex
public int lineIndex
array
public char[] array
offset
public int offset
lastOffset
public int lastOffset
lastKeyword
public int lastKeyword
length
public int length
pos
public int pos
prevLineInfo
public TokenMarker.LineInfo prevLineInfo
currLineInfo
public TokenMarker.LineInfo currLineInfo
TokenMarkerContext
public TokenMarkerContext(javax.swing.text.Segment line,
int lineIndex,
TokenMarkerWithAddToken marker,
TokenMarker.LineInfo[] lineInfo)
TokenMarkerContext
public TokenMarkerContext(javax.swing.text.Segment line,
int lineIndex,
TokenMarkerWithAddToken marker)
atFirst
public boolean atFirst()
hasMoreChars
public boolean hasMoreChars()
remainingChars
public int remainingChars()
getChar
public char getChar()
getChar
public char getChar(int inc)
lastChar
public char lastChar()
addToken
public void addToken(int length,
byte id)
addTokenToPos
public void addTokenToPos(byte id)
- Adds a token to the position specified (position exclusive)
The character at pos index is excluded
addTokenToPos
public void addTokenToPos(int pos,
byte id)
addTokenToEnd
public void addTokenToEnd(byte id)
doKeywordToPos
public byte doKeywordToPos(int pos,
KeywordMap keywords)
doKeywordToPos
public byte doKeywordToPos(KeywordMap keywords)
doKeywordToEnd
public byte doKeywordToEnd(KeywordMap keywords)
regionMatches
public boolean regionMatches(boolean ignoreCase,
java.lang.String match)
RERegionMatches
public gnu.regexp.REMatch RERegionMatches(gnu.regexp.RE match)
toString
public java.lang.String toString()
Copyright ? 2002 Romain Guy.