gf tddlZGddeZGddeZGddeZdZd Zd ZdS) Nc$eZdZdZdZddZdZdS)Coordz Coordinates of a syntactic element. Consists of: - File name - Line number - (optional) column number, for the Lexer )filelinecolumn __weakref__Nc0||_||_||_dSNrrr)selfrrrs s/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pycparser/plyparser.py__init__zCoord.__init__s   cP|jd|j}|jr |d|jzz }|S)N:z:%sr )r strs r __str__z Coord.__str__s3DII. ;2ut{22 rr )__name__ __module__ __qualname____doc__ __slots__rrrr rr sH :I rrceZdZdS) ParseErrorN)rrrrrr rrsrrc(eZdZdZddZdZdZdS) PLYParsercx|dz}d}|d||_d|z|_t|j|j|dS)z Given a rule name, creates an optional ply.yacc rule for it. The name of the optional rule is _opt _optc|d|d<dS)Nrr)r ps r optrulez+PLYParser._create_opt_rule..optrule*sQ4AaDDDrz : empty | zp_%sN)rrsetattr __class__)r rulenameoptnamer#s r _create_opt_rulezPLYParser._create_opt_rule#s[ V#   18B!G+ 0':::::rNc:t|jj||S)Nr )rclexfilename)r linenors r _coordzPLYParser._coord1s'Y' rc|jjjdd||}|dkrd}|||z }||||S)z Returns 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.  r)lexerlexdatarfindlexposr-r,)r r" token_idxlast_crrs r _token_coordzPLYParser._token_coord7sr '-'--dAqxx 7J7JKK Q;;G((9%%1{{188I..777rc*t|d|)Nz: )r)r msgcoords r _parse_errorzPLYParser._parse_errorBsUUUCC0111rr )rrrr(r-r7r;rrr rr"sU ; ; ; 8 8 822222rrcfd}|S)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|_|Sr )_params) rule_funcparamss r decoratezparameterized..decoratePs" rr)r@rAs` r parameterizedrBFs# Orc(d}t|D]}|drht||}t|drHt |||jt ||_|stjdtdd}|S) z Class decorator to generate rules from parameterized rule templates. See `parameterized` for more information on parameterized rules. Fp_r>Nz@parsing methods must have __doc__ for pycparser to work properly) stacklevelT) dir startswithgetattrhasattrdelattrr_create_param_ruleswarningswarnRuntimeWarning)clsissued_nodoc_warning attr_namemethods r templaterTVs !XX00    % % 0S),,Fvy)) 0Y'''>-'V4444-0MZ&#$&&&&,0( JrcjD]t\}}fd}jd|d||_jd||_t ||j|udS)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 ||dSr r)r r"funcs r param_rulez'_create_param_rules..param_rule}s DqMMMMMrxxxyyyN)r>rreplacerr$)rPrWrYrZrXs ` r rLrLtsL 6 6S     "\11%==EEeSQQ "m33E3??  Z(*5555 6 6r) rMobjectr ExceptionrrrBrTrLrrr r^sF$"!!!!!!!!2!2!2!2!2!2!2!2H    <66666r