PyForTool
Python-fortran-tool
Loading...
Searching...
No Matches
Classes | Functions | Variables
pyfortool.util Namespace Reference

Classes

class  PYFTError
 

Functions

 debugDecor (func)
 
 noParallel (func)
 
 setVerbosity (level)
 
 printInfos ()
 
 fortran2xml (fortranSource, parser='fxtran', parserOptions=None, wrapH=False)
 
 tostring (doc)
 
 tofortran (doc)
 
 isint (string)
 Other.
 
 isfloat (string)
 
 tag (elem)
 Helper functions acting on the xml.
 
 n2name (nodeN)
 
 alltext (doc)
 
 nonCode (elem)
 
 isExecutable (elem)
 
 isConstruct (elem)
 
 isStmt (elem)
 

Variables

dict debugStats = {}
 Verbosity, decorators and Exception.
 
 SHARED_TREE
 

Detailed Description

This module implements some tools to manipulate the xml

Function Documentation

◆ alltext()

pyfortool.util.alltext (   doc)
Helper function to iterate on all text fragment and join them
:param doc: xml fragment

Definition at line 297 of file util.py.

◆ debugDecor()

pyfortool.util.debugDecor (   func)
Defines a decorator to trace all function calling with arguments and results
and count number of calls and time spent

Definition at line 22 of file util.py.

◆ fortran2xml()

pyfortool.util.fortran2xml (   fortranSource,
  parser = 'fxtran',
  parserOptions = None,
  wrapH = False 
)
:param fortranSource: a string containing a fortran source code
                      or a filename
:param parser: path to the fxtran parser
:param parserOptions: dictionnary holding the parser options
:param wrapH: if True, content of .h file is put in a .F90 file (to force
              fxtran to recognize it as free form) inside a module (to
              enable the reading of files containing only a code part)
:returns: (includesRemoved, xml) where includesRemoved indicates if an include
          was replaced by fxtran and xml is an ET xml document

Definition at line 131 of file util.py.

◆ isConstruct()

pyfortool.util.isConstruct (   elem)
:param elem: element
:return: True if element is a construct

Definition at line 327 of file util.py.

Here is the caller graph for this function:

◆ isExecutable()

pyfortool.util.isExecutable (   elem)
:param e: element
:return: True if element is executable

Definition at line 313 of file util.py.

Here is the call graph for this function:

◆ isfloat()

pyfortool.util.isfloat (   string)
:param string: string to test for intergerness
:return: True if s represent a real

Definition at line 266 of file util.py.

◆ isint()

pyfortool.util.isint (   string)

Other.

:param string: string to test for intergerness
:return: True if s represent an int

Definition at line 253 of file util.py.

◆ isStmt()

pyfortool.util.isStmt (   elem)
:param elem: element
:return: True if element is a statement

Definition at line 335 of file util.py.

◆ n2name()

pyfortool.util.n2name (   nodeN)
Helper function which returns the entity name enclosed in a N tag

Definition at line 290 of file util.py.

◆ nonCode()

pyfortool.util.nonCode (   elem)
:param e: element
:return: True if e is non code (comment, text...)

Definition at line 305 of file util.py.

◆ noParallel()

pyfortool.util.noParallel (   func)
Defines a decorator that prevent this method to be executed in parallel on several files

Definition at line 70 of file util.py.

◆ printInfos()

pyfortool.util.printInfos ( )
Print statistics on methods and function usage

Definition at line 107 of file util.py.

◆ setVerbosity()

pyfortool.util.setVerbosity (   level)
Set the verbosity level
:param level: verbosity level used to set the logging module

Definition at line 95 of file util.py.

◆ tag()

pyfortool.util.tag (   elem)

Helper functions acting on the xml.

:param elem: ET Element
:return: the tag without the namespace

Definition at line 282 of file util.py.

◆ tofortran()

pyfortool.util.tofortran (   doc)
:param doc: an ET object
:return: a string representing the FORTRAN source code

Definition at line 232 of file util.py.

◆ tostring()

pyfortool.util.tostring (   doc)
:param doc: an ET object
:return: xml as a string

Definition at line 224 of file util.py.

Variable Documentation

◆ debugStats

dict pyfortool.util.debugStats = {}

Verbosity, decorators and Exception.

Definition at line 19 of file util.py.

◆ SHARED_TREE

pyfortool.util.SHARED_TREE

Definition at line 85 of file util.py.