Class Morpher
source code
object --+
|
Morpher
A class managing the process of morphing an ADQL expression.
It is constructed with a a dictionary of morphers; the keys are node
types, the values morphing functions.
Morphing functions have the signature m(node, state) -> node. They
should return the node if they do not with to change it. state is a State
instance.
The main entry point is morph(origTree) -> state, tree. origTree
is not modified, the return value can be flattened but can otherwise be
severely damaged.
For special effects, there's also earlyMorphers. These will be called
when traversal reaches the node for the first time. If these return
None, traversal continues as usual, if not, their result will be added to
the tree and *not* further traversed.
|
__init__(self,
morphers,
earlyMorphers={ } )
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
Inherited from object :
__class__
|
__init__(self,
morphers,
earlyMorphers={ } )
(Constructor)
| source code
|
x.__init__(...) initializes x; see help(type(x)) for signature
- Overrides:
object.__init__
- (inherited documentation)
|