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

Public Member Functions

def __init__ (self, parent)
 
- Public Member Functions inherited from psyclone.f2pygen.BaseGen
def __init__ (self, parent, root)
 
def parent (self)
 
def children (self)
 
def root (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

 Generate a Fortran 'implicit none' statement 

Definition at line 681 of file f2pygen.py.

Constructor & Destructor Documentation

◆ __init__()

def psyclone.f2pygen.ImplicitNoneGen.__init__ (   self,
  parent 
)
:param parent: node in AST to which to add 'implicit none' as a child
:type parent: :py:class:`psyclone.f2pygen.ModuleGen` or
              :py:class:`psyclone.f2pygen.SubroutineGen`

:raises Exception: if `parent` is not a ModuleGen or SubroutineGen

Definition at line 683 of file f2pygen.py.

683  def __init__(self, parent):
684  '''
685  :param parent: node in AST to which to add 'implicit none' as a child
686  :type parent: :py:class:`psyclone.f2pygen.ModuleGen` or
687  :py:class:`psyclone.f2pygen.SubroutineGen`
688 
689  :raises Exception: if `parent` is not a ModuleGen or SubroutineGen
690  '''
691  if not isinstance(parent, ModuleGen) and not isinstance(parent,
692  SubroutineGen):
693  raise Exception(
694  f"The parent of ImplicitNoneGen must be a module or a "
695  f"subroutine, but found {type(parent)}")
696  reader = FortranStringReader("IMPLICIT NONE\n")
697  reader.set_format(FortranFormat(True, True)) # free form, strict
698  subline = reader.next()
699 
700  from fparser.one.typedecl_statements import Implicit
701  my_imp_none = Implicit(parent.root, subline)
702 
703  BaseGen.__init__(self, parent, my_imp_none)
704 
705 

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