X7ROOT File Manager
Current Path:
/lib64/python2.7/lib2to3
lib64
/
python2.7
/
lib2to3
/
??
..
??
Grammar.txt
(6.93 KB)
??
Grammar2.7.18.final.0.pickle
(39.54 KB)
??
PatternGrammar.txt
(793 B)
??
PatternGrammar2.7.18.final.0.pickle
(2.73 KB)
??
__init__.py
(7 B)
??
__init__.pyc
(127 B)
??
__init__.pyo
(127 B)
??
__main__.py
(67 B)
??
__main__.pyc
(242 B)
??
__main__.pyo
(242 B)
??
btm_matcher.py
(6.67 KB)
??
btm_matcher.pyc
(5.69 KB)
??
btm_matcher.pyo
(5.69 KB)
??
btm_utils.py
(9.78 KB)
??
btm_utils.pyc
(7.39 KB)
??
btm_utils.pyo
(7.39 KB)
??
fixer_base.py
(6.62 KB)
??
fixer_base.pyc
(7.02 KB)
??
fixer_base.pyo
(7.02 KB)
??
fixer_util.py
(14.25 KB)
??
fixer_util.pyc
(14.34 KB)
??
fixer_util.pyo
(14.34 KB)
??
fixes
??
main.py
(11.33 KB)
??
main.pyc
(9.6 KB)
??
main.pyo
(9.56 KB)
??
patcomp.py
(6.9 KB)
??
patcomp.pyc
(6.45 KB)
??
patcomp.pyo
(6.14 KB)
??
pgen2
??
pygram.py
(1.13 KB)
??
pygram.pyc
(1.41 KB)
??
pygram.pyo
(1.41 KB)
??
pytree.py
(28.36 KB)
??
pytree.pyc
(29.59 KB)
??
pytree.pyo
(28.73 KB)
??
refactor.py
(27.37 KB)
??
refactor.pyc
(23.35 KB)
??
refactor.pyo
(23.31 KB)
Editing: pygram.py
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Export the Python grammar and symbols.""" # Python imports import os # Local imports from .pgen2 import token from .pgen2 import driver from . import pytree # The grammar file _GRAMMAR_FILE = os.path.join(os.path.dirname(__file__), "Grammar.txt") _PATTERN_GRAMMAR_FILE = os.path.join(os.path.dirname(__file__), "PatternGrammar.txt") class Symbols(object): def __init__(self, grammar): """Initializer. Creates an attribute for each grammar symbol (nonterminal), whose value is the symbol's type (an int >= 256). """ for name, symbol in grammar.symbol2number.iteritems(): setattr(self, name, symbol) python_grammar = driver.load_packaged_grammar("lib2to3", _GRAMMAR_FILE) python_symbols = Symbols(python_grammar) python_grammar_no_print_statement = python_grammar.copy() del python_grammar_no_print_statement.keywords["print"] pattern_grammar = driver.load_packaged_grammar("lib2to3", _PATTERN_GRAMMAR_FILE) pattern_symbols = Symbols(pattern_grammar)
Upload File
Create Folder