Class CallGraphCollector
- All Implemented Interfaces:
org.antlr.v4.runtime.tree.ParseTreeListener, EK9Listener
This listener walks the AST and populates a shared CallGraph with:
- Callable registrations (functions, methods, programs, operators)
- Call edges (caller → callee relationships)
- Allocated types (for RTA filtering of polymorphic calls)
- Assertion locations (for E81007 and orphan detection)
Thread-safe: Uses a shared CallGraph with ConcurrentHashMap internals. Multiple instances can process different source files in parallel.
-
Field Summary
Fields inherited from class AbstractEK9PhaseListener
symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionCallGraphCollector(ParsedModule parsedModule, CallGraph callGraph) Create a collector for call graph information. -
Method Summary
Modifier and TypeMethodDescriptionvoidEnter a parse tree produced byEK9Parser.assertDoesNotThrowExpression().voidEnter a parse tree produced byEK9Parser.assertStatement().voidEnter a parse tree produced byEK9Parser.assertThrowsExpression().voidEnter a parse tree produced byEK9Parser.call().voidEnter a parse tree produced byEK9Parser.dynamicClassDeclaration().voidEnter a parse tree produced byEK9Parser.dynamicFunctionDeclaration().voidEnter a parse tree produced byEK9Parser.expression().voidEnter a parse tree produced byEK9Parser.functionDeclaration().voidEnter a parse tree produced byEK9Parser.methodDeclaration().voidEnter a parse tree produced byEK9Parser.objectAccessExpression().voidEnter a parse tree produced byEK9Parser.operationCall().voidEnter a parse tree produced byEK9Parser.operatorDeclaration().voidEnter a parse tree produced byEK9Parser.serviceOperationDeclaration().voidEnter a parse tree produced byEK9Parser.tryStatementExpression().voidExit a parse tree produced byEK9Parser.dynamicFunctionDeclaration().voidExit a parse tree produced byEK9Parser.functionDeclaration().voidExit a parse tree produced byEK9Parser.methodDeclaration().voidExit a parse tree produced byEK9Parser.operatorDeclaration().voidExit a parse tree produced byEK9Parser.serviceOperationDeclaration().Methods inherited from class ScopeStackConsistencyListener
enterApplicationDeclaration, enterBlock, enterCatchStatementExpression, enterClassDeclaration, enterComponentDeclaration, enterDynamicVariableCapture, enterFinallyStatementExpression, enterForStatementExpression, enterIfStatement, enterInstructionBlock, enterPackageBlock, enterRecordDeclaration, enterReturningParam, enterServiceDeclaration, enterSingleStatementBlock, enterSwitchStatementExpression, enterTernaryPart, enterTextBodyDeclaration, enterTextDeclaration, enterTraitDeclaration, enterTypeDeclaration, enterWhileStatementExpressionMethods inherited from class AbstractEK9PhaseListener
exitApplicationDeclaration, exitBlock, exitCatchStatementExpression, exitClassDeclaration, exitComponentDeclaration, exitDynamicClassDeclaration, exitDynamicVariableCapture, exitFinallyStatementExpression, exitForStatementExpression, exitIfStatement, exitInstructionBlock, exitModuleDeclaration, exitPackageBlock, exitRecordDeclaration, exitReturningParam, exitServiceDeclaration, exitSingleStatementBlock, exitSwitchStatementExpression, exitTernaryPart, exitTextBodyDeclaration, exitTextDeclaration, exitTraitDeclaration, exitTryStatementExpression, exitTypeDeclaration, exitWhileStatementExpression, getErrorListener, getParsedModule, isScopeStackEmpty, pullBlockTerminationUp, pullIfElseTerminationUp, pullSwitchCaseDefaultUp, pullTryCatchFinallyUpMethods inherited from class EK9BaseListener
enterAccessModifier, enterAggregateParts, enterAggregateProperty, enterAllowingOnly, enterApplicationBlock, enterArgumentParam, enterAspectDeclaration, enterAssignmentExpression, enterAssignmentStatement, enterBinaryLit, enterBinaryLiteral, enterBlockStatement, enterBooleanLit, enterBooleanLiteral, enterCaseExpression, enterCaseStatement, enterCharacterLit, enterCharacterLiteral, enterClassBlock, enterCloseStatement, enterColourLit, enterColourLiteral, enterCompilationUnit, enterComponentBlock, enterConstantBlock, enterConstantDeclaration, enterConstantInitialiser, enterConstrainDeclaration, enterConstrainType, enterDateLit, enterDateLiteral, enterDateTimeLit, enterDateTimeLiteral, enterDeclareArgumentParam, enterDecorationDimensionLiteral, enterDecorationResolutionLiteral, enterDefaultOperator, enterDict, enterDimensionLit, enterDirective, enterDirectivePart, enterDottedName, enterDurationLit, enterDurationLiteral, enterDynamicFunctionBody, enterElseOnlyBlock, enterEnumerationDeclaration, enterEveryRule, enterExpressionParam, enterExtendDeclaration, enterExtendPreamble, enterFloatingPointLit, enterFloatingPointLiteral, enterForLoop, enterForRange, enterFunctionBlock, enterGuardExpression, enterHttpAccess, enterHttpVerb, enterIdentifier, enterIdentifierReference, enterIfControlBlock, enterInitValuePair, enterIntegerLit, enterIntegerLiteral, enterList, enterMillisecondLit, enterMillisecondLiteral, enterModuleBlock, enterModuleDeclaration, enterModuleSegment, enterMoneyLit, enterMoneyLiteral, enterObjectAccess, enterObjectAccessStart, enterObjectAccessType, enterOperationDetails, enterOperator, enterParameterisedArgs, enterParameterisedDetail, enterParameterisedParams, enterParameterisedType, enterParamExpression, enterPathLit, enterPathLiteral, enterPipelinePart, enterPreFlowAndControl, enterPreFlowStatement, enterPrimary, enterPrimaryReference, enterProgramBlock, enterRange, enterRecordBlock, enterReferencesBlock, enterRegExLit, enterRegisterStatement, enterRegularExpressionLiteral, enterRequireStatement, enterReservedWord, enterResolutionLit, enterServiceBlock, enterSheBang, enterStatement, enterStreamCat, enterStreamExpression, enterStreamExpressionTermination, enterStreamFor, enterStreamPart, enterStreamSource, enterStreamStatement, enterStreamStatementTermination, enterStringLit, enterStringLiteral, enterStringPart, enterTextBlock, enterThrowStatement, enterTimeLit, enterTimeLiteral, enterTraitBlock, enterTraitPreamble, enterTraitReference, enterTraitsList, enterTypeBlock, enterTypeDef, enterVariableDeclaration, enterVariableOnlyDeclaration, enterVersionNumberLit, enterVersionNumberLiteral, enterWebVariableCorrelation, exitAccessModifier, exitAggregateParts, exitAggregateProperty, exitAllowingOnly, exitApplicationBlock, exitArgumentParam, exitAspectDeclaration, exitAssertDoesNotThrowExpression, exitAssertStatement, exitAssertThrowsExpression, exitAssignmentExpression, exitAssignmentStatement, exitBinaryLit, exitBinaryLiteral, exitBlockStatement, exitBooleanLit, exitBooleanLiteral, exitCall, exitCaseExpression, exitCaseStatement, exitCharacterLit, exitCharacterLiteral, exitClassBlock, exitCloseStatement, exitColourLit, exitColourLiteral, exitCompilationUnit, exitComponentBlock, exitConstantBlock, exitConstantDeclaration, exitConstantInitialiser, exitConstrainDeclaration, exitConstrainType, exitDateLit, exitDateLiteral, exitDateTimeLit, exitDateTimeLiteral, exitDeclareArgumentParam, exitDecorationDimensionLiteral, exitDecorationResolutionLiteral, exitDefaultOperator, exitDict, exitDimensionLit, exitDirective, exitDirectivePart, exitDottedName, exitDurationLit, exitDurationLiteral, exitDynamicFunctionBody, exitElseOnlyBlock, exitEnumerationDeclaration, exitEveryRule, exitExpression, exitExpressionParam, exitExtendDeclaration, exitExtendPreamble, exitFloatingPointLit, exitFloatingPointLiteral, exitForLoop, exitForRange, exitFunctionBlock, exitGuardExpression, exitHttpAccess, exitHttpVerb, exitIdentifier, exitIdentifierReference, exitIfControlBlock, exitInitValuePair, exitIntegerLit, exitIntegerLiteral, exitList, exitMillisecondLit, exitMillisecondLiteral, exitModuleBlock, exitModuleSegment, exitMoneyLit, exitMoneyLiteral, exitObjectAccess, exitObjectAccessExpression, exitObjectAccessStart, exitObjectAccessType, exitOperationCall, exitOperationDetails, exitOperator, exitParameterisedArgs, exitParameterisedDetail, exitParameterisedParams, exitParameterisedType, exitParamExpression, exitPathLit, exitPathLiteral, exitPipelinePart, exitPreFlowAndControl, exitPreFlowStatement, exitPrimary, exitPrimaryReference, exitProgramBlock, exitRange, exitRecordBlock, exitReferencesBlock, exitRegExLit, exitRegisterStatement, exitRegularExpressionLiteral, exitRequireStatement, exitReservedWord, exitResolutionLit, exitServiceBlock, exitSheBang, exitStatement, exitStreamCat, exitStreamExpression, exitStreamExpressionTermination, exitStreamFor, exitStreamPart, exitStreamSource, exitStreamStatement, exitStreamStatementTermination, exitStringLit, exitStringLiteral, exitStringPart, exitTextBlock, exitThrowStatement, exitTimeLit, exitTimeLiteral, exitTraitBlock, exitTraitPreamble, exitTraitReference, exitTraitsList, exitTypeBlock, exitTypeDef, exitVariableDeclaration, exitVariableOnlyDeclaration, exitVersionNumberLit, exitVersionNumberLiteral, exitWebVariableCorrelation, visitErrorNode, visitTerminal
-
Constructor Details
-
CallGraphCollector
Create a collector for call graph information.- Parameters:
parsedModule- The module being processedcallGraph- Shared call graph (thread-safe)
-
-
Method Details
-
enterMethodDeclaration
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.methodDeclaration().The default implementation does nothing.
- Specified by:
enterMethodDeclarationin interfaceEK9Listener- Overrides:
enterMethodDeclarationin classScopeStackConsistencyListener- Parameters:
ctx- the parse tree
-
exitMethodDeclaration
Description copied from class:EK9BaseListenerExit a parse tree produced byEK9Parser.methodDeclaration().The default implementation does nothing.
- Specified by:
exitMethodDeclarationin interfaceEK9Listener- Overrides:
exitMethodDeclarationin classAbstractEK9PhaseListener- Parameters:
ctx- the parse tree
-
enterFunctionDeclaration
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.functionDeclaration().The default implementation does nothing.
- Specified by:
enterFunctionDeclarationin interfaceEK9Listener- Overrides:
enterFunctionDeclarationin classScopeStackConsistencyListener- Parameters:
ctx- the parse tree
-
exitFunctionDeclaration
Description copied from class:EK9BaseListenerExit a parse tree produced byEK9Parser.functionDeclaration().The default implementation does nothing.
- Specified by:
exitFunctionDeclarationin interfaceEK9Listener- Overrides:
exitFunctionDeclarationin classAbstractEK9PhaseListener- Parameters:
ctx- the parse tree
-
enterOperatorDeclaration
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.operatorDeclaration().The default implementation does nothing.
- Specified by:
enterOperatorDeclarationin interfaceEK9Listener- Overrides:
enterOperatorDeclarationin classScopeStackConsistencyListener- Parameters:
ctx- the parse tree
-
exitOperatorDeclaration
Description copied from class:EK9BaseListenerExit a parse tree produced byEK9Parser.operatorDeclaration().The default implementation does nothing.
- Specified by:
exitOperatorDeclarationin interfaceEK9Listener- Overrides:
exitOperatorDeclarationin classAbstractEK9PhaseListener- Parameters:
ctx- the parse tree
-
enterServiceOperationDeclaration
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.serviceOperationDeclaration().The default implementation does nothing.
- Specified by:
enterServiceOperationDeclarationin interfaceEK9Listener- Overrides:
enterServiceOperationDeclarationin classScopeStackConsistencyListener- Parameters:
ctx- the parse tree
-
exitServiceOperationDeclaration
Description copied from class:EK9BaseListenerExit a parse tree produced byEK9Parser.serviceOperationDeclaration().The default implementation does nothing.
- Specified by:
exitServiceOperationDeclarationin interfaceEK9Listener- Overrides:
exitServiceOperationDeclarationin classAbstractEK9PhaseListener- Parameters:
ctx- the parse tree
-
enterDynamicFunctionDeclaration
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.dynamicFunctionDeclaration().The default implementation does nothing.
- Specified by:
enterDynamicFunctionDeclarationin interfaceEK9Listener- Overrides:
enterDynamicFunctionDeclarationin classScopeStackConsistencyListener- Parameters:
ctx- the parse tree
-
exitDynamicFunctionDeclaration
Description copied from class:EK9BaseListenerExit a parse tree produced byEK9Parser.dynamicFunctionDeclaration().The default implementation does nothing.
- Specified by:
exitDynamicFunctionDeclarationin interfaceEK9Listener- Overrides:
exitDynamicFunctionDeclarationin classAbstractEK9PhaseListener- Parameters:
ctx- the parse tree
-
enterDynamicClassDeclaration
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.dynamicClassDeclaration().The default implementation does nothing.
- Specified by:
enterDynamicClassDeclarationin interfaceEK9Listener- Overrides:
enterDynamicClassDeclarationin classScopeStackConsistencyListener- Parameters:
ctx- the parse tree
-
enterCall
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.call().The default implementation does nothing.
- Specified by:
enterCallin interfaceEK9Listener- Overrides:
enterCallin classEK9BaseListener- Parameters:
ctx- the parse tree
-
enterOperationCall
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.operationCall().The default implementation does nothing.
- Specified by:
enterOperationCallin interfaceEK9Listener- Overrides:
enterOperationCallin classEK9BaseListener- Parameters:
ctx- the parse tree
-
enterObjectAccessExpression
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.objectAccessExpression().The default implementation does nothing.
- Specified by:
enterObjectAccessExpressionin interfaceEK9Listener- Overrides:
enterObjectAccessExpressionin classEK9BaseListener- Parameters:
ctx- the parse tree
-
enterExpression
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.expression().The default implementation does nothing.
- Specified by:
enterExpressionin interfaceEK9Listener- Overrides:
enterExpressionin classEK9BaseListener- Parameters:
ctx- the parse tree
-
enterTryStatementExpression
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.tryStatementExpression().The default implementation does nothing.
- Specified by:
enterTryStatementExpressionin interfaceEK9Listener- Overrides:
enterTryStatementExpressionin classScopeStackConsistencyListener- Parameters:
ctx- the parse tree
-
enterAssertStatement
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.assertStatement().The default implementation does nothing.
- Specified by:
enterAssertStatementin interfaceEK9Listener- Overrides:
enterAssertStatementin classEK9BaseListener- Parameters:
ctx- the parse tree
-
enterAssertThrowsExpression
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.assertThrowsExpression().The default implementation does nothing.
- Specified by:
enterAssertThrowsExpressionin interfaceEK9Listener- Overrides:
enterAssertThrowsExpressionin classEK9BaseListener- Parameters:
ctx- the parse tree
-
enterAssertDoesNotThrowExpression
Description copied from class:EK9BaseListenerEnter a parse tree produced byEK9Parser.assertDoesNotThrowExpression().The default implementation does nothing.
- Specified by:
enterAssertDoesNotThrowExpressionin interfaceEK9Listener- Overrides:
enterAssertDoesNotThrowExpressionin classEK9BaseListener- Parameters:
ctx- the parse tree
-