fparser.two.Fortran2008 ======================= .. py:module:: fparser.two.Fortran2008 .. autoapi-nested-parse:: Fortran 2008 module. Contains classes which extend the Fortran 2003 standard to implement the Fortran 2008 standard. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/fparser/two/Fortran2008/action_stmt_c201/index /autoapi/fparser/two/Fortran2008/action_stmt_c816/index /autoapi/fparser/two/Fortran2008/action_stmt_c828/index /autoapi/fparser/two/Fortran2008/action_stmt_r214/index /autoapi/fparser/two/Fortran2008/action_term_do_construct_r824/index /autoapi/fparser/two/Fortran2008/alloc_opt_r627/index /autoapi/fparser/two/Fortran2008/allocate_stmt_r626/index /autoapi/fparser/two/Fortran2008/attr_spec_r502/index /autoapi/fparser/two/Fortran2008/block_construct_r807/index /autoapi/fparser/two/Fortran2008/block_label_do_construct_r814_1/index /autoapi/fparser/two/Fortran2008/block_nonlabel_do_construct_r814_2/index /autoapi/fparser/two/Fortran2008/block_stmt_r808/index /autoapi/fparser/two/Fortran2008/coarray_bracket_spec_r502d0/index /autoapi/fparser/two/Fortran2008/coarray_spec_r509/index /autoapi/fparser/two/Fortran2008/codimension_attr_spec_r502d/index /autoapi/fparser/two/Fortran2008/component_attr_spec_r437/index /autoapi/fparser/two/Fortran2008/connect_spec_r905/index /autoapi/fparser/two/Fortran2008/coshape_spec_r511a/index /autoapi/fparser/two/Fortran2008/critical_construct_r810/index /autoapi/fparser/two/Fortran2008/critical_stmt_r811/index /autoapi/fparser/two/Fortran2008/data_component_def_stmt_r436/index /autoapi/fparser/two/Fortran2008/declaration_construct_c1112/index /autoapi/fparser/two/Fortran2008/deferred_coshape_spec_r510/index /autoapi/fparser/two/Fortran2008/do_term_action_stmt_r826/index /autoapi/fparser/two/Fortran2008/end_block_stmt_r809/index /autoapi/fparser/two/Fortran2008/end_critical_stmt_r812/index /autoapi/fparser/two/Fortran2008/end_submodule_stmt_r1119/index /autoapi/fparser/two/Fortran2008/error_stop_stmt_r856/index /autoapi/fparser/two/Fortran2008/executable_construct_c201/index /autoapi/fparser/two/Fortran2008/executable_construct_r213/index /autoapi/fparser/two/Fortran2008/explicit_coshape_spec_r511/index /autoapi/fparser/two/Fortran2008/format_item_r1003/index /autoapi/fparser/two/Fortran2008/if_stmt_r837/index /autoapi/fparser/two/Fortran2008/implicit_part_c1112/index /autoapi/fparser/two/Fortran2008/implicit_part_stmt_c1112/index /autoapi/fparser/two/Fortran2008/label_do_stmt_r816/index /autoapi/fparser/two/Fortran2008/loop_control_r818/index /autoapi/fparser/two/Fortran2008/lower_cobound_r512/index /autoapi/fparser/two/Fortran2008/nonlabel_do_stmt_r817/index /autoapi/fparser/two/Fortran2008/open_stmt_r904/index /autoapi/fparser/two/Fortran2008/parent_identifier_r1118/index /autoapi/fparser/two/Fortran2008/procedure_stmt_r1206/index /autoapi/fparser/two/Fortran2008/program_unit_r202/index /autoapi/fparser/two/Fortran2008/specification_part_c1112/index /autoapi/fparser/two/Fortran2008/stop_code_r857/index /autoapi/fparser/two/Fortran2008/submodule_r1116/index /autoapi/fparser/two/Fortran2008/submodule_stmt_r1117/index /autoapi/fparser/two/Fortran2008/type_declaration_stmt_r501/index /autoapi/fparser/two/Fortran2008/upper_cobound_r513/index Attributes ---------- .. autoapisummary:: fparser.two.Fortran2008.ClassType fparser.two.Fortran2008._names fparser.two.Fortran2008.NEW_CLS fparser.two.Fortran2008.NEW_CLS fparser.two.Fortran2008.classes fparser.two.Fortran2008.__all__ Classes ------- .. autoapisummary:: fparser.two.Fortran2008.Base fparser.two.Fortran2008.SequenceBase fparser.two.Fortran2008.Program_Unit fparser.two.Fortran2008.Executable_Construct fparser.two.Fortran2008.Executable_Construct_C201 fparser.two.Fortran2008.Action_Stmt fparser.two.Fortran2008.Action_Stmt_C201 fparser.two.Fortran2008.Action_Stmt_C816 fparser.two.Fortran2008.Action_Stmt_C828 fparser.two.Fortran2008.Data_Component_Def_Stmt fparser.two.Fortran2008.Component_Attr_Spec fparser.two.Fortran2008.Type_Declaration_Stmt fparser.two.Fortran2008.Codimension_Attr_Spec fparser.two.Fortran2008.Coarray_Bracket_Spec fparser.two.Fortran2008.Attr_Spec fparser.two.Fortran2008.Coarray_Spec fparser.two.Fortran2008.Deferred_Coshape_Spec fparser.two.Fortran2008.Explicit_Coshape_Spec fparser.two.Fortran2008.Coshape_Spec fparser.two.Fortran2008.Lower_Cobound fparser.two.Fortran2008.Upper_Cobound fparser.two.Fortran2008.Do_Term_Action_Stmt fparser.two.Fortran2008.Alloc_Opt fparser.two.Fortran2008.Allocate_Stmt fparser.two.Fortran2008.Loop_Control fparser.two.Fortran2008.If_Stmt fparser.two.Fortran2008.Error_Stop_Stmt fparser.two.Fortran2008.Format_Item fparser.two.Fortran2008.Stop_Code fparser.two.Fortran2008.Specification_Part_C1112 fparser.two.Fortran2008.Implicit_Part_C1112 fparser.two.Fortran2008.Implicit_Part_Stmt_C1112 fparser.two.Fortran2008.Declaration_Construct_C1112 fparser.two.Fortran2008.Submodule fparser.two.Fortran2008.Submodule_Stmt fparser.two.Fortran2008.End_Submodule_Stmt fparser.two.Fortran2008.Parent_Identifier fparser.two.Fortran2008.Open_Stmt fparser.two.Fortran2008.Connect_Spec fparser.two.Fortran2008.Block_Construct fparser.two.Fortran2008.Block_Stmt fparser.two.Fortran2008.End_Block_Stmt fparser.two.Fortran2008.Critical_Construct fparser.two.Fortran2008.Critical_Stmt fparser.two.Fortran2008.End_Critical_Stmt fparser.two.Fortran2008.Procedure_Stmt fparser.two.Fortran2008.Action_Term_Do_Construct fparser.two.Fortran2008.Block_Label_Do_Construct fparser.two.Fortran2008.Label_Do_Stmt Package Contents ---------------- .. py:class:: Base(string, parent_cls=None) Bases: :py:obj:`ComparableMixin` Base class for Fortran 2003 syntax rules. All Base classes have the following attributes:: self.string - original argument to construct a class instance, its type is either str or FortranReaderBase. self.item - Line instance (holds label) or None. :param type cls: the class of object to create. :param string: (source of) Fortran string to parse. :type string: str | :py:class:`fparser.common.readfortran.FortranReaderBase` :param parent_cls: the parent class of this object. :type parent_cls: `type` .. py:attribute:: subclasses .. py:attribute:: parent :value: None .. py:method:: __getnewargs__() Method to dictate the values passed to the __new__() method upon unpickling. The method must return a pair (args, kwargs) where args is a tuple of positional arguments and kwargs a dictionary of named arguments for constructing the object. Those will be passed to the __new__() method upon unpickling. :return: set of arguments for __new__ :rtype: tuple[str, NoneType, bool] .. py:method:: get_root() Gets the node at the root of the parse tree to which this node belongs. :returns: the node at the root of the parse tree. :rtype: :py:class:`fparser.two.utils.Base` .. py:property:: children Return an iterable containing the immediate children of this node in the parse tree. If this node represents an expression then its children are contained in a tuple which is immutable. Therefore, the manipulation of the children of such a node must be done by replacing the `items` property of the node directly rather than via the objects returned by this method. :returns: the immediate children of this node. :rtype: list or tuple containing zero or more of :py:class:`fparser.two.utils.Base` or NoneType or str .. py:method:: init(*items) Store the supplied list of nodes in the `items` list of this node. :param items: the children of this node. :type items: tuple of :py:class:`fparser.two.utils.Base` .. py:method:: torepr() .. py:method:: __str__() .. py:method:: __repr__() .. py:method:: _cmpkey() Provides a key of objects to be used for comparing. .. py:method:: tofortran(tab='', isfix=None) Produce the Fortran representation of this Comment. :param str tab: characters to pre-pend to output. :param bool isfix: whether or not this is fixed-format code. :returns: Fortran representation of this comment. :rtype: str .. py:method:: restore_reader(reader) .. py:class:: SequenceBase(string, parent_cls=None) Bases: :py:obj:`Base` Match one or more fparser2 rules separated by a defined separator:: sequence-base is obj [sep obj ] ... .. py:method:: match(separator, subcls, string) :staticmethod: Match one or more 'subcls' fparser2 rules in the string 'string' separated by 'separator'. :param str separator: the separator used to split the supplied string. :param subcls: an fparser2 object representing the rule that should be matched. :type subcls: subclass of :py:class:`fparser.two.utils.Base` :param str string: the input string to match. :returns: a tuple containing 1) the separator and 2) the matched objects in a tuple, or None if there is no match. :rtype: Optional[(Str, :py:class:`fparser.two.utils.Base`)] :raises InternalError: if the separator or string arguments are not the expected type. :raises InternalError: if the separator is white space. .. py:method:: init(separator, items) Store the result of the match method if the match is successful. :param str separator: the separator used to split the supplied string. :param items: a tuple containing the matched objects. :type items: tuple(Subclass of :py:class:`fparser.two.utils.Base`) .. py:method:: tostr() :returns: The Fortran representation of this object as a string. :rtype: str .. py:method:: torepr() :returns: The Python representation of this object as a string. :rtype: str .. py:class:: Program_Unit(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Program_Unit` Fortran 2008 rule R202. .. code-block:: fortran program-unit is main-program or external-subprogram or module or submodule or block-data .. py:attribute:: subclass_names :value: ['Comment', 'Main_Program', 'External_Subprogram', 'Module', 'Block_Data'] .. py:class:: Executable_Construct(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Executable_Construct` Fortran 2008 rule R213. .. code-block:: fortran executable-construct is action-stmt or associate-construct or block-construct or case-construct or critical-construct or do-construct or forall-construct or if-construct or select-type-construct or where-construct Associated constraints are: "C201 (R208) An execution-part shall not contain an end-function-stmt, end-mp-subprogram-stmt, end-program-stmt, or end-subroutine-stmt." .. py:attribute:: subclass_names :value: ['Action_Stmt', 'Associate_Construct', 'Block_Construct', 'Case_Construct',... .. py:class:: Executable_Construct_C201(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Executable_Construct_C201` executable-construct-c201 is executable construct. This applies C201. .. py:attribute:: subclass_names :value: ['Action_Stmt', 'Associate_Construct', 'Block_Construct', 'Case_Construct',... .. py:class:: Action_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Action_Stmt` Fortran 2008 rule R214. .. code-block:: fortran action-stmt is allocate-stmt or assignment-stmt or backspace-stmt or call-stmt or close-stmt or continue-stmt or cycle-stmt or deallocate-stmt or end-function-stmt or end-mp-subprogram-stmt or end-program-stmt or end-subroutine-stmt or endfile-stmt or error-stop-stmt or exit-stmt or flush-stmt or forall-stmt or goto-stmt or if-stmt or inquire-stmt or lock-stmt or nullify-stmt or open-stmt or pointer-assignment-stmt or print-stmt or read-stmt or return-stmt or rewind-stmt or stop-stmt or sync-all-stmt or sync-images-stmt or sync-memory-stmt or unlock-stmt or wait-stmt or where-stmt or write-stmt or arithmetic-if-stmt or computed-goto-stmt The implementation of this rule adds the relevant subclass names for new statements added in Fortran 2008. Associated constraints are: "C201 (R208) An execution-part shall not contain an end-function-stmt, end-mp-subprogram-stmt, end-program-stmt, or end-subroutine-stmt." NB: The following statements are not yet implemented: end-mp-subprogram-stmt, endfile-stmt, lock-stmt, sync-all-stmt, sync-images-stmt, sync-memory-stmt, unlock-stmt. .. py:attribute:: subclass_names :value: ['Allocate_Stmt', 'Assignment_Stmt', 'Backspace_Stmt', 'Call_Stmt', 'Close_Stmt', 'Comment',... .. py:class:: Action_Stmt_C201(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Action_Stmt_C201` action-stmt-c201 is action-stmt C201 is applied. .. py:attribute:: subclass_names :value: ['Allocate_Stmt', 'Assignment_Stmt', 'Backspace_Stmt', 'Call_Stmt', 'Close_Stmt', 'Comment',... .. py:class:: Action_Stmt_C816(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Action_Stmt_C824` action-stmt-c816 is action-stmt C816 is applied. .. py:attribute:: subclass_names :value: ['Allocate_Stmt', 'Assignment_Stmt', 'Backspace_Stmt', 'Call_Stmt', 'Close_Stmt', 'Comment',... .. py:class:: Action_Stmt_C828(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Action_Stmt_C802` action-stmt-c828 is action-stmt C828 is applied. .. py:attribute:: subclass_names :value: ['Allocate_Stmt', 'Assignment_Stmt', 'Backspace_Stmt', 'Call_Stmt', 'Close_Stmt', 'Comment',... .. py:class:: Data_Component_Def_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Data_Component_Def_Stmt` Fortran 2008 rule 436. .. code-block:: fortran data-component-def-stmt is declaration-type-spec [ [ , component-attr-spec-list ] :: ] component-decl-list The implementation of this rule does not add anything to the Fortran 2003 variant but reimplements the match method identical to Fortran 2003 as otherwise the generated Fortran 2008 variant of `Component_Attr_Spec_List` would not be used. Unfortunately, the required `attr_spec_list_cls` can not simply be provided as a class property since the relevant class is only generated at the end of this file using the `use_names` class property of this class. Associated constraints are: "C439 (R436) No component-attr-spec shall appear more than once in a given component-def-stmt." "C440 (R436) If neither the POINTER nor the ALLOCATABLE attribute is specified, the declaration-type-spec in the component-def-stmt shall specify an intrinsic type or a previously defined derived type." "C441 (R436) If the POINTER or ALLOCATABLE attribute is specified, each component-array-spec shall be a deferred-shape-spec-list." "C442 (R436) If a coarray-spec appears, it shall be a deferred-coshape-spec-list and the component shall have the ALLOCATABLE attribute." "C443 (R436) If a coarray-spec appears, the component shall not be of type C_PTR or C_FUNPTR." "C445 (R436) If neither the POINTER nor the ALLOCATABLE attribute is specified, each component-array-spec shall be an explicit-shape-spec-list." "C447 (R436) A component shall not have both the ALLOCATABLE and POINTER attributes." "C448 (R436) If the CONTIGUOUS attribute is specified, the component shall be an array with the POINTER attribute." "C457 (R436) If component-initialization appears, a double-colon separator shall appear before the component-decl-list." "C458 (R436) If component-initialization appears, every type parameter and array bound of the component shall be a colon or constant expression. "C459 (R436) If => appears in component-initialization, POINTER shall appear in the component-attr-spec-list. If = appears in component-initialization, neither POINTER nor ALLOCATABLE shall appear in the component-attr-spec-list." C439-C443, C445, C447-C448, C457-C459 are currently not checked - issue #258. .. py:method:: match(string) :staticmethod: Implements the matching of a data component definition statement. :param str string: the reader or string to match as a data component definition statement. :return: a 3-tuple containing declaration type specification, component attribute specification and component declaration list if there is a match or None if there is no match. :rtype: `NoneType` or (:py:class:`fparser.two.Fortran2003.Declaration_Type_Spec`, :py:class:`fparser.two.Fortran2008.Component_Attr_Spec_List`, :py:class:`fparser.two.Fortran2003.Component_Decl_List`) .. py:class:: Component_Attr_Spec(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Component_Attr_Spec` Fortran 2008 rule R437. .. code-block:: fortran component-attr-spec is access-spec or ALLOCATABLE or CODIMENSION lbracket coarray-spec rbracket or CONTIGUOUS or DIMENSION ( component-array-spec ) or POINTER In the spec above, lbracket and rbracket are left and right square brackets `[]` but not printed explicitly to avoid misinterpretation as optional parts. This rule adds CODIMENSION and CONTIGUOUS attributes to Fortran2003's R441. .. py:attribute:: subclass_names :value: ['Access_Spec', 'Dimension_Component_Attr_Spec'] .. py:attribute:: attributes :value: ['POINTER', 'ALLOCATABLE'] .. py:class:: Type_Declaration_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Type_Declaration_Stmt` Fortran 2008 rule 501. .. code-block:: fortran type-declaration-stmt is declaration-type-spec [ [ , attr-spec ] ... :: ] entity-decl-list The implementation of this rule does not add anything to the Fortran 2003 variant but overwrites :py:meth:`get_attr_spec_list_cls` to use the Fortran 2008 variant of :py:class:`Attr_Spec_List`. Associated constraints are: "C501 (R501) The same attr-spec shall not appear more than once in a given type-declaration-stmt." "C502 (R501) If a language-binding-spec with a NAME= specifier appears, the entity-decl-list shall consist of a single entity-decl." "C503 (R501) If a language-binding-spec is specified, the entity-decl-list shall not contain any procedure names." "C505 (R501) If initialization appears, a double-colon separator shall appear before the entity-decl-list." C501-C503, C505 are currently not checked - issue #259. .. py:method:: get_attr_spec_list_cls() :staticmethod: Return the type used to match the attr-spec-list This overwrites the Fortran 2003 type with the Fortran 2008 variant. .. py:class:: Codimension_Attr_Spec(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.WORDClsBase` codimension-attr-spec is CODIMENSION lbracket coarray-spec rbracket In the spec above, lbracket and rbracket are left and right square brackets `[]` but not printed explicitly to avoid misinterpretation as optional parts. .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Coarray_Bracket_Spec'] .. py:method:: match(string) :staticmethod: Implements the matching for the CODIMENSION attribute. :param str string: the string to match as the attribute. :return: `None` if there is no match, otherwise a 2-tuple containing `CODIMENSION` as a string and the matched coarray-spec.. :rtype: `NoneType` or (`str`, :py:class:`fparser.two.Fortran2008.Coarray_Bracket_Spec`,) .. py:class:: Coarray_Bracket_Spec(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.BracketBase` coarray-bracket-spec is lbracket coarray-spec rbracket In the spec above, lbracket and rbracket are left and right square brackets `[]` but not printed explicitly to avoid misinterpretation as optional parts. .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Coarray_Spec'] .. py:method:: match(string) :staticmethod: Implements the matching for the coarray specification including the square brackets. :param str string: the string to match as the specification. :return: `None` if there is no match, otherwise a 3-tuple containing the left bracket, the matched coarray-spec, and the right bracket. :rtype: `NoneType` or (`str`, :py:class:`fparser.two.Fortran2008.Coarray_Spec`, `str`) .. py:class:: Attr_Spec(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Attr_Spec` Fortran 2008 rule R502. .. code-block:: fortran attr-spec is access-spec or ALLOCATABLE or ASYNCHRONOUS or CODIMENSION lbracket coarray-spec rbracket or CONTIGUOUS or DIMENSION ( array-spec ) or EXTERNAL or INTENT ( intent-spec ) or INTRINSIC or language-binding-spec or OPTIONAL or PARAMETER or POINTER or PROTECTED or SAVE or TARGET or VALUE or VOLATILE In the spec above, lbracket and rbracket are left and right square brackets `[]` but not printed explicitly to avoid misinterpretation as optional parts. This rule adds CODIMENSION and CONTIGUOUS attributes to Fortran2003's R503. .. py:attribute:: subclass_names :value: ['Access_Spec', 'Language_Binding_Spec', 'Dimension_Attr_Spec', 'Intent_Attr_Spec'] .. py:attribute:: use_names :value: [] .. py:method:: match(string) :staticmethod: Implements the matching for attributes of types. :param str string: the string to match as attribute. :return: `None` if there is no match, otherwise a 1-tuple containing the matched string. :rtype: `NoneType` or (`str`,) .. py:class:: Coarray_Spec(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.Base` Fortran 2008 rule R509. .. code-block:: fortran coarray-spec is deferred-coshape-spec-list or explicit-coshape-spec-list .. py:attribute:: subclass_names :value: ['Explicit_Coshape_Spec', 'Deferred_Coshape_Spec_List'] .. py:class:: Deferred_Coshape_Spec(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.SeparatorBase` Fortran 2008 rule R510 deferred-coshape-spec is : .. py:attribute:: subclass_names :value: [] .. py:method:: match(string) :staticmethod: Implements the matching for deferred coarray shape specification. :param str string: the string to match as deferred shape. :return: `None` if there is no match, otherwise a 2-tuple containing `None`. :rtype: `NoneType` or (`None`, `None`) .. py:class:: Explicit_Coshape_Spec(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.SeparatorBase` Fortran 2008 rule R511 explicit-coshape-spec is [ coshape-spec-list , ] [ lower-cobound : ] * Associated constraint is: "C529 (R511) A lower-cobound or upper-cobound that is not a constant expression shall appear only in a subprogram, BLOCK construct, or interface body." C529 is currently not checked - issue #259. .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Coshape_Spec_List', 'Lower_Cobound'] .. py:method:: match(string) :staticmethod: Implements the matching for explicit coarray shape specification. :param str string: the string to match as deferred shape. :return: `None` if there is no match, otherwise a 2-tuple containing matched coshape-spec-list or `None` and matched lower-cobound or `None`. :rtype: `NoneType` or (:py:class:`fparser.two.Fortran2008.Coshape_Spec_List` or `None`, :py:class:`fparser.two:Fortran2008.Lower_Cobound` or `None`) .. py:method:: tostr() Converts the explicit coarray shape specification to string. :return: the shape specification as string. :rtype: str .. py:class:: Coshape_Spec(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.SeparatorBase` coshape-spec is [ lower-cobound : ] upper-cobound .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Lower_Cobound', 'Upper_Cobound'] .. py:method:: match(string) :staticmethod: Implements the matching for a coarray shape. :param str string: the string to match as shape. :return: `None` if there is no match, otherwise a 2-tuple with lower bound if given or `None`, and upper bound. :rtype: `NoneType` or (`None`, :py:class:`fparser.two.Fortran2008.Upper_Cobound`) or (:py:class:`fparser.two.Fortran2008.Lower_Cobound`, :py:class:`fparser.two.Fortran2008.Upper_Cobound`) .. py:method:: tostr() Converts the Shape specification to string. :return: the shape specification as string. :rtype: str .. py:class:: Lower_Cobound(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.Base` Fortran 2008 rule R512 lower-cobound is specification-expr .. py:attribute:: subclass_names :value: ['Specification_Expr'] .. py:class:: Upper_Cobound(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.Base` Fortran 2008 rule R513 upper-cobound is specification-expr .. py:attribute:: subclass_names :value: ['Specification_Expr'] .. py:class:: Do_Term_Action_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Do_Term_Action_Stmt` Fortran 2008 rule R826. do-term-action-stmt is action-stmt Associated constraints are: "C816 (R826) A do-term-action-stmt shall not be an arithmetic-if-stmt, continue-stmt, cycle-stmt, end-function-stmt, end-mp-subprogram-stmt, end-program-stmt, end-subroutine-stmt, error-stop-stmt, exit-stmt, goto-stmt, return-stmt, or stop-stmt." .. py:attribute:: subclass_names :value: ['Action_Stmt_C816'] .. py:class:: Alloc_Opt(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Alloc_Opt` Fortran2008 rule R627. .. code-block:: fortran alloc-opt is ERRMSG = errmsg-variable or MOLD = source-expr or SOURCE = source-expr or STAT = stat-variable Extends the Fortran2003 version of this class by updating the keyword pairs (used in match) with support for MOLD. .. py:attribute:: _keyword_pairs .. py:class:: Allocate_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Allocate_Stmt` Fortran 2008 rule R626. .. code-block:: fortran allocate-stmt is ALLOCATE ( [ type-spec :: ] allocation-list [, alloc-opt-list ] ) The implementation of this rule simply ensures that the Fortran2008 version of Alloc_Opt is used. .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Type_Spec', 'Allocation_List', 'Alloc_Opt_List'] .. py:method:: alloc_opt_list() :classmethod: :returns: the Fortran2008 flavour of Alloc_Opt_List. :rtype: type .. py:class:: Loop_Control(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Loop_Control` Fortran 2008 rule R818 loop-control is [ , ] do-variable = scalar-int-expr , scalar-int-expr [ , scalar-int-expr ] or [ , ] WHILE ( scalar-logical-expr ) or [ , ] CONCURRENT forall-header Extends the Fortran2003 rule R830 with the additional CONCURRENT clause. The F2003 Loop_Control class would be better and more extensible if it called 2 classes, one for each of the above expressions. This would then affect the implementation of this class. Something like the suggestion below. However, this would result in a different fparser tree, see issue #416. F2003 - While_Loop_Cntl: scalar-logical-expression, delim F2003 - Counter_Loop_Cntl: var, lower, upper, [step], delim F2008 - Concurrent_Loop_Cntl: conc_expr, delim F2018 - Concurrent_Loop_Cntl: conc_expr, local_x, delim .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Do_Variable', 'Scalar_Int_Expr', 'Scalar_Logical_Expr'] .. py:method:: match(string) :staticmethod: Attempts to match the supplied text with this rule. :param str string: Fortran code to check for a match. :returns: None if there is no match, a tuple with the first entry providing the result of matching the 'WHILE' part of the rule if there is a match, the second entry providing the result of matching the 'COUNTER' part of the rule if there is a match, the third entry indicating whether there is an optional preceding ',' and the fourth entry providing the result of matching the 'CONCURRENT' part of the rule if there is a match. :rtype: Optional[Tuple[ Optional[ :py:class:`fparser.two.Fortran2003.Scalar_Logical_Expr`], Optional[Tuple[ :py:class:`fparser.two.Fortran2003.Do_Variable`, List[str]]], Optional[str], Optional[:py:class:`fparser.two.Fortran2003.Forall_Header`]]] .. py:method:: tostr() :returns: the Fortran representation of this object. :rtype: str .. py:class:: If_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.If_Stmt` Fortran 2008 rule R837 if-stmt is IF ( scalar-logical-expr ) action-stmt The implementation of this rule only replaces the :py:attr:`use_names` and :py:attr:`action_stmt_class` attributes to use the Fortran 2008 variant :py:class:`Action_Stmt_C828` instead of :py:class:`fparser.two.Fortran2003.Action_Stmt_C802`. Associated constraints are: C828 (R837) The action-stmt in the if-stmt shall not be an end-function-stmt, end-mp-subprogram-stmt, end-program-stmt, end-subroutine-stmt, or if-stmt. .. py:attribute:: use_names :value: ['Scalar_Logical_Expr', 'Action_Stmt_C828'] .. py:attribute:: action_stmt_cls .. py:class:: Error_Stop_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.StmtBase`, :py:obj:`fparser.two.utils.WORDClsBase` Fortran 2008 rule R856 error-stop-stmt is ERROR STOP [ stop-code ] .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Stop_Code'] .. py:method:: match(string) :staticmethod: Check whether the input matches the rule :param str string: Text that we are trying to match. :returns: None if there is no match or, if there is a match, a 2-tuple containing a string matching 'ERROR STOP' and an instance of :py:class:`fparser.two.Fortran2003.Stop_Code` (or None if an instance of 'Stop_Code' is not required and not provided). :rtype: (str, :py:class:`fparser.two.Fortran2003.Stop_Code` or None) or NoneType .. py:class:: Format_Item(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Format_Item` Fortran 2008 rule R1003 format-item is [ r ] data-edit-desc or control-edit-desc or char-string-edit-desc or [ r ] ( format-item-list ) or format-item-c1002 or hollerith-item or * ( format-item-list ) Extends the Fortran 2003 rule R1003 with the additional unlimited format repeat specifier ``*`` before a parenthesised format-item-list. .. py:attribute:: subclass_names :value: ['Hollerith_Item', 'Control_Edit_Desc', 'Char_String_Edit_Desc', 'Format_Item_C1002', 'Format_Item'] .. py:attribute:: use_names :value: ['R', 'Format_Item_List', 'Data_Edit_Desc'] .. py:method:: match(string: str) -> Optional[Tuple[Union[str, fparser.two.Fortran2003.Digit_String], Union[fparser.two.Fortran2003.Format_Item, fparser.two.Fortran2003.Format_Item_List]]] :staticmethod: Attempts to match the supplied text with this rule. Calls the Fortran 2003 match first. If that fails, checks for the Fortran 2008 unlimited format repeat: ``*(format-item-list)``. :param string: Fortran code to check for a match. :returns: None if there is no match, a tuple of size 2 containing a repeat specifier (``"*"`` or a Repeat instance) and the matched descriptor or format-item-list. .. py:class:: Stop_Code(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.Base` Fortran2008 rule R867. Changes the allowed stop code type. stop-code is scalar-default-char-constant-expr or scalar-int-constant-expr .. py:attribute:: subclass_names :value: ['Scalar_Default_Char_Expr', 'Scalar_Int_Expr'] .. py:attribute:: use_names :value: ['Stop_Code'] .. py:class:: Specification_Part_C1112(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Specification_Part` Fortran 2008 constraint C1112 C1112 A submodule specification-part shall not contain a format-stmt, entry-stmt, or stmt-function-stmt. These statements are found in the following rule hierarchy format-stmt Specification_Part/implicit_part/implicit_part_stmt/format_stmt Specification_Part/declaration_construct/format_stmt entry-stmt Specification_Part/implicit_part/implicit_part_stmt/entry_stmt Specification_Part/declaration_construct/entry_stmt stmt-function-stmt Specification_Part/declaration_construct/ stmt-function-stmt Therefore we need to specialise implicit_part, implicit_part_stmt and declaration_construct .. py:attribute:: use_names :value: ['Use_Stmt', 'Import_Stmt', 'Implicit_Part_C1112', 'Declaration_Construct_C1112'] .. py:method:: match(reader) :staticmethod: Check whether the input matches the rule param reader: the fortran file reader containing the line(s) of code that we are trying to match :type reader: :py:class:`fparser.common.readfortran.FortranFileReader` | :py:class:`fparser.common.readfortran.FortranStringReader` :returns: `tuple` containing a single `list` which contains instance of the classes that have matched if there is a match or `None` if there is no match :rtype: Optional[Tuple[List[:py:class:`fparser.two.utils.Base`]]] .. py:class:: Implicit_Part_C1112(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Implicit_Part` Fortran 2008 constraint C1112 C1112 A submodule specification-part shall not contain a format-stmt, entry-stmt, or stmt-function-stmt. This class specialises 'Implicit_Part' so that the specialised 'Implicit_Part_Stmt_C1112' is called rather than the original 'Implicit_Part_Stmt' .. py:attribute:: use_names :value: ['Implicit_Part_Stmt_C1112', 'Implicit_Stmt'] .. py:method:: match(reader) :staticmethod: Check whether the input matches the rule param reader: the fortran file reader containing the line(s) of code that we are trying to match :type reader: :py:class:`fparser.common.readfortran.FortranFileReader` or :py:class:`fparser.common.readfortran.FortranStringReader` :return: `tuple` containing a single `list` which contains instance of the classes that have matched if there is a match or `None` if there is no match .. py:class:: Implicit_Part_Stmt_C1112(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Implicit_Part_Stmt` Fortran 2008 constraint C1112 C1112 A submodule specification-part shall not contain a format-stmt, entry-stmt, or stmt-function-stmt. This class specialises 'Implicit_Part_Stmt' to remove 'Format_Stmt' and 'Entry_Stmt' .. py:attribute:: subclass_names :value: ['Comment', 'Implicit_Stmt', 'Parameter_Stmt', 'Format_Stmt', 'Entry_Stmt'] .. py:class:: Declaration_Construct_C1112(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Declaration_Construct` Fortran 2008 constraint C1112 C1112 A submodule specification-part shall not contain a format-stmt, entry-stmt, or stmt-function-stmt. This class specialises 'Declaration_Construct' to remove 'Format_Stmt', 'Entry_Stmt' and 'Stmt_Function_Stmt' .. py:attribute:: subclass_names :value: ['Derived_Type_Def', 'Entry_Stmt', 'Enum_Def', 'Format_Stmt', 'Interface_Block',... .. py:class:: Submodule(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.BlockBase` Fortran 2008 rule R1116. .. code-block:: fortran submodule is submodule-stmt [ specification-part ] [ module-subprogram-part ] end-submodule-stmt C1112 A submodule specification-part shall not contain a format-stmt, entry-stmt, or stmt-function-stmt. This constraint is handled by specialising the Specification_Part class. C1114 If a submodule-name appears in the end-submodule-stmt, it shall be identical to the one in the submodule-stmt. This constraint is handled by the Base class with the names being provided by the 'Submodule_Stmt and 'End_Submodule_Stmt' classes via a `get_name` method. .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Submodule_Stmt', 'Specification_Part_C1112', 'Module_Subprogram_Part', 'End_Submodule_Stmt'] .. py:method:: match(reader) :staticmethod: Check whether the input matches the rule param reader: the fortran file reader containing the line(s) of code that we are trying to match :type reader: :py:class:`fparser.common.readfortran.FortranFileReader` or :py:class:`fparser.common.readfortran.FortranStringReader` :return: `tuple` containing a single `list` which contains instance of the classes that have matched if there is a match or `None` if there is no match .. py:class:: Submodule_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.Base`, :py:obj:`fparser.two.utils.ScopingRegionMixin` Fortran 2008 rule R1117:: submodule-stmt is SUBMODULE ( parent-identifier ) submodule-name .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Submodule_Name', 'Parent_Identifier'] .. py:method:: match(fstring) :staticmethod: Check whether the input matches the rule :param st fstring: contains the Fortran that we are trying to match. :returns: instances of the Classes that have matched if there is a match or `None` if there is no match. :rtype: Optional[Tuple[:py:class:`fparser.two.Fortran2008.Parent_Identifier`, :py:class:`fparser.two.Fortran2008.Submodule_Name`]] .. py:method:: tostr() return the fortran representation of this object .. py:method:: get_name() Fortran 2008 constraint C1114 return the submodule name. This is used by the base class to check whether the submodule name matches the name used for the end submodule statement if one is provided. :return: the name of the submodule stored in a Name class :rtype: :py:class:`fparser.two.Fortran2003.Name` .. py:class:: End_Submodule_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.EndStmtBase` Fortran 2008 rule R1119 end-submodule-stmt is END [ SUBMODULE [ submodule-name ] ] .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Submodule_Name'] .. py:method:: match(fstring) :staticmethod: Check whether the input matches the rule param string fstring : contains the Fortran that we are trying to match :return: instances of the Classes that have matched if there is a match or `None` if there is no match .. py:method:: get_name() Fortran 2008 constraint C1114 return the submodule name as specified by the end submodule statement or `None` if one is not specified. This is used by the base class to check whether this name matches the submodule name. :return: the name of the submodule stored in a Name class :return type: :py:class:`fparser.two.Fortran2003.Name` or `None` .. py:class:: Parent_Identifier(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.Base` Fortran 2008 rule R1118 parent-identifier is ancestor-module-name [ : parent-submodule-name ] C1113 The ancestor-module-name shall be the name of a nonintrinsic module; the parent-submodule name shall be the name of a descendant of that module. This constraint can not be tested by fparser in general as the module or submodule may be in a different file. We therefore do not check this constraint in fparser. .. py:attribute:: use_names :value: ['Ancestor_Module_Name', 'Parent_SubModule_Name'] .. py:method:: match(fstring) :staticmethod: Check whether the input matches the rule param string fstring : contains the Fortran that we are trying to match :return: instances of the Classes that have matched if there is a match or `None` if there is no match .. py:method:: tostr() return the fortran representation of this object .. py:class:: Open_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Open_Stmt` Fortran2008 Rule R904. open-stmt is OPEN ( connect-spec-list ) .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Connect_Spec_List'] .. py:method:: match(string) :staticmethod: Attempts to match the supplied string as an Open_Stmt. :param str string: the string to attempt to match. :returns: a new Open_Stmt object if the match is successful, None otherwise. :rtype: Optional[:py:class:`fparser.two.Fortran2008.Open_Stmt] .. py:class:: Connect_Spec(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Connect_Spec` Fortran2008 rule R905. Extends the Fortran2003 definition with support for the NEWUNIT specifier. connect-spec is [ UNIT = ] file-unit-number or ACCESS = scalar-default-char-expr or ACTION = scalar-default-char-expr or ASYNCHRONOUS = scalar-default-char-expr or BLANK = scalar-default-char-expr or DECIMAL = scalar-default-char-expr or DELIM = scalar-default-char-expr or ENCODING = scalar-default-char-expr or ERR = label or FILE = file-name-expr or FORM = scalar-default-char-expr or IOMSG = iomsg-variable or IOSTAT = scalar-int-variable or NEWUNIT = scalar-int-variable or PAD = scalar-default-char-expr or POSITION = scalar-default-char-expr or RECL = scalar-int-expr or ROUND = scalar-default-char-expr or SIGN = scalar-default-char-expr or STATUS = scalar-default-char-expr R906 file-name-expr is scalar-default-char-expr R907 iomsg-variable is scalar-default-char-variable C903 No specifier shall appear more than once in a given connect-spec-list. C904 (R904) If the NEWUNIT= specifier does not appear, a file-unit-number shall be specified; if the optional characters UNIT= are omitted, the file-unit-number shall be the first item in the connect-spec-list. C905 (R904) The label used in the ERR= specifier shall be the statement label of a branch target statement that appears in the same inclusive scope as the OPEN statement. C906 (R904) If a NEWUNIT= specifier appears, a file-unit-number shall not appear. The constraints listed above are checked for in the Open_Stmt.match() method as we don't have access to the full list of Connect_Spec elements here. The exceptions are the second part of C904 (un-named file-unit-number must be first in the list) and C905: these are not currently checked. .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['File_Unit_Number', 'Scalar_Default_Char_Expr', 'Label', 'File_Name_Expr', 'Iomsg_Variable',... .. py:method:: _keyword_value_list() :classmethod: Extends the list of keywords supported in Fortran2003 with NEWUNIT. :returns: list of keyword, class pairs to match against. :rtype: list[tuple[str, type]] .. py:class:: Block_Construct(string, parent_cls=None) Bases: :py:obj:`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). .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Block_Stmt', 'Specification_Part', 'Execution_Part_Construct', 'End_Block_Stmt'] .. py:method:: match(reader) :staticmethod: Checks whether the content in reader matches the given type of block statement (e.g. DO..END DO, IF...END IF etc.) :param type startcls: the class marking the beginning of the block :param list subclasses: list of classes that can be children of the block. :param type endcls: the class marking the end of the block. :param reader: content to check for match. :type reader: str or instance of :py:class:`FortranReaderBase` :param bool match_labels: whether or not the statement terminating the block must have a label that matches the opening statement. Default is False. :param bool match_names: TBD :param tuple match_name_classes: TBD :param bool enable_do_label_construct_hook: TBD :param bool enable_if_construct_hook: TBD :param bool enable_where_construct_hook: TBD :param bool strict_order: whether to enforce the order of the given subclasses. :param bool strict_match_names: if start name present, end name must exist and match. :return: instance of startcls or None if no match is found :rtype: startcls .. py:class:: Block_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.StmtBase`, :py:obj:`fparser.two.utils.WORDClsBase`, :py:obj:`fparser.two.utils.ScopingRegionMixin` Fortran 2008 Rule 808. block-stmt is [ block-construct-name : ] BLOCK .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Block_Construct_Name'] .. py:attribute:: counter :value: 0 .. py:method:: match(string) :staticmethod: Attempts to match the supplied text with this rule. :param str string: the text to match. :returns: a tuple of the matched node and instance of Counter or None if there is no match. :rtype: Tuple["BLOCK", :py:class:`fparser.two.Fortran2008.Block_Stmt.Counter`] | NoneType .. py:method:: get_scope_name() :returns: the name of this scoping region. :rtype: str .. py:method:: get_start_name() :returns: the name associated with this Block construct or None. :rtype: str | NoneType .. py:method:: tostr() :returns: the string representation of this node. :rtype: str .. py:class:: End_Block_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.EndStmtBase` Fortran 2008 Rule 809. end-block-stmt is END BLOCK [ block-construct-name ] .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Block_Construct_Name'] .. py:method:: match(string) :staticmethod: :param str string: Fortran code to check for a match :return: 2-tuple containing "BLOCK" and, optionally, an associated Name or None if no match. :rtype: Optional[Tuple[ str, Optional[:py:class:`fparser.two.Fortran2003.Block_Construct_Name`]]] .. py:class:: Critical_Construct(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.BlockBase` Fortran 2008 Rule 810. critical-construct is critical-stmt block end-critical-stmt TODO: Should disallow RETURN (C809) and CYCLE or EXIT to outside block (C811) .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Critical_Stmt', 'Execution_Part_Construct', 'End_Critical_Stmt'] .. py:method:: match(reader) :staticmethod: Attempt to match the supplied content with this Rule. :param reader: the fortran file reader containing the line(s) of code that we are trying to match :type reader: :py:class:`fparser.common.readfortran.FortranFileReader` | :py:class:`fparser.common.readfortran.FortranStringReader` :returns: instance of class that has matched or `None` if no match. :rtype: :py:class:`fparser.two.utils.BlockBase` | NoneType .. py:class:: Critical_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.StmtBase`, :py:obj:`fparser.two.utils.WORDClsBase` Fortran 2008 Rule R811. critical-stmt is [ critical-construct-name : ] CRITICAL .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Critical_Construct_Name'] .. py:method:: match(string) :staticmethod: Attempts to match the supplied string as a CRITICAL statement. :param str string: the string to attempt to match. :returns: 2-tuple containing the matched word "CRITICAL" and None or None if no match. :rtype: Tuple[str, NoneType] or NoneType .. py:method:: get_start_name() :returns: the name associated with the start of this CRITICAL region (if any) :rtype: str | NoneType .. py:method:: tostr() :returns: the string representation of this node. :rtype: str .. py:class:: End_Critical_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.utils.EndStmtBase` Fortran 2008 Rule 812. end-critical-stmt is END CRITICAL [ critical-construct-name ] .. py:attribute:: subclass_names :value: [] .. py:attribute:: use_names :value: ['Critical_Construct_Name'] .. py:method:: match(string) :staticmethod: :param str string: Fortran code to check for a match :returns: 2-tuple containing "CRITICAL" and, optionally, an associated Name or None if there is no match. :rtype: Optional[Tuple[ str, Optional[:py:class:`fparser.two.Fortran2003.Critical_Construct_Name`]]] .. py:class:: Procedure_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Procedure_Stmt` Fortran 2008 Rule 1206. procedure-stmt is [ MODULE ] PROCEDURE [ :: ] procedure-name-list .. py:method:: match(string) :staticmethod: :param str string: Fortran code to check for a match :returns: 3-tuple containing a boolean indicating whether the optional MODULE keyword is included, a boolean indicating whether the optional '::' is included and a Procedure_Name_List instance, or None if there is no match. :rtype: Optional[Tuple[ bool, bool, :py:class:`fparser.two.Fortran2003.Procedure_Name_List`]]] .. py:method:: tostr() :returns: the string representation of this node. :rtype: str .. py:class:: Action_Term_Do_Construct(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Action_Term_Do_Construct` Subclass the 2003 version so that this class will import the Fortran2008 Label_Do_Stmt class. .. py:method:: label_do_stmt_cls() :staticmethod: :returns: Fortran2008 Label_Do_Stmt class. :rtype: :py:class:`fparser.two.Fortran2008.Label_Do_Stmt` .. py:class:: Block_Label_Do_Construct(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Block_Label_Do_Construct` Subclass the 2003 version so that this class will import the Fortran2008 Label_Do_Stmt class .. py:method:: label_do_stmt_cls() :staticmethod: :returns: Fortran2008 Label_Do_Stmt class. :rtype: :py:class:`fparser.two.Fortran2008.Label_Do_Stmt` .. py:class:: Label_Do_Stmt(string, parent_cls=None) Bases: :py:obj:`fparser.two.Fortran2003.Label_Do_Stmt` Subclass the 2003 version so that this class will import the Fortran2008 Label_Do_Stmt class. .. py:method:: loop_control_cls() :staticmethod: :returns: Fortran2008 Loop_Control class. :rtype: :py:class:`fparser.two.Fortran2008.Loop_Control` .. py:data:: ClassType .. py:data:: _names .. py:data:: NEW_CLS .. py:data:: NEW_CLS :value: None .. py:data:: classes :value: [] .. py:data:: __all__