HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //snap/certbot/current/lib/python3.12/site-packages/pycparser/__pycache__/_ast_gen.cpython-312.pyc
�

�F�h;)��D�ddlmZGd�de�ZGd�de�ZdZdZy)	�)�Templatec�"�eZdZdd�Zdd�Zd�Zy)�ASTCodeGeneratorc��||_|j|�D��cgc]\}}t||���c}}|_ycc}}w)zN Initialize the code generator from a configuration
            file.
        N)�cfg_filename�
parse_cfgfile�NodeCfg�node_cfg)�selfr�name�contentss    ��/build/snapcraft-certbot-c9aaebe726f8beb59a0eb2d8e1671bc4/parts/certbot/install/lib/python3.12/site-packages/pycparser/_ast_gen.py�__init__zASTCodeGenerator.__init__sD��)���$(�$6�$6�|�$D�F� ��x�!��x�0�F��
��Fs�<Nc���tt�j|j��}|tz
}|j
D]}||j
�dzz
}�|j|�y)z< Generates the code into file, an open file buffer.
        )rz

N)r�_PROLOGUE_COMMENT�
substituter�_PROLOGUE_CODEr
�generate_source�write)r�file�srcr
s    r�generatezASTCodeGenerator.generatesl���(�)�4�4��*�*�5�,��	�~����
�
�	7�H��8�+�+�-��6�6�C�	7�	
�
�
�3��c	#��K�t|d�5}|D]�}|j�}|r|jd�r�'|jd�}|jd�}|jd�}|dks
||ks||krt	d|�d|�d	���|d
|}||dz|}|r-|jd�D�	cgc]}	|	j���c}	ng}
||
f����	d
d
d
�y
cc}	w#1swYy
xYw�w)ze Parse the configuration file and yield pairs of
            (name, contents) for each node.
        �r�#�:�[�]�zInvalid line in z:
�
N�,)�open�strip�
startswith�find�RuntimeError�split)r�filename�f�line�colon_i�
lbracket_i�
rbracket_ir�val�v�vallists           rrzASTCodeGenerator.parse_cfgfile%s������(�C�
 �	$�A��

$���z�z�|���t���s�3���)�)�C�.��!�Y�Y�s�^�
�!�Y�Y�s�^�
��Q�;�*��"7�:��;S�&�h�PT�'U�V�V��H�W�~���:��>�*�5��AD�c�i�i��n�=��1�7�7�9�=�"���G�m�#�

$�	$�	$��>�	$�	$�s/�
C.�B C"�/C�
C"�	C.�C"�"C+�'C.)z
_c_ast.cfg)N)�__name__�
__module__�__qualname__rrr�rrrrs��F�
�$rrc�4�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	y)	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��||_g|_g|_g|_g|_|D]�}|jd�}|jj
|�|jd�r|jj
|��\|jd�r|jj
|���|jj
|���y)N�*z**)r�all_entries�attr�child�	seq_child�rstrip�append�endswith)rrr
�entry�clean_entrys     rrzNodeCfg.__init__Bs�����	������	���
�����		(�E��,�,�s�+�K����#�#�K�0��~�~�d�#����%�%�k�2�����$��
�
�!�!�+�.��	�	� � ��'�		(rc��|j�}|d|j�zz
}|d|j�zz
}|d|j�zz
}|S)Nr!)�	_gen_init�
_gen_children�	_gen_iter�_gen_attr_names�rrs  rrzNodeCfg.generate_sourceTsY���n�n����t�d�(�(�*�*�*���t�d�n�n�&�&�&���t�d�*�*�,�,�,���
rc�6�d|jz}|jrHdj|j�}djd�|jD��}|dz
}d|z}nd}d}|d|zz
}|d	|zz
}|jd
gzD]}|d|�d|�d
�z
}�|S)Nzclass %s(Node):
z, c3�>K�|]}dj|����y�w)z'{0}'N)�format)�.0�es  r�	<genexpr>z$NodeCfg._gen_init.<locals>.<genexpr>`s����J�A�g�n�n�Q�/�J�s�z, 'coord', '__weakref__'z(self, %s, coord=None)z'coord', '__weakref__'z(self, coord=None)z    __slots__ = (%s)
z    def __init__%s:
�coordz
        self.z = r!)rr9�join)rr�args�slots�arglistrs      rrCzNodeCfg._gen_init[s���!�D�I�I�-������9�9�T�-�-�.�D��I�I�J��9I�9I�J�J�E��/�/�E�.��5�G�,�E�*�G��'�%�/�/���&��0�0���$�$��y�0�	;�D��t�T�:�:�C�	;��
rc���d}|jrR|dz
}|jD]}|dt|��zz
}�|jD]}|dt|��zz
}�|dz
}|S|dz
}|S)Nz    def children(self):
z        nodelist = []
zV        if self.%(child)s is not None: nodelist.append(("%(child)s", self.%(child)s))
�r;zu        for i, child in enumerate(self.%(child)s or []):
            nodelist.append(("%(child)s[%%d]" %% i, child))
z        return tuple(nodelist)
z        return ()
�r9r;�dictr<�rrr;r<s    rrDzNodeCfg._gen_childrenos���)������,�,�C����
+���H��5�)�+�+��
+�"�^�^�
/�	��T��9�-�/�/��
/�
�5�5�C��
�
�(�(�C��
rc��d}|jre|jD]}|dt|��zz
}�|jD]}|dt|��zz
}�|js|js|dz
}|S|dz
}|S)Nz    def __iter__(self):
zH        if self.%(child)s is not None:
            yield self.%(child)s
rTzE        for child in (self.%(child)s or []):
            yield child
z        return
        yield
rUrWs    rrEzNodeCfg._gen_iter�s���)��������
P���9�=A��=N�P�P��
P�
"�^�^�
K�	��0�48�y�4I�K�K��
K�
�J�J�$�.�.��&�'���
�	
�"�
#�C��
rc�V�ddjd�|jD��zdz}|S)Nz    attr_names = (�c3�&K�|]	}d|z���y�w)z%r, Nr5)rK�nms  rrMz*NodeCfg._gen_attr_names.<locals>.<genexpr>�s����,M�R�V�b�[�,M�s��))rOr:rGs  rrFzNodeCfg._gen_attr_names�s*��"�R�W�W�,M�4�9�9�,M�%M�M�PS�S���
rN)
r2r3r4�__doc__rrrCrDrErFr5rrr	r	:s%���(�$��(�0�6rr	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�objectrr	rrr5rr�<module>ras8���'$�v�'$�Tj�f�j�\��(U�r