4.4.2. Module-Based Logical Model

After parsing the source files from any language, Sonargraph creates a module-based logical model based on the parser model which correspond to following diagram:

Module-based Logical Model
Figure 4.9. Module-based Logical Model

The module-based logical model is constructed in a way that the mapping from physical elements to logical elements occurs inside each module and in the external scope separatedly meaning that the following conditions will be met:

  • Given a physical element "abc" inside a module X of the user code and a physical element "abc" inside the module Y also in the user code, there will be a ModuleBasedLogicalNamespaceRoot X containing a Logical Programming Element "abc" and another ModuleBasedLogicalNamespaceRoot containing also a Logical Programming Element "abc".

  • Given a physical element "abc" inside a module X of the user code and a physical element "abc" inside the external scope, there will be a ModuleBasedLogicalNamespaceRoot X containing a logical element "abc" and another logical element "abc" belonging to the ExternalLogicalNamespaceRoot in the module-based logical model.