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

Public Member Functions

def __init__ (self, parent, lhs="", rhs="", pointer=False)
 
- 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

 Generates a Fortran statement where a value is assigned to a
    variable quantity 

Definition at line 1441 of file f2pygen.py.

Constructor & Destructor Documentation

◆ __init__()

def psyclone.f2pygen.AssignGen.__init__ (   self,
  parent,
  lhs = "",
  rhs = "",
  pointer = False 
)
:param parent: the node to which to add this assignment as a child
:type parent: :py:class:`psyclone.f2pygen.BaseGen`
:param str lhs: the LHS of the assignment expression
:param str rhs: the RHS of the assignment expression
:param bool pointer: whether or not this is a pointer assignment

Definition at line 1445 of file f2pygen.py.

1445  def __init__(self, parent, lhs="", rhs="", pointer=False):
1446  '''
1447  :param parent: the node to which to add this assignment as a child
1448  :type parent: :py:class:`psyclone.f2pygen.BaseGen`
1449  :param str lhs: the LHS of the assignment expression
1450  :param str rhs: the RHS of the assignment expression
1451  :param bool pointer: whether or not this is a pointer assignment
1452  '''
1453  if pointer:
1454  reader = FortranStringReader("lhs=>rhs")
1455  else:
1456  reader = FortranStringReader("lhs=rhs")
1457  reader.set_format(FortranFormat(True, True)) # free form, strict
1458  myline = reader.next()
1459  if pointer:
1460  self._assign = fparser1.statements.PointerAssignment(parent.root,
1461  myline)
1462  else:
1463  self._assign = fparser1.statements.Assignment(parent.root, myline)
1464  self._assign.expr = rhs
1465  self._assign.variable = lhs
1466  BaseGen.__init__(self, parent, self._assign)

References psyclone.f2pygen.AssignGen._assign.


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