
xFWgc           @   s  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l m Z d  d l m Z m	 Z	 m
 Z
 m Z d  d l m Z m Z m Z m Z d  d l m Z m Z m Z m Z m Z d  d l m Z m Z m Z m Z m Z m Z m Z m Z m Z d  d l m  Z  y e j! d Z" Wn e# k
 r2d	 Z" n Xi d
 d d f 6d d	 d f 6d d d	 f 6d d	 d	 f 6Z$ d	 Z% d Z& d Z' d Z( d d  Z) e* e* d  Z+ d f  d     YZ, d e, f d     YZ- d e, f d     YZ. d e, f d     YZ/ d f  d     YZ0 d   Z1 d f  d     YZ2 d  f  d!     YZ3 d" e3 e2 f d#     YZ4 d$ e3 e2 f d%     YZ5 d& e3 e2 f d'     YZ6 d( f  d)     YZ7 d* e3 e7 e2 f d+     YZ8 d, e3 e7 e2 f d-     YZ9 d. f  d/     YZ: d0 e3 e: e2 f d1     YZ; d2   Z< d3   Z= d4 f  d5     YZ> d6 f  d7     YZ? d8 e? f d9     YZ@ d: e? f d;     YZA d< e? f d=     YZB d> e? f d?     YZC i e@ e jD 6eA e jE 6eB e jF 6eC e jG 6ZH d@   ZI eJ dA k rx e jK d	 D] ZL e) eL  qWn  d S(B   iN(   t   StringIO(   t   astt   parset   walkt   syntax(   t   pyassemt   misct   futuret   symbols(   t   SC_LOCALt   SC_GLOBAL_IMPLICITt   SC_GLOBAL_EXPLICITt   SC_FREEt   SC_CELL(	   t
   CO_VARARGSt   CO_VARKEYWORDSt   CO_NEWLOCALSt	   CO_NESTEDt   CO_GENERATORt   CO_FUTURE_DIVISIONt   CO_FUTURE_ABSIMPORTt   CO_FUTURE_WITH_STATEMENTt   CO_FUTURE_PRINT_FUNCTION(   t   TupleArgi    i   t   CALL_FUNCTIONt   CALL_FUNCTION_VARt   CALL_FUNCTION_KWt   CALL_FUNCTION_VAR_KWi   i   i   c         C   s   t  |  d  } | j   } | j   t | |   } y | j |  Wn t k
 r[   n+ Xt  |  d d  } | j |  | j   d  S(   Nt   Ut   ct   wb(   t   opent   readt   closet   Modulet   compilet   SyntaxErrort   dump(   t   filenamet   displayt   ft   buft   mod(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   compileFile%   s    
c         C   s   | d k	 s | d k	 r$ t d  n  | d k rB t |  |  } nH | d k r` t |  |  } n* | d k r~ t |  |  } n t d   | j   | j S(   s*   Replacement for builtin compile() functions   not implemented yett   singlet   exect   evals6   compile() 3rd arg must be 'exec' or 'eval' or 'single'N(   t   Nonet   RuntimeErrort   InteractiveR"   t
   Expressiont
   ValueErrorR#   t   code(   t   sourceR&   t   modet   flagst   dont_inheritt   gen(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR#   3   s    
t   AbstractCompileModec           B   s2   e  Z d Z d    Z d   Z d   Z d   Z RS(   c         C   s   | |  _  | |  _ d  |  _ d  S(   N(   R5   R&   R/   R4   (   t   selfR5   R&   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   __init__H   s    		c         C   s9   t  |  j |  j  } t j |  j |  t j |  | S(   N(   R   R5   R6   R   t   set_filenameR&   R   t   check(   R;   t   tree(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt	   _get_treeM   s    c         C   s   d  S(   N(    (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR#   S   s    c         C   s   |  j  S(   N(   R4   (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   getCodeV   s    N(   t   __name__t
   __module__R/   R6   R<   R@   R#   RA   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR:   D   s
   			R2   c           B   s   e  Z d  Z d   Z RS(   R.   c         C   s+   |  j    } t |  } | j   |  _ d  S(   N(   R@   t   ExpressionCodeGeneratorRA   R4   (   R;   R?   R9   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR#   ]   s    (   RB   RC   R6   R#   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR2   Y   s   R1   c           B   s   e  Z d  Z d   Z RS(   R,   c         C   s+   |  j    } t |  } | j   |  _ d  S(   N(   R@   t   InteractiveCodeGeneratorRA   R4   (   R;   R?   R9   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR#   f   s    (   RB   RC   R6   R#   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR1   b   s   R"   c           B   s8   e  Z d  Z d d  Z d   Z e j   Z d   Z RS(   R-   i    c         C   sN   |  j    } t |  } | r; d d  l } | j |  GHn  | j   |  _ d  S(   Ni(   R@   t   ModuleCodeGeneratort   pprintRA   R4   (   R;   R'   R?   R9   RG   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR#   o   s    c         C   s*   | j  |  j    t j |  j |  d  S(   N(   t   writet   getPycHeadert   marshalR%   R4   (   R;   R(   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR%   w   s    c         C   s2   t  j j |  j  } t j d |  } |  j | S(   Ns   <i(   t   ost   patht   getmtimeR&   t   structt   packt   MAGIC(   R;   t   mtime(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRI   }   s    (	   RB   RC   R6   R#   R%   t   impt	   get_magicRP   RI   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR"   k   s
   	t   LocalNameFinderc           B   sk   e  Z d  Z d d  Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z RS(   s   Find local names in scopec         C   sC   t  j   |  _ t  j   |  _ x | D] } |  j j |  q% Wd  S(   N(   R   t   Sett   namest   globalst   add(   R;   RV   t   name(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR<      s    c         C   sF   x< |  j  j   D]+ } |  j j |  r |  j j |  q q W|  j S(   N(   RW   t   elementsRV   t   has_eltt   remove(   R;   t   elt(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt	   getLocals   s    c         C   s   d  S(   N(    (   R;   t   node(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt	   visitDict   s    c         C   s(   x! | j  D] } |  j j |  q
 Wd  S(   N(   RV   RW   RX   (   R;   R_   RY   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitGlobal   s    c         C   s   |  j  j | j  d  S(   N(   RV   RX   RY   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitFunction   s    c         C   s   d  S(   N(    (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitLambda   s    c         C   s4   x- | j  D]" \ } } |  j  j | p( |  q
 Wd  S(   N(   RV   RX   (   R;   R_   RY   t   alias(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitImport   s    c         C   s4   x- | j  D]" \ } } |  j  j | p( |  q
 Wd  S(   N(   RV   RX   (   R;   R_   RY   Rd   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt	   visitFrom   s    c         C   s   |  j  j | j  d  S(   N(   RV   RX   RY   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt
   visitClass   s    c         C   s   |  j  j | j  d  S(   N(   RV   RX   RY   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAssName   s    (    (   RB   RC   t   __doc__R<   R^   R`   Ra   Rb   Rc   Re   Rf   Rg   Rh   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRT      s   								c         C   s&   t  |  t j  r" |  j s" d Sn  d S(   Ni   i    (   t
   isinstanceR   t   Constt   value(   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   is_constant_false   s    	t   CodeGeneratorc           B   sU  e  Z d  Z d Z d Z d Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z e d  Z e Z d Z d Z d   Z d   Z d   Z d   Z d d  Z d   Z  d   Z! d   Z" d   Z# d   Z$ d   Z% d   Z& d   Z' d   Z( d   Z) d    Z* d!   Z+ d"   Z, d#   Z- d$   Z. d%   Z/ d&   Z0 d'   Z1 d(   Z2 d)   Z3 d*   Z4 d+   Z5 d,   Z6 d-   Z7 d.   Z8 d Z9 d/   Z: d0   Z; d1   Z< d2   Z= d3   Z> d4   Z? d5   Z@ d6   ZA d7   ZB d8   ZC d9   ZD d:   ZE d;   ZF d<   ZG d= d>  ZH eI d? k rveH ZJ eH ZK n d@   ZJ dA   ZK dB   ZL i dC dD 6dE dF 6dG dH 6dI dJ 6dK dL 6dM dN 6dO dP 6dQ dR 6dS dT 6dU dV 6dW dX 6dY dZ 6ZM d[   ZN d\   ZO d]   ZP d^   ZQ d_   ZR d`   ZS d da  ZT db   ZU dc   ZV dd   ZW d de  ZX d df  ZY dg   ZZ dh   Z[ di   Z\ dj   Z] dk   Z^ dl   Z_ dm   Z` dn   Za do   Zb dp   Zc dq   Zd dr   Ze ds   Zf dt   Zg du   Zh dv   Zi dw   Zj dx   Zk dy   Zl dz   Zm d{   Zn d|   Zo d}   Zp d~   Zq d   Zr d   Zs d   Zt RS(   s  Defines basic code generator for Python bytecode

    This class is an abstract base class.  Concrete subclasses must
    define an __init__() that defines self.graph and then calls the
    __init__() defined in this class.

    The concrete class must also define the class attributes
    NameFinder, FunctionGen, and ClassGen.  These attributes can be
    defined in the initClass() method, which is a hook for
    initializing these methods after all the classes have been
    defined.
    i    c         C   s  |  j  d  k r( |  j   d |  j _  n  |  j   t j   |  _ t j   |  _ d  |  _	 |  j
   d |  _ |  j   j } x | D] } | d k r |  j j t  d |  _ q | d k r |  j j t  q | d k r |  j j t  q | d k r |  j j t  q q Wd  S(   Ni   t   BINARY_DIVIDEt   divisiont   BINARY_TRUE_DIVIDEt   absolute_importt   with_statementt   print_function(   t   _CodeGenerator__initializedR/   t	   initClasst	   __class__t
   checkClassR   t   Stackt   localst   setupst   last_linenot   _setupGraphDelegationt   _div_opt
   get_modulet   futurest   grapht   setFlagR   R   R   R   (   R;   R   t   feature(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR<      s(    

	
	c         C   s   d S(   s)   This method is called once for each classN(    (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRv      t    c         C   s   yX t  |  d  s t  t |  d  s- t  t |  d  sB t  t |  d  sW t  Wn, t k
 r } d |  j j } t |  n Xd S(   s*   Verify that class is constructed correctlyR   t
   NameFindert   FunctionGent   ClassGens   Bad class construction for %sN(   t   hasattrt   AssertionErrort   getattrRw   RB   (   R;   t   msgt   intro(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRx      s    c         C   sO   |  j  j |  _ |  j  j |  _ |  j  j |  _ |  j  j |  _ |  j  j |  _ d  S(   N(   R   t   emitt   newBlockt
   startBlockt	   nextBlockt   setDocstring(   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR}      s
    c         C   s   |  j  j   S(   s   Return a code object(   R   RA   (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRA      s    c         C   s*   |  j  d  k	 r" t j | |  j   S| Sd  S(   N(   t
   class_nameR/   R   t   mangle(   R;   RY   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR      s    c         C   s    t  j   } t | |  | j S(   N(   R   t   SymbolVisitorR   t   scopes(   R;   R?   t   s(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   parseSymbols   s    c         C   s   t  d  d  S(   Ns#   should be implemented by subclasses(   R0   (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR     s    c         C   s   |  j  j   j |  S(   N(   Rz   t   topR[   (   R;   RY   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   isLocalName
  s    c         C   s   |  j  d |  d  S(   Nt   STORE(   t   _nameOp(   R;   RY   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt	   storeName  s    c         C   s   |  j  d |  d  S(   Nt   LOAD(   R   (   R;   RY   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   loadName  s    c         C   s   |  j  d |  d  S(   Nt   DELETE(   R   (   R;   RY   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   delName  s    c         C   s  |  j  |  } |  j j |  } | t k rd |  j sM |  j | d |  q|  j | d |  n | t k r |  j | d |  n | t k r |  j s |  j | d |  q|  j | d |  nB | t k s | t	 k r |  j | d |  n t
 d | | f  d  S(   Nt   _NAMEt   _FASTt   _GLOBALt   _DEREFs    unsupported scope for var %s: %d(   R   t   scopet
   check_nameR	   t	   optimizedR   R   R
   R   R   R0   (   R;   t   prefixRY   R   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR     s     		c         C   s8   |  j  r  |  j | d |  n |  j | d |  d S(   s   Emit name ops for names generated implicitly by for loops

        The interpreter generates names that start with a period or
        dollar sign.  The symbol table ignores these names because
        they aren't present in the program text.
        R   R   N(   R   R   (   R;   R   RY   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   _implicitNameOp+  s    	c         C   sT   t  | d d  } | d k	 rP | |  j k s3 | rP |  j d |  | |  _ t St S(   s  Emit SET_LINENO if necessary.

        The instruction is considered necessary if the node has a
        lineno attribute and it is different than the last lineno
        emitted.

        Returns true if SET_LINENO was emitted.

        There are no rules for when an AST node should have a lineno
        attribute.  The transformer and AST code need to be reviewed
        and a consistent policy implemented and documented.  Until
        then, this method works around missing line numbers.
        t   linenot
   SET_LINENON(   R   R/   R|   R   t   Truet   False(   R;   R_   t   forceR   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt
   set_lineno<  s    	c         C   s   |  j  |  |  _ |  j | |  _ |  j d d  | j r^ |  j d | j  |  j d  n  t | j |  j   d d } |  j	 j
 | j    |  j | j  |  j d d   |  j d  d  S(   NR   i    t
   LOAD_CONSTRi   t   verboset   RETURN_VALUE(   R   R   R   R   t   docR   R   R_   R   Rz   t   pushR^   t   visitR/   (   R;   R_   t   lnf(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitModuleZ  s    	c         C   sP   |  j  |  |  j |  |  _ |  j | |  _ |  j | j  |  j d  d  S(   NR   (   R   R   R   R   R   R_   R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitExpressiong  s
    c         C   sC   |  j  | d d | j r/ |  j | j  n  |  j | j  d  S(   Nt   isLambdai    (   t   _visitFuncOrLambdaR   R   R   RY   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRb   n  s    	c         C   s   |  j  | d d d  S(   NR   i   (   R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRc   t  s    c         C   s  | rI | j  rI x! | j  j D] } |  j |  q Wt | j  j  } n d } |  j | |  j | |  j |  j    } t | j	 |  | j
   |  j |  x | j D] } |  j |  q W|  j | t | j   x$ t |  D] } |  j d d  q Wd  S(   Ni    R   i   (   t
   decoratorst   nodesR   t   lenR   R   R   R   R   R4   t   finishR   t   defaultst   _makeClosuret   rangeR   (   R;   R_   R   t	   decoratort   ndecoratorsR9   t   defaultt   i(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR   w  s    
c         C   s   |  j  | |  j |  j    } t | j |  | j   |  j |  |  j d | j  x | j	 D] } |  j
 |  qb W|  j d t | j	   |  j | d  |  j d d  |  j d  |  j | j  d  S(   NR   t   BUILD_TUPLEi    R   t   BUILD_CLASS(   R   R   R   R   R4   R   R   R   RY   t   basesR   R   R   R   (   R;   R_   R9   t   base(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRg     s    
c         C   s   |  j    } t | j  } x t |  D] } | j | \ } } t |  rS q( n  |  j |  |  j |  |  j    } |  j d |  |  j   |  j |  |  j d |  |  j	 |  q( W| j
 r |  j | j
  n  |  j |  d  S(   Nt   POP_JUMP_IF_FALSEt   JUMP_FORWARD(   R   R   t   testsR   Rm   R   R   R   R   R   t   else_(   R;   R_   t   endt   numtestsR   t   testt   suitet   nextTest(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitIf  s"    
	c         C   s  |  j  |  |  j   } |  j   } |  j   } |  j d |  |  j |  |  j j t | f  |  j  | d t |  j | j	  |  j d | p |  |  j   |  j | j
  |  j d |  |  j |  |  j d  |  j j   | j r
|  j | j  n  |  j |  d  S(   Nt
   SETUP_LOOPR   R   t   JUMP_ABSOLUTEt	   POP_BLOCK(   R   R   R   R   R{   R   t   LOOPR   R   R   t   bodyR   t   popR   (   R;   R_   t   loopR   t   after(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt
   visitWhile  s&    
	c         C   s(  |  j    } |  j    } |  j    } |  j j t | f  |  j |  |  j d |  |  j | j  |  j d  |  j |  |  j | d d |  j d |  |  j | j	  |  j | j
  |  j d |  |  j |  |  j d  |  j j   | j r|  j | j  n  |  j |  d  S(   NR   t   GET_ITERR   i   t   FOR_ITERR   R   (   R   R{   R   R   R   R   R   t   listR   t   assignR   R   R   (   R;   R_   t   startt   anchorR   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitFor  s(    	c         C   sC   |  j  s% t d | j | j f  n  |  j |  |  j d  d  S(   Ns   'break' outside loop (%s, %d)t
   BREAK_LOOP(   R{   R$   R&   R   R   R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt
   visitBreak  s
    	c         C   s[  |  j  s% t d | j | j f  n  |  j  j   \ } } | t k rp |  j |  |  j d |  |  j   n | t	 k s | t
 k r)|  j |  t |  j   } x= | d k r | d } |  j  | \ } } | t k r Pq q W| t k rt d | j | j f  n  |  j d |  |  j   n. | t k rWd } t | | j | j f  n  d  S(   Ns    'continue' outside loop (%s, %d)R   i    i   t   CONTINUE_LOOPs7   'continue' not allowed inside 'finally' clause (%s, %d)(   R{   R$   R&   R   R   R   R   R   R   t   EXCEPTt   TRY_FINALLYR   t   END_FINALLY(   R;   R_   t   kindt   blockR   t
   loop_blockR   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitContinue  s0    	
c         C   sp   |  j    } x< | j d  D]- } |  j |  |  j | |  |  j   q W|  j | j d  |  j |  d  S(   Ni(   R   R   R   R   R   (   R;   R_   t   jumpR   t   child(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt	   visitTest  s    c         C   s   |  j  | d  d  S(   Nt   JUMP_IF_FALSE_OR_POP(   R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAnd  s    c         C   s   |  j  | d  d  S(   Nt   JUMP_IF_TRUE_OR_POP(   R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitOr  s    c         C   s   |  j    } |  j    } |  j | j  |  j d |  |  j | j  |  j d |  |  j |  |  j | j  |  j |  d  S(   NR   R   (   R   R   R   R   t   thenR   R   (   R;   R_   t   endblockt	   elseblock(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt
   visitIfExp  s    c         C   s3  |  j  | j  |  j   } xl | j d  D]] \ } } |  j  |  |  j d  |  j d  |  j d |  |  j d |  |  j   q* W| j r | j d \ } } |  j  |  |  j d |  n  t | j  d k r/|  j   } |  j d |  |  j |  |  j d  |  j d	  |  j |  n  d  S(
   Nit   DUP_TOPt	   ROT_THREEt
   COMPARE_OPR   i   R   t   ROT_TWOt   POP_TOP(   R   t   exprR   t   opsR   R   R   R   (   R;   R_   t   cleanupt   opR4   R   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitCompare   s(    	c   	      C   sF  |  j  |  |  j d d  g  } x t t t | j   | j  D] \ } } |  j |  \ } } d  } x< | j D]1 } | d  k r |  j	   } n  |  j | |  qv W| j
 d | | | f  qE W|  j | j  |  j d t | j  d  xJ | D]B \ } } } | r!|  j |  n  |  j d |  |  j |  q Wd  S(   Nt
   BUILD_LISTi    t   LIST_APPENDi   R   (   R   R   t   zipR   R   t   qualsR   R/   t   ifsR   t   insertR   R   R   (	   R;   R_   t   stackR   t   for_R   R   t   contt   if_(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitListComp8  s$    .c   	      C   sF  |  j  |  |  j d d  g  } x t t t | j   | j  D] \ } } |  j |  \ } } d  } x< | j D]1 } | d  k r |  j	   } n  |  j | |  qv W| j
 d | | | f  qE W|  j | j  |  j d t | j  d  xJ | D]B \ } } } | r!|  j |  n  |  j d |  |  j |  q Wd  S(   Nt	   BUILD_SETi    t   SET_ADDi   R   (   R   R   R  R   R   R  R   R/   R  R   R  R   R   R   (	   R;   R_   R	  R   R
  R   R   R  R  (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitSetCompP  s$    .c   	      C   sV  |  j  |  |  j d d  g  } x t t t | j   | j  D] \ } } |  j |  \ } } d  } x< | j D]1 } | d  k r |  j	   } n  |  j | |  qv W| j
 d | | | f  qE W|  j | j  |  j | j  |  j d t | j  d  xJ | D]B \ } } } | r1|  j |  n  |  j d |  |  j |  qWd  S(   Nt	   BUILD_MAPi    t   MAP_ADDi   R   (   R   R   R  R   R   R  R   R/   R  R   R  Rl   t   keyR   R   (	   R;   R_   R	  R   R
  R   R   R  R  (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitDictComph  s&    .c         C   s   |  j    } |  j    } |  j | j  |  j d  |  j |  |  j | d t |  j d |  |  j   |  j | j  | | f S(   NR   R   R   (   R   R   R   R   R   R   R   R   (   R;   R_   R   R   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitListCompFor  s    
c         C   sA   |  j  | d t |  j | j  |  j d |  |  j   d  S(   NR   R   (   R   R   R   R   R   R   (   R;   R_   t   branch(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitListCompIf  s    c         C   s   | j  j   } | ro x | D] } |  j d |  q W|  j d t |   |  j d |  |  j d |  n  |  j d |  |  j d |  d  S(   Nt   LOAD_CLOSURER   R   t   MAKE_CLOSUREt   MAKE_FUNCTION(   R   t   get_free_varsR   R   (   R;   R9   t   argst   freesRY   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR     s    c         C   s   t  | |  j |  j |  j    } t | j |  | j   |  j |  |  j | d  |  j	 | j j
 d j  |  j d  |  j d d  d  S(   Ni    R   R   i   (   t   GenExprCodeGeneratorR   R   R   R   R4   R   R   R   R   R  t   iterR   (   R;   R_   R9   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitGenExpr  s    
c   
      C   ss  |  j  |  g  } x t t t | j   | j  D] \ } } |  j |  \ } } } d  } x< | j D]1 }	 | d  k r |  j   } n  |  j |	 |  qi W| j	 d | | | | f  q5 W|  j | j
  |  j d  |  j d  xt | D]l \ } } } } | r|  j |  n  |  j d |  |  j |  |  j d  |  j j   |  j |  q W|  j d d   d  S(   Ni    t   YIELD_VALUER   R   R   R   (   R   R  R   R   R  R   R/   R  R   R  R   R   R   R   R{   R   (
   R;   R_   R	  R   R
  R   R   R   R  R  (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitGenExprInner  s,    . c         C   s   |  j    } |  j    } |  j    } |  j j t | f  |  j d |  | j rc |  j d  n |  j | j  |  j d  |  j	 |  |  j
 | d t |  j d |  |  j	   |  j | j  | | | f S(   NR   s   .0R   R   R   (   R   R{   R   R   R   t
   is_outmostR   R   R  R   R   R   R   (   R;   R_   R   R   R   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitGenExprFor  s    	
c         C   sA   |  j  | d t |  j | j  |  j d |  |  j   d  S(   NR   R   (   R   R   R   R   R   R   (   R;   R_   R  (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitGenExprIf  s    c         C   s   |  j    } |  j |  |  j   |  j | j  |  j d |  |  j   |  j d d  | j r |  j | j  |  j d d  n |  j d d  |  j |  d  S(   Nt   POP_JUMP_IF_TRUEt   LOAD_GLOBALR   t   RAISE_VARARGSi   i   (   R   R   R   R   R   R   t   fail(   R;   R_   R   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAssert  s    

	c         C   s   |  j  |  d } | j r9 |  j | j  | d } n  | j r_ |  j | j  | d } n  | j r |  j | j  | d } n  |  j d |  d  S(   Ni    i   R(  (   R   t   expr1R   t   expr2t   expr3R   (   R;   R_   t   n(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt
   visitRaise  s    			c         C   s9  |  j    } |  j    } |  j    } | j r< |  j    } n | } |  j |  |  j d |  |  j |  |  j j t | f  |  j | j	  |  j d  |  j j
   |  j d |  |  j |  t | j  d } xt t | j   D] } | j | \ } }	 } |  j |  | rt|  j d  |  j |  |  j d d  |  j    }
 |  j d |
  |  j   n  |  j d	  |	 r|  j |	  n |  j d	  |  j d	  |  j |  |  j d |  | r|  j |
  q |  j   q W|  j d
  | j r(|  j |  |  j | j  n  |  j |  d  S(   Nt   SETUP_EXCEPTR   R   i   R   R   s   exception matchR   R   R   (   R   R   R   R   R   R{   R   R   R   R   R   R   R   t   handlersR   (   R;   R_   R   R1  R   t   lElset   lastR   R   t   targett   next(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitTryExcept	  sR    		c         C   s   |  j    } |  j    } |  j |  |  j d |  |  j |  |  j j t | f  |  j | j  |  j d  |  j j	   |  j d d   |  j |  |  j j t | f  |  j | j  |  j d  |  j j	   d  S(   Nt   SETUP_FINALLYR   R   R   (   R   R   R   R   R{   R   R   R   R   R   R/   R   t   final(   R;   R_   R   R8  (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitTryFinally8  s    c         C   s  |  j    } |  j    } |  j d 7_ d |  j } |  j |  |  j | j  |  j d  |  j d d  |  j d  |  j d d  |  j d d	  | j d  k r |  j d
  n |  j d |  |  j d |  |  j	 |  |  j
 j t | f  | j d  k	 r?|  j d |  |  j d |  |  j | j  n  |  j | j  |  j d  |  j
 j   |  j d d   |  j	 |  |  j
 j t | f  |  j d  |  j d  |  j
 j   |  j d 8_ d  S(   Ni   s   _[%d]R   t	   LOAD_ATTRt   __exit__R   t	   __enter__R   i    R   R   R7  R   R   R   R   t   WITH_CLEANUPR   (   R   t   _CodeGenerator__with_countR   R   R   R   t   varsR/   R   R   R{   R   R   R   R   R   (   R;   R_   R   R8  t   valuevar(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt	   visitWithK  s>    c         C   s.   |  j  |  |  j | j  |  j d  d  S(   NR   (   R   R   R   R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitDiscardo  s    c         C   s   |  j  d | j  d  S(   NR   (   R   Rl   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt
   visitConstt  s    c         C   s'   |  j  d | j  |  j | j  d  S(   NR   (   R   RY   R   R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitKeywordw  s    c         C   s   d  S(   N(    (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRa   {  s    c         C   s!   |  j  |  |  j | j  d  S(   N(   R   R   RY   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt	   visitName  s    c         C   s   |  j  |  d  S(   N(   R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt	   visitPass  s    c         C   s   |  j  |  |  j j t  r% d n d } x | j D] \ } } t d k rp |  j d |  |  j d d   n  |  j d |  | j d  d } | r |  j	 |  |  j
 |  q5 |  j
 |  q5 Wd  S(   Ni    ii   R   t   IMPORT_NAMEt   .(   R   R   t	   checkFlagR   RV   t   VERSIONR   R/   t   splitt   _resolveDotsR   (   R;   R_   t   levelRY   Rd   R*   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRe     s    c         C   sT  |  j  |  | j } | d k r> |  j j t  r> d } n  t d   | j D  } t d k r |  j d |  |  j d |  n  |  j d | j	  x | j D] \ } } t d k r/| d k r d |  _
 |  j d  t | j  d k s t  d  S|  j d	 |  |  j |  |  j | p(|  q |  j d	 |  q W|  j d
  d  S(   Ni    ic         s   s   |  ] \ } } | Vq d  S(   N(    (   t   .0RY   Rd   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pys	   <genexpr>  s    i   R   RG  t   *t   IMPORT_STARt   IMPORT_FROMR   (   R   RM  R   RI  R   t   tupleRV   RJ  R   t   modnamet	   namespaceR   R   RL  R   (   R;   R_   RM  t   fromlistRY   Rd   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRf     s*    			c         C   sN   | j  d  } t |  d k r% d  Sx" | d D] } |  j d |  q0 Wd  S(   NRH  i   R:  (   RK  R   R   (   R;   RY   t   eltsR]   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRL    s
    c         C   s0   |  j  | j  |  j d |  j | j   d  S(   NR:  (   R   R   R   R   t   attrname(   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitGetattr  s    c         C   s   |  j  |  |  j | j  t | j  d } xh t t | j   D]Q } | j | } | | k  ru |  j d  n  t | t j	  rF |  j |  qF qF Wd  S(   Ni   R   (
   R   R   R   R   R   R   R   Rj   R   t   Node(   R;   R_   t   dupsR   R]   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAssign  s    c         C   sa   | j  d k r" |  j | j  n; | j  d k rQ |  j |  |  j | j  n d G| j  GHd  S(   Nt	   OP_ASSIGNt	   OP_DELETEt   oops(   R7   R   RY   R   R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRh     s    c         C   s   |  j  | j  | j d k r> |  j d |  j | j   n? | j d k rl |  j d |  j | j   n d G| j GH| GHd  S(   NR\  t
   STORE_ATTRR]  t   DELETE_ATTRs   warning: unexpected flags:(   R   R   R7   R   R   RW  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAssAttr  s    t   UNPACK_SEQUENCEc         C   sS   t  |  d k r. |  j | t | j   n  x | j D] } |  j |  q8 Wd  S(   NR]  (   t   findOpR   R   R   R   (   R;   R_   R  R   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   _visitAssSequence  s    i   c         C   s   |  j  | d  d  S(   Nt   UNPACK_TUPLE(   Rd  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAssTuple  s    c         C   s   |  j  | d  d  S(   Nt   UNPACK_LIST(   Rd  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAssList  s    c         C   sg   |  j  |  t | j  } |  j | d  |  j | j  |  j |  j | j  |  j | d  d  S(   Nt   loadt   store(   R   t   wrap_augR_   R   R   R   t   _augmented_opcodeR  (   R;   R_   t   aug_node(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAugAssign  s    t   INPLACE_ADDs   +=t   INPLACE_SUBTRACTs   -=t   INPLACE_MULTIPLYs   *=t   INPLACE_DIVIDEs   /=t   INPLACE_FLOOR_DIVIDEs   //=t   INPLACE_MODULOs   %=t   INPLACE_POWERs   **=t   INPLACE_RSHIFTs   >>=t   INPLACE_LSHIFTs   <<=t   INPLACE_ANDs   &=t   INPLACE_XORs   ^=t
   INPLACE_ORs   |=c         C   sB   | d k r |  j  | j  n | d k r> |  j | j  n  d  S(   NRi  Rj  (   R   RY   R   (   R;   R_   R6   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAugName  s    c         C   s   | d k rH |  j  | j  |  j d  |  j d |  j | j   n8 | d k r |  j d  |  j d |  j | j   n  d  S(   NRi  R   R:  Rj  R   R_  (   R   R   R   R   RW  (   R;   R_   R6   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAugGetattr	  s    c         C   s   | d k r |  j  | d  n | d k r d } | j rG | d B} n  | j r] | d B} n  | d k ry |  j d  n) | d k r |  j d  n |  j d	  |  j d
 |  n  d  S(   NRi  i   Rj  i    i   R   i   t   ROT_FOURR   s   STORE_SLICE+%d(   t
   visitSlicet   lowert   upperR   (   R;   R_   R6   t   slice(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAugSlice  s    		c         C   sL   | d k r |  j  | d  n) | d k rH |  j d  |  j d  n  d  S(   NRi  i   Rj  R   t   STORE_SUBSCR(   t   visitSubscriptR   (   R;   R_   R6   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAugSubscript#  s
    c         C   s   |  j  | j  | j d  k r2 |  j d d   n |  j  | j  | j d  k ra |  j d  n |  j  | j  |  j d  d  S(   NR   R   t	   EXEC_STMT(   R   R   Rz   R/   R   RW   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt	   visitExec*  s    c         C   s  d } d } |  j  |  |  j | j  xG | j D]< } |  j |  t | t j  re | d } q3 | d } q3 W| j d  k	 r |  j | j  n  | j	 d  k	 r |  j | j	  n  | j d  k	 } | j	 d  k	 } t
 | | f } |  j | | d >| B d  S(   Ni    i   i   (   R   R   R_   R  Rj   R   t   Keywordt	   star_argsR/   t
   dstar_argst   callfunc_opcode_infoR   (   R;   R_   t   post   kwt   argt	   have_start
   have_dstart   opcode(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitCallFunc6  s"    c         C   s   |  j  |  | j r) |  j | j  n  xj | j D]_ } | j rR |  j d  n  |  j |  | j r |  j d  |  j d  q3 |  j d  q3 W| j r | r |  j d  n  d  S(   NR   R   t   PRINT_ITEM_TOt
   PRINT_ITEMR   (   R   t   destR   R   R   (   R;   R_   t   newlineR   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt
   visitPrintJ  s    			c         C   s=   |  j  | d d | j r, |  j d  n |  j d  d  S(   NR  i   t   PRINT_NEWLINE_TOt   PRINT_NEWLINE(   R  R  R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitPrintnlZ  s    	c         C   s.   |  j  |  |  j | j  |  j d  d  S(   NR   (   R   R   Rl   R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitReturna  s    c         C   s.   |  j  |  |  j | j  |  j d  d  S(   NR!  (   R   R   Rl   R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt
   visitYieldf  s    c         C   s2  |  j  | j  d } | j r< |  j  | j  | d B} n  | j rb |  j  | j  | d B} n  | r | d k r |  j d  q | d k r |  j d d  q |  j d d  n  | j d k r |  j d |  nU | j d	 k r |  j d
 |  n2 | j d k r|  j d |  n d G| j GH  d  S(   Ni    i   i   R   i   t   DUP_TOPXt   OP_APPLYs   SLICE+%dR\  s   STORE_SLICE+%dR]  s   DELETE_SLICE+%ds   weird slice(   R   R   R  R  R   R7   (   R;   R_   t   aug_flagR  (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR~  m  s,    		c         C   s   |  j  | j  x | j D] } |  j  |  q Wt | j  d k rb |  j d t | j   n  | r{ |  j d d  n  | j d k r |  j d  n> | j d k r |  j d  n | j d	 k r |  j d
  n  d  S(   Ni   R   R  i   R  t   BINARY_SUBSCRR\  R  R]  t   DELETE_SUBSCR(   R   R   t   subsR   R   R7   (   R;   R_   R  t   sub(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR    s    c         C   s1   |  j  | j  |  j  | j  |  j |  d  S(   N(   R   t   leftt   rightR   (   R;   R_   R  (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   binaryOp  s    c         C   s   |  j  | d  S(   Nt
   BINARY_ADD(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitAdd  s    c         C   s   |  j  | d  S(   Nt   BINARY_SUBTRACT(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitSub  s    c         C   s   |  j  | d  S(   Nt   BINARY_MULTIPLY(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitMul  s    c         C   s   |  j  | |  j  S(   N(   R  R~   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitDiv  s    c         C   s   |  j  | d  S(   Nt   BINARY_FLOOR_DIVIDE(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitFloorDiv  s    c         C   s   |  j  | d  S(   Nt   BINARY_MODULO(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitMod  s    c         C   s   |  j  | d  S(   Nt   BINARY_POWER(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt
   visitPower  s    c         C   s   |  j  | d  S(   Nt   BINARY_LSHIFT(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitLeftShift  s    c         C   s   |  j  | d  S(   Nt   BINARY_RSHIFT(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitRightShift  s    c         C   s!   |  j  | j  |  j |  d  S(   N(   R   R   R   (   R;   R_   R  (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   unaryOp  s    c         C   s   |  j  | d  S(   Nt   UNARY_INVERT(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitInvert  s    c         C   s   |  j  | d  S(   Nt   UNARY_NEGATIVE(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitUnarySub  s    c         C   s   |  j  | d  S(   Nt   UNARY_POSITIVE(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitUnaryAdd  s    c         C   s   |  j  | d  S(   NR  (   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitUnaryInvert  s    c         C   s   |  j  | d  S(   Nt	   UNARY_NOT(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitNot  s    c         C   s   |  j  | d  S(   Nt   UNARY_CONVERT(   R  (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitBackquote  s    c         C   sD   |  j  | d  x, | d D]  } |  j  |  |  j |  q Wd  S(   Ni    i   (   R   R   (   R;   R   R  R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   bitOp  s    c         C   s   |  j  | j d  S(   Nt
   BINARY_AND(   R  R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitBitand  s    c         C   s   |  j  | j d  S(   Nt	   BINARY_OR(   R  R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt
   visitBitor  s    c         C   s   |  j  | j d  S(   Nt
   BINARY_XOR(   R  R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitBitxor  s    c         C   s   |  j  d t  d  S(   NR   (   R   t   Ellipsis(   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitEllipsis  s    c         C   sK   |  j  |  x | j D] } |  j |  q W|  j d t | j   d  S(   NR   (   R   R   R   R   R   (   R;   R_   R]   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt
   visitTuple  s    c         C   sK   |  j  |  x | j D] } |  j |  q W|  j d t | j   d  S(   NR  (   R   R   R   R   R   (   R;   R_   R]   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt	   visitList  s    c         C   sK   |  j  |  x | j D] } |  j |  q W|  j d t | j   d  S(   NR  (   R   R   R   R   R   (   R;   R_   R]   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitSet  s    c         C   s>   x | j  D] } |  j |  q
 W|  j d t | j    d  S(   Nt   BUILD_SLICE(   R   R   R   R   (   R;   R_   R   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   visitSliceobj  s    c         C   s|   |  j  |  |  j d d  xX | j D]M \ } } |  j d  |  j |  |  j |  |  j d  |  j d  q' Wd  S(   NR  i    R   R   R  (   R   R   t   itemsR   (   R;   R_   t   kt   v(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR`     s    N(u   RB   RC   Ri   R   R/   Ru   R   R<   Rv   Rx   R}   RA   R   R   R   R   R   R   R   R   R   R   R   RT   R   R   R   R   R   Rb   Rc   R   Rg   R   R   R   R   R   R   R   R   R   R  R  R  R  R  R  R   R   R"  R$  R%  R*  R/  R6  R9  R>  RA  RB  RC  RD  Ra   RE  RF  Re   Rf   RL  RX  R[  Rh   Ra  Rd  RJ  Rf  Rh  Rn  Rl  R{  R|  R  R  R  R  R  R  R  R  R~  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R`   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRn      s   																																											/		$														
				
																																				t   NestedScopeMixinc           B   s   e  Z d  Z d   Z RS(   s>   Defines initClass() for nested scoping (Python 2.2-compatible)c         C   s(   t  |  j _ t |  j _ t |  j _ d  S(   N(   RT   Rw   R   t   FunctionCodeGeneratorR   t   ClassCodeGeneratorR   (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRv   
  s    (   RB   RC   Ri   Rv   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR    s   RF   c           B   s)   e  Z e j Z d Z d    Z d   Z RS(   c         C   sE   t  j d | j  |  _ t j |  |  _ |  j   t | |   d  S(   Ns   <module>(	   R   t   PyFlowGraphR&   R   R   t   find_futuresR   t    _ModuleCodeGenerator__super_initR   (   R;   R?   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR<     s    
c         C   s   |  S(   N(    (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR     s    N(   RB   RC   Rn   R<   R  R/   R   R   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRF     s   		RD   c           B   s/   e  Z e j Z d Z d Z d    Z d   Z RS(   c         C   s3   t  j d | j  |  _ |  j   t | |   d  S(   Ns   <expression>(   R   R  R&   R   t$   _ExpressionCodeGenerator__super_initR   (   R;   R?   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR<   #  s    
c         C   s   |  S(   N(    (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR   (  s    N(    (	   RB   RC   Rn   R<   R  R/   R   R   R   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRD     s
   		RE   c           B   s8   e  Z e j Z d Z d Z d    Z d   Z d   Z	 RS(   c         C   sM   t  j d | j  |  _ |  j   |  j |  t | |   |  j d  d  S(   Ns   <interactive>R   (   R   R  R&   R   t%   _InteractiveCodeGenerator__super_initR   R   R   (   R;   R?   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR<   2  s
    
c         C   s   |  S(   N(    (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR   9  s    c         C   s!   |  j  | j  |  j d  d  S(   Nt
   PRINT_EXPR(   R   R   R   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRB  <  s    N(    (
   RB   RC   Rn   R<   R  R/   R   R   R   RB  (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRE   +  s   			t   AbstractFunctionCodec           B   sG   e  Z d  Z d Z d   Z d   Z d   Z d   Z d   Z e Z	 RS(   i   i    c         C   sL  | |  _  | |  _ | r> t } d | j } | j d | _ n	 | j } t | j  \ } }	 t j | | j	 | d d |  _
 | |  _ |  j   | r | j r |  j | j  n  t | j |  j |  d d }
 |  j j |
 j    | j r|  j
 j t  n  | j r"|  j
 j t  n  |  j |  |	 rH|  j | j  n  d  S(   Ns   <lambda.%d>i   R   R   i    (   R   t   moduleR  t   lambdaCountRY   t   generateArgListt   argnamesR   R  R&   R   R   t
   super_initR   R   R   R4   R   Rz   R   R^   t   varargsR   R   t   kwargsR   R   t   generateArgUnpack(   R;   t   funcR   R   R   R*   t   klassRY   R  t   hasTupleArgR   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR<   F  s.    				
!		c         C   s   |  j  S(   N(   R  (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR   c  s    c         C   s:   |  j  j   |  j s) |  j d d   n  |  j d  d  S(   NR   R   (   R   t   startExitBlockR   R   R/   (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR   f  s    	c         C   sb   x[ t  t |   D]G } | | } t | t  r |  j d d | d  |  j |  q q Wd  S(   Nt	   LOAD_FASTs   .%di   (   R   R   Rj   RR  R   t   unpackSequence(   R;   R  R   R  (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR  l  s
    
c         C   s   t  d k r% |  j d t |   n |  j d t |   x= | D]5 } t | t  rg |  j |  qB |  j d |  qB Wd  S(   Ni   Rb  Re  R   (   RJ  R   R   Rj   RR  R  R   (   R;   t   tupR]   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR  s  s    (
   RB   RC   R   R  R<   R   R   R  R  t   unpackTuple(    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR  B  s   					R  c           B   s)   e  Z e j Z d Z e j Z d    Z RS(   c         C   s   | |  _  | | |  _ |  j | | | | |  |  j j |  j j    |  j j |  j j    |  j j d  k	 r |  j j
 t  n  d  S(   N(   R   R   t"   _FunctionCodeGenerator__super_initR   t   setFreeVarsR  t   setCellVarst   get_cell_varst	   generatorR/   R   R   (   R;   R  R   R   R   R*   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR<     s    	N(	   RB   RC   Rn   R<   R  R/   R   R  R  (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR    s   		R  c           B   s)   e  Z e j Z d Z e j Z d    Z RS(   c         C   su   | |  _  | | |  _ |  j | | d | |  |  j j |  j j    |  j j |  j j    |  j j t	  d  S(   Ni   (
   R   R   t!   _GenExprCodeGenerator__super_initR   R  R  R  R  R   R   (   R;   t   gexpR   R   R*   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR<     s    	N(	   RB   RC   Rn   R<   R  R/   R   R  R  (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR    s   		t   AbstractClassCodec           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s   | j  |  _ | |  _ t j | j  | j d d d d |  _ |  j   t | j	 |  j
   d d } |  j j | j    |  j j t  | j r |  j | j  n  d  S(   NR   i    R  i   R   (   RY   R   R  R   R  R&   R   R  R   R4   R   Rz   R   R^   R   R   R   R   (   R;   R  R   R  R   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR<     s    	
	c         C   s   |  j  S(   N(   R  (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR     s    c         C   s+   |  j  j   |  j d  |  j d  d  S(   Nt   LOAD_LOCALSR   (   R   R  R   (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR     s    (   RB   RC   R<   R   R   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR    s   		R  c           B   s)   e  Z e j Z d Z e j Z d    Z RS(   c         C   s   | |  _  | | |  _ |  j | | |  |  j j |  j j    |  j j |  j j    |  j |  |  j	 d d  |  j
 d  | j r |  j	 d | j  |  j
 d  n  d  S(   NR'  RB   RC   R   Ri   (   R   R   t   _ClassCodeGenerator__super_initR   R  R  R  R  R   R   R   R   (   R;   R  R   R  (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR<     s    		N(	   RB   RC   Rn   R<   R  R/   R   R  R  (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR    s   		c         C   s   g  } g  } d } x t  t |    D] } |  | } t | t  rT | j |  q% t | t  r | j t | d |   | j t j	 |   | d } q% t
 d |  q% W| | | f S(   s&   Generate an arg list marking TupleArgsi    i   i   s   unexpect argument type:(   R   R   Rj   t   strt   appendRR  R   t   extendR   t   flattenR3   (   t   arglistR  t   extrat   countR   R]   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR    s    
c         C   s#   t    } t |  | d d | j S(   s5   Find the op (DELETE, LOAD, STORE) in an AssTuple treeR   i    (   t   OpFinderR   R  (   R_   R  (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRc    s    	R   c           B   s&   e  Z d    Z d   Z e Z e Z RS(   c         C   s   d  |  _ d  S(   N(   R/   R  (   R;   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR<     s    c         C   s@   |  j  d  k r | j |  _  n |  j  | j k r< t d  n  d  S(   Ns   mixed ops in stmt(   R  R/   R7   R3   (   R;   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRh     s    (   RB   RC   R<   Rh   Ra  R  (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR     s   		t	   Delegatorc           B   s    e  Z d  Z d   Z d   Z RS(   s  Base class to support delegation for augmented assignment nodes

    To generator code for augmented assignments, we use the following
    wrapper classes.  In visitAugAssign, the left-hand expression node
    is visited twice.  The first time the visit uses the normal method
    for that node .  The second time the visit uses a different method
    that generates the appropriate code to perform the assignment.
    These delegator classes wrap the original AST nodes in order to
    support the variant visit methods.
    c         C   s   | |  _  d  S(   N(   t   obj(   R;   R  (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR<     s    c         C   s   t  |  j |  S(   N(   R   R  (   R;   t   attr(    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   __getattr__  s    (   RB   RC   Ri   R<   R  (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR    s   
	t
   AugGetattrc           B   s   e  Z RS(    (   RB   RC   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR    s   t   AugNamec           B   s   e  Z RS(    (   RB   RC   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR    s   t   AugSlicec           B   s   e  Z RS(    (   RB   RC   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR    s   t   AugSubscriptc           B   s   e  Z RS(    (   RB   RC   (    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyR    s   c         C   s   t  |  j |   S(   N(   t   wrapperRw   (   R_   (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyRk    s    t   __main__(M   RR   RK   RJ   RN   t   syst	   cStringIOR    t   compilerR   R   R   R   R   R   R   R   t   compiler.constsR	   R
   R   R   R   R   R   R   R   R   R   R   R   R   t   compiler.pyassemR   t   version_infoRJ  t   AttributeErrorR  R   R   R   R   R+   R/   R#   R:   R2   R1   R"   RT   Rm   Rn   R  RF   RD   RE   R  R  R  R  R  R  Rc  R   R  R  R  R  R  t   Getattrt   Namet   Slicet	   SubscriptR	  Rk  RB   t   argvt   file(    (    (    s(   /usr/lib/python2.7/compiler/pycodegen.pyt   <module>   s   ""(@
		+	    U>				


	