public class SourceTokenSearcher extends Object
| Constructor and Description |
|---|
SourceTokenSearcher() |
| Modifier and Type | Method and Description |
|---|---|
static TSourceToken |
backforwardSearch(TSourceToken token,
int backsearchSize,
String text)
backward search the source token
|
static TSourceToken |
backforwardSearchNotWhitespaceAndReturnToken(TSourceToken endToken,
int backforwardSearchSize,
String text) |
static TSourceToken |
firstNotWhitespaceAndReturnToken(TSourceTokenList list,
int startPos,
int endPos)
get first token which is not whitespace and return token
|
static TSourceToken |
firstSelectedToken(TSourceTokenList list,
int startPos,
int endPos,
String text) |
static TSourceToken |
firstSelectNotWhitespaceAndReturnToken(TSourceTokenList list,
int startPos,
String text)
forward search the token which is the first not whitespace or return
token, and its value is a fixed text
|
static TSourceToken |
forwardSearch(TSourceToken token,
int forwardSearchSize,
String text)
forward search the source token
|
static int |
indexOf(TSourceTokenList list,
int startPos,
int endPos,
ETokenType type)
search the source token in the source token list from the top
|
static int |
indexOf(TSourceTokenList list,
int startPos,
int endPos,
String text)
search the source token in the source token list from the top
|
static int |
indexOf(TSourceTokenList list,
int startPos,
String text)
search the source token in the source token list from the top
|
static boolean |
isNewLineToken(TSourceToken token) |
static boolean |
isSimpleComment(TSourceToken token) |
static int |
lastIndexOf(TSourceTokenList list,
int startPos,
int endPos,
String text)
search the source token in the source token list from the end
|
static int |
lastIndexOf(TSourceTokenList list,
int endPos,
String text)
search the source token in the source token list from the end
|
static TSourceToken |
lastNotWhitespaceAndReturnToken(TSourceTokenList list,
int endPos)
get last token which is not whitespace and return token
|
static TSourceToken |
lastNotWhitespaceAndReturnToken(TSourceTokenList list,
int startPos,
int endPos)
get last token which is not whitespace and return token
|
static TSourceToken |
lastSelectedNotWhitespaceAndReturnToken(TSourceTokenList list,
int endPos,
String text)
backward search the token which is the first not whitespace or return
token, and its value is a fixed text
|
static TSourceToken |
lastSelectedNotWhitespaceAndReturnToken(TSourceToken token,
String text)
backward search the token which is the first not whitespace or return
token, and its value is a fixed text
|
static TSourceToken |
lastSelectedToken(TSourceTokenList list,
int startPos,
int endPos,
String text) |
public SourceTokenSearcher()
public static int indexOf(TSourceTokenList list, int startPos, int endPos, String text)
list - startPos - endPos - text - public static int indexOf(TSourceTokenList list, int startPos, int endPos, ETokenType type)
list - startPos - endPos - type - public static int indexOf(TSourceTokenList list, int startPos, String text)
list - startPos - text - public static TSourceToken backforwardSearch(TSourceToken token, int backsearchSize, String text)
backsearchSize - text - public static TSourceToken forwardSearch(TSourceToken token, int forwardSearchSize, String text)
token - forwardSearchSize - text - public static int lastIndexOf(TSourceTokenList list, int startPos, int endPos, String text)
list - startPos - endPos - text - public static int lastIndexOf(TSourceTokenList list, int endPos, String text)
list - endPos - text - public static TSourceToken lastNotWhitespaceAndReturnToken(TSourceTokenList list, int startPos, int endPos)
list - startPos - endPos - public static TSourceToken lastNotWhitespaceAndReturnToken(TSourceTokenList list, int endPos)
list - endPos - public static TSourceToken lastSelectedNotWhitespaceAndReturnToken(TSourceTokenList list, int endPos, String text)
list - endPos - the fixed valuepublic static TSourceToken firstNotWhitespaceAndReturnToken(TSourceTokenList list, int startPos, int endPos)
list - startPos - endPos - public static TSourceToken firstSelectNotWhitespaceAndReturnToken(TSourceTokenList list, int startPos, String text)
list - startPos - text - public static TSourceToken lastSelectedNotWhitespaceAndReturnToken(TSourceToken token, String text)
token - text - public static boolean isNewLineToken(TSourceToken token)
public static boolean isSimpleComment(TSourceToken token)
public static TSourceToken backforwardSearchNotWhitespaceAndReturnToken(TSourceToken endToken, int backforwardSearchSize, String text)
public static TSourceToken lastSelectedToken(TSourceTokenList list, int startPos, int endPos, String text)
public static TSourceToken firstSelectedToken(TSourceTokenList list, int startPos, int endPos, String text)