Psyduck - 可達鴨 之 鴨力山大2


Server : LiteSpeed
System : Linux premium217.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User : alloknri ( 880)
PHP Version : 8.1.34
Disable Function : NONE
Directory :  /opt/alt/python310/lib64/python3.10/lib2to3/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python310/lib64/python3.10/lib2to3/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)
Name
Size
Permissions
Options
__pycache__
--
drwxr-xr-x
fixes
--
drwxr-xr-x
pgen2
--
drwxr-xr-x
Grammar.txt
8.492 KB
-rw-r--r--
Grammar3.10.18.final.0.pickle
14.954 KB
-rw-r--r--
PatternGrammar.txt
0.774 KB
-rw-r--r--
PatternGrammar3.10.18.final.0.pickle
1.196 KB
-rw-r--r--
__init__.py
0.159 KB
-rw-r--r--
__main__.py
0.065 KB
-rw-r--r--
btm_matcher.py
6.468 KB
-rw-r--r--
btm_utils.py
9.732 KB
-rw-r--r--
fixer_base.py
6.533 KB
-rw-r--r--
fixer_util.py
14.85 KB
-rw-r--r--
main.py
11.576 KB
-rw-r--r--
patcomp.py
6.889 KB
-rw-r--r--
pygram.py
1.274 KB
-rw-r--r--
pytree.py
27.318 KB
-rw-r--r--
refactor.py
26.862 KB
-rw-r--r--