fparser Reference Guide  0.0.14
fparser.one.block_statements.Do Class Reference
Inheritance diagram for fparser.one.block_statements.Do:
Collaboration diagram for fparser.one.block_statements.Do:

Public Member Functions

def tostr (self)
 
def process_item (self)
 
def process_subitem (self, item)
 
def get_classes (self)
 

Public Attributes

 endlabel
 
 construct_name
 
 loopcontrol
 

Static Public Attributes

 match
 
 pattern
 
 item_re
 
 end_stmt_cls
 
 name
 

Detailed Description

[<do-construct-name> :] DO label [loopcontrol]
[<do-construct-name> :] DO [loopcontrol]

Definition at line 1319 of file block_statements.py.

Member Function Documentation

◆ process_item()

def fparser.one.block_statements.Do.process_item (   self)
Parses the next line assuming it is a "Do" statement.

Overrides method in `BeginStatement`.

Definition at line 1339 of file block_statements.py.

References fparser.common.base_classes.BeginStatement.construct_name, fparser.one.block_statements.Select.construct_name, fparser.one.block_statements.Where.construct_name, fparser.one.block_statements.IfThen.construct_name, fparser.one.block_statements.Do.construct_name, fparser.one.block_statements.Do.endlabel, fparser.two.Fortran2003.Comment.item, fparser.common.base_classes.Statement.item, fparser.one.block_statements.Do.item_re, fparser.one.block_statements.Do.loopcontrol, fparser.common.base_classes.Variable.parent, fparser.two.utils.Base.parent, fparser.two.symbol_table.SymbolTable.parent, fparser.common.base_classes.Statement.parent, fparser.one.parsefortran.FortranParser.put_item(), fparser.common.readfortran.FortranReaderBase.put_item(), and fparser.common.base_classes.BeginStatement.put_item.

1339  def process_item(self):
1340  """
1341  Parses the next line assuming it is a "Do" statement.
1342 
1343  Overrides method in `BeginStatement`.
1344  """
1345  item = self.item
1346  line = item.get_line()
1347  matched = self.item_re(line)
1348  if matched.group("label"):
1349  self.endlabel = int(matched.group("label").strip())
1350  else:
1351  self.endlabel = None
1352  self.construct_name = item.name
1353  if matched.group("loopcontrol"):
1354  self.loopcontrol = item.apply_map(matched.group("loopcontrol").strip())
1355  else:
1356  self.loopcontrol = None
1357  return BeginStatement.process_item(self)
1358 
Here is the call graph for this function:

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