???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
fc           @   sô   d  Z  d d l Z d d l Z d d l Z e j d ƒ Z d d d „ Z d „  Z e	 d k rð e
 e j ƒ d k rˆ e e j d ƒ Z n	 e j Z e
 e j ƒ d	 k r¿ e e j d	 d
 ƒ Z n	 e j Z e j ƒ  Z e e ƒ Z e e e ƒ n  d S(   s¥   Utility for parsing HTML entity definitions available from:

      http://www.w3.org/ as e.g.
      http://www.w3.org/TR/REC-html40/HTMLlat1.ent

    Input is read from stdin, output is written to stdout in form of a
    Python snippet defining a dictionary "entitydefs" mapping literal
    entity name to character or numeric entity.

    Marc-Andre Lemburg, mal@lemburg.com, 1999.
    Use as you like. NO WARRANTIES.

iÿÿÿÿNs7   <!ENTITY +(\w+) +CDATA +"([^"]+)" +-- +((?:.|
)+?) *-->i    c         C   s‚   d } | d  k r! t |  ƒ } n  i  } xT t j |  | | ƒ } | sI Pn  | j ƒ  \ } } } | | f | | <| j ƒ  } q* W| S(   Ni    (   t   Nonet   lent   entityREt   searcht   groupst   end(   t   textt   post   endpost   dt   mt   namet   charcodet   comment(    (    s3   /usr/lib64/python2.7/Tools/scripts/parseentities.pyt   parse   s    c         C   sÑ   |  j  d ƒ | j ƒ  } | j ƒ  xš | D]’ \ } \ } } | d  d k r‡ t | d d !ƒ } | d k  rx d | } q“ t | ƒ } n t | ƒ } t j | ƒ } |  j  d | | | f ƒ q* W|  j  d ƒ d  S(	   Ns   entitydefs = {
i   s   &#iÿÿÿÿi   s   '\%o's       '%s':	%s,  	# %s
s   
}
(   t   writet   itemst   sortt   intt   reprt	   TextToolst   collapse(   t   ft   defsR   R   R   R   t   code(    (    s3   /usr/lib64/python2.7/Tools/scripts/parseentities.pyt	   writefile#   s    
t   __main__i   i   t   w(   t   __doc__t   ret   sysR   t   compileR   R    R   R   t   __name__R   t   argvt   opent   infilet   stdint   outfilet   stdoutt   readR   R   (    (    (    s3   /usr/lib64/python2.7/Tools/scripts/parseentities.pyt   <module>   s   			