fparser.two.Fortran2008.loop_control_r818 ========================================= .. py:module:: fparser.two.Fortran2008.loop_control_r818 .. autoapi-nested-parse:: Module containing Fortran2008 Loop_Control rule R818 Classes ------- .. autoapisummary:: fparser.two.Fortran2008.loop_control_r818.Loop_Control Module Contents --------------- .. 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