| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python2.7/lib2to3/ |
Upload File : |
ó
—|_c @ s§ d Z d d l m Z d d l m Z m Z d d l m Z m Z e Z e Z
e j Z e Z
d Z d Z d Z d e f d „ ƒ YZ d
d
„ Z d „ Z d „ Z d
S( s0 Utility functions used by the btm_matcher modulei ( t pytree( t grammart token( t pattern_symbolst python_symbolsiÿÿÿÿiþÿÿÿiýÿÿÿt MinNodec B sA e Z d Z d d d „ Z d „ Z d „ Z d „ Z d „ Z RS( s‰ This class serves as an intermediate representation of the
pattern tree during the conversion to sets of leaf-to-root
subpatternsc C sC | | _ | | _ g | _ t | _ d | _ g | _ g | _ d S( N( t typet namet childrent Falset leaft Nonet parentt alternativest group( t selfR R ( ( s' /usr/lib/python2.7/lib2to3/btm_utils.pyt __init__ s c C s t | j ƒ d t | j ƒ S( Nt ( t strR R ( R ( ( s' /usr/lib/python2.7/lib2to3/btm_utils.pyt __repr__ s c C sU | } g } xB| rP| j t k r | j j | ƒ t | j ƒ t | j ƒ k r| t | j ƒ g } g | _ | j } q q | j } d } Pn | j t k r| j
j | ƒ t | j
ƒ t | j ƒ k ró t | j
ƒ } g | _
| j } q q| j } d } Pn | j t j
k r4| j r4| j | j ƒ n | j | j ƒ | j } q W| S( s° Internal method. Returns a characteristic path of the
pattern tree. This method must be run for all leaves until the
linear subpatterns are merged into a singleN( R t TYPE_ALTERNATIVESR
t appendt lenR t tupleR R t
TYPE_GROUPR t get_characteristic_subpatternt token_labelst NAMER ( R t nodet subp( ( s' /usr/lib/python2.7/lib2to3/btm_utils.pyt leaf_to_root! s8
c C s1 x* | j ƒ D] } | j ƒ } | r
| Sq
Wd S( s‹ Drives the leaf_to_root method. The reason that
leaf_to_root must be run multiple times is because we need to
reject 'group' matches; for example the alternative form
(a | b c) creates a group [b c] that needs to be matched. Since
matching multiple linear patterns overcomes the automaton's
capabilities, leaf_to_root merges each group into a single
choice based on 'characteristic'ity,
i.e. (a|b c) -> (a|b) if b more characteristic than c
Returns: The most 'characteristic'(as defined by
get_characteristic_subpattern) path for the compiled pattern
tree.
N( t leavesR ( R t lR ( ( s' /usr/lib/python2.7/lib2to3/btm_utils.pyt get_linear_subpatternK s c c sE x- | j D]"