+
     h  c                   sb    ^ RI t  ! R R]4      t ! R R]4      t ! R R]4      tR tR	 tR
 tR# )i    Nc                   s8   a  ] tR t^t o RtRtRR ltR tRtV t	R# )CoordzuCoordinates of a syntactic element. Consists of:
- File name
- Line number
- (optional) column number, for the Lexer
Nc                s*    Wn         W n        W0n        R # Nfilelinecolumn)selfr   r   r   s   &&&&8/usr/lib/python3.14/site-packages/pycparser/plyparser.py__init__ZCoord.__init__   s    		    c                s    V P                   : R V P                  : 2pV P                  '       d   VRV P                  ,          ,          pV# )Z:z:%sr   )r   Zstrs   & r   __str__ZCoord.__str__   s4    DII.;;;ut{{22
r	   )r   r   r   )r   r   r   Z__weakref__r   )
__name__
__module____qualname____firstlineno____doc__Z	__slots__r   r
   __static_attributes____classdictcell__Z__classdict__   @r   r    r       s      
 :I
 r	   r    c                   s    ] tR t^tRtR# )
ParseError N)r   r   r   r   r   r   r	   r   r   r      s    Tr	   r   c                   s<   a  ] tR t^"t o R tRR ltR tR tRtV t	R# )	PLYParserc                s    VR,           pR pV: RV: 2Vn         RV,          Vn        \        V P                  VP                  V4       R# )zmGiven a rule name, creates an optional ply.yacc rule
for it. The name of the optional rule is
<rulename>_opt
Z_optc                 s    V^,          V^ &   R# )i   Nr   )r   ps   &&r   optruleZ+PLYParser._create_opt_rule.<locals>.optrule*   s    Q4AaDr	   z : empty
| zp_%sN)r   r   setattrZ	__class__)r   ZrulenameZoptnamer   s   &&  r   _create_opt_ruleZPLYParser._create_opt_rule#   sD    
 V#	 18B!G+ 0 0':r	   Nc                sF    \        V P                  P                  VVR 7      # )r   )r    ZclexZfilename)r   linenor      &&&r   _coordZPLYParser._coord1   s"    YY'' 	r	   c                s   VP                   P                   P                  P                  R^ VP                  V4      4      pV^ 8  d   RpVP                  V4      V,
          pV P	                  VP                  V4      V4      # )zReturns the coordinates for the YaccProduction object 'p' indexed
with 'token_idx'. The coordinate includes the 'lineno' and
'column'. Both follow the lex semantic, starting from 1.
Z
i)ZlexerZlexdataZrfindZlexposr   r   )r   r   Z	token_idxZlast_crr   s   &&&  r   _token_coordZPLYParser._token_coord7   sh    
 ''--''--dAqxx	7JKQ;G((9%1{{188I.77r	   c                s&    \        V: R V: 24      h)z: )r   )r   ZmsgZcoordr   r   _parse_errorZPLYParser._parse_errorB   s    UC011r	   r   r   )
r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   "   s     ;	82 2r	   r   c                 s   a  V 3R lpV# )a  Decorator to create parameterized rules.

Parameterized rule methods must be named starting with 'p_' and contain
'xxx', and their docstrings may contain 'xxx' and 'yyy'. These will be
replaced by the given parameter tuples. For example, ``p_xxx_rule()`` with
docstring 'xxx_rule  : yyy' when decorated with
``@parameterized(('id', 'ID'))`` produces ``p_id_rule()`` with the docstring
'id_rule  : ID'. Using multiple tuples produces multiple rules.
c                 s   < SV n         V # r   )_params)Z	rule_funcparamss   &r   decorateZparameterized.<locals>.decorateP   s    "	r	   r   )r!   r"   s   j r   parameterizedr#   F   s     Or	   c                s<   Rp\        V 4       F  pVP                  R4      '       g   K  \        W4      p\        VR4      '       g   K;  \	        W4       VP
                  e   \        W4       Ka  V'       d   Kk  \        P                  ! R\        ^R7       RpK  	  V # )zClass decorator to generate rules from parameterized rule templates.

See `parameterized` for more information on parameterized rules.
FZp_r    z@parsing methods must have __doc__ for pycparser to work properly)Z
stacklevelT)
ZdirZ
startswithZgetattrZhasattrZdelattrr   _create_param_ruleswarningsZwarnZRuntimeWarning)clsZissued_nodoc_warningZ	attr_nameZmethods   &   r   templater'   V   s    
 !X	%%S,Fvy))' >>-'4--MMZ&#$& ,0() * Jr	   c                s  a SP                    Fs  w  r#V3R lpSP                  P                  RV4      P                  RV4      Vn        SP                  P                  RV4      Vn        \	        WP                  V4       Ku  	  R# )a  Create ply.yacc rules based on a parameterized rule function

Generates new methods (one per each pair of parameters) based on the
template rule function `func`, and attaches them to `cls`. The rule
function's parameters must be accessible via its `_params` attribute.
c                 s   < S! W4       R # r   r   )r   r   funcs   &&r   
param_ruleZ'_create_param_rules.<locals>.param_rule}   s
    Mr	   xxxyyyN)r    r   Zreplacer   r   )r&   r(   r*   r+   r)   s   &f   r   r$   r$   t   sm     LL	 "\\11%=EEeSQ
"mm33E3?
 	((*5 !r	   )	r%   Zobjectr    Z	Exceptionr   r   r#   r'   r$   r   r	   r   <module>r,      s<    F $ " !!2 !2H <6r	   