-í
ŽH ?c       sB  d  Z  d k Z d k Z d g Z e i d ƒ Z e i d ƒ Z e i d ƒ Z e i d ƒ Z e i d ƒ Z	 e i d ƒ Z
 e i d	 ƒ Z e i d
 ƒ Z e i d ƒ Z e i d ƒ Z e i d ƒ Z e i d ƒ Z d e f d „  ƒ  YZ d e i f d „  ƒ  YZ d e f d „  ƒ  YZ e d „ Z e d j o e ƒ  n d S(   s;   A parser for SGML, using the derived class as a static DTD.Ns
   SGMLParsers   [&<]sN   &([a-zA-Z][a-zA-Z0-9]*|#[0-9]*)?|<([a-zA-Z][^<>]*|/([a-zA-Z][^<>]*)?|![^<>]*)?s%   &([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]s   &#([0-9]+)[^0-9]s
   <[>a-zA-Z]s   <[a-zA-Z][-.a-zA-Z0-9]*/s"   <([a-zA-Z][-.a-zA-Z0-9]*)/([^/]*)/s   >s   [<>]s   --\s*>s   [a-zA-Z][-_.a-zA-Z0-9]*s`   \s*([a-zA-Z_][-:.a-zA-Z_0-9]*)(\s*=\s*(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$\(\)_#=~\'"]*))?s   SGMLParseErrorc      s   d  Z  RS(   s&   Exception raised for all parse errors.(   s   __doc__(    (    (    s$   /mit/python/lib/python2.2/sgmllib.pys   SGMLParseError( s    c      sL  d d „ Z  d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d	 „  Z d
 d „ Z d Z	 d „  Z
 e Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z h  d d <d d <d d <d d <d  d! <Z d" „  Z d# „  Z d$ „  Z d% „  Z d& „  Z d' „  Z d( „  Z d) „  Z d* „  Z  RS(+   Ni    c    s   | |  _  |  i ƒ  d S(   s#   Initialize and reset this instance.N(   s   verboses   selfs   reset(   s   selfs   verbose(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   __init__: s     	c    sA   d |  _ g  |  _ d |  _ d |  _ d |  _ t i i |  ƒ d S(   s0   Reset this instance. Loses all unprocessed data.s    s   ???i    N(	   s   selfs   rawdatas   stacks   lasttags
   nomoretagss   literals
   markupbases
   ParserBases   reset(   s   self(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   reset? s     					c    s   d |  _ |  _ d S(   sY   Enter literal mode (CDATA) till EOF.

        Intended for derived classes only.
        i   N(   s   selfs
   nomoretagss   literal(   s   self(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   setnomoretagsH s     c    s   d |  _ d S(   sP   Enter literal mode (CDATA).

        Intended for derived classes only.
        i   N(   s   selfs   literal(   s   selfs   args(    (    s$   /mit/python/lib/python2.2/sgmllib.pys
   setliteralO s     c    s!   |  i | |  _ |  i d ƒ d S(   sã   Feed some data to the parser.

        Call this as often as you want, with as little or as much text
        as you want (may include '
').  (This just saves the text,
        all the processing is done by goahead().)
        i    N(   s   selfs   rawdatas   datas   goahead(   s   selfs   data(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   feedV s     c    s   |  i d ƒ d S(   s   Handle the remaining data.i   N(   s   selfs   goahead(   s   self(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   closea s     c    s   t  | ƒ ‚ d  S(   N(   s   SGMLParseErrors   message(   s   selfs   message(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   errore s    c 	   sz  |  i } d } t | ƒ } x| | j  o|  i o |  i | | | !ƒ | } Pn t i | | ƒ } | o | i
 ƒ  } n | } | | j  o |  i | | | !ƒ n | } | | j o Pn | | d j oÀt i	 | | ƒ oZ |  i o" |  i | | ƒ | d } q n |  i | ƒ } | d j  o Pn | } q n | i d | ƒ o7 |  i | ƒ } | d j  o Pn | } d |  _ q n |  i o4 | | d j o |  i d ƒ | d } n Pq n | i d | ƒ o. |  i | ƒ } | d j  o Pn | } q n | i d | ƒ o2 |  i | ƒ } | d j  o Pn | | } q n | i d | ƒ o. |  i | ƒ } | d j  o Pn | } q n n+| | d j o|  i o" |  i | | ƒ | d } q n t i	 | | ƒ } | oU | i d ƒ } |  i | ƒ | i d ƒ } | | d d	 j o | d } n q n t i	 | | ƒ } | oU | i d ƒ } |  i | ƒ | i d ƒ } | | d d	 j o | d } n q n n |  i d
 ƒ t i	 | | ƒ } | o" |  i | | ƒ | d } q n | i d ƒ } | | j o Pn |  i | | | !ƒ | } q W| o
 | | j  o |  i | | | !ƒ | } n | | |  _ d  S(   Ni    s   <i   s   </s   <!--s   <?s   <!s   &s   ;s   neither < nor & ??(   s   selfs   rawdatas   is   lens   ns
   nomoretagss   handle_datas   interestings   searchs   matchs   starts   js   starttagopens   literals   parse_starttags   ks
   startswiths   parse_endtags   parse_comments   parse_pis   parse_declarations   charrefs   groups   names   handle_charrefs   ends	   entityrefs   handle_entityrefs   errors
   incomplete(	   s   selfs   ends   names   is   js   ns   rawdatas   ks   match(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   goaheadk sÀ    	 
  

  	
  
 

  

i   c    s›   |  i } | | | d !d j o |  i d ƒ n t i | | d ƒ } | o d Sn | o+ | i d ƒ } |  i
 | | d | !ƒ n | i d ƒ Sd  S(   Ni   s   <!--s"   unexpected call to parse_comment()iÿÿÿÿi    (   s   selfs   rawdatas   is   errors   commentcloses   searchs   matchs   reports   starts   js   handle_comments   end(   s   selfs   is   reports   rawdatas   js   match(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   parse_commentÎ s    	s   =c    sš   |  i } | | | d !d j o |  i d ƒ n t i | | d ƒ } | o d Sn | i d ƒ } |  i	 | | d | !ƒ | i
 d ƒ } | | Sd  S(   Ni   s   <?s   unexpected call to parse_pi()iÿÿÿÿi    (   s   selfs   rawdatas   is   errors   picloses   searchs   matchs   starts   js	   handle_pis   end(   s   selfs   is   rawdatas   js   match(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   parse_piÞ s    	c    s   |  i Sd  S(   N(   s   selfs   _SGMLParser__starttag_text(   s   self(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   get_starttag_textë s    c    s¶  t  |  _ | }	 |  i } t i | | ƒ o— t i | | ƒ } | o d Sn | i	 d d ƒ \ } }
 d | |  _ | i ƒ  } | i d ƒ } |  i | |
 ƒ | |	 | i d ƒ d !|  _ | Sn t i | | d ƒ } | o d Sn | i d ƒ } g  } | | | d !d j o | } |  i } n_ t i | | d ƒ } | o |  i d ƒ n | i d ƒ } | | d | !i ƒ  } | |  _ xæ | | j  oØ t i | | ƒ } | o Pn | i	 d d d ƒ \ } } } | o
 | } n^ | d  d	 j o | d j n p# | d  d
 j o | d j n o | d d !} n | i | i ƒ  | f ƒ | i d ƒ } q‰W| | d j o | d } n | |	 | !|  _ |  i | | ƒ | Sd  S(   Niÿÿÿÿi   i   s   <%s/i    s   <>s!   unexpected call to parse_starttagi   s   's   "s   >(   s   Nones   selfs   _SGMLParser__starttag_texts   is	   start_poss   rawdatas   shorttagopens   matchs   shorttags   groups   tags   datas   lowers   ends   ks   finish_shorttags
   endbrackets   searchs   starts   js   attrss   lasttags   tagfinds   errors   attrfinds   attrnames   rests	   attrvalues   appends   finish_starttag(   s   selfs   is   rests	   attrvalues   ks   js   attrnames   tags   rawdatas	   start_poss   datas   matchs   attrs(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   parse_starttagï sZ    			  
Lc    s�   |  i } t i | | d ƒ } | o d Sn | i d ƒ } | | d | !i ƒ  i	 ƒ  } | | d j o | d } n |  i | ƒ | Sd  S(   Ni   iÿÿÿÿi    i   s   >(   s   selfs   rawdatas
   endbrackets   searchs   is   matchs   starts   js   strips   lowers   tags   finish_endtag(   s   selfs   is   js   rawdatas   tags   match(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   parse_endtag&s    	c    s.   |  i | g  ƒ |  i | ƒ |  i | ƒ d  S(   N(   s   selfs   finish_starttags   tags   handle_datas   datas   finish_endtag(   s   selfs   tags   data(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   finish_shorttag3s    c    s°   y t  |  d | ƒ } Wnk t j
 o_ y t  |  d | ƒ } Wn' t j
 o |  i | | ƒ d Sn X|  i | | | ƒ d Sn) X|  i i	 | ƒ |  i | | | ƒ d Sd  S(   Ns   start_s   do_iÿÿÿÿi    i   (
   s   getattrs   selfs   tags   methods   AttributeErrors   unknown_starttags   attrss   handle_starttags   stacks   append(   s   selfs   tags   attrss   method(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   finish_starttag:s    		c    sx  | o9 t |  i ƒ d } | d j  o |  i | ƒ d  Sn n¤ | |  i j oO y t |  d | ƒ } Wn  t j
 o |  i | ƒ n X|  i	 | ƒ d  Sn t |  i ƒ } x2 t
 | ƒ D]$ } |  i | | j o
 | } n q¼ Wx� t |  i ƒ | j ov |  i d } y t |  d | ƒ } Wn t j
 o t } n X| o |  i | | ƒ n |  i | ƒ |  i d =qç Wd  S(   Ni   i    s   end_iÿÿÿÿ(   s   tags   lens   selfs   stacks   founds   unknown_endtags   getattrs   methods   AttributeErrors   report_unbalanceds   ranges   is   Nones   handle_endtag(   s   selfs   tags   is   founds   method(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   finish_endtagLs8       c    s   | | ƒ d  S(   N(   s   methods   attrs(   s   selfs   tags   methods   attrs(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   handle_starttagks    c    s   | ƒ  d  S(   N(   s   method(   s   selfs   tags   method(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   handle_endtagos    c    s+   |  i o d | d GHd G|  i GHn d  S(   Ns   *** Unbalanced </s   >s
   *** Stack:(   s   selfs   verboses   tags   stack(   s   selfs   tag(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   report_unbalancedss    
c    s‚   y t  | ƒ } Wn$ t j
 o |  i | ƒ d Sn Xd | j o
 d j n o |  i | ƒ d Sn |  i t | ƒ ƒ d S(   s0   Handle character reference, no need to override.Ni    iÿ   (   s   ints   names   ns
   ValueErrors   selfs   unknown_charrefs   handle_datas   chr(   s   selfs   names   n(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   handle_charrefxs     	s   <s   lts   >s   gts   &s   amps   "s   quots   's   aposc    sC   |  i } | i | ƒ o |  i | | ƒ n |  i | ƒ d Sd S(   s°   Handle entity references.

        There should be no need to override this method; it can be
        tailored by setting up the self.entitydefs mapping appropriately.
        N(   s   selfs
   entitydefss   tables   has_keys   names   handle_datas   unknown_entityref(   s   selfs   names   table(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   handle_entityrefˆs     	c    s   d  S(   N(    (   s   selfs   data(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   handle_data–s    c    s   d  S(   N(    (   s   selfs   data(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   handle_commentšs    c    s   d  S(   N(    (   s   selfs   decl(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   handle_declžs    c    s   d  S(   N(    (   s   selfs   data(    (    s$   /mit/python/lib/python2.2/sgmllib.pys	   handle_pi¢s    c    s   d  S(   N(    (   s   selfs   tags   attrs(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   unknown_starttag¦s    c    s   d  S(   N(    (   s   selfs   tag(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   unknown_endtag§s    c    s   d  S(   N(    (   s   selfs   ref(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   unknown_charref¨s    c    s   d  S(   N(    (   s   selfs   ref(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   unknown_entityref©s    (!   s   __init__s   resets   setnomoretagss
   setliterals   feeds   closes   errors   goaheads   parse_comments   _decl_othercharss   parse_pis   Nones   _SGMLParser__starttag_texts   get_starttag_texts   parse_starttags   parse_endtags   finish_shorttags   finish_starttags   finish_endtags   handle_starttags   handle_endtags   report_unbalanceds   handle_charrefs
   entitydefss   handle_entityrefs   handle_datas   handle_comments   handle_decls	   handle_pis   unknown_starttags   unknown_endtags   unknown_charrefs   unknown_entityref(    (    (    s$   /mit/python/lib/python2.2/sgmllib.pys
   SGMLParser8 s@    								c			7								3								s   TestSGMLParserc      sV   d d „ Z  d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d	 „  Z d
 „  Z RS(   Ni    c    s   d |  _ t i |  | ƒ d  S(   Ns    (   s   selfs   testdatas
   SGMLParsers   __init__s   verbose(   s   selfs   verbose(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   __init__®s    	c    s9   |  i | |  _ t |  i ƒ d j o |  i ƒ  n d  S(   NiF   (   s   selfs   testdatas   datas   lens   flush(   s   selfs   data(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   handle_data²s    c    s+   |  i } | o d |  _ d G| GHn d  S(   Ns    s   data:(   s   selfs   testdatas   data(   s   selfs   data(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   flush·s    		c    sK   |  i ƒ  | } t | ƒ d j o | d  d | d } n d G| GHd  S(   NiD   i    s   ...iàÿÿÿs   comment:(   s   selfs   flushs   datas   rs   len(   s   selfs   datas   r(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   handle_comment½s
    
c    s_   |  i ƒ  | o d | d GHn9 d | Gx( | D]  \ } } | d d | d Gq2 Wd GHd  S(   Ns   start tag: <s   >s   =s   "(   s   selfs   flushs   attrss   tags   names   value(   s   selfs   tags   attrss   values   name(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   unknown_starttagÄs    
 c    s   |  i ƒ  d | d GHd  S(   Ns   end tag: </s   >(   s   selfs   flushs   tag(   s   selfs   tag(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   unknown_endtagÎs    
c    s   |  i ƒ  d | d GHd  S(   Ns   *** unknown entity ref: &s   ;(   s   selfs   flushs   ref(   s   selfs   ref(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   unknown_entityrefÒs    
c    s   |  i ƒ  d | d GHd  S(   Ns   *** unknown char ref: &#s   ;(   s   selfs   flushs   ref(   s   selfs   ref(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   unknown_charrefÖs    
c    s   t  i |  ƒ |  i ƒ  d  S(   N(   s
   SGMLParsers   closes   selfs   flush(   s   self(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   closeÚs    (	   s   __init__s   handle_datas   flushs   handle_comments   unknown_starttags   unknown_endtags   unknown_entityrefs   unknown_charrefs   close(    (    (    s$   /mit/python/lib/python2.2/sgmllib.pys   TestSGMLParser¬s    				
			c 	   s-  d  k  } |  o | i d }  n |  o |  d d j o |  d }  t } n t } |  o |  d } n d } | d j o | i } nF y t	 | d ƒ } Wn/ t
 j
 o# } | Gd G| GH| i d ƒ n X| i ƒ  } | | i j	 o | i ƒ  n | ƒ  } x | D] } | i | ƒ qW| i ƒ  d  S(   Ni   i    s   -ss	   test.htmls   -s   rs   :(   s   syss   argss   argvs
   SGMLParsers   klasss   TestSGMLParsers   files   stdins   fs   opens   IOErrors   msgs   exits   reads   datas   closes   xs   cs   feed(	   s   argss   cs   files   fs   datas   syss   klasss   xs   msg(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   testßs2    	

	 s   __main__(   s   __doc__s
   markupbases   res   __all__s   compiles   interestings
   incompletes	   entityrefs   charrefs   starttagopens   shorttagopens   shorttags   picloses
   endbrackets   commentcloses   tagfinds   attrfinds   RuntimeErrors   SGMLParseErrors
   ParserBases
   SGMLParsers   TestSGMLParsers   Nones   tests   __name__(   s   starttagopens   shorttags
   SGMLParsers   charrefs   attrfinds   picloses   commentcloses   __all__s   SGMLParseErrors
   markupbases   interestings   tagfinds   res	   entityrefs   TestSGMLParsers   tests   shorttagopens
   endbrackets
   incomplete(    (    s$   /mit/python/lib/python2.2/sgmllib.pys   ? s,   			ÿ u3$