[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.117.145.109: ~ $
U

��_�!�@shddlZddlmZGdd�de�ZGdd�de�ZdZdZed	krdddl	Z	ed
�Z
e
�edd��dS)
�N)�Templatec@s(eZdZd	dd�Zd
dd�Zdd�ZdS)�ASTCodeGenerator�
_c_ast.cfgcCs ||_dd�|�|�D�|_dS)zN Initialize the code generator from a configuration
            file.
        cSsg|]\}}t||��qS�)�NodeCfg)�.0�name�contentsrr�/_ast_gen.py�
<listcomp>s�z-ASTCodeGenerator.__init__.<locals>.<listcomp>N)�cfg_filename�
parse_cfgfile�node_cfg)�selfrrrr
�__init__s�zASTCodeGenerator.__init__NcCsDtt�j|jd�}|t7}|jD]}||��d7}q |�|�dS)z< Generates the code into file, an open file buffer.
        )rz

N)r�_PROLOGUE_COMMENTZ
substituter�_PROLOGUE_CODEr�generate_source�write)r�file�srcrrrr
�generates�
zASTCodeGenerator.generatec
	cs�t|d���}|D]�}|��}|r|�d�r,q|�d�}|�d�}|�d�}|dksb||ksb||krrtd||f��|d|�}||d|�}|r�d	d
�|�d�D�ng}	||	fVqW5QRXdS)ze Parse the configuration file and yield pairs of
            (name, contents) for each node.
        �r�#�:�[�]�zInvalid line in %s:
%s
NcSsg|]}|���qSr)�strip)r�vrrr
r7sz2ASTCodeGenerator.parse_cfgfile.<locals>.<listcomp>�,)�openr�
startswith�find�RuntimeError�split)
r�filename�f�lineZcolon_iZ
lbracket_iZ
rbracket_ir�valZvallistrrr
r
&s


zASTCodeGenerator.parse_cfgfile)r)N)�__name__�
__module__�__qualname__rrr
rrrr
rs

rc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rz� 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.
    cCs~||_g|_g|_g|_g|_|D]V}|�d�}|j�|�|�d�rT|j�|�q"|�d�rl|j�|�q"|j�|�q"dS)N�*z**)r�all_entries�attr�child�	seq_child�rstrip�append�endswith)rrr	�entryZclean_entryrrr
rBs


zNodeCfg.__init__cCs,|��}|d|��7}|d|��7}|S)N�
)�	_gen_init�
_gen_children�_gen_attr_names�rrrrr
rTszNodeCfg.generate_sourcecCs�d|j}|jrDd�|j�}d�dd�|jD��}|d7}d|}nd}d}|d	|7}|d
|7}|jdgD]}|d||f7}qp|S)
Nzclass %s(Node):
z, css|]}d�|�VqdS)z'{0}'N)�format)r�errr
�	<genexpr>_sz$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
)rr.�join)rr�args�slotsZarglistrrrr
r7Zs

zNodeCfg._gen_initcCsdd}|jrX|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))
)r0zu        for i, child in enumerate(self.%(child)s or []):
            nodelist.append(("%(child)s[%%d]" %% i, child))
z        return tuple(nodelist)
z        return ()
)r.r0�dictr1)rrr0r1rrr
r8ns 
�
�
zNodeCfg._gen_childrencCs"dd�dd�|jD��d}|S)Nz    attr_names = (�css|]}d|VqdS)z%r, Nr)rZnmrrr
r=�sz*NodeCfg._gen_attr_names.<locals>.<genexpr>�))r>r/r:rrr
r9�szNodeCfg._gen_attr_namesN)	r*r+r,�__doc__rrr7r8r9rrrr
r;sra�#-----------------------------------------------------------------
# ** 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.
#
# Copyright (C) 2008-2015, Eli Bendersky
# License: BSD
#-----------------------------------------------------------------

a�

import sys


class Node(object):
    __slots__ = ()
    """ Abstract base class for AST nodes.
    """
    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)
    """
    def visit(self, node):
        """ Visit a node.
        """
        method = 'visit_' + node.__class__.__name__
        visitor = getattr(self, method, self.generic_visit)
        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_name, c in node.children():
            self.visit(c)


�__main__rzc_ast.py�w)
Zpprint�stringr�objectrrrrr*�sysZast_genrr!rrrr
�<module>
s*Q�s

Filemanager

Name Type Size Permission Actions
__init__.cpython-38.opt-1.pyc File 2.42 KB 0644
__init__.cpython-38.pyc File 2.42 KB 0644
_ast_gen.cpython-38.opt-1.pyc File 8.39 KB 0644
_ast_gen.cpython-38.pyc File 8.39 KB 0644
_build_tables.cpython-38.opt-1.pyc File 459 B 0644
_build_tables.cpython-38.pyc File 459 B 0644
ast_transforms.cpython-38.opt-1.pyc File 2.37 KB 0644
ast_transforms.cpython-38.pyc File 2.41 KB 0644
c_ast.cpython-38.opt-1.pyc File 26.54 KB 0644
c_ast.cpython-38.pyc File 26.54 KB 0644
c_generator.cpython-38.opt-1.pyc File 14.45 KB 0644
c_generator.cpython-38.pyc File 14.45 KB 0644
c_lexer.cpython-38.opt-1.pyc File 11.36 KB 0644
c_lexer.cpython-38.pyc File 11.36 KB 0644
c_parser.cpython-38.opt-1.pyc File 53.37 KB 0644
c_parser.cpython-38.pyc File 53.5 KB 0644
lextab.cpython-38.opt-1.pyc File 5.77 KB 0644
lextab.cpython-38.pyc File 5.77 KB 0644
plyparser.cpython-38.opt-1.pyc File 1.99 KB 0644
plyparser.cpython-38.pyc File 1.99 KB 0644
yacctab.cpython-38.opt-1.pyc File 97.87 KB 0644
yacctab.cpython-38.pyc File 97.87 KB 0644