-í
çś<c       sV   d  Z  d k Z d k Z e i d  i Z e i d  i Z [ d f  d     YZ d S(   sI   Shared support for scanning document type declarations in HTML and XHTML.Ns   [a-zA-Z][-_.a-zA-Z0-9]*\s*s   (\'[^\']*\'|"[^"]*")\s*s
   ParserBasec      s   t  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(   si   Parser base class which provides some common support methods used
    by the SGML/HTML and XHTML parsers.c    s$   |  i t j o t d   n d  S(   Ns(   markupbase.ParserBase must be subclassed(   s   selfs	   __class__s
   ParserBases   RuntimeError(   s   self(    (    s    /usr/lib/python2.2/markupbase.pys   __init__ s    c    s   t  d   d  S(   Ns.   subclasses of ParserBase must override error()(   s   NotImplementedError(   s   selfs   message(    (    s    /usr/lib/python2.2/markupbase.pys   error s    c    s   d |  _ d |  _ d  S(   Ni   i    (   s   selfs   linenos   offset(   s   self(    (    s    /usr/lib/python2.2/markupbase.pys   reset s    	c    s   |  i |  i f Sd S(   s&   Return current line number and offset.N(   s   selfs   linenos   offset(   s   self(    (    s    /usr/lib/python2.2/markupbase.pys   getpos s     c    s   | | j o | Sn |  i } t i | d | |  } | o= |  i | |  _ t i | d | |  } | | d |  _
 n |  i
 | | |  _
 | Sd  S(   Ns   
i   (   s   is   js   selfs   rawdatas   strings   counts   nliness   linenos   rindexs   poss   offset(   s   selfs   is   js   poss   rawdatas   nlines(    (    s    /usr/lib/python2.2/markupbase.pys	   updatepos% s    	s    c 
   sű  |  i } | d } | | | d !d d f j o d Sn t |  } |  i | |  \ } } | d j  o | Sn | d j o d |  _ n xd| | j  oV| | } | d j oH | | d | !}	 | d j o |  i |	  n |  i |	  | d Sn | d	 j o/ t | |  } | o d Sn | i   } nŁ | d
 j o |  i | |  \ } } nz | |  i j o | d } n\ | d j o8 | d j o |  i | d |  } n |  i d  n |  i d | |  | d j  o | Sn q Wd Sd  S(   Ni   i   s   -s    i˙˙˙˙i    s   doctypes   >s   "'s4   abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZs   [s"   unexpected '[' char in declarations!   unexpected %s char in declaration(   s   selfs   rawdatas   is   js   lens   ns
   _scan_names   decltypes   _decl_othercharss   cs   datas   handle_decls   unknown_decls   _declstringlit_matchs   ms   ends   names   _parse_doctype_subsets   error(
   s   selfs   is   cs   decltypes   names   js   ms   ns   rawdatas   data(    (    s    /usr/lib/python2.2/markupbase.pys   parse_declaration5 sJ    	
  
c 
   s)  |  i } t |  } | } x| | j  oő| | } | d j o| | | d !} | d j o d Sn | d j o* |  i | | d  |  i
 d |  n | d | j o d Sn | d | j o d Sn | | | d !d j o1 |  i | d	 d
 } | d
 j  o | Sn q n |  i | d |  \ } } | d j o d Sn | d d d d f j o* |  i | | d  |  i
 d |  n t |  d |  }	 |	 | |  } | d
 j  o | Sn nT| d j om | d | j o d Sn |  i | d |  \ } } | d
 j  o | Sn | | d j o | d } n nÚ | d j o | d } x0 | | j  o | | t i j o | d } q]W| | j  o: | | d j o | Sn |  i | |  |  i
 d  n d SnA | t i j o | d } n# |  i | |  |  i
 d |  q Wd Sd  S(   Ns   <i   i˙˙˙˙s   <!i   s*   unexpected char in internal subset (in %s)i   s   <!--s   reporti    s   attlists   elements   entitys   notations)   unknown declaration %s in internal subsets   _parse_doctype_s   %s   ;s   ]s   >s%   unexpected char after internal subsets%   unexpected char %s in internal subset(   s   selfs   rawdatas   lens   ns   is   js   cs   ss	   updateposs   declstartposs   errors   parse_comments
   _scan_names   names   getattrs   meths   strings
   whitespace(
   s   selfs   is   declstartposs   names   js   cs   ns   ss   rawdatas   meth(    (    s    /usr/lib/python2.2/markupbase.pys   _parse_doctype_subseth sp    	 

 !c    sj   |  i | |  \ } } | d j o d Sn |  i } d | | j o t i | d |  d Sn d Sd  S(   Ni˙˙˙˙s   >i   (	   s   selfs
   _scan_names   is   declstartposs   names   js   rawdatas   strings   find(   s   selfs   is   declstartposs   rawdatas   js   name(    (    s    /usr/lib/python2.2/markupbase.pys   _parse_doctype_elementŹ s    	c    st  |  i } |  i | |  \ } } | | | d !} | d j o d Sn | d j o | d Sn xd o|  i | |  \ } } | d j  o | Sn | | | d !} | d j o d Sn | d j ow d | | j o t i	 | d |  d } n d Sx* | | | d !t i
 j o | d } q˙ W| | o d Sn n |  i | |  \ } } | | | d !} | o d Sn | d j oO t | |  } | o | i   } n d S| | | d !} | o d Sn n | d	 j oo | | d	 j o d Sn |  i | d |  \ } } | d j  o | Sn | | | d !} | o d Sn n | d j o | d Sn qc Wd  S(
   Ni   s    i˙˙˙˙s   >i    s   (s   )s   '"s   #(   s   selfs   rawdatas
   _scan_names   is   declstartposs   names   js   cs   strings   finds
   whitespaces   _declstringlit_matchs   ms   end(   s   selfs   is   declstartposs   names   js   ms   cs   rawdata(    (    s    /usr/lib/python2.2/markupbase.pys   _parse_doctype_attlistˇ s^    	  c    sě   |  i | |  \ } } | d j  o | Sn |  i } xŻ d o§ | | | d !} | o d Sn | d j o | d Sn | d j o/ t | |  } | o d Sn | i
   } n. |  i | |  \ } } | d j  o | Sn q9 Wd  S(   Ni    i   i˙˙˙˙s   >s   '"(   s   selfs
   _scan_names   is   declstartposs   names   js   rawdatas   cs   _declstringlit_matchs   ms   end(   s   selfs   is   declstartposs   rawdatas   js   ms   cs   name(    (    s    /usr/lib/python2.2/markupbase.pys   _parse_doctype_notationđ s&    	 c    si  |  i } | | | d !d j o] | d } xL d oD | | | d !} | o d Sn | t i j o | d } n Pq. Wn | } |  i | |  \ } } | d j  o | Sn xą d oŠ |  i | | d !} | o d Sn | d j o. t
 | |  } | o | i   } n d SnG | d j o | d Sn. |  i | |  \ } } | d j  o | Sn q´ Wd  S(   Ni   s   %i˙˙˙˙i    s   '"s   >(   s   selfs   rawdatas   is   js   cs   strings
   whitespaces
   _scan_names   declstartposs   names   _declstringlit_matchs   ms   end(   s   selfs   is   declstartposs   cs   rawdatas   names   js   m(    (    s    /usr/lib/python2.2/markupbase.pys   _parse_doctype_entitys<    	
 
 c    sÁ   |  i } t |  } | | j o t d f Sn t | |  } | oZ | i   } | i
   } | t |  | j o t d f Sn t i |  | i   f Sn |  i | |  |  i d  d  S(   Ni˙˙˙˙s   expected name token(   s   selfs   rawdatas   lens   ns   is   Nones   _declname_matchs   ms   groups   ss   strips   names   strings   lowers   ends	   updateposs   declstartposs   error(   s   selfs   is   declstartposs   names   ms   ns   ss   rawdata(    (    s    /usr/lib/python2.2/markupbase.pys
   _scan_name+s    	c    s   d  S(   N(    (   s   selfs   data(    (    s    /usr/lib/python2.2/markupbase.pys   unknown_decl<s    (   s   __name__s
   __module__s   __doc__s   __init__s   errors   resets   getposs	   updateposs   _decl_othercharss   parse_declarations   _parse_doctype_subsets   _parse_doctype_elements   _parse_doctype_attlists   _parse_doctype_notations   _parse_doctype_entitys
   _scan_names   unknown_decl(    (    (    s    /usr/lib/python2.2/markupbase.pys
   ParserBase s    						3	D		9		$	(   s   __doc__s   res   strings   compiles   matchs   _declname_matchs   _declstringlit_matchs
   ParserBase(   s   res   _declname_matchs
   ParserBases   strings   _declstringlit_match(    (    s    /usr/lib/python2.2/markupbase.pys   ? s   		