-í
a<c       s‰      d  k  Z  	 d e f d „  ƒ  YZ  d e f d „  ƒ  YZ  d f  d „  ƒ  YZ h d f  d „  ƒ  YZ } d	 „  Z ¡ d
 „  Z d  S(   Ns   SyntaxErrorc      s,   	 d  Z  
  d d d „ Z  d „  Z RS(   sB   When we run into an unexpected token, this is the exception to useiÿÿÿÿs	   Bad Tokenc    s     | |  _   | |  _ d  S(   N(   s   poss   selfs   msg(   s   selfs   poss   msg(    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   __init__ s   c    sC     |  i d j  o  d Sn  d |  i d |  i d Sd  S(   Ni    s   #<syntax-error>s   SyntaxError[@ char s   : s   ](   s   selfs   poss   msg(   s   self(    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   __repr__ s    (   s   __doc__s   __init__s   __repr__(    (    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   SyntaxError	 s   	s   NoMoreTokensc      s    d  Z    RS(   s7   Another exception object, for when we run out of tokens(   s   __doc__(    (    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   NoMoreTokens s   	s   Scannerc      s8     d „  Z  ) d d „ Z 7 d „  Z > d „  Z RS(   Nc    s¥      g  |  _  g  |  _  | |  _  d |  _  | |  _ $ | t j	 oO % g  |  _ & x9 | D& ]. \ } } ' |  i i
 | t i | ƒ f ƒ qh Wn d S(   sV   Patterns is [(terminal,regex)...]
        Ignore is [terminal,...];
	Input is a stringi    N(   s   selfs   tokenss   restrictionss   inputs   poss   ignores   patternss   Nones   ks   rs   appends   res   compile(   s   selfs   patternss   ignores   inputs   rs   k(    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   __init__ s   
 i    c    sÅ   ) , - | t |  i ƒ j o - |  i | ƒ n . | t |  i ƒ j  oi 0 | o |  i | o? 1 x5 | D1 ]* } 2 | |  i | j o 3 d ‚ n qn Wn 4 |  i | Sn 5 t ƒ  ‚ d S(   s”   Get the i'th token, and if i is one past the end, then scan 
	for another token; restrict is a list of tokens that
	are allowed, or 0 for any token.s&   Unimplemented: restriction set changedN(	   s   is   lens   selfs   tokenss   scans   restricts   restrictionss   rs   NoMoreTokens(   s   selfs   is   restricts   r(    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   token) s    
 	c    s^   7 8 9 d } : x> |  i d D: ], } ; d | | d | d | d f } q  W< | Sd S(   s2   Print the last 10 tokens that have been scanned ins    iöÿÿÿs   %s
  (@%s)  %s  =  %si    i   i   N(   s   outputs   selfs   tokenss   t(   s   selfs   outputs   t(    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   __repr__7 s   	 	*c 	   s  > @ B xþB d oóE d } F d } G x± |  i DG ]£ \ } } I | o | | j o | |  i j o
 J q5 n K | i |  i	 |  i
 ƒ } L | o t | i d ƒ ƒ | j o% N | } O t | i d ƒ ƒ } n q5 WR | d j o
 | d j  oF S d } T | o U d t | d ƒ } n V t |  i
 | ƒ ‚ n Y | |  i j o [ |  i
 |  i
 | | |  i	 |  i
 |  i
 | !f } ] |  i
 | |  _
 ` |  i p | |  i d j o* a |  i i | ƒ b |  i i | ƒ n c d Sn f |  i
 | |  _
 q Wd S(	   sl   Should scan another token and add it to the list, self.tokens,
	and add the restriction to self.restrictionsi   iÿÿÿÿs   (error)i    s	   Bad Tokens   Trying to find one of s   , N(   s
   best_matchs   best_pats   selfs   patternss   ps   regexps   restricts   ignores   matchs   inputs   poss   ms   lens   groups   msgs   joins   SyntaxErrors   tokens   tokenss   appends   restrictions(	   s   selfs   restricts   best_pats
   best_matchs   ms   ps   tokens   regexps   msg(    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   scan> s4    
		 '
&	 	
3"(   s   __init__s   tokens   __repr__s   scan(    (    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   Scanner s   s   Parserc      s)   h i d „  Z  m d „  Z s d „  Z RS(   Nc    s   i j | |  _ k d |  _ d  S(   Ni    (   s   scanners   selfs   _scanners   _pos(   s   selfs   scanner(    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   __init__i s   c    s0   m o p |  i i |  i | ƒ } q | d Sd S(   s|   Returns the token type for lookahead; if there are any args
        then the list of args is the set of token types to allowi   N(   s   selfs   _scanners   tokens   _poss   typess   tok(   s   selfs   typess   tok(    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   _peekm s   c    sx   s t u |  i i |  i | g ƒ } v | d | j o w t | d d | ƒ ‚ n x d |  i |  _ y | d Sd S(   s5   Returns the matched text, and moves to the next tokeni   i    s   Trying to find i   i   N(   s   selfs   _scanners   tokens   _poss   types   toks   SyntaxError(   s   selfs   types   tok(    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   _scans s   (   s   __init__s   _peeks   _scan(    (    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   Parserh s   c    s#  } ~  | i }  t |  |  d ƒ } ‚ | i d | d d GH„ |  t | d d ƒ | d !} … | t | d d ƒ } ˆ t	 | |  d ƒ } ‰ t	 | |  d ƒ } Š | d j  p | | j  o
 | d j o Š | } n ‹ | d j o
 | | j  o& Œ | | d }  | | d } n  t | d | ƒ } ‘ t | d | ƒ } ’ | d j  p | | j  o
 | d j o ’ | } n “ | d j o ” | |  } n — xF — t | ƒ d j o
 | d	 j o" ™ d
 | d } š | d } q­W d G| GHž d Gd | d GHŸ d G| GHd S(   sC   This is a really dumb long function to print error messages nicely.s   
s	    on line i   s   :iP   i    s   iF   i<   s   ...i
   i   s   > s    s   ^s   List of nearby tokens:N(   s   errs   poss   ps   counts   inputs   lines   msgs   maxs   texts   rfinds   is   js   finds   lens   scanner(   s   inputs   errs   scanners   is   js   ps   texts   line(    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   print_error} s4   !* *  #c    sÔ   ¡ ¢ y ¢ t  |  | ƒ ƒ  SWn° £ t j
 oy } ¤ |  i i } ¥ y ¦ t | | |  i ƒ WnA § t j
 o2 ¨ d G| i	 Gd Gd t
 | | i  d ƒ GHn Xn* © t j
 o ª d GH« |  i GHn Xd  S(   Ns   Syntax Errors   on linei   s   
s0   Could not complete parsing; stopped around here:(   s   getattrs   parsers   rules   SyntaxErrors   ss   _scanners   inputs   print_errors   ImportErrors   msgs   counts   poss   NoMoreTokens(   s   parsers   rules   inputs   s(    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   wrap_error_reporter¡ s    4(   s   res	   Exceptions   SyntaxErrors   NoMoreTokenss   Scanners   Parsers   print_errors   wrap_error_reporter(   s   NoMoreTokenss   res   Scanners   print_errors   SyntaxErrors   Parsers   wrap_error_reporter(    (    sD   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/xpath/yappsrt.pys   ? s   	R$