3
&yV:                 @   s4   G d d de ZG dd deZG dd de ZdS )c               @   s&   e Zd ZdZdZdddZd	d
 ZdS )Coordz Coordinates of a syntactic element. Consists of:
            - File name
            - Line number
            - (optional) column number, for the Lexer
    filelinecolumn__weakref__Nc             C   s   || _ || _|| _d S )N)r   r   r   )selfr   r   r    r   S/var/www/html/enquirykeeper_venv/lib/python3.6/site-packages/pycparser/plyparser.py__init__   s    zCoord.__init__c             C   s(   d| j | jf }| jr$|d| j 7 }|S )Nz%s:%sz:%s)r   r   r   )r   strr   r   r   __str__   s     zCoord.__str__)r   r   r   r   )N)__name__
__module____qualname____doc__	__slots__r	   r   r   r   r   r   r      s   
r   c               @   s   e Zd ZdS )
ParseErrorN)r   r   r   r   r   r   r   r      s    r   c               @   s&   e Zd Zdd ZdddZdd ZdS )		PLYParserc             C   s<   |d }dd }d||f |_ d| |_t| j|j| dS )z Given a rule name, creates an optional ply.yacc rule
            for it. The name of the optional rule is
            <rulename>_opt
        Z_optc             S   s   |d |d< d S )N       r   )r   pr   r   r   optrule)   s    z+PLYParser._create_opt_rule.<locals>.optrulez%s : empty
| %szp_%sN)r   r   setattr	__class__)r   Zrulenameoptnamer   r   r   r   _create_opt_rule"   s
    
zPLYParser._create_opt_ruleNc             C   s   t | jj||dS )N)r   r   r   )r   Zclexfilename)r   linenor   r   r   r   _coord0   s    zPLYParser._coordc             C   s   t d||f d S )Nz%s: %s)r   )r   msgZcoordr   r   r   _parse_error6   s    zPLYParser._parse_error)N)r   r   r   r   r   r   r   r   r   r   r   !   s   
r   N)objectr   	Exceptionr   r   r   r   r   r   <module>   s   