Record Class CallEdge
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase5.callgraph.CallEdge
- Record Components:
caller- Fully-qualified name of the calling function/methodcallee- Fully-qualified name of the called function/methodsourceToken- Token at the call site for error reportingcallType- Classification of the call (function, method, dispatcher, etc.)isPolymorphic- True if this call may dispatch to multiple targets at runtime
public record CallEdge(String caller, String callee, IToken sourceToken, CallType callType, boolean isPolymorphic)
extends Record
Represents an edge in the call graph from caller to callee.
Each edge captures the source location and call type for precise error reporting.
The call graph uses fully-qualified names for callables to ensure uniqueness. For methods, the format is "module::ClassName._methodName" or "module::functionName".
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncallee()Returns the value of thecalleerecord component.caller()Returns the value of thecallerrecord component.callType()Returns the value of thecallTyperecord component.static CallEdgeCreate a direct (non-polymorphic) call edge.final booleanIndicates whether some other object is "equal to" this one.Format the source location for error messages.intGet the column position of the call site.intgetLine()Get the line number of the call site.Get the source file name from the token.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisPolymorphicrecord component.static CallEdgepolymorphic(String caller, String callee, IToken token, CallType type) Create a polymorphic call edge (dispatcher or trait method).Returns the value of thesourceTokenrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
CallEdge
-
-
Method Details
-
direct
-
polymorphic
-
getSourceFile
Get the source file name from the token. -
getLine
public int getLine()Get the line number of the call site. -
getColumn
public int getColumn()Get the column position of the call site. -
formatLocation
Format the source location for error messages.- Returns:
- Location string in format "filename:line:column"
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
caller
-
callee
-
sourceToken
Returns the value of thesourceTokenrecord component.- Returns:
- the value of the
sourceTokenrecord component
-
callType
-
isPolymorphic
public boolean isPolymorphic()Returns the value of theisPolymorphicrecord component.- Returns:
- the value of the
isPolymorphicrecord component
-