Package gudusoft.gsqlparser.pp.utils
Class SourceTokenSearcher
Object
gudusoft.gsqlparser.pp.utils.SourceTokenSearcher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TSourceTokenbackforwardSearch(TSourceToken token, int backsearchSize, String text) backward search the source tokenstatic TSourceTokenbackforwardSearchNotWhitespaceAndReturnToken(TSourceToken endToken, int backforwardSearchSize, String text) static TSourceTokenfirstNotWhitespaceAndReturnToken(TSourceTokenList list, int startPos, int endPos) get first token which is not whitespace and return tokenstatic TSourceTokenfirstSelectedToken(TSourceTokenList list, int startPos, int endPos, String text) static TSourceTokenfirstSelectNotWhitespaceAndReturnToken(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 textstatic TSourceTokenforwardSearch(TSourceToken token, int forwardSearchSize, String text) forward search the source tokenstatic intindexOf(TSourceTokenList list, int startPos, int endPos, ETokenType type) search the source token in the source token list from the topstatic intindexOf(TSourceTokenList list, int startPos, int endPos, String text) search the source token in the source token list from the topstatic intindexOf(TSourceTokenList list, int startPos, String text) search the source token in the source token list from the topstatic booleanisNewLineToken(TSourceToken token) static booleanisSimpleComment(TSourceToken token) static intlastIndexOf(TSourceTokenList list, int startPos, int endPos, String text) search the source token in the source token list from the endstatic intlastIndexOf(TSourceTokenList list, int endPos, String text) search the source token in the source token list from the endstatic TSourceTokenlastNotWhitespaceAndReturnToken(TSourceTokenList list, int endPos) get last token which is not whitespace and return tokenstatic TSourceTokenlastNotWhitespaceAndReturnToken(TSourceTokenList list, int startPos, int endPos) get last token which is not whitespace and return tokenstatic TSourceTokenlastSelectedNotWhitespaceAndReturnToken(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 textstatic TSourceTokenlastSelectedNotWhitespaceAndReturnToken(TSourceToken token, String text) backward search the token which is the first not whitespace or return token, and its value is a fixed textstatic TSourceTokenlastSelectedToken(TSourceTokenList list, int startPos, int endPos, String text)
-
Constructor Details
-
SourceTokenSearcher
public SourceTokenSearcher()
-
-
Method Details
-
indexOf
search the source token in the source token list from the top- Parameters:
list-startPos-endPos-text-- Returns:
- position
-
indexOf
search the source token in the source token list from the top- Parameters:
list-startPos-endPos-type-- Returns:
-
indexOf
search the source token in the source token list from the top- Parameters:
list-startPos-text-- Returns:
-
backforwardSearch
backward search the source token- Parameters:
backsearchSize-text-- Returns:
-
forwardSearch
forward search the source token- Parameters:
token-forwardSearchSize-text-- Returns:
-
lastIndexOf
search the source token in the source token list from the end- Parameters:
list-startPos-endPos-text-- Returns:
- position
-
lastIndexOf
search the source token in the source token list from the end- Parameters:
list-endPos-text-- Returns:
-
lastNotWhitespaceAndReturnToken
public static TSourceToken lastNotWhitespaceAndReturnToken(TSourceTokenList list, int startPos, int endPos) get last token which is not whitespace and return token- Parameters:
list-startPos-endPos-- Returns:
-
lastNotWhitespaceAndReturnToken
get last token which is not whitespace and return token- Parameters:
list-endPos-- Returns:
-
lastSelectedNotWhitespaceAndReturnToken
public 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- Parameters:
list-endPos- the fixed value- Returns:
-
firstNotWhitespaceAndReturnToken
public static TSourceToken firstNotWhitespaceAndReturnToken(TSourceTokenList list, int startPos, int endPos) get first token which is not whitespace and return token- Parameters:
list-startPos-endPos-- Returns:
-
firstSelectNotWhitespaceAndReturnToken
public 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- Parameters:
list-startPos-text-- Returns:
-
lastSelectedNotWhitespaceAndReturnToken
backward search the token which is the first not whitespace or return token, and its value is a fixed text- Parameters:
token-text-- Returns:
-
isNewLineToken
-
isSimpleComment
-
backforwardSearchNotWhitespaceAndReturnToken
public static TSourceToken backforwardSearchNotWhitespaceAndReturnToken(TSourceToken endToken, int backforwardSearchSize, String text) -
lastSelectedToken
public static TSourceToken lastSelectedToken(TSourceTokenList list, int startPos, int endPos, String text) -
firstSelectedToken
public static TSourceToken firstSelectedToken(TSourceTokenList list, int startPos, int endPos, String text)
-