[ SYSTEM ]: Linux srv.persadacompanies.com 4.18.0-553.56.1.el8_10.x86_64 #1 SMP Tue Jun 10 05:00:59 EDT 2025 x86_64
[ SERVER ]: Apache | PHP: 8.4.19
[ USER ]: persadamedika | IP: 45.64.1.108
GEFORCE FILE MANAGER
/
usr
/
lib64
/
python3.12
/
lib2to3
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📁 __pycache__
SET
[ DEL ]
📁 fixes
SET
[ DEL ]
📁 pgen2
SET
[ DEL ]
📄 Grammar.txt
8,696 B
SET
[ EDIT ]
|
[ DEL ]
📄 Grammar3.12.12.final.0.pickle
15,313 B
SET
[ EDIT ]
|
[ DEL ]
📄 PatternGrammar.txt
793 B
SET
[ EDIT ]
|
[ DEL ]
📄 PatternGrammar3.12.12.final.0.pickle
1,225 B
SET
[ EDIT ]
|
[ DEL ]
📄 __init__.py
156 B
SET
[ EDIT ]
|
[ DEL ]
📄 __main__.py
67 B
SET
[ EDIT ]
|
[ DEL ]
📄 btm_matcher.py
6,623 B
SET
[ EDIT ]
|
[ DEL ]
📄 btm_utils.py
9,945 B
SET
[ EDIT ]
|
[ DEL ]
📄 fixer_base.py
6,690 B
SET
[ EDIT ]
|
[ DEL ]
📄 fixer_util.py
15,206 B
SET
[ EDIT ]
|
[ DEL ]
📄 main.py
11,854 B
SET
[ EDIT ]
|
[ DEL ]
📄 patcomp.py
7,054 B
SET
[ EDIT ]
|
[ DEL ]
📄 pygram.py
1,305 B
SET
[ EDIT ]
|
[ DEL ]
📄 pytree.py
27,974 B
SET
[ EDIT ]
|
[ DEL ]
📄 refactor.py
27,507 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: 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.items(): 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"] python_grammar_no_print_and_exec_statement = python_grammar_no_print_statement.copy() del python_grammar_no_print_and_exec_statement.keywords["exec"] pattern_grammar = driver.load_packaged_grammar("lib2to3", _PATTERN_GRAMMAR_FILE) pattern_symbols = Symbols(pattern_grammar)