BlockIt
blockit::blocks::Block Class Reference
Inheritance diagram for blockit::blocks::Block:
Collaboration diagram for blockit::blocks::Block:

List of all members.

Public Member Functions

def __init__
def getTimeStamp
def addLine
def addDeps
def addChildDeps
def shareDeps
def contains
def addChild
def mergeChildren
def setParent
def popChild
def regenChildDeps
def baseName
def childString
def name
def blockType
def sentinel
def children
def dependencies
def clearChildDependencies
def clearOwnDependencies
def clearAllDependencies
def renameDependencies
def removeDependencies
def ignoreDependencies
def getIgnoreDependencies
def parent
def hasChild
def root
def upTo
def objects
def code
def codeList
def show
def hash
def __getstate__
def __setstate__
def unserialize
def serialize
def toFile
def lineArtGraph
def findAll
def getFromCache
def setFromCache
def resolveSymbol
def instantiate
def getState
def setState

Static Public Attributes

 GRAMMAR = None
 SENTINEL = None
 CHILDTOKEN = None
string BLOCKTYPE = 'Block'

Properties

 fromCache = property(getFromCache, setFromCache)

Private Attributes

 _parent
 _code
 _children
 _name
 _blockType
 _childDeps
 _ownDeps
 _childToken
 _depList
 _depIgnore
 _state
 _fromCache
 _timeStamp
 _hash

Detailed Description

This is the base block class.

Definition at line 33 of file blocks.py.


Constructor & Destructor Documentation

def blockit::blocks::Block::__init__ (   self,
  blockType,
  name,
  parent = None,
  childToken = None 
)

Definition at line 46 of file blocks.py.


Member Function Documentation

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

Reimplemented in blockit::Fortran::blocks::FortranBlock.

Definition at line 407 of file blocks.py.

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

Reimplemented in blockit::Fortran::blocks::FortranBlock.

Definition at line 422 of file blocks.py.

def blockit::blocks::Block::addChild (   self,
  blk,
  token = None,
  before = False,
  regen = True 
)
Add a block as a child of this block.  If a token string is given, then add
this child as a token before/after this string in the code, else,
just append it to the code at the end.

Inputs
------
blk : child block to add
token : token string to use for adding line after/before
before : boolean.  If true, add child line before given token; else after.

Reimplemented in blockit::Fortran::blocks::FortranBlock.

Definition at line 139 of file blocks.py.

def blockit::blocks::Block::addChildDeps (   self,
  sym,
  propagate = True,
  skipList = None 
)
Add the dependencies from a child block to the _childDeps set.

Definition at line 103 of file blocks.py.

def blockit::blocks::Block::addDeps (   self,
  sym,
  propagate = True 
)
Add an internal dependency and propagate up the tree.  Do not add
dependencies that are resolved by any of your children.  This is
checked by consulting the child nodes to see if they contain the
dependency.  Call the addChildDeps() on the parent.  The dependency is
given as a symbol name, not a set.

Definition at line 90 of file blocks.py.

def blockit::blocks::Block::addLine (   self,
  line,
  n = None 
)
def blockit::blocks::Block::baseName (   self)
Return the base, i.e. non-instantiated, non-mangled, name of the block.

Definition at line 240 of file blocks.py.

def blockit::blocks::Block::blockType (   self)

Definition at line 259 of file blocks.py.

def blockit::blocks::Block::children (   self)

Definition at line 269 of file blocks.py.

def blockit::blocks::Block::childString (   name)
Create a child string token.

Definition at line 247 of file blocks.py.

def blockit::blocks::Block::clearAllDependencies (   self)

Definition at line 281 of file blocks.py.

def blockit::blocks::Block::clearChildDependencies (   self)

Definition at line 275 of file blocks.py.

def blockit::blocks::Block::clearOwnDependencies (   self)

Definition at line 278 of file blocks.py.

def blockit::blocks::Block::code (   self,
  lineNumbers = False 
)
Show the code strings with or without line numbers.  The default is
no line numbers.

Definition at line 360 of file blocks.py.

def blockit::blocks::Block::codeList (   self)

Definition at line 376 of file blocks.py.

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

Reimplemented in blockit::Fortran::blocks::FortranBlock.

Definition at line 123 of file blocks.py.

def blockit::blocks::Block::dependencies (   self)

Definition at line 272 of file blocks.py.

def blockit::blocks::Block::findAll (   self,
  blks,
  depth = -1 
)
Find all types given in the blks tuple in your descendants to the
given depth.  If depth is < 0 , then recurse all the way to the
leaves.

Definition at line 489 of file blocks.py.

def blockit::blocks::Block::getFromCache (   self)

Definition at line 511 of file blocks.py.

