PyForTool
Python-fortran-tool
Loading...
Searching...
No Matches
Classes | Functions
pyfortool.tree Namespace Reference

Classes

class  Tree
 

Functions

 updateTree (method='file')
 

Detailed Description

Code dependency tree analysis and visualization.

Provides the Tree class for building and navigating compilation and execution
dependency graphs across multiple FORTRAN source files.

Key Features
------------
- Compilation dependency tracking (USE statements)
- Execution dependency tracking (CALL statements)
- Source directory scanning
- Tree serialization to/from JSON
- Dependency graph visualization (DOT format)
- Scope reachability analysis

Classes
-------
Tree : Manages cross-file dependency analysis

Examples
--------
>>> tree = Tree(['/path/to/src'], descTreeFile='tree.json')
>>> deps = tree.needsFile('file.F90')
>>> tree.plotExecTreeFromScope('module:MOD/sub:SUB', 'deps.png', 2, 2)
>>> tree.toJson('tree.json')  # Save for later use

Function Documentation

◆ updateTree()

pyfortool.tree.updateTree (   method = 'file')
Decorator factory to update the tree after PYFTscope method execution.

Parameters
----------
method : str, optional
    Update method:
    - 'file' (default): Analyze current file.
    - 'scan': Analyze new files, remove info for deleted files.
    - 'signal': Analyze files signaled via tree.signal().

Definition at line 41 of file tree.py.