/usr/lib64/python2.7/lib2to3
NameSizeModeActions
fixes/-0755rm
pgen2/-0755rm
btm_matcher.py68340644editdlrm
btm_matcher.pyc58300644editdlrm
btm_matcher.pyo58300644editdlrm
btm_utils.py100120644editdlrm
btm_utils.pyc75630644editdlrm
btm_utils.pyo75630644editdlrm
fixer_base.py67800644editdlrm
fixer_base.pyc71860644editdlrm
fixer_base.pyo71860644editdlrm
fixer_util.py145970644editdlrm
fixer_util.pyc146830644editdlrm
fixer_util.pyo146830644editdlrm
Grammar.txt70940644editdlrm
Grammar2.7.18.final.0.pickle404860644editdlrm
main.py116050644editdlrm
main.pyc98310644editdlrm
main.pyo97890644editdlrm
patcomp.py70650644editdlrm
patcomp.pyc66010644editdlrm
patcomp.pyo62890644editdlrm
PatternGrammar.txt7930644editdlrm
PatternGrammar2.7.18.final.0.pickle27990644editdlrm
pygram.py11580644editdlrm
pygram.pyc14410644editdlrm
pygram.pyo14410644editdlrm
pytree.py290390644editdlrm
pytree.pyc303030644editdlrm
pytree.pyo294200644editdlrm
refactor.py280260644editdlrm
refactor.pyc239120644editdlrm
refactor.pyo238700644editdlrm
__init__.py70644editdlrm
__init__.pyc1270644editdlrm
__init__.pyo1270644editdlrm
__main__.py670644editdlrm
__main__.pyc2420644editdlrm
__main__.pyo2420644editdlrm
Edit: /usr/lib64/python2.7/lib2to3/btm_matcher.pyc (5830B)
ó {fc@s“dZdZddlZddlZddlmZddlmZddlm Z de fd „ƒYZ d e fd „ƒYZ ia d „ZdS( sŒA bottom-up tree matching algorithm implementation meant to speed up 2to3's matching process. After the tree patterns are reduced to their rarest linear path, a linear Aho-Corasick automaton is created. The linear automaton traverses the linear paths from the leaves to the root of the AST and returns a set of nodes for further matching. This reduces significantly the number of candidate nodes.s+George Boutsioukis iÿÿÿÿN(t defaultdicti(tpytree(t reduce_treetBMNodecBs#eZdZejƒZd„ZRS(s?Class for a node of the Aho-Corasick automaton used in matchingcCs1i|_g|_ttjƒ|_d|_dS(Nt(ttransition_tabletfixerstnextRtcounttidtcontent(tself((s+/usr/lib64/python2.7/lib2to3/btm_matcher.pyt__init__s  (t__name__t __module__t__doc__t itertoolsRR (((s+/usr/lib64/python2.7/lib2to3/btm_matcher.pyRs t BottomMatchercBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(sgThe main matcher class. After instantiating the patterns should be added using the add_fixer methodcCsFtƒ|_tƒ|_|jg|_g|_tjdƒ|_dS(NtRefactoringTool( tsettmatchRtroottnodesRtloggingt getLoggertlogger(R ((s+/usr/lib64/python2.7/lib2to3/btm_matcher.pyR s    cCsh|jj|ƒt|jƒ}|jƒ}|j|d|jƒ}x|D]}|jj|ƒqJWdS(sÒReduces a fixer's pattern tree to a linear path and adds it to the matcher(a common Aho-Corasick automaton). The fixer is appended on the matching states and called when they are reachedtstartN(RtappendRt pattern_treetget_linear_subpatterntaddR(R tfixerttreetlineart match_nodest match_node((s+/usr/lib64/python2.7/lib2to3/btm_matcher.pyt add_fixer%s   cCsú|s |gSt|dtƒr‚g}xU|dD]I}|j|d|ƒ}x+|D]#}|j|j|d|ƒƒqSWq1W|S|d|jkr²tƒ}||j|d     !          cs*dGH‡fd†‰ˆ|jƒdGHdS(s<Prints a graphviz diagram of the BM automaton(for debugging)s digraph g{csvxo|jjƒD]^}|j|}d|j|jt|ƒt|jƒfGH|dkrd|jGHnˆ|ƒqWdS(Ns%d -> %d [label=%s] //%si(RR7R t type_reprtstrRR (tnodet subnode_keytsubnode(t print_node(s+/usr/lib64/python2.7/lib2to3/btm_matcher.pyRE“s '  t}N(R(R ((REs+/usr/lib64/python2.7/lib2to3/btm_matcher.pytprint_acs (R RRR R$RR?RG(((s+/usr/lib64/python2.7/lib2to3/btm_matcher.pyRs   " =cCshtsXddlm}x?|jjƒD]+\}}t|ƒtkr&|t|s   …