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/python27/lib64/python2.7/lib2to3/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python27/lib64/python2.7/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.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)
Name
Size
Permissions
Options
fixes
--
drwxr-xr-x
pgen2
--
drwxr-xr-x
Grammar.txt
6.928 KB
-rw-r--r--
Grammar2.7.18.final.0.pickle
39.537 KB
-rw-r--r--
PatternGrammar.txt
0.774 KB
-rw-r--r--
PatternGrammar2.7.18.final.0.pickle
2.733 KB
-rw-r--r--
__init__.py
0.007 KB
-rw-r--r--
__init__.pyc
0.137 KB
-rw-r--r--
__init__.pyo
0.137 KB
-rw-r--r--
__main__.py
0.065 KB
-rw-r--r--
__main__.pyc
0.249 KB
-rw-r--r--
__main__.pyo
0.249 KB
-rw-r--r--
btm_matcher.py
6.674 KB
-rw-r--r--
btm_matcher.pyc
5.833 KB
-rw-r--r--
btm_matcher.pyo
5.833 KB
-rw-r--r--
btm_utils.py
9.777 KB
-rw-r--r--
btm_utils.pyc
7.551 KB
-rw-r--r--
btm_utils.pyo
7.551 KB
-rw-r--r--
fixer_base.py
6.621 KB
-rw-r--r--
fixer_base.pyc
7.221 KB
-rw-r--r--
fixer_base.pyo
7.221 KB
-rw-r--r--
fixer_util.py
14.255 KB
-rw-r--r--
fixer_util.pyc
14.771 KB
-rw-r--r--
fixer_util.pyo
14.771 KB
-rw-r--r--
main.py
11.333 KB
-rw-r--r--
main.pyc
9.728 KB
-rw-r--r--
main.pyo
9.687 KB
-rw-r--r--
patcomp.py
6.899 KB
-rw-r--r--
patcomp.pyc
6.599 KB
-rw-r--r--
patcomp.pyo
6.294 KB
-rw-r--r--
pygram.py
1.131 KB
-rw-r--r--
pygram.pyc
1.445 KB
-rw-r--r--
pygram.pyo
1.445 KB
-rw-r--r--
pytree.py
28.358 KB
-rw-r--r--
pytree.pyc
30.558 KB
-rw-r--r--
pytree.pyo
29.695 KB
-rw-r--r--
refactor.py
27.369 KB
-rw-r--r--
refactor.pyc
23.872 KB
-rw-r--r--
refactor.pyo
23.831 KB
-rw-r--r--