
    2h                     r    d dl mZ d dl mZ  G d de          Z G d de          Z G d de          Zd	S )
    )absolute_import)print_functionc                        e Zd ZdZddZd ZdS )Coordz Coordinates of a syntactic element. Consists of:
            - File name
            - Line number
            - (optional) column number, for the Lexer
    Nc                 >    || _         || _        || _        d | _        d S N)file	directorylinenocolumn)selfr	   r
   r   s       N/home/metal/girl-os-victor/victor-clad/tools/message-buffers/clad/plyparser.py__init__zCoord.__init__   s"    	"    c                 P    | j         d| j        }| j        r|d| j        z  z  }|S )N:z:%s)r	   r   r   )r   strs     r   __str__zCoord.__str__   s3    DKK0;2ut{22
r   )NN)__name__
__module____qualname____doc__r   r    r   r   r   r      sA         
       r   r   c                       e Zd ZdS )
ParseErrorN)r   r   r   r   r   r   r   r       s          r   r   c                       e Zd Zd Zd ZdS )	PLYParserc                 x    |dz   }d }|d||_         d|z  |_        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
        _optc                     |d         |d<   d S )N   r   r   )r   ps     r   optrulez+PLYParser._create_opt_rule.<locals>.optrule+   s    Q4AaDDDr   z : empty
| zp_%sN)r   r   setattr	__class__)r   rulenameoptnamer#   s       r   _create_opt_rulezPLYParser._create_opt_rule$   s[    
 V#	 	 	 18B!G+ 0':::::r   c                 "    t          ||          r   )r   )r   msgcoords      r   _parse_errorzPLYParser._parse_error2   s    $$$r   N)r   r   r   r(   r,   r   r   r   r   r   #   s2        ; ; ;% % % % %r   r   N)
__future__r   r   objectr   	Exceptionr   r   r   r   r   <module>r0      s    ' & & & & & % % % % % %    F   $ " ! ! ! ! ! ! !% % % % % % % % % %r   