fparser Reference Guide  0.0.14
fparser.common.base_classes.EndStatement Class Reference
Inheritance diagram for fparser.common.base_classes.EndStatement:
Collaboration diagram for fparser.common.base_classes.EndStatement:

Public Member Functions

def __init__ (self, parent, item)
 
def process_item (self)
 
def analyze (self)
 
def get_indent_tab (self, deindent=False, isfix=None)
 
def tofortran (self, isfix=None)
 
- Public Member Functions inherited from fparser.common.base_classes.Statement
def __init__ (self, parent, item)
 
def __repr__ (self)
 
def torepr (self, depth=-1, incrtab="")
 
def get_indent_tab (self, deindent=False, isfix=None)
 
def __str__ (self)
 
def asfix (self)
 
def format_message (self, kind, message)
 
def error (self, message)
 
def warning (self, message)
 
def info (self, message)
 
def analyze (self)
 
def get_variable (self, name)
 
def get_type (self, name)
 
def get_type_decl (self, kind)
 
def get_provides (self)
 
- Public Member Functions inherited from fparser.common.utils.classes
def __new__ (metacls, name, bases, dict)
 
- Public Member Functions inherited from fparser.common.utils.meta_classes
def __getattr__ (self, name)
 

Public Attributes

 blocktype
 
 isvalid
 
 name
 
- Public Attributes inherited from fparser.common.base_classes.Statement
 parent
 
 reader
 
 top
 
 item
 
 programblock
 
 isvalid
 
 ignore
 
 a
 

Additional Inherited Members

- Static Public Attributes inherited from fparser.common.base_classes.Statement
list modes = ["free", "fix", "f77", "pyf"]
 

Detailed Description

END [<blocktype> [<name>]]

EndStatement instances have additional attributes:
  name
  blocktype

Definition at line 977 of file base_classes.py.

Member Function Documentation

◆ tofortran()

def fparser.common.base_classes.EndStatement.tofortran (   self,
  isfix = None 
)
Returns a valid Fortran string for this END statement. It
guarantees that there is no white space after the 'END' in case
of an unnamed statement.

:param bool isfix: True if the code is in fixed format.

:returns: the (named or unnamed) valid Fortran END statement \
  as a string.
:rtype: str

Definition at line 1030 of file base_classes.py.

References fparser.common.base_classes.BeginStatement.blocktype, fparser.common.base_classes.EndStatement.blocktype, fparser.common.base_classes.Statement.get_indent_tab(), fparser.common.base_classes.Variable.name, fparser.common.base_classes.BeginStatement.name, and fparser.common.base_classes.EndStatement.name.

1030  def tofortran(self, isfix=None):
1031  """Returns a valid Fortran string for this END statement. It
1032  guarantees that there is no white space after the 'END' in case
1033  of an unnamed statement.
1034 
1035  :param bool isfix: True if the code is in fixed format.
1036 
1037  :returns: the (named or unnamed) valid Fortran END statement \
1038  as a string.
1039  :rtype: str
1040 
1041  """
1042  if self.name:
1043  return self.get_indent_tab(isfix=isfix) + "END {0} {1}".format(
1044  self.blocktype.upper(), self.name
1045  )
1046 
1047  # Make sure there is no space after an unnamed END:
1048  return self.get_indent_tab(isfix=isfix) + "END {0}".format(
1049  self.blocktype.upper()
1050  )
1051 
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/fparser-ref/checkouts/342_reference_guide/src/fparser/common/base_classes.py