| 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 : |
o
�@�a� � @ s� d Z ddlZddlZddlZdd� ZG dd� de�ZG dd� de�ZG d d
� d
eej �Z
G dd� de
�ZG d
d� de
�ZG dd� de
�Z
G dd� de�ZG dd� deej�ZG dd� 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.
� Nc C s 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�uncamel s r c @ s e Zd ZdZdd� ZdS )�AnalysisContextz{
Class that stores the hierarchy of node visited.
Contains:
* parent module
* parent function
c C s d | _ d | _d S �N)�module�function)�selfr r r �__init__# s
zAnalysisContext.__init__N)�__name__�
__module__�__qualname__�__doc__r r r r r r
s r
c sV e Zd ZdZ� 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'.
c s || _ | �� tt| ��� dS )z3 Create default context and save all dependencies. N)�deps�verify_dependencies�superr r �r �dependencies�� __class__r r r 0 s zContextManager.__init__Nc C s || _ |pt� | _d S r )�passmanagerr
�ctx)r �pmr r r r �attach6 s zContextManager.attachc C sJ t dt| j��D ]}t| j| t�r"t| j|d t�r"J d| ��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 �ir r r r : s ����z"ContextManager.verify_dependenciesc s\ t |tj�r&|| j_| jD ]}t|t�r%| jj ||f }t
| t|j�|� q
t
t| ��|�S r )r# �ast�FunctionDefr r
r �
issubclass�FunctionAnalysisr �_cache�setattrr r r r �visit)r �node�D�resultr r r r- E s
�zContextManager.visitc C sl t |tj�r|| j_n
t |tj�r|| j_| jD ]}|� }|�| j | j� |�
|�}t| t|j
�|� qdS )z0Gather analysis result required by this analysisN)r# r'