Record Class CallableInfo
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase5.callgraph.CallableInfo
- Record Components:
fullyQualifiedName- Unique identifier for the callable (e.g., "module::Class._method")symbol- The underlying EK9 symbol (function, method, etc.)sourceToken- Source location for error reportingmoduleName- Module containing this callableisPure- True if callable is marked as pureisProgram- True if this is a program entry pointisTestEntry- True if this has @Test directivecontainsAssertion- True if this callable directly contains assert/assertThrows/assertDoesNotThrow
public record CallableInfo(String fullyQualifiedName, ISymbol symbol, IToken sourceToken, String moduleName, boolean isPure, boolean isProgram, boolean isTestEntry, boolean containsAssertion)
extends Record
Metadata about a callable entity (function, method, operator, constructor, program).
Used by the call graph for reachability analysis and validation.
This record captures properties needed for various call graph analyses:
- Entry point detection: isProgram, isTestEntry
- Assertion reachability: containsAssertion
- Purity analysis: isPure
- Module boundaries: moduleName
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for CallableInfo to support incremental construction during AST traversal. -
Constructor Summary
ConstructorsConstructorDescriptionCallableInfo(String fullyQualifiedName, ISymbol symbol, IToken sourceToken, String moduleName, boolean isPure, boolean isProgram, boolean isTestEntry, boolean containsAssertion) Create CallableInfo with validation. -
Method Summary
Modifier and TypeMethodDescriptionstatic CallableInfo.Builderbuilder()Create a builder for fluent construction of CallableInfo.booleanReturns the value of thecontainsAssertionrecord component.final booleanIndicates whether some other object is "equal to" this one.Format the source location for error messages.Returns the value of thefullyQualifiedNamerecord component.intgetLine()Get the line number of the callable definition.Get the source file name.final inthashCode()Returns a hash code value for this object.booleanCheck if this callable is any kind of entry point (program or @Test).booleanReturns the value of theisProgramrecord component.booleanisPure()Returns the value of theisPurerecord component.booleanReturns the value of theisTestEntryrecord component.Returns the value of themoduleNamerecord component.Returns the value of thesourceTokenrecord component.symbol()Returns the value of thesymbolrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
CallableInfo
-
-
Method Details
-
isEntryPoint
public boolean isEntryPoint()Check if this callable is any kind of entry point (program or @Test). -
getSourceFile
Get the source file name. -
getLine
public int getLine()Get the line number of the callable definition. -
formatLocation
Format the source location for error messages.- Returns:
- Location string in format "filename:line"
-
builder
Create a builder for fluent construction of CallableInfo. -
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. -
fullyQualifiedName
Returns the value of thefullyQualifiedNamerecord component.- Returns:
- the value of the
fullyQualifiedNamerecord component
-
symbol
-
sourceToken
Returns the value of thesourceTokenrecord component.- Returns:
- the value of the
sourceTokenrecord component
-
moduleName
Returns the value of themoduleNamerecord component.- Returns:
- the value of the
moduleNamerecord component
-
isPure
-
isProgram
-
isTestEntry
public boolean isTestEntry()Returns the value of theisTestEntryrecord component.- Returns:
- the value of the
isTestEntryrecord component
-
containsAssertion
public boolean containsAssertion()Returns the value of thecontainsAssertionrecord component.- Returns:
- the value of the
containsAssertionrecord component
-