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, ISymbol returnType, org.antlr.v4.runtime.ParserRuleContext 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theargumentTypesrecord component.Returns the value of theargumentVariablesrecord component.final booleanIndicates whether some other object is "equal to" this one.static CallContextforBinaryOperation(ISymbol leftType, ISymbol rightType, ISymbol returnType, String methodName, String leftVariable, String rightVariable, String scopeId) Create context for binary operation: left.method(right)static CallContextforBinaryOperationWithContext(ISymbol leftType, ISymbol rightType, ISymbol returnType, String methodName, String leftVariable, String rightVariable, String scopeId, org.antlr.v4.runtime.ParserRuleContext parseContext) Create context for binary operation with parseContext: left.method(right) Used when Phase 3 has already resolved the method (e.g., switch case comparisons)static CallContextforFunctionCall(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 CallContextforUnaryOperation(ISymbol targetType, String methodName, String targetVariable, ISymbol returnType, String scopeId) Create context for unary operation: target.method()final inthashCode()Returns a hash code value for this object.Returns the value of themethodNamerecord component.org.antlr.v4.runtime.ParserRuleContextReturns the value of theparseContextrecord component.Returns the value of thereturnTyperecord component.scopeId()Returns the value of thescopeIdrecord component.Returns the value of thetargetTyperecord component.Returns the value of thetargetVariablerecord component.final StringtoString()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, ISymbol returnType, org.antlr.v4.runtime.ParserRuleContext parseContext) Creates an instance of aCallContextrecord class.- Parameters:
targetType- the value for thetargetTyperecord componenttargetVariable- the value for thetargetVariablerecord componentmethodName- the value for themethodNamerecord componentargumentTypes- the value for theargumentTypesrecord componentargumentVariables- the value for theargumentVariablesrecord componentscopeId- the value for thescopeIdrecord componentreturnType- the value for thereturnTyperecord componentparseContext- the value for theparseContextrecord component
-
-
Method Details
-
forBinaryOperation
-
forBinaryOperationWithContext
public static CallContext forBinaryOperationWithContext(ISymbol leftType, ISymbol rightType, ISymbol returnType, String methodName, String leftVariable, String rightVariable, String scopeId, org.antlr.v4.runtime.ParserRuleContext parseContext) Create context for binary operation with parseContext: left.method(right) Used when Phase 3 has already resolved the method (e.g., switch case comparisons) -
forUnaryOperation
-
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 thetargetTyperecord component.- Returns:
- the value of the
targetTyperecord component
-
targetVariable
Returns the value of thetargetVariablerecord component.- Returns:
- the value of the
targetVariablerecord component
-
methodName
Returns the value of themethodNamerecord component.- Returns:
- the value of the
methodNamerecord component
-
argumentTypes
-
argumentVariables
-
scopeId
Returns the value of thescopeIdrecord component.- Returns:
- the value of the
scopeIdrecord component
-
returnType
Returns the value of thereturnTyperecord component.- Returns:
- the value of the
returnTyperecord component
-
parseContext
public org.antlr.v4.runtime.ParserRuleContext parseContext()Returns the value of theparseContextrecord component.- Returns:
- the value of the
parseContextrecord component
-