fparser Reference Guide
0.0.14
|
Public Member Functions | |
def | __init__ (self, string, parent_cls=None) |
def | __new__ (cls, string, parent_cls=None) |
def | get_root (self) |
def | children (self) |
def | init (self, items) |
def | torepr (self) |
def | __str__ (self) |
def | __repr__ (self) |
def | tofortran (self, tab="", isfix=None) |
def | restore_reader (self, reader) |
![]() | |
def | __lt__ (self, other) |
def | __le__ (self, other) |
def | __eq__ (self, other) |
def | __ge__ (self, other) |
def | __gt__ (self, other) |
def | __ne__ (self, other) |
Public Attributes | |
parent | |
items | |
Static Public Attributes | |
subclasses | |
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` or \ :py:class:`fparser.common.readfortran.FortranReaderBase` :param parent_cls: the parent class of this object. :type parent_cls: `type`
def fparser.two.utils.Base.children | ( | self | ) |
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
Definition at line 464 of file utils.py.
def fparser.two.utils.Base.get_root | ( | self | ) |
def fparser.two.utils.Base.init | ( | self, | |
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`
Definition at line 484 of file utils.py.
References fparser.one.statements.GeneralAssignment.__class__, fparser.one.statements.Read.__class__, fparser.two.Fortran2003.Comment.items, fparser.one.statements.StatementWithNamelist.items, fparser.one.statements.Assign.items, fparser.one.statements.Call.items, fparser.one.statements.ComputedGoto.items, fparser.one.statements.AssignedGoto.items, fparser.two.utils.Base.items, fparser.one.statements.Print.items, fparser.one.statements.Read0.items, fparser.one.statements.Read1.items, fparser.one.typedecl_statements.Implicit.items, fparser.one.statements.Write.items, fparser.one.statements.Allocate.items, fparser.one.statements.Deallocate.items, fparser.one.statements.ModuleProcedure.items, fparser.one.statements.Access.items, fparser.one.statements.Save.items, fparser.one.statements.Nullify.items, fparser.one.statements.Use.items, fparser.one.statements.Parameter.items, fparser.one.statements.Equivalence.items, fparser.one.statements.Dimension.items, fparser.one.statements.Target.items, fparser.one.statements.Pointer.items, fparser.one.statements.Inquire.items, fparser.one.statements.Namelist.items, fparser.one.statements.Common.items, fparser.one.statements.Intent.items, fparser.one.statements.Entry.items, fparser.one.statements.GenericBinding.items, fparser.one.statements.Allocatable.items, fparser.one.statements.Bind.items, fparser.one.statements.Case.items, fparser.one.statements.TypeIs.items, fparser.one.statements.ClassIs.items, fparser.one.statements.Enumerator.items, fparser.one.statements.Depend.items, fparser.common.base_classes.AttributeHolder.torepr(), fparser.two.utils.Base.torepr(), fparser.common.base_classes.Statement.torepr(), fparser.common.base_classes.BeginStatement.torepr(), fparser.two.C99Preprocessor.Cpp_Pp_Tokens.tostr(), fparser.two.Fortran2003.Comment.tostr(), fparser.two.C99Preprocessor.Cpp_If_Stmt.tostr(), fparser.two.C99Preprocessor.Cpp_Elif_Stmt.tostr(), fparser.two.C99Preprocessor.Cpp_Else_Stmt.tostr(), fparser.two.C99Preprocessor.Cpp_Endif_Stmt.tostr(), fparser.one.typedecl_statements.TypeDeclarationStatement.tostr(), fparser.one.block_statements.BeginSource.tostr(), fparser.two.C99Preprocessor.Cpp_Macro_Identifier_List.tostr(), fparser.two.C99Preprocessor.Cpp_Undef_Stmt.tostr(), fparser.one.block_statements.Interface.tostr(), fparser.two.C99Preprocessor.Cpp_Warning_Stmt.tostr(), fparser.one.block_statements.SubProgramStatement.tostr(), fparser.common.base_classes.BeginStatement.tostr(), fparser.two.utils.BlockBase.tostr(), fparser.two.utils.SequenceBase.tostr(), fparser.two.utils.UnaryOpBase.tostr(), fparser.one.block_statements.SelectCase.tostr(), fparser.one.block_statements.SelectType.tostr(), fparser.two.utils.BinaryOpBase.tostr(), fparser.one.block_statements.Where.tostr(), fparser.two.utils.SeparatorBase.tostr(), fparser.one.block_statements.Forall.tostr(), fparser.one.block_statements.IfThen.tostr(), fparser.two.utils.KeywordValueBase.tostr(), fparser.one.block_statements.If.tostr(), fparser.two.utils.BracketBase.tostr(), fparser.two.utils.NumberBase.tostr(), fparser.one.block_statements.Do.tostr(), fparser.two.utils.CallBase.tostr(), fparser.one.block_statements.Associate.tostr(), fparser.two.utils.StringBase.tostr(), fparser.one.block_statements.Type.tostr(), fparser.two.utils.EndStmtBase.tostr(), fparser.two.utils.WORDClsBase.tostr(), fparser.two.utils.Type_Declaration_StmtBase.tostr(), fparser.two.Fortran2003.Generic_Binding.tostr(), fparser.two.Fortran2003.Ac_Implied_Do.tostr(), fparser.two.Fortran2003.Ac_Implied_Do_Control.tostr(), and fparser.two.Fortran2003.Data_Edit_Desc_C1002.tostr().
def fparser.two.utils.Base.tofortran | ( | self, | |
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
Definition at line 507 of file utils.py.
References fparser.two.Fortran2003.Comment.item, and fparser.common.base_classes.Statement.item.