BlockIt
blockit::Fortran::blocks::FortranBlock Class Reference
Inheritance diagram for blockit::Fortran::blocks::FortranBlock:
Collaboration diagram for blockit::Fortran::blocks::FortranBlock:

List of all members.

Public Member Functions

def __init__
def getSymMap
def version
def contains
def addLine
def rootNotAFile
def getState
def setState
def isTemplated
def template
def addObjects
def show
def resolveInternal
def mangle
def resolveSymbol
def symbolTuple
def name
def useDeclarations
def __getstate__
def serialize
def __setstate__
def getSig
def sentinel
def findSymbol
def setNameLength
def getNameLength
def addChild
def intrinsicType

Public Attributes

 DEP_GRAMMAR
 SHOW_GRAMMARS

Static Public Attributes

list intrinsicList
string BLOCKTYPE = 'FortranBlock'
 SENTINEL = None
string VERSION = '1.3.1'

Properties

 types = property( **__propTypes() )
 symbols = property( **__propSymbols() )

Private Member Functions

def _addLine
def __addType
def __addIntrinsic
def __addFunc
def __addProc
def __addSub
def __addUse
def __addImport
def __mangleShow
def __spawnChildShow
def __resolveSymbol
def __propTypes
def __propSymbols

Private Attributes

 _modLine
 _parameters
 _objects
 _template
 _use
 _types
 _sigs
 _version
 _name_length
 _state
 _mangle
 _children

Detailed Description

Definition at line 225 of file blocks.py.


Constructor & Destructor Documentation

def blockit::Fortran::blocks::FortranBlock::__init__ (   self,
  blockType,
  parameters,
  childToken = None 
)
Base FortranBlock class that all F90/95/2003 block types should inherit from.

Definition at line 240 of file blocks.py.


Member Function Documentation

def blockit::Fortran::blocks::FortranBlock::__addFunc (   self,
  s,
  l,
  t 
) [private]
Add a templated function call from a given pyparsed line.

Definition at line 368 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__addImport (   self,
  s,
  l,
  t 
) [private]
Add a scanned `import` declaration from a given pyparsed line.

Definition at line 405 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__addIntrinsic (   self,
  s,
  l,
  t 
) [private]
Add a scanned instrinsic type declaration from a given pyparsed line.

Definition at line 356 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__addProc (   self,
  s,
  l,
  t 
) [private]
Add a procedure declaration from a given pyparsed line.

Definition at line 377 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__addSub (   self,
  s,
  l,
  t 
) [private]
Add a templated subroutine call from a given pyparsed line.

Definition at line 385 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__addType (   self,
  s,
  l,
  t 
) [private]
Add a scanned type declaration from a given pyparsed line.

Definition at line 342 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__addUse (   self,
  s,
  l,
  t 
) [private]
Add a scanned `use` declaration from a given pyparsed line.  Add to
dependencies if its a templated use declaration.

Definition at line 394 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__getstate__ (   self,
  _dd = None 
)
Builds a dictionary tree of the block for pickling.

Reimplemented from blockit::blocks::Block.

Definition at line 691 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__mangleShow (   self,
  s,
  l,
  t 
) [private]
Mangle the template tokens and set internal _modLine.

Definition at line 476 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__propSymbols ( ) [private]

Definition at line 797 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__propTypes ( ) [private]

Definition at line 791 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__resolveSymbol (   self,
  sym 
) [private]
Resolve a symbol name, i.e. search for wildcards in a template
string and substitute the wildcards with the appropriate default
value as well as missing template parameters

sym : symbol name to resolve

Definition at line 601 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__setstate__ (   self,
  tree 
)
Unpack the dictionary tree.

Reimplemented from blockit::blocks::Block.

Definition at line 703 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::__spawnChildShow (   self,
  s,
  l,
  t 
) [private]
Spawn the show() method of a child token and set internal _modLine

Definition at line 488 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::_addLine (   self,
  n 
) [private]
Add the internal _modLine to the code listing.

Definition at line 333 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::addChild (   self,
  child,
  token = None,
  before = False,
  regen = True 
)
Overrided addChild method which simply is needed to set the
internal _name_length parameter to that of the parent.

Reimplemented from blockit::blocks::Block.

Definition at line 770 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::addLine (   self,
  line,
  n = None 
)
Method to add a text line to a block code listing.  If the optional
line number parameter is given, then the line is inserted AFTER the
given line number.

Input
-----
line : text line to add to code listing
n : line number in listing to insert after.  Negative numbers insert
    from the end of the code listing.

Reimplemented from blockit::blocks::Block.

Reimplemented in blockit::Fortran::blocks::Function, blockit::Fortran::blocks::Subroutine, blockit::Fortran::blocks::Interface, and blockit::Fortran::blocks::Specialization.

Definition at line 305 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::addObjects (   self,
  obj 
)
Add a list of template specs to the internal objects set if this is
a template block.  If not, propagate up the tree to find the parent
template block.

