-í
ë¶<c       sß    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 id „  Z nd „  Z qe d j o®rd k Z sd k l Z l Z td k Z vd „  Z zxje i d Dz]XZ {e GH|e 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' ƒ o@ ‰HŠd Ge GH‹e e# ƒ GHŒe e' ƒ GHe 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 qå[/ Z3 ™e4 e3 ƒ d j o šd Ge% i2 ƒ  GHn‚ œe e e% i5 ƒ  ƒ e3 d i ƒ  ƒ oT že% i2 ƒ  GHŸe e e% i5 ƒ  ƒ ƒ GH e e3 d i ƒ  ƒ GH¡e i( d ƒ n n q»Wqx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 2 d „  Z < d „  Z	 A d „  Z
 H d	 „  Z K d
 „  Z N d „  Z V d „  Z i d „  Z t d „  Z { d „  Z  d „  Z ª d „  Z RS(   Nc    sú     | |  _   | |  _  h  |  _  h  |  _  h  |  _  h  |  _  h  |  _  h  |  _  g  |  _	  t
 |  _  t
 |  _  t
 |  _  | t
 j	 oS  xI t t | ƒ ƒ D ]2 }   | | 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    s8   ' ( |  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    / 0 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Ÿ   2 3 |  i | ƒ } 4 |  i i | ƒ p |  i i | ƒ o 5 n 6 |  i i | ƒ o 7 t d | |  i f ‚ n 9 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    s9   < = |  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    sV   A B h  } C | i |  i ƒ D | i |  i ƒ E | i |  i ƒ F | 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   H I |  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   K L |  i Sd  S(   N(   s   selfs   children(   s   self(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   get_childrenK s   c  	  s®   N O t  i |  i I|  i o d p d IJP t  i d I|  i IJQ t  i d I|  i IJR t  i d I|  i IJS t  i d I|  i IJT t  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Ê   V Z [ |  i i | ƒ o \ t Sn ] |  i i | ƒ o ^ t Sn _ |  i i | ƒ o ` t Sn a |  i	 o# |  i
 i | ƒ p |  i i | ƒ o c t Sn d |  i	 o e t Sn g 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   3c    s¤   i j |  i o k f  Sn l h  } m | i |  i ƒ n xU |  i i ƒ  Dn ]A } o |  i i	 | ƒ p |  i
 i	 | ƒ o q d | | <n qK Wr | 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    si   t u x\ |  i Du ]N } v | i ƒ  } w |  i | ƒ } x x! | Dx ] } y | i | ƒ qD 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    sˆ   { ‡ ˆ d |  i | <‰ |  i i | ƒ o Š |  i | =n ‹ xA |  i D‹ ]3 } Œ | i | ƒ t j o  | i	 | ƒ n qJ 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    sY   • – g  } — x9| D— ].} ˜ |  i | ƒ } ™ |  i oÁ š | t j p | t j p t	 |  t
 ƒ o œ d |  i | <n}  | t j o ž | i | ƒ nY Ÿ t	 |  t ƒ o
 | t j o   d |  i | <n% ¡ | t j o ¢ | i | ƒ n nI ¤ | 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    s?   » ¼ |  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 Ed d „ Z Ld „  Z Ve i e i e i f Z Xd „  Z e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    s;   Í Î 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# W× t | 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 Wâ t |  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    s^   ê ë xQ | Dë ]F } ì 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# Wù t | 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    ss   |  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    sX   xK | i D]= \ } } | 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    sq   xd | i D]V \ } }  | 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    s1   %&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    sP   )56x* | i D6] } 7|  i | | d ƒ q W8|  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    sP   @A|  i | i | d ƒ Bx* | i DB] } C|  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    st   EF|  i | i | d ƒ G| i o H|  i | i | d ƒ n I| i o J|  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    si   LO|  i | i | ƒ Pt | i t i ƒ o Q|  i | i | d ƒ n R|  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Yx’ | i DY]„ \ } } Zt | t i ƒ o< [t | i ƒ |  i
 j o \| i o
 ]q n n n ^|  i | | ƒ _|  i | | ƒ q W`| i o a|  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)   efd | _ g|  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j|  }  k|  i ƒ  l|  Sd  S(   N(   s   ls   sort(   s   l(    (    s&   /usr/lib/python2.2/compiler/symbols.pys   sortis   
c    s    no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Š   vwg  i  } g  i  } |  i ƒ  Dw] } | | i ƒ  ƒ q$ ~ Dw]8 } x| i d ƒ p | i d ƒ o | | ƒ n qD ~ 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   (	 
£ 		
 	 	0