-í
ë¶<c       s1  d  Z  d k l Z d k l Z l Z l Z l Z l Z d k	 l
 Z
 d k Z d k Z d Z d f  d „  ƒ  YZ d e f d	 „  ƒ  YZ d
 e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d f  d „  ƒ  YZ d „  Z d „  Z e d j o3d k Z d k l Z l Z d k Z d „  Z xþe i d D]ïZ e GHe e ƒ Z e i ƒ  Z  e i! ƒ  e i e  e d ƒ Z" e e" ƒ Z# e e ƒ Z$ e ƒ  Z% e e$ e% ƒ e% i& e$ i ƒ  Z' e e# e' ƒ o1 Hd Ge GHe e# ƒ GHe e' ƒ GHe i( d ƒ n h  Z) e) i* e% i& ƒ e) e$ =e) i+ ƒ  Z& [) xû e" i, ƒ  D]í Z% e% i- ƒ  oÚ g  i. Z/ e& D]* Z0 e0 i1 e% i2 ƒ  j o e/ e0 ƒ n qU[/ Z3 e4 e3 ƒ d j o d Ge% i2 ƒ  GHnp e e e% i5 ƒ  ƒ e3 d i ƒ  ƒ oH e% i2 ƒ  GHe e e% i5 ƒ  ƒ ƒ GHe e3 d i ƒ  ƒ GHe i( d ƒ n n q4Wq6Wn d S(   s   Module symbol-table generator(   s   ast(   s   SC_LOCALs	   SC_GLOBALs   SC_FREEs   SC_CELLs
   SC_UNKNOWN(   s   mangleNi   s   Scopec      s¤   t  Z e 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 RS(   Nc    sÁ   | |  _  | |  _ h  |  _ h  |  _ h  |  _ h  |  _ h  |  _ h  |  _ g  |  _	 t
 |  _ t
 |  _ t
 |  _ | t
 j	 oD x= t t | ƒ ƒ D]) } | | d j o | | |  _ Pn qŒ Wn d  S(   Ns   _(   s   names   selfs   modules   defss   usess   globalss   paramss   freess   cellss   childrens   Nones   nesteds	   generators   klasss   ranges   lens   i(   s   selfs   names   modules   klasss   i(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   __init__ s$    												 c    s   d |  i i |  i f Sd  S(   Ns   <%s: %s>(   s   selfs	   __class__s   __name__s   name(   s   self(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   __repr__$ s    c    s,   |  i t j o | Sn t | |  i ƒ Sd  S(   N(   s   selfs   klasss   Nones   names   mangle(   s   selfs   name(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   mangle' s    c    s   d |  i |  i | ƒ <d  S(   Ni   (   s   selfs   defss   mangles   name(   s   selfs   name(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   add_def, s    c    s   d |  i |  i | ƒ <d  S(   Ni   (   s   selfs   usess   mangles   name(   s   selfs   name(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   add_use/ s    c    s‡   |  i | ƒ } |  i i | ƒ p |  i i | ƒ o n |  i i | ƒ o t d | |  i f ‚ n d |  i | <|  i	 i
 | ƒ d  S(   Ns    %s in %s is global and parameteri   (   s   selfs   mangles   names   usess   has_keys   defss   paramss   SyntaxErrors   globalss   modules   add_def(   s   selfs   name(    (    s&   /usr/lib/python2.2/compiler/symbols.pys
   add_global2 s    &c    s-   |  i | ƒ } d |  i | <d |  i | <d  S(   Ni   (   s   selfs   mangles   names   defss   params(   s   selfs   name(    (    s&   /usr/lib/python2.2/compiler/symbols.pys	   add_param< s    c    sD   h  } | i |  i ƒ | i |  i ƒ | i |  i ƒ | i ƒ  Sd  S(   N(   s   ds   updates   selfs   defss   usess   globalss   keys(   s   selfs   d(    (    s&   /usr/lib/python2.2/compiler/symbols.pys	   get_namesA s
    c    s   |  i i | ƒ d  S(   N(   s   selfs   childrens   appends   child(   s   selfs   child(    (    s&   /usr/lib/python2.2/compiler/symbols.pys	   add_childH s    c    s   |  i Sd  S(   N(   s   selfs   children(   s   self(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   get_childrenK s    c  	  s™   t  i |  i I|  i o d p d IJt  i d I|  i IJt  i d I|  i IJt  i d I|  i IJt  i d I|  i IJt  i d I|  i	 IJd  S(   Ns   nesteds    s
   	globals: s   	cells: s   	defs: s   	uses: s   	frees:(
   s   syss   stderrs   selfs   names   nesteds   globalss   cellss   defss   usess   frees(   s   self(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   DEBUGN s    'c    s£   |  i i | ƒ o t Sn |  i i | ƒ o t Sn |  i i | ƒ o t Sn |  i	 o# |  i
 i | ƒ p |  i i | ƒ o t Sn |  i	 o t Sn t Sd S(   sb   Return scope of name.

        The scope of a name could be LOCAL, GLOBAL, FREE, or CELL.
        N(   s   selfs   globalss   has_keys   names	   SC_GLOBALs   cellss   SC_CELLs   defss   SC_LOCALs   nesteds   freess   usess   SC_FREEs
   SC_UNKNOWN(   s   selfs   name(    (    s&   /usr/lib/python2.2/compiler/symbols.pys
   check_nameV s     0
c    s†   |  i o f  Sn h  } | i |  i ƒ xL |  i i ƒ  D]; } |  i i	 | ƒ p |  i
 i	 | ƒ o d | | <n q9 W| i ƒ  Sd  S(   Ni   (   s   selfs   nesteds   frees   updates   freess   usess   keyss   names   defss   has_keys   globals(   s   selfs   names   free(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   get_free_varsi s     'c    sQ   xJ |  i D]? } | i ƒ  } |  i | ƒ } x | D] } | i | ƒ q2 Wq
 Wd  S(   N(	   s   selfs   childrens   childs   get_free_varss   freess	   add_freess   globalss   names   force_global(   s   selfs   freess   globalss   names   child(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   handle_childrent s    
  c    sm   d |  i | <|  i i | ƒ o |  i | =n x8 |  i D]- } | i | ƒ t j o | i	 | ƒ n q8 Wd S(   sÞ  Force name to be global in scope.

        Some child of the current node had a free reference to name.
        When the child was processed, it was labelled a free
        variable.  Now that all its enclosing scope have been
        processed, the name is known to be a global or builtin.  So
        walk back down the child chain and set the name to be global
        rather than free.

        Be careful to stop if a child does not think the name is
        free.
        i   N(
   s   selfs   globalss   names   freess   has_keys   childrens   childs
   check_names   SC_FREEs   force_global(   s   selfs   names   child(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   force_global{ s     
 c    s  g  } x| D]} |  i | ƒ } |  i o© | t j p | t j p t	 |  t
 ƒ o d |  i | <nk | t j o | i | ƒ nM t	 |  t ƒ o
 | t j o d |  i | <n | t j o | i | ƒ n n= | t j o d |  i | <n | t j o | i | ƒ n q W| Sd S(   sþ   Process list of free vars from nested scope.

        Returns a list of names that are either 1) declared global in the
        parent or 2) undefined in a top-level parent.  In either case,
        the nested scope should treat them as globals.
        i   N(   s   child_globalss   namess   names   selfs
   check_names   scs   nesteds
   SC_UNKNOWNs   SC_FREEs
   isinstances
   ClassScopes   freess	   SC_GLOBALs   appends   FunctionScopes   SC_LOCALs   cellss   SC_CELL(   s   selfs   namess   names   scs   child_globals(    (    s&   /usr/lib/python2.2/compiler/symbols.pys	   add_frees s&      
*c    s   |  i i ƒ  Sd  S(   N(   s   selfs   cellss   keys(   s   self(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   get_cell_varsª s    (   s   __name__s
   __module__s   Nones   __init__s   __repr__s   mangles   add_defs   add_uses
   add_globals	   add_params	   get_namess	   add_childs   get_childrens   DEBUGs
   check_names   get_free_varss   handle_childrens   force_globals	   add_freess   get_cell_vars(    (    (    s&   /usr/lib/python2.2/compiler/symbols.pys   Scope s"   					
										s   ModuleScopec      s   t  Z e i Z d „  Z RS(   Nc    s   |  i d |  ƒ d  S(   Ns   global(   s   selfs   _ModuleScope__super_init(   s   self(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   __init__° s    (   s   __name__s
   __module__s   Scopes   __init__s   _ModuleScope__super_init(    (    (    s&   /usr/lib/python2.2/compiler/symbols.pys   ModuleScope­ s   	s   FunctionScopec      s   t  Z RS(   N(   s   __name__s
   __module__(    (    (    s&   /usr/lib/python2.2/compiler/symbols.pys   FunctionScope³ s   s   LambdaScopec      s#   t  Z e i Z d Z e d „ Z RS(   Ni   c    s3   |  i } |  i d 7_ |  i d | | | ƒ d  S(   Ni   s	   lambda.%d(   s   selfs   _LambdaScope__counters   is   _LambdaScope__super_inits   modules   klass(   s   selfs   modules   klasss   i(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   __init__» s    	(   s   __name__s
   __module__s   Scopes   __init__s   _LambdaScope__super_inits   _LambdaScope__counters   None(    (    (    s&   /usr/lib/python2.2/compiler/symbols.pys   LambdaScope¶ s   	s
   ClassScopec      s   t  Z e i Z d „  Z RS(   Nc    s   |  i | | | ƒ d  S(   N(   s   selfs   _ClassScope__super_inits   names   module(   s   selfs   names   module(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   __init__Ã s    (   s   __name__s
   __module__s   Scopes   __init__s   _ClassScope__super_init(    (    (    s&   /usr/lib/python2.2/compiler/symbols.pys
   ClassScopeÀ s   	s   SymbolVisitorc      sé   t  Z d „  Z d „  Z e 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 d „ Z d d „ Z d d „ Z d d „ Z d „  Z e i e i e i f Z d „  Z d „  Z RS(   Nc    s   h  |  _ t |  _ d  S(   N(   s   selfs   scopess   Nones   klass(   s   self(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   __init__Ç s    	c    s2   t  ƒ  } |  _ |  i | <|  i | i | ƒ d  S(   N(   s   ModuleScopes   scopes   selfs   modules   scopess   nodes   visit(   s   selfs   nodes   scope(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   visitModuleÍ s    c    s½   | i | i ƒ x! | i D] } |  i | | ƒ q Wt | i |  i	 |  i
 ƒ } | i p t | t ƒ o d | _ n | |  i | <|  i | | i ƒ |  i | i | ƒ |  i | | ƒ d  S(   Ni   (   s   parents   add_defs   nodes   names   defaultss   ns   selfs   visits   FunctionScopes   modules   klasss   scopes   nesteds
   isinstances   scopess   _do_argss   argnamess   codes   handle_free_vars(   s   selfs   nodes   parents   scopes   n(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   visitFunctionÓ s    
 c    s§   x! | i D] } |  i | | ƒ q
 Wt |  i |  i ƒ } | i
 p t | t ƒ o d | _
 n | |  i | <|  i | | i ƒ |  i | i | ƒ |  i | | ƒ d  S(   Ni   (   s   nodes   defaultss   ns   selfs   visits   parents   LambdaScopes   modules   klasss   scopes   nesteds
   isinstances   FunctionScopes   scopess   _do_argss   argnamess   codes   handle_free_vars(   s   selfs   nodes   parents   scopes   n(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   visitLambdaß s    
 c    sL   xE | D]= } t | ƒ t i j o |  i | | ƒ n | i | ƒ q Wd  S(   N(	   s   argss   names   types   typess	   TupleTypes   selfs   _do_argss   scopes	   add_param(   s   selfs   scopes   argss   name(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   _do_argsê s
     c    s   | i | ƒ | i ƒ  d  S(   N(   s   parents	   add_childs   scopes   handle_children(   s   selfs   scopes   parent(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   handle_free_varsñ s    c    sÂ   | i | i ƒ x! | i D] } |  i | | ƒ q Wt | i |  i	 ƒ } | i p t | t ƒ o d | _ n | |  i | <|  i } | i |  _ |  i | i | ƒ | |  _ |  i | | ƒ d  S(   Ni   (   s   parents   add_defs   nodes   names   basess   ns   selfs   visits
   ClassScopes   modules   scopes   nesteds
   isinstances   FunctionScopes   scopess   klasss   prevs   codes   handle_free_vars(   s   selfs   nodes   parents   prevs   scopes   n(    (    s&   /usr/lib/python2.2/compiler/symbols.pys
   visitClassõ s    
 		i    c    s/   | o | i | i ƒ n | i | i ƒ d  S(   N(   s   assigns   scopes   add_defs   nodes   names   add_use(   s   selfs   nodes   scopes   assign(    (    s&   /usr/lib/python2.2/compiler/symbols.pys	   visitName	s    c    sa   |  i | i | d ƒ |  i | i | ƒ |  i | i | ƒ | i o |  i | i | ƒ n d  S(   Ni   (   s   selfs   visits   nodes   assigns   scopes   lists   bodys   else_(   s   selfs   nodes   scope(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   visitFors
    
c    sF   x? | i D]4 \ } } | d j o q
 n | i | p | ƒ q
 Wd  S(   Ns   *(   s   nodes   namess   names   asnames   scopes   add_def(   s   selfs   nodes   scopes   names   asname(    (    s&   /usr/lib/python2.2/compiler/symbols.pys	   visitFroms
    
 c    s\   xU | i D]J \ } } | i d ƒ } | d j o | |  } n | i | p | ƒ q
 Wd  S(   Ns   .iÿÿÿÿ(   s   nodes   namess   names   asnames   finds   is   scopes   add_def(   s   selfs   nodes   scopes   names   asnames   i(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   visitImports    
 c    s%   x | i D] } | i | ƒ q
 Wd  S(   N(   s   nodes   namess   names   scopes
   add_global(   s   selfs   nodes   scopes   name(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   visitGlobal%s    
 c    s>   x$ | i D] } |  i | | d ƒ q
 W|  i | i | ƒ d S(   s.  Propagate assignment flag down to child nodes.

        The Assign node doesn't itself contains the variables being
        assigned to.  Instead, the children in node.nodes are visited
        with the assign flag set to true.  When the names occur in
        those nodes, they are marked as defs.

        Some names that occur in an assignment target are not bound by
        the assignment, e.g. a name occurring inside a slice.  The
        visitor handles these nodes specially; they do not propagate
        the assign flag to their children.
        i   N(   s   nodes   nodess   ns   selfs   visits   scopes   expr(   s   selfs   nodes   scopes   n(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   visitAssign)s
     
 i   c    s   | i | i ƒ d  S(   N(   s   scopes   add_defs   nodes   name(   s   selfs   nodes   scopes   assign(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   visitAssName:s    c    s   |  i | i | d ƒ d  S(   Ni    (   s   selfs   visits   nodes   exprs   scope(   s   selfs   nodes   scopes   assign(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   visitAssAttr=s    c    sA   |  i | i | d ƒ x$ | i D] } |  i | | d ƒ q  Wd  S(   Ni    (   s   selfs   visits   nodes   exprs   scopes   subss   n(   s   selfs   nodes   scopes   assigns   n(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   visitSubscript@s    
 c    sb   |  i | i | d ƒ | i o |  i | i | d ƒ n | i o |  i | i | d ƒ n d  S(   Ni    (   s   selfs   visits   nodes   exprs   scopes   lowers   upper(   s   selfs   nodes   scopes   assign(    (    s&   /usr/lib/python2.2/compiler/symbols.pys
   visitSliceEs
    

c    sZ   |  i | i | ƒ t | i t i ƒ o |  i | i | d ƒ n |  i | i | ƒ d  S(   Ni   (   s   selfs   visits   nodes   scopes
   isinstances   asts   Names   expr(   s   selfs   nodes   scope(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   visitAugAssignLs    c    s¥   x} | i D]r \ } } t | t i ƒ o3 t | i ƒ |  i
 j o | i o q
 n n n |  i | | ƒ |  i | | ƒ q
 W| i o |  i | i | ƒ n d  S(   N(   s   nodes   testss   tests   bodys
   isinstances   asts   Consts   types   values   selfs   _const_typess   visits   scopes   else_(   s   selfs   nodes   scopes   bodys   test(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   visitIfXs    
 
c    s    d | _ |  i | i | ƒ d  S(   Ni   (   s   scopes	   generators   selfs   visits   nodes   value(   s   selfs   nodes   scope(    (    s&   /usr/lib/python2.2/compiler/symbols.pys
   visitYieldes    	(   s   __name__s
   __module__s   __init__s   visitModules   visitExpressions   visitFunctions   visitLambdas   _do_argss   handle_free_varss
   visitClasss	   visitNames   visitFors	   visitFroms   visitImports   visitGlobals   visitAssigns   visitAssNames   visitAssAttrs   visitSubscripts
   visitSlices   visitAugAssigns   typess
   StringTypes   IntTypes	   FloatTypes   _const_typess   visitIfs
   visitYield(    (    (    s&   /usr/lib/python2.2/compiler/symbols.pys   SymbolVisitorÆ s,   													
	c    s   |  }  |  i ƒ  |  Sd  S(   N(   s   ls   sort(   s   l(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   sortis    
c    s   t  |  ƒ t  | ƒ j Sd  S(   N(   s   sorts   l1s   l2(   s   l1s   l2(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   list_eqns    s   __main__(   s	   parseFiles   walkc    s{   g  i  } g  i  } |  i ƒ  D] } | | i ƒ  ƒ q ~ D]5 } | i d ƒ p | i d ƒ o | | ƒ n q; ~ Sd  S(   Ns   _[s   .(   s   appends   _[1]s   _[2]s   symss   get_symbolss   ss   get_names
   startswith(   s   symss   _[1]s   ss   _[2](    (    s&   /usr/lib/python2.2/compiler/symbols.pys	   get_namesvs      i   s   execs   oopsiÿÿÿÿs   skippingi    (6   s   __doc__s   compilers   asts   compiler.constss   SC_LOCALs	   SC_GLOBALs   SC_FREEs   SC_CELLs
   SC_UNKNOWNs   compiler.miscs   mangles   typess   syss
   MANGLE_LENs   Scopes   ModuleScopes   FunctionScopes   LambdaScopes
   ClassScopes   SymbolVisitors   sorts   list_eqs   __name__s	   parseFiles   walks   symtables	   get_namess   argvs   files   opens   fs   reads   bufs   closes   symss	   mod_namess   trees   ss   scopess   names2s   exits   ds   updates   valuess   get_symbolss   is_namespaces   appends   _[1]s   scs   names   get_names   ls   lens   get_namespace(#   s   LambdaScopes   sorts   SC_FREEs   list_eqs   asts	   get_namess
   MANGLE_LENs   walks   syss	   SC_GLOBALs	   parseFiles   files   SymbolVisitors   typess   symtables
   ClassScopes   ls   bufs   symss
   SC_UNKNOWNs   Scopes   ds   fs   FunctionScopes   trees   ss   ModuleScopes   _[1]s   SC_CELLs   SC_LOCALs   names2s	   mod_namess   scs   scopess   mangle(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   ? sp   %		 
£					 
		  -