Reimplemented in blockit::Fortran::blocks::Template.

Definition at line 450 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::contains (   self,
  sym,
  skipList = None 
)
Search to see if the block has a symbol.

Reimplemented from blockit::blocks::Block.

Definition at line 285 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::findSymbol (   self,
  sym 
)
Look for a type symbol in the block.  If not found, check the
enclosing block.

Definition at line 747 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::getNameLength (   self)
Return the max number of characters for mangled templated names.

Definition at line 764 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::getSig (   self,
  name 
)
Return the call signature for the given templated
function/subroutine name that this block calls.

Definition at line 721 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::getState (   self)
Return the internal _state variable.

Reimplemented from blockit::blocks::Block.

Reimplemented in blockit::Fortran::blocks::Program.

Definition at line 417 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::getSymMap (   self,
  table 
)
Get the symbol map for the block.

Definition at line 273 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::intrinsicType (   s)
Function returning a boolean whether any of the defined built-in types
are found in the given string.

Definition at line 779 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::isTemplated (   self)
Return true if the internal _template attribute is not None.  If
the block has a parent, then call the parent isTemplated() method.
A block is templated if it exists within a template block

Reimplemented in blockit::Fortran::blocks::Template, and blockit::Fortran::blocks::Template.

Definition at line 429 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::mangle (   name,
  width = 31,
  tempTokens = TEMPLATE_TOKENS 
)
Generate a mangled name from a name and and a template string.

Long names are contracted to fit within `width` argument size.

Definition at line 554 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::name (   self,
  tempTokens = TEMPLATE_TOKENS 
)
Return the name of the block.

Definition at line 674 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::resolveInternal (   self)
Resolve the internal child dependencies of instantiated templated types for
a given block so that the appear in the proper order internally within
the block.

Definition at line 500 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::resolveSymbol (   self,
  sym,
  mangle = True 
)
Resolve a templated symbol name.  This should only be used after
the globalSymbolMap has been generated.  Otherwise, it will be
expensive if called many times with symbols that have wildcards (*) or
missing template parameters.  If the symbol is not already in the
globalSymbolMap, then add it after resolving the symbol, i.e. cache it
for future use.

Definition at line 583 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::rootNotAFile (   self)

Definition at line 412 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::sentinel (   self,
  line 
)
Overrided sentinel method. Calls super first.  If true, then looks
for AutoDelete/Specialization blocks in scope and merges symbols and
types found in these blocks with its own symbols and types.

Reimplemented from blockit::blocks::Block.

Reimplemented in blockit::Fortran::blocks::Template, blockit::Fortran::blocks::Specialization, blockit::Fortran::blocks::Prepod, and blockit::Fortran::blocks::PyF95Directives.

Definition at line 733 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::serialize (   self,
  _dd = None 
)
Builds a dictionary tree of the block.

Reimplemented from blockit::blocks::Block.

Definition at line 697 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::setNameLength (   self,
  name_length 
)
Set the max number of characters for mangled templated names.

Arguments:
- `name_length` : integer number of max characters

Definition at line 756 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::setState (   self,
  subs 
)
Set the internal state variable _state.  Can be used for anything.

Reimplemented from blockit::blocks::Block.

Reimplemented in blockit::Fortran::blocks::Specialization.

Definition at line 423 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::symbolTuple (   self,
  x 
)
Given a template symbol 'x' (or regular symbol), return a tuple with
that contains the symbol with all wildcards and missing template
parameters resolved and the mangled version of the symbol.

Definition at line 665 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::template (   self)
Return the _template attribute if this block has one.  If it
does not and has a parent, the call the parents template() method,
thereby walking up the tree.

Reimplemented in blockit::Fortran::blocks::Template.

Definition at line 440 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::useDeclarations (   self)
Return the set of use declarations.

Definition at line 685 of file blocks.py.

def blockit::Fortran::blocks::FortranBlock::version (   self)
Return the block version number.

Definition at line 279 of file blocks.py.


Member Data Documentation

Reimplemented from blockit::blocks::Block.

Definition at line 705 of file blocks.py.

Definition at line 465 of file blocks.py.

Definition at line 242 of file blocks.py.

Definition at line 242 of file blocks.py.

Definition at line 242 of file blocks.py.

Reimplemented from blockit::blocks::Block.

Reimplemented in blockit::Fortran::blocks::Specialization.

Definition at line 425 of file blocks.py.

Definition at line 242 of file blocks.py.

Definition at line 242 of file blocks.py.

Definition at line 242 of file blocks.py.

Initial value:
['integer', 'double', 'character', 'logical', 'complex',
                     'real']

Definition at line 229 of file blocks.py.

Definition at line 237 of file blocks.py.


Property Documentation

blockit::Fortran::blocks::FortranBlock::symbols = property( **__propSymbols() ) [static]

Definition at line 804 of file blocks.py.

blockit::Fortran::blocks::FortranBlock::types = property( **__propTypes() ) [static]

Definition at line 803 of file blocks.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Properties