Package nz.org.riskscape.rl.ast
Class FunctionCall.Argument
java.lang.Object
nz.org.riskscape.rl.ast.FunctionCall.Argument
- Enclosing class:
- FunctionCall
-
Constructor Summary
ConstructorDescriptionArgument
(Expression expression) Argument
(Expression expression, String keyword) Argument
(Expression expression, Optional<Token> nameToken) -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendSource
(StringBuilder appendTo) boolean
<T> ResultOrProblems<T>
evaluateConstant
(RealizationContext context, Class<T> requiredJavaType, Type requiredType) Attempts to realize and evaluate this argument's expression against an emptyStruct
, returning useful problems if the expression wasn't constant or if the returned type doesn't match the expected java type.getName()
int
hashCode()
toSource()
toString()
-
Constructor Details
-
Argument
-
Argument
-
Argument
-
-
Method Details
-
getName
-
getNameToken
-
appendSource
-
toSource
-
evaluateConstant
public <T> ResultOrProblems<T> evaluateConstant(RealizationContext context, Class<T> requiredJavaType, Type requiredType) Attempts to realize and evaluate this argument's expression against an empty
Struct
, returning useful problems if the expression wasn't constant or if the returned type doesn't match the expected java type.ExpressionRealizer.realizeConstant(Expression)
has more details.- Type Parameters:
T
- the expected object- Parameters:
requiredJavaType
- the java type that we expect the expression to yield. Checked against the expression's return type, not the actual constant value's class type.requiredType
- a riskscape type to use in any error message that's generated
-
getExpression
-
equals
-
hashCode
public int hashCode() -
toString
-