Reference Guide  2.5.0
psyclone.f2pygen.BaseDeclGen Class Reference
Inheritance diagram for psyclone.f2pygen.BaseDeclGen:
Collaboration diagram for psyclone.f2pygen.BaseDeclGen:

Public Member Functions

def __init__ (self, parent, datatype="", entity_decls=None, intent="", pointer=False, dimension="", allocatable=False, save=False, target=False, initial_values=None, private=False)
 
def names (self)
 
def root (self)
 
- Public Member Functions inherited from psyclone.f2pygen.BaseGen
def __init__ (self, parent, root)
 
def parent (self)
 
def children (self)
 
def add (self, new_object, position=None)
 
def previous_loop (self)
 
def last_declaration (self)
 
def start_parent_loop (self, debug=False)
 

Detailed Description

Abstract base class for all types of Fortran declaration. Uses the
abc module so it cannot be instantiated.

:param parent: node to which to add this declaration as a child.
:type parent: :py:class:`psyclone.f2pygen.BaseGen`
:param str datatype: the (intrinsic) type for this declaration.
:param list entity_decls: list of variable names to declare.
:param str intent: the INTENT attribute of this declaration.
:param bool pointer: whether or not this is a pointer declaration.
:param str dimension: the DIMENSION specifier (i.e. the xx in \
                      DIMENSION(xx)).
:param bool allocatable: whether this declaration is for an \
                         ALLOCATABLE quantity.
:param bool save: whether this declaration has the SAVE attribute.
:param bool target: whether this declaration has the TARGET attribute.
:param initial_values: initial value to give each variable.
:type initial_values: list of str with same no. of elements as entity_decls
:param bool private: whether this declaration has the PRIVATE attribute \
                     (default is False).

:raises RuntimeError: if no variable names are specified.
:raises RuntimeError: if the wrong number or type of initial values are \
                      supplied.
:raises RuntimeError: if initial values are supplied for a quantity that \
                      is allocatable or has INTENT(in).
:raises NotImplementedError: if initial values are supplied for array \
                             variables (dimension != "").

Definition at line 889 of file f2pygen.py.

Member Function Documentation

◆ names()

def psyclone.f2pygen.BaseDeclGen.names (   self)
:returns: the names of the variables being declared.
:rtype: list of str.

Definition at line 991 of file f2pygen.py.

991  def names(self):
992  '''
993  :returns: the names of the variables being declared.
994  :rtype: list of str.
995  '''
996  return self._names
997 

References psyclone.f2pygen.BaseDeclGen._names.

Here is the caller graph for this function:

◆ root()

def psyclone.f2pygen.BaseDeclGen.root (   self)
:returns: the associated Type object.
:rtype: \
:py:class:`fparser.one.typedecl_statements.TypeDeclarationStatement`.

Reimplemented from psyclone.f2pygen.BaseGen.

Definition at line 999 of file f2pygen.py.

999  def root(self):
1000  '''
1001  :returns: the associated Type object.
1002  :rtype: \
1003  :py:class:`fparser.one.typedecl_statements.TypeDeclarationStatement`.
1004  '''
1005  return self._decl
1006 

References psyclone.f2pygen.AllocateGen._decl, psyclone.f2pygen.DeallocateGen._decl, psyclone.f2pygen.BaseDeclGen._decl, psyclone.f2pygen.DeclGen._decl, psyclone.f2pygen.CharDeclGen._decl, and psyclone.f2pygen.TypeDeclGen._decl.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: