public abstract class CsCheckUtils extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
INTERPOLATION_PATTERN
Matches an interpolation in a C# 6 interpolation string.
|
static int |
UNKNOWN_ARITY
Value for a unknown method arity.
|
Constructor and Description |
---|
CsCheckUtils() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.Integer> |
checkForVariableUseInStringInterpolation(java.util.List<IToken> tokens,
java.lang.String variableName)
Checks whether the given variable name was used in a string interpolation in
the given tokens.
|
static java.util.List<IToken> |
extractInterpolatedCalls(java.util.List<IToken> tokens)
Filters a list of tokens for interpolated literal calls.
|
static boolean |
isMainMethod(ShallowEntity method)
Determines, if the given method is a valid Main method according to the
Microsoft
documentation
|
static SetMap<java.lang.String,java.lang.Integer> |
retrieveMethodReferences(java.util.List<IToken> tokens)
Retrieves all possible method references from the given tokens and adds them
to the given SetMap.
|
static java.util.List<java.util.List<IToken>> |
tokenizeInterpolatedCalls(java.util.List<IToken> interpolatedStringTokens)
Tokenize the interpolated calls in string token.
|
public static final java.util.regex.Pattern INTERPOLATION_PATTERN
public static final int UNKNOWN_ARITY
public CsCheckUtils()
public static boolean isMainMethod(ShallowEntity method)
public static SetMap<java.lang.String,java.lang.Integer> retrieveMethodReferences(java.util.List<IToken> tokens)
public static java.util.List<IToken> extractInterpolatedCalls(java.util.List<IToken> tokens)
String string = $"{foo(a, b)} comment";
tokens
- to check for interpolated literal tokens.public static java.util.List<java.util.List<IToken>> tokenizeInterpolatedCalls(java.util.List<IToken> interpolatedStringTokens)
interpolatedStringToken
- to be tokenized.public static java.util.List<java.lang.Integer> checkForVariableUseInStringInterpolation(java.util.List<IToken> tokens, java.lang.String variableName)