fparser.two.Fortran2008.block_construct_r807

Module containing Fortran2008 Block_Construct rule R807

Module Contents

Classes

Block_Construct

Fortran 2008 Rule 807.

class fparser.two.Fortran2008.block_construct_r807.Block_Construct(string, parent_cls=None)[source]

Bases: fparser.two.utils.BlockBase

Fortran 2008 Rule 807.

block-construct is block-stmt

[ specification-part ] block end-block-stmt

TODO #394: Should disallow COMMON, EQUIVALENCE, IMPLICIT, INTENT, NAMELIST, OPTIONAL, VALUE, and statement functions (C806) (which are all valid members of Specification_Part).

subclass_names = [][source]
use_names = ['Block_Stmt', 'Specification_Part', 'Execution_Part_Construct', 'End_Block_Stmt'][source]
static match(reader)[source]

Checks whether the content in reader matches the given type of block statement (e.g. DO..END DO, IF…END IF etc.)

Parameters:
  • startcls (type) – the class marking the beginning of the block

  • subclasses (list) – list of classes that can be children of the block.

  • endcls (type) – the class marking the end of the block.

  • reader (str or instance of FortranReaderBase) – content to check for match.

  • match_labels (bool) – whether or not the statement terminating the block must have a label that matches the opening statement. Default is False.

  • match_names (bool) – TBD

  • match_name_classes (tuple) – TBD

  • enable_do_label_construct_hook (bool) – TBD

  • enable_if_construct_hook (bool) – TBD

  • enable_where_construct_hook (bool) – TBD

  • strict_order (bool) – whether to enforce the order of the given subclasses.

  • strict_match_names (bool) – if start name present, end name must exist and match.

Returns:

instance of startcls or None if no match is found

Return type:

startcls