graph LR
Code_Generation_Entry_Point["Code Generation Entry Point"]
Model_and_Language_Loader["Model and Language Loader"]
Code_Generation_Orchestrator["Code Generation Orchestrator"]
Class_Dependency_Orderer["Class Dependency Orderer"]
Class_Declaration_Generator["Class Declaration Generator"]
Attribute_Generator["Attribute Generator"]
Relationship_Generator["Relationship Generator"]
Code_Generation_Entry_Point -- "calls" --> Model_and_Language_Loader
Code_Generation_Entry_Point -- "calls" --> Code_Generation_Orchestrator
Code_Generation_Orchestrator -- "calls" --> Class_Dependency_Orderer
Code_Generation_Orchestrator -- "calls" --> Class_Declaration_Generator
Code_Generation_Orchestrator -- "calls" --> Attribute_Generator
Code_Generation_Orchestrator -- "calls" --> Relationship_Generator
The Code Generation subsystem is responsible for translating the abstract Gaphor model into executable code or other textual representations. Its primary boundary is defined by the gaphor.codegen.coder module, specifically the coder.py file.
The external entry point for initiating the code generation process. It sets up the environment by loading the model and language configurations before triggering the core generation logic.
Related Classes/Methods:
Responsible for loading the Gaphor model data and configuring the code generation process based on the specific target modeling language's requirements and interpretations.
Related Classes/Methods:
The core orchestrator that drives the generation of code for various model elements. It acts as the central control flow, delegating tasks to specialized generator components.
Related Classes/Methods:
Ensures that classes are processed in a dependency-aware order, which is crucial for correct code generation, by analyzing inheritance and other structural relationships.
Related Classes/Methods:
Generates the foundational code for a class declaration, including its name and inherited base classes, forming the basic structure of each class in the output.
Related Classes/Methods:
Handles the generation of code for attributes (variables) within a class, differentiating between primitive and complex types to ensure correct representation.
Related Classes/Methods:
Manages the generation of code representing relationships (associations and subsetting) between classes, handling references or collections as appropriate for the target language.
Related Classes/Methods: