Record Class CallContext
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.calls.CallContext
public record CallContext(ISymbol targetType, String targetVariable, String methodName, List<ISymbol> argumentTypes, List<String> argumentVariables, String scopeId, EK9Parser.CallContext parseContext)
extends Record
Context information needed for resolving method calls and constructing CallDetails.
Contains all the information needed to perform cost-based method resolution
and parameter-by-parameter promotion checking.
-
Constructor Summary
ConstructorsConstructorDescriptionCallContext
(ISymbol targetType, String targetVariable, String methodName, List<ISymbol> argumentTypes, List<String> argumentVariables, String scopeId, EK9Parser.CallContext parseContext) Creates an instance of aCallContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theargumentTypes
record component.Returns the value of theargumentVariables
record component.final boolean
Indicates whether some other object is "equal to" this one.static CallContext
forBinaryOperation
(ISymbol leftType, ISymbol rightType, String methodName, String leftVariable, String rightVariable, String scopeId) Create context for binary operation: left.method(right)static CallContext
forFunctionCall
(ISymbol targetType, List<ISymbol> argumentTypes, String methodName, String targetVariable, List<String> argumentVariables, String scopeId, EK9Parser.CallContext parseContext) Create context for function call: function(args...)static CallContext
forUnaryOperation
(ISymbol targetType, String methodName, String targetVariable, String scopeId) Create context for unary operation: target.method()final int
hashCode()
Returns a hash code value for this object.Returns the value of themethodName
record component.Returns the value of theparseContext
record component.scopeId()
Returns the value of thescopeId
record component.Returns the value of thetargetType
record component.Returns the value of thetargetVariable
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
CallContext
public CallContext(ISymbol targetType, String targetVariable, String methodName, List<ISymbol> argumentTypes, List<String> argumentVariables, String scopeId, EK9Parser.CallContext parseContext) Creates an instance of aCallContext
record class.- Parameters:
targetType
- the value for thetargetType
record componenttargetVariable
- the value for thetargetVariable
record componentmethodName
- the value for themethodName
record componentargumentTypes
- the value for theargumentTypes
record componentargumentVariables
- the value for theargumentVariables
record componentscopeId
- the value for thescopeId
record componentparseContext
- the value for theparseContext
record component
-
-
Method Details
-
forBinaryOperation
-
forUnaryOperation
public static CallContext forUnaryOperation(ISymbol targetType, String methodName, String targetVariable, String scopeId) Create context for unary operation: target.method() -
forFunctionCall
public static CallContext forFunctionCall(ISymbol targetType, List<ISymbol> argumentTypes, String methodName, String targetVariable, List<String> argumentVariables, String scopeId, EK9Parser.CallContext parseContext) Create context for function call: function(args...) -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
targetType
Returns the value of thetargetType
record component.- Returns:
- the value of the
targetType
record component
-
targetVariable
Returns the value of thetargetVariable
record component.- Returns:
- the value of the
targetVariable
record component
-
methodName
Returns the value of themethodName
record component.- Returns:
- the value of the
methodName
record component
-
argumentTypes
-
argumentVariables
-
scopeId
Returns the value of thescopeId
record component.- Returns:
- the value of the
scopeId
record component
-
parseContext
Returns the value of theparseContext
record component.- Returns:
- the value of the
parseContext
record component
-