org.gjt.sp.jedit.syntax
Class TokenMarkerContext

java.lang.Object
  extended byorg.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

Field Summary
 char[] array
           
 TokenMarker.LineInfo currLineInfo
           
 int lastKeyword
           
 int lastOffset
           
 int length
           
 javax.swing.text.Segment line
           
 int lineIndex
           
 int offset
           
 int pos
           
 TokenMarker.LineInfo prevLineInfo
           
 
Constructor Summary
TokenMarkerContext(javax.swing.text.Segment line, int lineIndex, TokenMarkerWithAddToken marker)
           
TokenMarkerContext(javax.swing.text.Segment line, int lineIndex, TokenMarkerWithAddToken marker, TokenMarker.LineInfo[] lineInfo)
           
 
Method Summary
 void addToken(int length, byte id)
           
 void addTokenToEnd(byte id)
           
 void addTokenToPos(byte id)
          Adds a token to the position specified (position exclusive) The character at pos index is excluded
 void addTokenToPos(int pos, byte id)
           
 boolean atFirst()
           
 byte doKeywordToEnd(KeywordMap keywords)
           
 byte doKeywordToPos(int pos, KeywordMap keywords)
           
 byte doKeywordToPos(KeywordMap keywords)
           
 char getChar()
           
 char getChar(int inc)
           
 boolean hasMoreChars()
           
 char lastChar()
           
 boolean regionMatches(boolean ignoreCase, java.lang.String match)
           
 int remainingChars()
           
 gnu.regexp.REMatch RERegionMatches(gnu.regexp.RE match)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

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)
Method Detail

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.