psyclone.psyir.symbols.data_type_symbol#
This module contains the DataTypeSymbol.
Classes#
DataTypeSymbol: Symbol identifying a user-defined type (e.g. a derived type in Fortran).
- class psyclone.psyir.symbols.data_type_symbol.DataTypeSymbol(name, datatype, visibility=Visibility.PUBLIC, interface=None)[source]#
Symbol identifying a user-defined type (e.g. a derived type in Fortran).
- Parameters:
name (str) – the name of this symbol.
datatype (
psyclone.psyir.symbols.DataType) – the type represented by this symbol.visibility (
psyclone.psyir.symbols.Symbol.Visibility) – the visibility of this symbol.interface (
psyclone.psyir.symbols.SymbolInterface) – the interface to this symbol.
Inheritance

- copy()[source]#
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:
psyclone.psyir.symbols.TypeSymbol
- copy_properties(symbol_in, exclude_interface=False)[source]#
Replace all properties in this object with the properties from symbol_in, apart from the name (which is immutable) and visibility. If exclude_interface is True, the interface is also not updated.
- Parameters:
symbol_in (
DataTypeSymbol) – the symbol from which the properties are copied.exclude_interface (
bool) – whether or not to exclude the interface when copying properties.
- Raises:
TypeError – if the argument is not the expected type.
- property datatype#
- Returns:
datatype that this DataTypeSymbol represents.
- Return type:
- get_all_accessed_symbols()[source]#
- Return type:
set[Symbol]- Returns:
a set of all the symbols accessed inside this Symbol.
- replace_symbols_using(table_or_symbol)[source]#
Replace any Symbols referred to by this object with those in the supplied SymbolTable (or just the supplied Symbol instance) if they have matching names. If there is no match for a given Symbol then it is left unchanged.
- Parameters:
table_or_symbol (
psyclone.psyir.symbols.SymbolTable|psyclone.psyir.symbols.Symbol) – the symbol table from which to get replacement symbols or a single, replacement Symbol.