graph LR
Function_Definition_Analyzer["Function Definition Analyzer"]
Generic_AST_Traversal["Generic AST Traversal"]
Concurrency_Detector["Concurrency Detector"]
Synchronization_Point_Identifier["Synchronization Point Identifier"]
Call_Expression_Analyzer["Call Expression Analyzer"]
Expression_Statement_Analyzer["Expression Statement Analyzer"]
Assignment_Statement_Analyzer["Assignment Statement Analyzer"]
Function_Definition_Analyzer -- "initiates AST traversal for" --> Generic_AST_Traversal
Function_Definition_Analyzer -- "queries for implicit synchronization points from" --> Synchronization_Point_Identifier
Generic_AST_Traversal -- "recursively identifies wait points with" --> Synchronization_Point_Identifier
Generic_AST_Traversal -- "dispatches node-specific analysis to" --> Call_Expression_Analyzer
Generic_AST_Traversal -- "dispatches node-specific analysis to" --> Expression_Statement_Analyzer
Generic_AST_Traversal -- "dispatches node-specific analysis to" --> Assignment_Statement_Analyzer
Concurrency_Detector -- "provides concurrency checks for" --> Call_Expression_Analyzer
Concurrency_Detector -- "identifies concurrent calls within" --> Expression_Statement_Analyzer
Synchronization_Point_Identifier -- "provides synchronization information to" --> Function_Definition_Analyzer
Synchronization_Point_Identifier -- "contributes to identification of wait points during" --> Generic_AST_Traversal
Call_Expression_Analyzer -- "delegates traversal for nested expressions to" --> Generic_AST_Traversal
Call_Expression_Analyzer -- "determines if a call is concurrent using" --> Concurrency_Detector
Expression_Statement_Analyzer -- "checks for concurrent calls using" --> Concurrency_Detector
Expression_Statement_Analyzer -- "continues AST traversal via" --> Generic_AST_Traversal
Assignment_Statement_Analyzer -- "traverses the right-hand side of assignments using" --> Generic_AST_Traversal
The AST Instrumentation & Analysis subsystem is responsible for statically analyzing the Abstract Syntax Tree (AST) of decorated functions within the deco library. Its primary boundary is defined by its focus on identifying concurrent calls, implicit synchronization points, and data dependencies directly from the source code's structure. This subsystem's core functionality is encapsulated within the deco.astutil module.
Serves as the entry point for initiating the static analysis of a decorated function's Abstract Syntax Tree (AST). It orchestrates the initial traversal and high-level identification of concurrency-related elements.
Related Classes/Methods:
Provides the foundational mechanism for recursively traversing the AST nodes. It dispatches control to specific visit_ methods for detailed, node-type-specific analysis, ensuring comprehensive coverage of the function's structure.
Related Classes/Methods:
Determines whether a specific function call expression within the AST represents a concurrent operation. This component guides the parallelization decisions by flagging calls that can or should be executed in parallel.
Related Classes/Methods:
Identifies and extracts information about implicit synchronization points (e.g., await or wait constructs, or inferred synchronization needs) within the AST. This is critical for managing the flow of concurrent execution and ensuring data consistency.
Related Classes/Methods:
Specifically handles the analysis of ast.Call nodes. It leverages the Concurrency Detector to identify concurrent calls and delegates further traversal of nested expressions to the Generic AST Traversal.
Related Classes/Methods:
Processes ast.Expr nodes, which often encapsulate function calls. It uses the Concurrency Detector to check for concurrent calls within these expressions and continues AST traversal via Generic AST Traversal.
Related Classes/Methods:
Analyzes ast.Assign nodes to understand data flow and dependencies. This is crucial for identifying potential race conditions or data hazards in a concurrent environment, using Generic AST Traversal for the right-hand side of assignments.
Related Classes/Methods: