public class FlowExpressionParseUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FlowExpressionParseUtil.FlowExpressionContext
Context used to parse a flow expression.
|
static class |
FlowExpressionParseUtil.FlowExpressionParseException
An exception that indicates a parse error.
|
Modifier and Type | Field and Description |
---|---|
protected static java.util.regex.Pattern |
identifierPattern
Matches an identifier
|
protected static java.lang.String |
identifierRegex
Regular expression for an identifier.
|
protected static java.util.regex.Pattern |
intPattern
Matches integer literals
|
protected static java.util.regex.Pattern |
longPattern
Matches long literals
|
protected static java.util.regex.Pattern |
parameterPattern
Matches a parameter
|
protected static java.lang.String |
parameterRegex
Regular expression for a formal parameter use.
|
protected static java.util.regex.Pattern |
parenthesesPattern
Matches an expression contained in matching start and end parentheses
|
protected static java.util.regex.Pattern |
stringPattern
Matches string literals
|
protected static java.lang.String |
stringRegex
Regular expression for a string literal.
|
protected static java.util.regex.Pattern |
unanchoredParameterPattern
Unanchored; can be used to find all formal parameter uses.
|
Constructor and Description |
---|
FlowExpressionParseUtil() |
Modifier and Type | Method and Description |
---|---|
static FlowExpressions.Receiver |
internalReprOfVariable(AnnotatedTypeFactory provider,
VariableTree tree) |
static java.util.List<java.lang.Integer> |
parameterIndices(java.lang.String s) |
static FlowExpressions.Receiver |
parse(java.lang.String expression,
FlowExpressionParseUtil.FlowExpressionContext context,
TreePath localScope,
boolean useLocalScope)
Parse a string and return its representation as a
FlowExpressions.Receiver , or throw an FlowExpressionParseUtil.FlowExpressionParseException . |
protected static final java.lang.String identifierRegex
protected static final java.lang.String parameterRegex
protected static final java.lang.String stringRegex
protected static final java.util.regex.Pattern unanchoredParameterPattern
protected static final java.util.regex.Pattern parameterPattern
protected static final java.util.regex.Pattern identifierPattern
protected static final java.util.regex.Pattern intPattern
protected static final java.util.regex.Pattern longPattern
protected static final java.util.regex.Pattern stringPattern
protected static final java.util.regex.Pattern parenthesesPattern
public static FlowExpressions.Receiver parse(java.lang.String expression, FlowExpressionParseUtil.FlowExpressionContext context, TreePath localScope, boolean useLocalScope) throws FlowExpressionParseUtil.FlowExpressionParseException
FlowExpressions.Receiver
, or throw an FlowExpressionParseUtil.FlowExpressionParseException
.expression
- flow expression to parsecontext
- information about any receiver and argumentslocalScope
- path to local scope to useuseLocalScope
- whether localScope
should be used to resolve identifiersFlowExpressionParseUtil.FlowExpressionParseException
public static java.util.List<java.lang.Integer> parameterIndices(java.lang.String s)
s
. Each
formal parameter occurs in s as a string like "#1" or "#4". This routine does not do
proper parsing; for instance, if "#2" appears within a string in s, then 2 would still be
in the result list.public static FlowExpressions.Receiver internalReprOfVariable(AnnotatedTypeFactory provider, VariableTree tree) throws FlowExpressionParseUtil.FlowExpressionParseException