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 :  /usr/include/python3.8/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/include/python3.8/symtable.h
#ifndef Py_LIMITED_API
#ifndef Py_SYMTABLE_H
#define Py_SYMTABLE_H
#ifdef __cplusplus
extern "C" {
#endif

#include "Python-ast.h"   /* mod_ty */

/* XXX(ncoghlan): This is a weird mix of public names and interpreter internal
 *                names.
 */

typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock }
    _Py_block_ty;

struct _symtable_entry;

struct symtable {
    PyObject *st_filename;          /* name of file being compiled,
                                       decoded from the filesystem encoding */
    struct _symtable_entry *st_cur; /* current symbol table entry */
    struct _symtable_entry *st_top; /* symbol table entry for module */
    PyObject *st_blocks;            /* dict: map AST node addresses
                                     *       to symbol table entries */
    PyObject *st_stack;             /* list: stack of namespace info */
    PyObject *st_global;            /* borrowed ref to st_top->ste_symbols */
    int st_nblocks;                 /* number of blocks used. kept for
                                       consistency with the corresponding
                                       compiler structure */
    PyObject *st_private;           /* name of current class or NULL */
    PyFutureFeatures *st_future;    /* module's future features that affect
                                       the symbol table */
    int recursion_depth;            /* current recursion depth */
    int recursion_limit;            /* recursion limit */
};

typedef struct _symtable_entry {
    PyObject_HEAD
    PyObject *ste_id;        /* int: key in ste_table->st_blocks */
    PyObject *ste_symbols;   /* dict: variable names to flags */
    PyObject *ste_name;      /* string: name of current block */
    PyObject *ste_varnames;  /* list of function parameters */
    PyObject *ste_children;  /* list of child blocks */
    PyObject *ste_directives;/* locations of global and nonlocal statements */
    _Py_block_ty ste_type;   /* module, class, or function */
    int ste_nested;      /* true if block is nested */
    unsigned ste_free : 1;        /* true if block has free variables */
    unsigned ste_child_free : 1;  /* true if a child block has free vars,
                                     including free refs to globals */
    unsigned ste_generator : 1;   /* true if namespace is a generator */
    unsigned ste_coroutine : 1;   /* true if namespace is a coroutine */
    unsigned ste_comprehension : 1; /* true if namespace is a list comprehension */
    unsigned ste_varargs : 1;     /* true if block has varargs */
    unsigned ste_varkeywords : 1; /* true if block has varkeywords */
    unsigned ste_returns_value : 1;  /* true if namespace uses return with
                                        an argument */
    unsigned ste_needs_class_closure : 1; /* for class scopes, true if a
                                             closure over __class__
                                             should be created */
    unsigned ste_comp_iter_target : 1; /* true if visiting comprehension target */
    int ste_comp_iter_expr; /* non-zero if visiting a comprehension range expression */
    int ste_lineno;          /* first line of block */
    int ste_col_offset;      /* offset of first line of block */
    int ste_opt_lineno;      /* lineno of last exec or import * */
    int ste_opt_col_offset;  /* offset of last exec or import * */
    struct symtable *ste_table;
} PySTEntryObject;

PyAPI_DATA(PyTypeObject) PySTEntry_Type;

#define PySTEntry_Check(op) (Py_TYPE(op) == &PySTEntry_Type)

PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *);

PyAPI_FUNC(struct symtable *) PySymtable_Build(
    mod_ty mod,
    const char *filename,       /* decoded from the filesystem encoding */
    PyFutureFeatures *future);
PyAPI_FUNC(struct symtable *) PySymtable_BuildObject(
    mod_ty mod,
    PyObject *filename,
    PyFutureFeatures *future);
PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *);

PyAPI_FUNC(void) PySymtable_Free(struct symtable *);

/* Flags for def-use information */

#define DEF_GLOBAL 1           /* global stmt */
#define DEF_LOCAL 2            /* assignment in code block */
#define DEF_PARAM 2<<1         /* formal parameter */
#define DEF_NONLOCAL 2<<2      /* nonlocal stmt */
#define USE 2<<3               /* name is used */
#define DEF_FREE 2<<4          /* name used but not defined in nested block */
#define DEF_FREE_CLASS 2<<5    /* free variable from class's method */
#define DEF_IMPORT 2<<6        /* assignment occurred via import */
#define DEF_ANNOT 2<<7         /* this name is annotated */
#define DEF_COMP_ITER 2<<8     /* this name is a comprehension iteration variable */

#define DEF_BOUND (DEF_LOCAL | DEF_PARAM | DEF_IMPORT)

/* GLOBAL_EXPLICIT and GLOBAL_IMPLICIT are used internally by the symbol
   table.  GLOBAL is returned from PyST_GetScope() for either of them.
   It is stored in ste_symbols at bits 12-15.
*/
#define SCOPE_OFFSET 11
#define SCOPE_MASK (DEF_GLOBAL | DEF_LOCAL | DEF_PARAM | DEF_NONLOCAL)

#define LOCAL 1
#define GLOBAL_EXPLICIT 2
#define GLOBAL_IMPLICIT 3
#define FREE 4
#define CELL 5

#define GENERATOR 1
#define GENERATOR_EXPRESSION 2

