OXIESEC PANEL
- Current Dir:
/
/
snap
/
core
/
17210
/
usr
/
lib
/
python3.5
/
lib2to3
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/02/2024 07:52:55 PM
rwxr-xr-x
📄
Grammar.txt
6.59 KB
09/30/2024 02:20:06 PM
rw-r--r--
📄
PatternGrammar.txt
793 bytes
09/30/2024 02:20:06 PM
rw-r--r--
📄
__init__.py
7 bytes
09/30/2024 02:20:06 PM
rw-r--r--
📄
__main__.py
67 bytes
09/30/2024 02:20:06 PM
rw-r--r--
📁
__pycache__
-
10/02/2024 07:52:55 PM
rwxr-xr-x
📄
btm_matcher.py
6.67 KB
09/30/2024 02:20:06 PM
rw-r--r--
📄
btm_utils.py
9.73 KB
09/30/2024 02:20:06 PM
rw-r--r--
📄
fixer_base.py
6.55 KB
09/30/2024 02:20:06 PM
rw-r--r--
📄
fixer_util.py
14.88 KB
09/30/2024 02:20:06 PM
rw-r--r--
📁
fixes
-
10/02/2024 07:52:55 PM
rwxr-xr-x
📄
main.py
11.37 KB
09/30/2024 02:20:06 PM
rw-r--r--
📄
patcomp.py
6.9 KB
09/30/2024 02:20:06 PM
rw-r--r--
📁
pgen2
-
10/02/2024 07:52:54 PM
rwxr-xr-x
📄
pygram.py
1.09 KB
09/30/2024 02:20:06 PM
rw-r--r--
📄
pytree.py
27.39 KB
09/30/2024 02:20:06 PM
rw-r--r--
📄
refactor.py
27.38 KB
09/30/2024 02:20:06 PM
rw-r--r--
Editing: pygram.py
Close
# 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_grammar(_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_grammar(_PATTERN_GRAMMAR_FILE) pattern_symbols = Symbols(pattern_grammar)