PyForTool
Python-fortran-tool
Loading...
Searching...
No Matches
Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
pyfortool.variables.VarList Class Reference

Public Member Functions

 __init__ (self, mainScope, _preCompute=None)
 
 __getitem__ (self, *args, **kwargs)
 
 __setitem__ (self, *args, **kwargs)
 
 __delitem__ (self, *args, **kwargs)
 
 __len__ (self, *args, **kwargs)
 
 restrict (self, scopePath, excludeContains)
 
 findVar (self, varName, array=None, exactScope=False, extraVarList=None)
 
 showVarList (self)
 

Static Protected Member Functions

 _fromScope (mainScope)
 

Protected Attributes

 _varList
 
 _scopePath
 
 _fullVarList
 

Detailed Description

The VarList class stores the characterisitcs of all variables contained in a source code

Definition at line 44 of file variables.py.

Constructor & Destructor Documentation

◆ __init__()

pyfortool.variables.VarList.__init__ (   self,
  mainScope,
  _preCompute = None 
)
:param mainScope: a PYFT object
:param _preCompute: pre-computed values (_varList, _fullVarList, _scopePath)

Notes: - variables are found in modules only if the 'ONLY' attribute is used
       - array specification and type is unknown for module variables
       - 'ASSOCIATE' statements are not followed

Definition at line 48 of file variables.py.

Here is the call graph for this function:

Member Function Documentation

◆ __delitem__()

pyfortool.variables.VarList.__delitem__ (   self,
args,
**  kwargs 
)

Definition at line 77 of file variables.py.

◆ __getitem__()

pyfortool.variables.VarList.__getitem__ (   self,
args,
**  kwargs 
)

Definition at line 71 of file variables.py.

◆ __len__()

pyfortool.variables.VarList.__len__ (   self,
args,
**  kwargs 
)

Definition at line 80 of file variables.py.

◆ __setitem__()

pyfortool.variables.VarList.__setitem__ (   self,
args,
**  kwargs 
)

Definition at line 74 of file variables.py.

◆ _fromScope()

pyfortool.variables.VarList._fromScope (   mainScope)
staticprotected
:param mainScope: a PYFT object

Definition at line 84 of file variables.py.

Here is the caller graph for this function:

◆ findVar()

pyfortool.variables.VarList.findVar (   self,
  varName,
  array = None,
  exactScope = False,
  extraVarList = None 
)
Search for a variable in a list of declared variables
:param varName: variable name
:param array: True to limit search to arrays,
              False to limit search to non array,
              None to return anything
:param exactScope: True to limit search to variables declared in the scopePath
:param extraVarList: None or list of variables (such as those contained in a VarList object)
                     defined but not yet available in the self.varList object.
:return: None if not found or the description of the variable

The function is designed to return the declaration of a given variable.
If we know that the variable is (is not) an array, the last declaration statement
must (must not) be an array declaration. If the last declaration statement found doesn't
correspond to what is expected, we don't return it.
In case array is None, we return the last declaration statement without checking its kind.

Definition at line 185 of file variables.py.

◆ restrict()

pyfortool.variables.VarList.restrict (   self,
  scopePath,
  excludeContains 
)
:param scopePath: return a varList restricted to this scope path
:param excludeContains: exclude variables declared in contained parts

Definition at line 171 of file variables.py.

◆ showVarList()

pyfortool.variables.VarList.showVarList (   self)
Display on stdout a nice view of all the variables

Definition at line 222 of file variables.py.

Member Data Documentation

◆ _fullVarList

pyfortool.variables.VarList._fullVarList
protected

Definition at line 66 of file variables.py.

◆ _scopePath

pyfortool.variables.VarList._scopePath
protected

Definition at line 65 of file variables.py.

◆ _varList

pyfortool.variables.VarList._varList
protected

Definition at line 64 of file variables.py.


The documentation for this class was generated from the following file: