Package EasyExtend :: Module eetransformer :: Class Transformer
[hide private]
[frames] | no frames]

Class Transformer

object --+
         |
        Transformer

Instance Methods [hide private]
 
__init__(self, langlet, **kwd)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
prepare(*args, **kwargs)
Add this transformer unconditionally to fiberspace transformers.
 
mark_node(self, tree)
 
unmark_node(self, tree, nid=-1)
 
is_node(self, node, nid)
 
contains_node(self, node, nids)
 
node_stack(self, node)
 
get_container(self, node, nid)
Get node N with node_id = nid when N is in the parental chain of node.
 
run(self, tree, **kwd)
Delegate to multi-langlet transformer
 
terminate(self)
Explicit signaling of langlet transform termination.
 
_find_handler(self)
Method used to find all methods that handle one node.
 
_load_exospace(self)
 
is_main(self, _if_stmt)
Returns True if _if_stmt node has the structure "if __name__ == '__main__': BLOCK" otherwise it returns False.
 
general_transform(self, tree)
Toplevel transformations:

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, langlet, **kwd)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

prepare(*args, **kwargs)

 

Add this transformer unconditionally to fiberspace transformers.

Decorators:
  • @EasyExtend.util.psyco_optimized

get_container(self, node, nid)

 

Get node N with node_id = nid when N is in the parental chain of node. raise ValueError if no such node is found.

terminate(self)

 

Explicit signaling of langlet transform termination. Dispatch to nodes of this transformer is stopped.

is_main(self, _if_stmt)

 

Returns True if _if_stmt node has the structure "if __name__ == '__main__': BLOCK" otherwise it returns False.

Parameters:
  • _if_stmt - node where node[0] == symbol.if_stmt

general_transform(self, tree)

 

Toplevel transformations:

   (A)       if __name__ == '__main__':   =>  def __like_main__():
                                                 BLOCK

                                             if __name__ == '__main__':
                                                __like_main__()

   (B)       import __langlet__  =>  __langlet__ = import_and_init_langlet( <langlet_name> )


   (C)       STMT1
             STMT2 ... =>  if STMT1 == from __future__ import*
                               STMT1; from EasyExtend.exotools import exoload; exospace = exoload(__file__);
                               STMT2 ....
                           else:
                               from EasyExtend.exotools import exoload; exospace = exoload(__file__);
                               STMT1
                               STMT2 ...