Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.gjt.sp.jedit.syntax
Class TokenMarkerContext  view TokenMarkerContext download TokenMarkerContext.java

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

Field Summary
 char[] array
           
 TokenMarker.LineInfo currLineInfo
           
 int lastKeyword
           
 int lastOffset
           
 int length
           
 javax.swing.text.Segment line
           
 int lineIndex
           
private  TokenMarkerWithAddToken marker
           
 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)
           
private static gnu.regexp.REMatch RERegionMatches(javax.swing.text.Segment text, int offset, gnu.regexp.RE match)
          Checks if a subregion of a Segment matches a regular expression.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
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

marker

private TokenMarkerWithAddToken marker

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)

RERegionMatches

private static gnu.regexp.REMatch RERegionMatches(javax.swing.text.Segment text,
                                                  int offset,
                                                  gnu.regexp.RE match)
Checks if a subregion of a Segment matches a regular expression. The match-beginning operator (^) in the regular expression matches segment at position offset This function is intended to be part of SyntaxUtilities


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).