def blockit::blocks::Block::getIgnoreDependencies (   self)

Definition at line 330 of file blocks.py.

def blockit::blocks::Block::getState (   self)

Reimplemented in blockit::Fortran::blocks::FortranBlock, and blockit::Fortran::blocks::Program.

Definition at line 531 of file blocks.py.

def blockit::blocks::Block::getTimeStamp (   self)
Return the time stamp of the block.

Definition at line 79 of file blocks.py.

def blockit::blocks::Block::hasChild (   self,
  blk 
)

Definition at line 336 of file blocks.py.

def blockit::blocks::Block::hash (   self)
Return a hashed value of this block if it does not already have a
_hash internal value.  Uses the mangled version for the hash.

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

Definition at line 397 of file blocks.py.

def blockit::blocks::Block::ignoreDependencies (   self,
  depList 
)
A list of dependencies that should be ignored.

Definition at line 322 of file blocks.py.

def blockit::blocks::Block::instantiate (   self,
  obj 
)

Definition at line 528 of file blocks.py.

def blockit::blocks::Block::lineArtGraph (   self,
  tree = None 
)
Display a line art graph for this block or the provided block tree.

Definition at line 471 of file blocks.py.

def blockit::blocks::Block::mergeChildren (   self,
  tbl 
)
Merge a symbol table with children into the block and add their
dependencies.  Does nothing to the underlying code base though.
Useful only in certain circumstances.

Definition at line 188 of file blocks.py.

def blockit::blocks::Block::objects (   self)

Definition at line 357 of file blocks.py.

def blockit::blocks::Block::parent (   self)

Definition at line 333 of file blocks.py.

def blockit::blocks::Block::popChild (   self,
  name,
  regen = True 
)
Remove a child from this block.

Definition at line 220 of file blocks.py.

def blockit::blocks::Block::regenChildDeps (   self)
Clear the child dependency list and regenerate it from the children.

Definition at line 229 of file blocks.py.

def blockit::blocks::Block::removeDependencies (   self,
  depList 
)
Remove a list of token dependencies from both dependencies lists
and traverse down the tree recursively to the children and do the
same.

Definition at line 311 of file blocks.py.

def blockit::blocks::Block::renameDependencies (   self,
  nameMap 
)
Rename an existing dependency in the dependency list and propagate
to the children.

Definition at line 285 of file blocks.py.

def blockit::blocks::Block::resolveSymbol (   self,
  sym 
)

Definition at line 524 of file blocks.py.

def blockit::blocks::Block::root (   self)
Return the root of the block tree starting at this block.

Definition at line 339 of file blocks.py.

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

Reimplemented in blockit::Fortran::blocks::FortranBlock.

Definition at line 442 of file blocks.py.

def blockit::blocks::Block::setFromCache (   self,
  value 
)

Definition at line 514 of file blocks.py.

def blockit::blocks::Block::setParent (   self,
  blk,
  regen = True 
)
Set the parent block for this block.  If this block has a parent,
remove it from that blocks children.

Definition at line 200 of file blocks.py.

def blockit::blocks::Block::setState (   self,
  subs 
)
def blockit::blocks::Block::shareDeps (   self,
  propagate = True 
)
Propagate the dependencies to the parent.  If propagate is True,
then continue up the tree.

Definition at line 113 of file blocks.py.

def blockit::blocks::Block::show (   self)
Show the block unrolled.

Definition at line 379 of file blocks.py.

def blockit::blocks::Block::toFile (   self,
  name 
)
Write the block to a special file.  This will write everything
necessary to recreate the block and all its children with the fromFile
class method.

Input
-----
name : block fileName to write it to

Definition at line 448 of file blocks.py.

def blockit::blocks::Block::unserialize (   self,
  tree 
)

Definition at line 439 of file blocks.py.

def blockit::blocks::Block::upTo (   self,
  blkType 
)
Travel up the tree and return the first blkType found in this
blocks lineage.

Definition at line 347 of file blocks.py.


Member Data Documentation

Definition at line 46 of file blocks.py.

Definition at line 46 of file blocks.py.

Reimplemented in blockit::Fortran::blocks::FortranBlock.

Definition at line 46 of file blocks.py.

Definition at line 46 of file blocks.py.

Definition at line 46 of file blocks.py.

Definition at line 46 of file blocks.py.

Definition at line 46 of file blocks.py.

Definition at line 46 of file blocks.py.

Definition at line 46 of file blocks.py.

Definition at line 46 of file blocks.py.

Definition at line 42 of file blocks.py.


Property Documentation

blockit::blocks::Block::fromCache = property(getFromCache, setFromCache) [static]

Definition at line 537 of file blocks.py.


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