Package com.pnfsoftware.jeb.util.format
Class TokenExtractor
java.lang.Object
com.pnfsoftware.jeb.util.format.TokenExtractor
A customizable string token extractor. Standard delimiters are provided: see
DF_xxx
objects.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Definition of a delimiter. -
Field Summary
Modifier and TypeFieldDescriptionstatic final TokenExtractor.IDelimiterFinder
Delimiter= '=' character.static final TokenExtractor.IDelimiterFinder
Delimiter= any character that is generally not legal in a symbol name, in particular: any character allowed in java identifier additional '/' character for java signature additional '+' character for native relative signaturestatic final TokenExtractor.IDelimiterFinder
Delimiter= any character that is generally not legal in a symbol name, in particular: any character allowed in java identifier astatic final TokenExtractor.IDelimiterFinder
Delimiter= any character that is neither a letter for a digitstatic final TokenExtractor.IDelimiterFinder
Delimiter= whitespace character -
Constructor Summary
ConstructorDescriptionTokenExtractor
(TokenExtractor.IDelimiterFinder delimiterFinder) Create a token extractor. -
Method Summary
Modifier and TypeMethodDescriptionExtract the token spanning over the provided offset of the input string.int[]
extractCoordinates
(String s, int o) Extract the token spanning over the provided offset of the input string.static List<TokenExtractor>
Retrieve the generic list of Token Extractor, based on DF_*TokenExtractor.IDelimiterFinder
.protected boolean
-
Field Details
-
DF_WhiteSpace
Delimiter= whitespace character -
DF_CommonFullSymbolChars
Delimiter= any character that is generally not legal in a symbol name, in particular:- any character allowed in java identifier
- additional '/' character for java signature
- additional '+' character for native relative signature
-
DF_CommonSymbolChars
Delimiter= any character that is generally not legal in a symbol name, in particular:- any character allowed in java identifier
- a
-
DF_NonAlphaNum
Delimiter= any character that is neither a letter for a digit -
DF_Assignment
Delimiter= '=' character. In particular on decompilation comment with pattern when x=myvalue
-
-
Constructor Details
-
TokenExtractor
Create a token extractor.- Parameters:
delimiterFinder
- a delimiter finder; client code may either create their own or use one of the standard finders, seeDF_*
-
-
Method Details
-
getGenericTokenList
Retrieve the generic list of Token Extractor, based on DF_*TokenExtractor.IDelimiterFinder
. List is sorted from least to most restrictive.- Returns:
- token extractor list
-
extract
Extract the token spanning over the provided offset of the input string.- Parameters:
s
- input stringo
- start offset- Returns:
- the token as a substring of s or null if not found.
-
extractCoordinates
Extract the token spanning over the provided offset of the input string.- Parameters:
s
- input stringo
- start offset- Returns:
- an array with 2 indexes [start, end] of the token, or null if not found.
-
match
-