Interface ExpressionProblems
- All Superinterfaces:
ProblemFactory
Factory for creating problems involving an expression
-
Method Summary
Modifier and TypeMethodDescriptionstatic Problem
cannotParse
(Object expectedThing, String expression) General purpose error for invalid expressions that cannot be parsed.canNotReplaceMember
(String name, StructDeclaration.Member first, StructDeclaration.Member second) constantRequired
(Expression expr) Something required a constant expression, but was given a non-constant expression, e.g.duplicateSelectAll
(Token duplicate) A second * has been put in a structSpecial case parsing error for when the user gives us an empty stringfailedToRealize
(Expression expression, Type inputType) Wraps other problems to give the context for realization failingstatic ExpressionProblems
get()
Handy accessor to save on precious keystrokeslambdaArityError
(Expression givenExpression, int found, int expected) malformedExpression
(String expression) A parent problem that wraps a more specific problem within the expressionGive the user some idea of what to do when an unexpected token exception occursmismatch
(Expression expr, Class<? extends Expression> requiredType, String example) expr is expected to be of requiredType but is not.noSuchOperatorFunction
(String op, List<Type> argTypes) noSuchStructMember
(String path, List<String> members) Similar tocannotParse(Object, String)
but for cases where mentioning 'parsing' is less appropriate.Generic error that says that an expression is no good in the current context as parameters are not allowed, i.e.pointlessSelectAll
(PropertyAccess expression) The user has done something likebar.*
outside of a struct, which makes no sensepointlessSelectAllInStruct
(StructDeclaration.Member memberDeclaration) The user has done something like{foo: bar.*}
which is probably a mistake - it should be either{bar.*}
or{foo: bar}
propertyOutsideOfAggregationFunction
(PropertyAccess expression) returned when an aggregate expression has property access expressions that aren't within an aggregate functionselectAllRequiresAStruct
(StructDeclaration.Member memberDeclaration, Type resultType) Given during realization when a .* is found against a non-struct type, like a list or a number
-
Method Details
-
get
Handy accessor to save on precious keystrokes
-
cannotParse
General purpose error for invalid expressions that cannot be parsed. Produces an error: "Failed to parse [expectedThing] expression '[expression]' e.g. Failed to parse type expression 'foo.bar'
-
notAValid
Similar to
cannotParse(Object, String)
but for cases where mentioning 'parsing' is less appropriate. Produces an error: "'[expression]' is not a valid [typeOfThing] expression" -
constantRequired
Something required a constant expression, but was given a non-constant expression, e.g. "Expected expression 'foo + bar' to be a constant value"
-
mismatch
expr is expected to be of requiredType but is not.
-
noSuchOperatorFunction
-
pointlessSelectAllInStruct
The user has done something like
{foo: bar.*}
which is probably a mistake - it should be either{bar.*}
or{foo: bar}
-
pointlessSelectAll
The user has done something like
bar.*
outside of a struct, which makes no sense -
duplicateSelectAll
A second * has been put in a struct
-
malformedExpression
A parent problem that wraps a more specific problem within the expression
-
selectAllRequiresAStruct
Given during realization when a .* is found against a non-struct type, like a list or a number
-
malformedExpressionTip
Problem malformedExpressionTip()Give the user some idea of what to do when an unexpected token exception occurs
-
failedToRealize
Wraps other problems to give the context for realization failing
-
lambdaArityError
- Returns:
- from function realization when a lambda expression has the wrong number of args
-
propertyOutsideOfAggregationFunction
returned when an aggregate expression has property access expressions that aren't within an aggregate function
-
aggregateFunctionNotSupportedInExpression
-
noSuchStructMember
- Returns:
- when a property expression fails to realize because a member doesn't exist
-
parametersNotAllowed
Generic error that says that an expression is no good in the current context as parameters are not allowed, i.e. there's no opportunity for the user to replace them, so it's never going to work.
-
canNotReplaceMember
Problem canNotReplaceMember(String name, StructDeclaration.Member first, StructDeclaration.Member second) -
emptyStringNotValid
Problem emptyStringNotValid()Special case parsing error for when the user gives us an empty string
-