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

Public Member Functions

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

 Create a Fortran Comment 

Definition at line 619 of file f2pygen.py.

Constructor & Destructor Documentation

◆ __init__()

def psyclone.f2pygen.CommentGen.__init__ (   self,
  parent,
  content 
)
:param parent: node in AST to which to add the Comment as a child
:type parent: :py:class:`psyclone.f2pygen.BaseGen`
:param str content: the content of the comment

Reimplemented from psyclone.f2pygen.BaseGen.

Definition at line 621 of file f2pygen.py.

621  def __init__(self, parent, content):
622  '''
623  :param parent: node in AST to which to add the Comment as a child
624  :type parent: :py:class:`psyclone.f2pygen.BaseGen`
625  :param str content: the content of the comment
626  '''
627  reader = FortranStringReader("! content\n", ignore_comments=False)
628  reader.set_format(FortranFormat(True, True)) # free form, strict
629  subline = reader.next()
630 
631  my_comment = Comment(parent.root, subline)
632  my_comment.content = content
633 
634  BaseGen.__init__(self, parent, my_comment)
635 
636 

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