§
    ¢”j,  ã                   óÌ  — d dl mZ d dlZd dlmZ  G d„ d¦  «        Z G d„ d¦  «        ZdZd	Ze	d
k    r¯ej
                             ej
                             e¦  «        ¦  «        Zej
                             ed¦  «        Zej
                             ed¦  «        Z ee¦  «        Z eed¦  «        5 Ze                     e¦  «         ddd¦  «         dS # 1 swxY w Y   dS dS )é    )ÚTemplateN)ÚIOc                   ó8   — e Zd Zdd„Zdee         ddfd„Zd„ ZdS )	ÚASTCodeGeneratorú
_c_ast.cfgc                 ó\   — || _         d„ |                      |¦  «        D ¦   «         | _        dS )zIInitialize the code generator from a configuration
        file.
        c                 ó4   — g | ]\  }}t          ||¦  «        ‘ŒS © )ÚNodeCfg)Ú.0ÚnameÚcontentss      úa/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/pycparser/_ast_gen.pyú
<listcomp>z-ASTCodeGenerator.__init__.<locals>.<listcomp>   s6   € ð 
ð 
ð 
á ��xõ �D˜(Ñ#Ô#ð
ð 
ð 
ó    N)Úcfg_filenameÚparse_cfgfileÚnode_cfg)Úselfr   s     r   Ú__init__zASTCodeGenerator.__init__   s>   € ð )ˆÔð
ð 
à$(×$6Ò$6°|Ñ$DÔ$Dð
ñ 
ô 
ˆŒˆˆr   ÚfileÚreturnNc                 óæ   — t          t          ¦  «                             | j        ¬¦  «        }|t          z  }| j        D ]}||                     ¦   «         dz   z  }Œ|                     |¦  «         dS )z2Generates the code into file, an open file buffer.)r   z

