⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.216
Server IP:
97.74.87.16
Server:
Linux 16.87.74.97.host.secureserver.net 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
opt
/
nydus
/
ops
/
pycparser
/
__pycache__
/
View File Name :
_ast_gen.cpython-39.pyc
a ������Ih;)����������������������@���s8���d�dl�mZ�G�dd��de�ZG�dd��de�ZdZdZdS�) �����)�Templatec�������������������@���s(���e�Zd�Zd dd�Zd dd�Zdd��ZdS�)�ASTCodeGenerator� _c_ast.cfgc�����������������C���s ���||�_�dd��|��|�D��|�_dS�)zN Initialize the code generator from a configuration file. c�����������������S���s���g�|�]\}}t�||��qS���)�NodeCfg)�.0�name�contentsr���r����C/opt/nydus/tmp/pip-target-os3qdbx0/lib/python/pycparser/_ast_gen.py� <listcomp>���s����z-ASTCodeGenerator.__init__.<locals>.<listcomp>N)�cfg_filename� parse_cfgfile�node_cfg)�selfr���r���r���r ����__init__���s�����zASTCodeGenerator.__init__Nc�����������������C���sD���t�t�j|�jd�}|t7�}|�jD�]}||���d�7�}q |�|��dS�)z< Generates the code into file, an open file buffer. )r���z N)r����_PROLOGUE_COMMENT� substituter����_PROLOGUE_CODEr����generate_source�write)r����file�srcr���r���r���r ����generate���s����� zASTCodeGenerator.generatec����������� ������c���s����t�|d���}|D�]�}|���}|r|�d�r,q|�d�}|�d�}|�d�}|dk�sb||ksb||krrtd||f���|d|��}||d�|��}|r�d d ��|�d�D��ng�} || fV��qW�d����n1�s�0����Y��dS�)ze Parse the configuration file and yield pairs of (name, contents) for each node. �r�#�:�[�]����zInvalid line in %s: %s Nc�����������������S���s���g�|�]}|�����qS�r���)�strip)r����vr���r���r ���r���6��������z2ASTCodeGenerator.parse_cfgfile.<locals>.<listcomp>�,)�openr���� startswith�find�RuntimeError�split) r����filename�f�lineZcolon_iZ lbracket_iZ rbracket_ir����valZvallistr���r���r ���r ���%���s���� zASTCodeGenerator.parse_cfgfile)r���)N)�__name__� __module__�__qualname__r���r���r ���r���r���r���r ���r������s��� r���c�������������������@���s@���e�Zd�ZdZdd��Zdd��Zdd��Zdd ��Zd d��Zdd ��Z dS�)r���z� Node configuration. name: node name contents: a list of contents - attributes and child nodes See comment at the top of the configuration file for details. c�����������������C���s~���||�_�g�|�_g�|�_g�|�_g�|�_|D�]V}|�d�}|�j�|��|�d�rT|�j�|��q"|�d�rl|�j�|��q"|�j�|��q"d�S�)N�*z**)r����all_entries�attr�child� seq_child�rstrip�append�endswith)r���r���r ����entryZclean_entryr���r���r ���r���B���s���� zNodeCfg.__init__c�����������������C���s<���|�����}|d|�����7�}|d|�����7�}|d|�����7�}|S�)N� )� _gen_init� _gen_children� _gen_iter�_gen_attr_names�r���r���r���r���r ���r���T���s ����zNodeCfg.generate_sourcec�����������������C���s����d|�j��}|�jrDd�|�j�}d�dd��|�jD���}|d7�}d|�}nd}d}|d |�7�}|d |�7�}|�jdg�D�]}|d||f�7�}qp|S�) Nzclass %s(Node): z, c�����������������s���s���|�]}d���|�V��qdS�)z'{0}'N)�format)r����er���r���r ���� <genexpr>`���r!���z$NodeCfg._gen_init.<locals>.<genexpr>z, 'coord', '__weakref__'z(self, %s, coord=None)z'coord', '__weakref__'z(self, coord=None)z __slots__ = (%s) z def __init__%s: Zcoordz self.%s = %s )r���r0����join)r���r����args�slotsZarglistr���r���r���r ���r9���[���s���� zNodeCfg._gen_initc�����������������C���sd���d}|�j�rX|d7�}|�jD�]}|dt|d��7�}q|�jD�]}|dt|d��7�}q6|d7�}n|d7�}|S�)Nz def children(self): z nodelist = [] zV if self.%(child)s is not None: nodelist.append(("%(child)s", self.%(child)s)) �r2���zu for i, child in enumerate(self.%(child)s or []): nodelist.append(("%(child)s[%%d]" %% i, child)) z return tuple(nodelist) z return () �r0���r2����dictr3����r���r���r2���r3���r���r���r ���r:���o���s ���� � � zNodeCfg._gen_childrenc�����������������C���sh���d}|�j�r\|�jD�]}|dt|d��7�}q|�jD�]}|dt|d��7�}q.|�jsd|�jsd|d7�}n|d7�}|S�)Nz def __iter__(self): zH if self.%(child)s is not None: yield self.%(child)s rD���zE for child in (self.%(child)s or []): yield child z return yield rE���rG���r���r���r ���r;�������s(���� � ���zNodeCfg._gen_iterc�����������������C���s"���dd��dd��|�jD����d�}|S�)Nz attr_names = (��c�����������������s���s���|�]}d�|�V��qdS�)z%r, Nr���)r����nmr���r���r ���r@�������r!���z*NodeCfg._gen_attr_names.<locals>.<genexpr>�))rA���r1���r=���r���r���r ���r<�������s����zNodeCfg._gen_attr_namesN) r,���r-���r.����__doc__r���r���r9���r:���r;���r<���r���r���r���r ���r���:���s���r���a���#----------------------------------------------------------------- # ** ATTENTION ** # This code was automatically generated from the file: # $cfg_filename # # Do not modify it directly. Modify the configuration file and # run the generator again. # ** ** *** ** ** # # pycparser: c_ast.py # # AST Node classes. # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- a3�� import sys def _repr(obj): """ Get the representation of an object, with dedicated pprint-like format for lists. """ if isinstance(obj, list): return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' else: return repr(obj) class Node(object): __slots__ = () """ Abstract base class for AST nodes. """ def __repr__(self): """ Generates a python representation of the current node """ result = self.__class__.__name__ + '(' indent = '' separator = '' for name in self.__slots__[:-2]: result += separator result += indent result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) separator = ',' indent = '\n ' + (' ' * len(self.__class__.__name__)) result += indent + ')' return result def children(self): """ A sequence of all children that are Nodes """ pass def show(self, buf=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=None): """ Pretty print the Node and all its attributes and children (recursively) to a buffer. buf: Open IO buffer into which the Node is printed. offset: Initial offset (amount of leading spaces) attrnames: True if you want to see the attribute names in name=value pairs. False to only see the values. nodenames: True if you want to see the actual node names within their parents. showcoord: Do you want the coordinates of each Node to be displayed. """ lead = ' ' * offset if nodenames and _my_node_name is not None: buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ') else: buf.write(lead + self.__class__.__name__+ ': ') if self.attr_names: if attrnames: nvlist = [(n, getattr(self,n)) for n in self.attr_names] attrstr = ', '.join('%s=%s' % nv for nv in nvlist) else: vlist = [getattr(self, n) for n in self.attr_names] attrstr = ', '.join('%s' % v for v in vlist) buf.write(attrstr) if showcoord: buf.write(' (at %s)' % self.coord) buf.write('\n') for (child_name, child) in self.children(): child.show( buf, offset=offset + 2, attrnames=attrnames, nodenames=nodenames, showcoord=showcoord, _my_node_name=child_name) class NodeVisitor(object): """ A base NodeVisitor class for visiting c_ast nodes. Subclass it and define your own visit_XXX methods, where XXX is the class name you want to visit with these methods. For example: class ConstantVisitor(NodeVisitor): def __init__(self): self.values = [] def visit_Constant(self, node): self.values.append(node.value) Creates a list of values of all the constant nodes encountered below the given node. To use it: cv = ConstantVisitor() cv.visit(node) Notes: * generic_visit() will be called for AST nodes for which no visit_XXX method was defined. * The children of nodes for which a visit_XXX was defined will not be visited - if you need this, call generic_visit() on the node. You can use: NodeVisitor.generic_visit(self, node) * Modeled after Python's own AST visiting facilities (the ast module of Python 3.0) """ _method_cache = None def visit(self, node): """ Visit a node. """ if self._method_cache is None: self._method_cache = {} visitor = self._method_cache.get(node.__class__.__name__, None) if visitor is None: method = 'visit_' + node.__class__.__name__ visitor = getattr(self, method, self.generic_visit) self._method_cache[node.__class__.__name__] = visitor return visitor(node) def generic_visit(self, node): """ Called if no explicit visitor function exists for a node. Implements preorder visiting of the node. """ for c in node: self.visit(c) N)�stringr����objectr���r���r���r���r���r���r���r ����<module> ���s ���*n