;
?c           @   s  d  Z  d k Z d k Z y d k l Z Wn  e j
 o d k l Z n Xd d g Z d f  d     YZ e	 d  Z
 e d j o e e i  d j o e   Z n# e i d Z e e e  e  Z x7 n o+ e i   Z e o d	 e e  GHq Pq Wn d S(
   s8   A lexical analyzer class for simple shell-like syntaxes.N(   s   StringIOs   shlexs   splitc           B   sz   t  Z d  Z e e e d  Z d   Z e d  Z d   Z d   Z	 d   Z
 d   Z e e d  Z d	   Z d
   Z RS(   s8   A lexical analyzer class for simple shell-like syntaxes.c         C   s@  t  | t  o t |  } n | t j	 o | |  _ | |  _ n t i |  _ t |  _ | |  _	 | o t |  _
 n
 d |  _
 d |  _ d |  _ |  i	 o |  i d 7_ n d |  _ t |  _ d |  _ d |  _ d |  _ d	 |  _ g  |  _ d
 |  _ d |  _ d |  _ g  |  _ t |  _ |  i o d |  i |  i f GHn d  S(   Ns    s   #s?   abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_s>   s    	
s   '"s   \s   "s    i   i    s   shlex: reading from %s, line %d(   s
   isinstances   instreams
   basestrings   StringIOs   Nones   selfs   infiles   syss   stdins   posixs   eofs
   commenterss	   wordcharss
   whitespaces   Falses   whitespace_splits   quotess   escapes   escapedquotess   states   pushbacks   linenos   debugs   tokens	   filestacks   source(   s   selfs   instreams   infiles   posix(    (    s"   /mit/python/lib/python2.3/shlex.pys   __init__   s:    						
												
c         C   s5   |  i d j o d | GHn |  i i d |  d S(   s:   Push a token onto the stack popped by the get_token methodi   s   shlex: pushing token i    N(   s   selfs   debugs   toks   pushbacks   insert(   s   selfs   tok(    (    s"   /mit/python/lib/python2.3/shlex.pys
   push_token:   s     c         C   s   t  | t  o t |  } n |  i i d |  i |  i |  i	 f  | |  _ | |  _ d |  _	 |  i o3 | t j	 o d |  i f GHq d |  i f GHn d S(   s9   Push an input source onto the lexer's input source stack.i    i   s   shlex: pushing to file %ss   shlex: pushing to stream %sN(   s
   isinstances	   newstreams
   basestrings   StringIOs   selfs	   filestacks   inserts   infiles   instreams   linenos   newfiles   debugs   None(   s   selfs	   newstreams   newfile(    (    s"   /mit/python/lib/python2.3/shlex.pys   push_source@   s     %			
c         C   sl   |  i i   |  i d \ |  _ |  _ |  _ |  i d |  _ |  i o d |  i |  i f GHn d |  _ d S(   s   Pop the input source stack.i    i   s   shlex: popping to %s, line %ds    N(   s   selfs   instreams   closes	   filestacks   infiles   linenos   debugs   state(   s   self(    (    s"   /mit/python/lib/python2.3/shlex.pys
   pop_sourceN   s     
c         C   sE  |  i o8 |  i i d  } |  i d j o d | GHn | Sn |  i   } |  i t j	 od xa | |  i j oL |  i	 |  i    } | o  | \ } } |  i | |  n |  i   } qa Wn xA | |  i j o0 |  i o |  i Sq |  i   |  i   } q W|  i d j o' | |  i j o d | GHq=d GHn | Sd S(   sB   Get a token from the input stream (or from stack if it's nonempty)i    i   s   shlex: popping token s   shlex: token=s   shlex: token=EOFN(   s   selfs   pushbacks   pops   toks   debugs
   read_tokens   raws   sources   Nones
   sourcehooks   specs   newfiles	   newstreams   push_sources	   get_tokens   eofs	   filestacks
   pop_source(   s   selfs   raws   toks	   newstreams   specs   newfile(    (    s"   /mit/python/lib/python2.3/shlex.pys	   get_tokenX   s4     
  
	c         C   s  t  } d } x]t oU|  i i d  } | d j o |  i d |  _ n |  i	 d j o$ d Gt
 |  i  Gd Gt
 |  GHn |  i t j o d |  _ Pq |  i d j oo| o t |  _ Pqg| |  i j o@ |  i	 d j o	 d	 GHn |  i p |  i o | o Pqq qg| |  i j o! |  i i   |  i d |  _ qg|  i o | |  i j o d
 } | |  _ qg| |  i j o | |  _ d
 |  _ qg| |  i j o% |  i o | |  _ n | |  _ qg|  i o | |  _ d
 |  _ qg| |  _ |  i p |  i o | o Pqgq q |  i |  i j o t } | o& |  i	 d j o	 d GHn t d  n | |  i j o6 |  i o |  i | |  _ d |  _ Pqd
 |  _ qg|  i o  | |  i j o |  i |  i j o |  i } | |  _ qg|  i | |  _ q |  i |  i j o | o& |  i	 d j o	 d GHn t d  n | |  i j o | |  i j o
 | | j o |  i |  i |  _ n |  i | |  _ | |  _ q |  i d
 j o| o t |  _ Pqg| |  i j oI |  i	 d j o	 d GHn d |  _ |  i p |  i o | o Pqcq qg| |  i j o[ |  i i   |  i d |  _ |  i o0 d |  _ |  i p |  i o | o Pqq qcqg|  i o | |  i j o | |  _ qg|  i o | |  i j o d
 } | |  _ qg| |  i j p | |  i j p |  i o |  i | |  _ qg|  i i d |  |  i	 d j o	 d GHn d |  _ |  i o Pqgq q q W|  i } d |  _ |  i o | o
 | d j o
 t } n |  i	 d j o | o d | GHqd GHn | Sd  S(   Ns    i   s   
i   s   shlex: in states   I see character:s    i   s+   shlex: I see whitespace in whitespace states   as    shlex: I see EOF in quotes states   No closing quotations    shlex: I see EOF in escape states   No escaped characters%   shlex: I see whitespace in word statei    s&   shlex: I see punctuation in word states   shlex: raw token=s   shlex: raw token=EOF(   s   Falses   quoteds   escapedstates   Trues   selfs   instreams   reads   nextchars   linenos   debugs   reprs   states   Nones   tokens
   whitespaces   posixs
   commenterss   readlines   escapes	   wordcharss   quotess   whitespace_splits
   ValueErrors   escapedquotess   pushbacks   inserts   result(   s   selfs   quoteds   results   nextchars   escapedstate(    (    s"   /mit/python/lib/python2.3/shlex.pys
   read_tokenx   s     $				
				-		-			
	*		
		
	c         C   s   | d d j o | d d !} n t |  i t  o t i i |  o( t i i t i i	 |  i  |  } n | t
 | d  f Sd S(   s(   Hook called on a filename to be sourced.i    s   "i   is   rN(   s   newfiles
   isinstances   selfs   infiles
   basestrings   oss   paths   isabss   joins   dirnames   open(   s   selfs   newfile(    (    s"   /mit/python/lib/python2.3/shlex.pys
   sourcehook   s     '(c         C   sF   | t j o |  i  } n | t j o |  i } n d | | f Sd S(   s<   Emit a C-compiler-like, Emacs-friendly error-message leader.s   "%s", line %d: N(   s   infiles   Nones   selfs   lineno(   s   selfs   infiles   lineno(    (    s"   /mit/python/lib/python2.3/shlex.pys   error_leader  s     c         C   s   |  Sd  S(   N(   s   self(   s   self(    (    s"   /mit/python/lib/python2.3/shlex.pys   __iter__	  s    c         C   s.   |  i   } | |  i j o
 t  n | Sd  S(   N(   s   selfs	   get_tokens   tokens   eofs   StopIteration(   s   selfs   token(    (    s"   /mit/python/lib/python2.3/shlex.pys   next  s    
(   s   __name__s
   __module__s   __doc__s   Nones   Falses   __init__s
   push_tokens   push_sources
   pop_sources	   get_tokens
   read_tokens
   sourcehooks   error_leaders   __iter__s   next(    (    (    s"   /mit/python/lib/python2.3/shlex.pys   shlex   s    $		
	 				c         C   s>   t  |  d t } t | _ | o d | _ n t |  Sd  S(   Ns   posixs    (   s   shlexs   ss   Trues   lexs   whitespace_splits   commentss
   commenterss   list(   s   ss   commentss   lex(    (    s"   /mit/python/lib/python2.3/shlex.pys   split  s
    	s   __main__i   s   Token: (   s   __doc__s   os.paths   oss   syss	   cStringIOs   StringIOs   ImportErrors   __all__s   shlexs   Falses   splits   __name__s   lens   argvs   lexers   files   opens	   get_tokens   tts   repr(	   s   __all__s   StringIOs   tts   lexers   syss   shlexs   files   oss   split(    (    s"   /mit/python/lib/python2.3/shlex.pys   ?   s(   		 