N)r   Ú_PROLOGUE_COMMENTÚ
substituter   Ú_PROLOGUE_CODEr   Úgenerate_sourceÚwrite)r   r   Úsrcr   s       r   ÚgeneratezASTCodeGenerator.generate    so   € åÕ(Ñ)Ô)×4Ò4À$ÔBSÐ4ÑTÔTˆà�~ÑˆØœð 	7ð 	7ˆHØ�8×+Ò+Ñ-Ô-°Ñ6Ñ6ˆCˆCà�
Š
�3‰Œˆˆˆr   c           	   #   ó  K  — t          |d¦  «        5 }|D ]Õ}|                     ¦   «         }|r|                     d¦  «        rŒ.|                     d¦  «        }|                     d¦  «        }|                     d¦  «        }|dk     s||k    s||k    rt	          d|› d|› d	�¦  «        ‚|d
|…         }||dz   |…         }|rd„ |                     d¦  «        D ¦   «         ng }	||	fV — ŒÖ	 d
d
d
¦  «         d
S # 1 swxY w Y   d
S )z`Parse the configuration file and yield pairs of
        (name, contents) for each node.
        Úrú#ú:ú[ú]é   zInvalid line in ú:
ú
Nc                 ó6   — g | ]}|                      ¦   «         ‘ŒS r
   )Ústrip)r   Úvs     r   r   z2ASTCodeGenerator.parse_cfgfile.<locals>.<listcomp>;   s    € Ð=Ð=Ð=¨˜1Ÿ7š7™9œ9Ð=Ð=Ð=r   ú,)Úopenr+   Ú
startswithÚfindÚRuntimeErrorÚsplit)
r   ÚfilenameÚfÚlineÚcolon_iÚ
lbracket_iÚ
rbracket_ir   ÚvalÚvallists
             r   r   zASTCodeGenerator.parse_cfgfile*   s  è è € õ �(˜CÑ Ô ð 	$ AØð $ð $�Ø—z’z‘|”|�Øð ˜tŸš¨sÑ3Ô3ð ØØŸ)š) C™.œ.�Ø!ŸYšY s™^œ^�
Ø!ŸYšY s™^œ^�
Ø˜Q’;�; *°Ò"7Ð"7¸:ÈÒ;SÐ;SÝ&Ð'O¸(Ð'OÐ'OÀtÐ'OÐ'OÐ'OÑPÔPÐPà˜H˜W˜H”~�Ø˜:¨™>¨JÐ6Ô7�ØADÐLÐ=Ð=¨c¯iªi¸©n¬nÐ=Ñ=Ô=Ð=È"�Ø˜G�mÐ#Ð#Ð#Ð#ð$ð	$ð 	$ð 	$ñ 	$ô 	$ð 	$ð 	$ð 	$ð 	$ð 	$ð 	$ð 	$øøøð 	$ð 	$ð 	$ð 	$ð 	$ð 	$s   “CC:Ã:C>ÄC>)r   )Ú__name__Ú
__module__Ú__qualname__r   r   Ústrr    r   r
   r   r   r   r      s]   € € € € € ð
ð 
ð 
ð 
ð˜R œWð ¨ð ð ð ð ð$ð $ð $ð $ð $r   r   c                   ó6   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	dS )	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 ]«}|                     d¦  «        }| j                             |¦  «         |                     d¦  «        r| j                             |¦  «         Œa|                     d¦  «        r| j                             |¦  «         Œ‘| j                             |¦  «         Œ¬d S )NÚ*z**)r   Úall_entriesÚattrÚchildÚ	seq_childÚrstripÚappendÚendswith)r   r   r   ÚentryÚclean_entrys        r   r   zNodeCfg.__init__G   sÚ   € ØˆŒ	ØˆÔØˆŒ	ØˆŒ
ØˆŒàð 		(ð 		(ˆEØŸ,š, sÑ+Ô+ˆKØÔ×#Ò# KÑ0Ô0Ð0à�~Š~˜dÑ#Ô#ð (Ø”×%Ò% kÑ2Ô2Ð2Ð2Ø—’ Ñ$Ô$ð (Ø”
×!Ò! +Ñ.Ô.Ð.Ð.à”	× Ò  Ñ'Ô'Ð'Ð'ð		(ð 		(r   c                 óÊ   — |                       ¦   «         }|d|                      ¦   «         z   z  }|d|                      ¦   «         z   z  }|d|                      ¦   «         z   z  }|S )Nr)   )Ú	_gen_initÚ_gen_childrenÚ	_gen_iterÚ_gen_attr_names©r   r   s     r   r   zNodeCfg.generate_sourceY   se   € Ø�nŠnÑÔˆØˆt�d×(Ò(Ñ*Ô*Ñ*Ñ*ˆØˆt�d—n’nÑ&Ô&Ñ&Ñ&ˆØˆt�d×*Ò*Ñ,Ô,Ñ,Ñ,ˆØˆ
r   c                 ó  — d| j         › d�}| j        rJd                     | j        ¦  «        }d                     d„ | j        D ¦   «         ¦  «        }|dz  }d|› d�}nd}d	}|d
|› d�z  }|d|› d�z  }| j        dgz   D ]}|d|› d|› d�z  }Œ|S )Nzclass z(Node):
ú, c              3   ó"   K  — | ]
}d |› d �V — ŒdS )ú'Nr
   )r   Úes     r   ú	<genexpr>z$NodeCfg._gen_init.<locals>.<genexpr>e   s*   è è € ÐAÐA¨1˜h !˜h˜h˜hÐAÐAÐAÐAÐAÐAr   z, 'coord', '__weakref__'z(self, z, coord=None)z'coord', '__weakref__'z(self, coord=None)z    __slots__ = (z)
z    def __init__r(   Úcoordz        self.z = r)   )r   rB   Újoin)r   r   ÚargsÚslotsÚarglistr   s         r   rL   zNodeCfg._gen_init`   sç   € Ø+�t”yÐ+Ð+Ð+ˆàÔð 	+Ø—9’9˜TÔ-Ñ.Ô.ˆDØ—I’IÐAÐA°Ô0@ÐAÑAÔAÑAÔAˆEØÐ/Ñ/ˆEØ3 Ð3Ð3Ð3ˆGˆGà,ˆEØ*ˆGàÐ- 5Ð-Ð-Ð-Ñ-ˆØÐ. 'Ð.Ð.Ð.Ñ.ˆàÔ$¨ yÑ0ð 	5ð 	5ˆDØÐ4 4Ð4Ð4¨DÐ4Ð4Ð4Ñ4ˆCˆCàˆ
r   c                 ó®   — d}| j         rF|dz  }| j        D ]}|d|› d�z  }|d|› d|› d�z  }Œ| j        D ]}|d|› d	�z  }|d
|› d�z  }Œ|dz  }n|dz  }|S )Nz    def children(self):
z        nodelist = []
ú        if self.ú is not None:
z            nodelist.append(("z", self.z))
z'        for i, child in enumerate(self.ú	 or []):
z            nodelist.append((f"z[{i}]", child))
z        return tuple(nodelist)
z        return ()
©rB   rD   rE   ©r   r   rD   rE   s       r   rM   zNodeCfg._gen_childrent   sÄ   € Ø)ˆàÔð 	)ØÐ,Ñ,ˆCàœð Sð S�ØÐ@¨%Ð@Ð@Ð@Ñ@�ØÐR¸ÐRÐRÀuÐRÐRÐRÑR��à!œ^ð Xð X�	ØÐVÀÐVÐVÐVÑV�ØÐW¸ÐWÐWÐWÑW��àÐ5Ñ5ˆCˆCàÐ(Ñ(ˆCàˆ
r   c                 ó²   — d}| j         rH| j        D ]}|d|› d�z  }|d|› d�z  }Œ| j        D ]}|d|› d�z  }|dz  }Œ| j        s| j        s|d	z  }n|d	z  }|S )
Nz    def __iter__(self):
r]   r^   z            yield self.r)   z        for child in (self.r_   z            yield child
z        return
        yield
r`   ra   s       r   rN   zNodeCfg._gen_iterˆ   s¶   € Ø)ˆàÔð 	:Øœð ;ð ;�ØÐ@¨%Ð@Ð@Ð@Ñ@�ØÐ:°Ð:Ð:Ð:Ñ:��à!œ^ð 3ð 3�	ØÐJ°YÐJÐJÐJÑJ�ØÐ2Ñ2��à”Jð > $¤.ð >àÐ=Ñ=�øð Ð9Ñ9ˆCàˆ
r   c                 óZ   — dd                      d„ | j        D ¦   «         ¦  «        z   dz   }|S )Nz    attr_names = (Ú c              3   ó    K  — | ]	}|›d �V — Œ
dS )rR   Nr
   )r   Únms     r   rV   z*NodeCfg._gen_attr_names.<locals>.<genexpr>ž   s(   è è € Ð,MÐ,M¸R°¨[¨[¨[Ð,MÐ,MÐ,MÐ,MÐ,MÐ,Mr   ú))rX   rC   rP   s     r   rO   zNodeCfg._gen_attr_names�   s4   € Ø" R§W¢WÐ,MÐ,MÀ4Ä9Ð,MÑ,MÔ,MÑ%MÔ%MÑMÐPSÑSˆØˆ
r   N)
r;   r<   r=   Ú__doc__r   r   rL   rM   rN   rO   r
   r   r   r   r   ?   sx   € € € € € ðð ð(ð (ð (ð$ð ð ðð ð ð(ð ð ð(ð ð ð*ð ð ð ð r   r   a¯  #-----------------------------------------------------------------
# ** ATTENTION **
# This code was automatically generated from _c_ast.cfg
#
# 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
#-----------------------------------------------------------------

ae  
import sys
from typing import Any, ClassVar, IO, Optional

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:
    __slots__ = ()
    """ Abstract base class for AST nodes.
    """
    attr_names: ClassVar[tuple[str, ...]] = ()
    coord: Optional[Any]
    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: IO[str] = sys.stdout,
        offset: int = 0,
        attrnames: bool = False,
        showemptyattrs: bool = True,
        nodenames: bool = False,
        showcoord: bool = False,
        _my_node_name: Optional[str] = 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.

            showemptyattrs:
                False if you want to suppress printing empty attributes.

            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:
            def is_empty(v):
                v is None or (hasattr(v, '__len__') and len(v) == 0)
            nvlist = [(n, getattr(self,n)) for n in self.attr_names \
                        if showemptyattrs or not is_empty(getattr(self,n))]
            if attrnames:
                attrstr = ', '.join(f'{name}={value}' for name, value in nvlist)
            else:
                attrstr = ', '.join(f'{value}' for _, value in nvlist)
            buf.write(attrstr)

        if showcoord:
            buf.write(f' (at {self.coord})')
        buf.write('\n')

        for (child_name, child) in self.children():
            child.show(
                buf,
                offset=offset + 2,
                attrnames=attrnames,
                showemptyattrs=showemptyattrs,
                nodenames=nodenames,
                showcoord=showcoord,
                _my_node_name=child_name)


class NodeVisitor:
    """ 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: 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: Node):
        """ Called if no explicit visitor function exists for a
            node. Implements preorder visiting of the node.
        """
        for _, c in node.children():
            self.visit(c)

Ú__main__r   zc_ast.pyÚw)Ústringr   ÚosÚtypingr   r   r   r   r   r;   ÚpathÚdirnameÚabspathÚ__file__Úbase_dirrX   Úcfg_pathÚout_pathÚast_genr.   Úoutr    r
   r   r   ú<module>rw      s–  ðð  Ð Ð Ð Ð Ð Ø 	€	€	€	Ø Ð Ð Ð Ð Ð ð'$ð '$ð '$ð '$ð '$ñ '$ô '$ð '$ðT`ð `ð `ð `ð `ñ `ô `ð `ðFÐ ð"g€ðT ˆzÒÐØŒw�Š˜rœwŸš¨xÑ8Ô8Ñ9Ô9€HØŒw�|Š|˜H lÑ3Ô3€HØŒw�|Š|˜H jÑ1Ô1€HØÐ˜xÑ(Ô(€GØ	ˆˆh˜Ñ	Ô	ð  Ø×Ò˜ÑÔÐðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð ð Ðs   Â4CÃCÃC