psyclone.psyir.symbols.containersymbol
This module contains the ContainerSymbol and its interfaces.
Classes
ContainerSymbol
: Symbol that represents a reference to a Container. The referenceContainerSymbolInterface
: Abstract implementation of the ContainerSymbol InterfaceFortranModuleInterface
: Implementation of ContainerSymbolInterface for Fortran modules
- class psyclone.psyir.symbols.containersymbol.ContainerSymbol(name, wildcard_import=False, **kwargs)
Symbol that represents a reference to a Container. The reference is lazy evaluated, this means that the Symbol will be created without parsing and importing the referenced container, but this can be imported when needed.
- Parameters:
name (str) – name of the symbol.
wildcard_import (bool) – if all public Symbols of the Container are imported into the current scope. Defaults to False.
kwargs (unwrapped dict.) – additional keyword arguments provided by
psyclone.psyir.symbols.Symbol
.
Inheritance
- property container
Returns the referenced container. If it is not available, use the interface to import the container
- Returns:
referenced container.
- Return type:
- copy()
Create and return a copy of this object. Any references to the original will not be affected so the copy will not be referred to by any other object.
- Returns:
A symbol object with the same properties as this symbol object.
- Return type:
- property wildcard_import
- Returns:
whether or not there is a wildcard import of all public symbols from this Container.
- Return type:
bool
- class psyclone.psyir.symbols.containersymbol.ContainerSymbolInterface
Abstract implementation of the ContainerSymbol Interface
Inheritance
- static import_container(name)
Abstract method to import an external container, the specific implementation depends on the language used.
- Parameters:
name (str) – name of the external entity to be imported.
- Raises:
NotImplementedError – this is an abstract method.
- class psyclone.psyir.symbols.containersymbol.FortranModuleInterface
Implementation of ContainerSymbolInterface for Fortran modules
Inheritance
- static import_container(name)
Imports a Fortran module as a PSyIR container. The module is expected to be found in a Fortran source file with the same name as the module plus the ‘.[f|F]90’ extension. The search locations are provided in-order by the Config include_paths attribute (‘-I’ in the psyclone script).
- Parameters:
name (str) – name of the module to be imported.
- Returns:
container associated with the given name.
- Return type:
- Raises:
SymbolError – the given Fortran module is not found on the import path.