#ifdef __cplusplus
}
#endif
#endif /* !Py_SYMTABLE_H */
#endif /* !Py_LIMITED_API */
Name
Size
Permissions
Options
cpython
--
drwxr-xr-x
internal
--
drwxr-xr-x
Python-ast.h
25.87 KB
-rw-r--r--
Python.h
3.53 KB
-rw-r--r--
_hashopenssl.h
1.333 KB
-rw-r--r--
abstract.h
29.576 KB
-rw-r--r--
asdl.h
1.2 KB
-rw-r--r--
ast.h
0.926 KB
-rw-r--r--
bitset.h
0.457 KB
-rw-r--r--
bltinmodule.h
0.258 KB
-rw-r--r--
boolobject.h
0.865 KB
-rw-r--r--
bytearrayobject.h
2.064 KB
-rw-r--r--
bytes_methods.h
3.224 KB
-rw-r--r--
bytesobject.h
8.294 KB
-rw-r--r--
cellobject.h
0.696 KB
-rw-r--r--
ceval.h
8.17 KB
-rw-r--r--
classobject.h
1.67 KB
-rw-r--r--
code.h
7.01 KB
-rw-r--r--
codecs.h
6.634 KB
-rw-r--r--
compile.h
3.498 KB
-rw-r--r--
complexobject.h
1.765 KB
-rw-r--r--
context.h
1.967 KB
-rw-r--r--
datetime.h
9.043 KB
-rw-r--r--
descrobject.h
2.948 KB
-rw-r--r--
dictobject.h
3.629 KB
-rw-r--r--
dtoa.h
0.447 KB
-rw-r--r--
dynamic_annotations.h
21.942 KB
-rw-r--r--
enumobject.h
0.247 KB
-rw-r--r--
errcode.h
1.655 KB
-rw-r--r--
eval.h
1.181 KB
-rw-r--r--
fileobject.h
1.534 KB
-rw-r--r--
fileutils.h
4.25 KB
-rw-r--r--
floatobject.h
4.682 KB
-rw-r--r--
frameobject.h
3.239 KB
-rw-r--r--
funcobject.h
4.102 KB
-rw-r--r--
genobject.h
3.633 KB
-rw-r--r--
graminit.h
2.068 KB
-rw-r--r--
grammar.h
1.778 KB
-rw-r--r--
import.h
4.811 KB
-rw-r--r--
interpreteridobject.h
0.326 KB
-rw-r--r--
intrcheck.h
0.841 KB
-rw-r--r--
iterobject.h
0.554 KB
-rw-r--r--
listobject.h
2.858 KB
-rw-r--r--
longintrepr.h
3.71 KB
-rw-r--r--
longobject.h
9.297 KB
-rw-r--r--
marshal.h
0.784 KB
-rw-r--r--
memoryobject.h
2.7 KB
-rw-r--r--
methodobject.h
4.303 KB
-rw-r--r--
modsupport.h
9.366 KB
-rw-r--r--
moduleobject.h
2.307 KB
-rw-r--r--
namespaceobject.h
0.341 KB
-rw-r--r--
node.h
1.297 KB
-rw-r--r--
object.h
28.905 KB
-rw-r--r--
objimpl.h
10.29 KB
-rw-r--r--
odictobject.h
1.27 KB
-rw-r--r--
opcode.h
5.043 KB
-rw-r--r--
osdefs.h
0.72 KB
-rw-r--r--
osmodule.h
0.284 KB
-rw-r--r--
parsetok.h
2.889 KB
-rw-r--r--
patchlevel.h
1.269 KB
-rw-r--r--
picklebufobject.h
0.827 KB
-rw-r--r--
py_curses.h
2.419 KB
-rw-r--r--
pyarena.h
2.68 KB
-rw-r--r--
pycapsule.h
1.686 KB
-rw-r--r--
pyconfig-64.h
46.41 KB
-rw-r--r--
pyconfig.h
0.158 KB
-rw-r--r--
pyctype.h
1.354 KB
-rw-r--r--
pydebug.h
1.186 KB
-rw-r--r--
pydtrace.h
2.356 KB
-rw-r--r--
pyerrors.h
12.486 KB
-rw-r--r--
pyexpat.h
2.393 KB
-rw-r--r--
pyfpe.h
0.333 KB
-rw-r--r--
pyhash.h
4.043 KB
-rw-r--r--
pylifecycle.h
2.032 KB
-rw-r--r--
pymacconfig.h
2.919 KB
-rw-r--r--
pymacro.h
3.689 KB
-rw-r--r--
pymath.h
8.117 KB
-rw-r--r--
pymem.h
5.279 KB
-rw-r--r--
pyport.h
29.513 KB
-rw-r--r--
pystate.h
4.576 KB
-rw-r--r--
pystrcmp.h
0.426 KB
-rw-r--r--
pystrhex.h
0.829 KB
-rw-r--r--
pystrtod.h
1.448 KB
-rw-r--r--
pythonrun.h
7.466 KB
-rw-r--r--
pythread.h
5.527 KB
-rw-r--r--
pytime.h
8.717 KB
-rw-r--r--
rangeobject.h
0.614 KB
-rw-r--r--
setobject.h
3.283 KB
-rw-r--r--
sliceobject.h
2.458 KB
-rw-r--r--
structmember.h
1.982 KB
-rw-r--r--
structseq.h
1.345 KB
-rw-r--r--
symtable.h
5.184 KB
-rw-r--r--
sysmodule.h
1.213 KB
-rw-r--r--
token.h
2.372 KB
-rw-r--r--
traceback.h
0.587 KB
-rw-r--r--
tracemalloc.h
1.088 KB
-rw-r--r--
tupleobject.h
1.622 KB
-rw-r--r--
typeslots.h
2.2 KB
-rw-r--r--
ucnhash.h
1.031 KB
-rw-r--r--
unicodeobject.h
34.895 KB
-rw-r--r--
warnings.h
1.734 KB
-rw-r--r--
weakrefobject.h
2.799 KB
-rw-r--r--