Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/python3.12/internal/pycore_compile.h
$ cat -n /usr/include/python3.12/internal/pycore_compile.h 1 #ifndef Py_INTERNAL_COMPILE_H 2 #define Py_INTERNAL_COMPILE_H 3 #ifdef __cplusplus 4 extern "C" { 5 #endif 6 7 #ifndef Py_BUILD_CORE 8 # error "this header requires Py_BUILD_CORE define" 9 #endif 10 11 struct _arena; // Type defined in pycore_pyarena.h 12 struct _mod; // Type defined in pycore_ast.h 13 14 // Export the symbol for test_peg_generator (built as a library) 15 PyAPI_FUNC(PyCodeObject*) _PyAST_Compile( 16 struct _mod *mod, 17 PyObject *filename, 18 PyCompilerFlags *flags, 19 int optimize, 20 struct _arena *arena); 21 22 static const _PyCompilerSrcLocation NO_LOCATION = {-1, -1, -1, -1}; 23 24 typedef struct { 25 int optimize; 26 int ff_features; 27 28 int recursion_depth; /* current recursion depth */ 29 int recursion_limit; /* recursion limit */ 30 } _PyASTOptimizeState; 31 32 extern int _PyAST_Optimize( 33 struct _mod *, 34 struct _arena *arena, 35 _PyASTOptimizeState *state); 36 37 typedef struct { 38 int h_offset; 39 int h_startdepth; 40 int h_preserve_lasti; 41 } _PyCompile_ExceptHandlerInfo; 42 43 typedef struct { 44 int i_opcode; 45 int i_oparg; 46 _PyCompilerSrcLocation i_loc; 47 _PyCompile_ExceptHandlerInfo i_except_handler_info; 48 } _PyCompile_Instruction; 49 50 typedef struct { 51 _PyCompile_Instruction *s_instrs; 52 int s_allocated; 53 int s_used; 54 55 int *s_labelmap; /* label id --> instr offset */ 56 int s_labelmap_size; 57 int s_next_free_label; /* next free label id */ 58 } _PyCompile_InstructionSequence; 59 60 typedef struct { 61 PyObject *u_name; 62 PyObject *u_qualname; /* dot-separated qualified name (lazy) */ 63 64 /* The following fields are dicts that map objects to 65 the index of them in co_XXX. The index is used as 66 the argument for opcodes that refer to those collections. 67 */ 68 PyObject *u_consts; /* all constants */ 69 PyObject *u_names; /* all names */ 70 PyObject *u_varnames; /* local variables */ 71 PyObject *u_cellvars; /* cell variables */ 72 PyObject *u_freevars; /* free variables */ 73 PyObject *u_fasthidden; /* dict; keys are names that are fast-locals only 74 temporarily within an inlined comprehension. When 75 value is True, treat as fast-local. */ 76 77 Py_ssize_t u_argcount; /* number of arguments for block */ 78 Py_ssize_t u_posonlyargcount; /* number of positional only arguments for block */ 79 Py_ssize_t u_kwonlyargcount; /* number of keyword only arguments for block */ 80 81 int u_firstlineno; /* the first lineno of the block */ 82 } _PyCompile_CodeUnitMetadata; 83 84 85 /* Utility for a number of growing arrays used in the compiler */ 86 int _PyCompile_EnsureArrayLargeEnough( 87 int idx, 88 void **array, 89 int *alloc, 90 int default_alloc, 91 size_t item_size); 92 93 int _PyCompile_ConstCacheMergeOne(PyObject *const_cache, PyObject **obj); 94 95 int _PyCompile_InstrSize(int opcode, int oparg); 96 97 /* Access compiler internals for unit testing */ 98 99 PyAPI_FUNC(PyObject*) _PyCompile_CodeGen( 100 PyObject *ast, 101 PyObject *filename, 102 PyCompilerFlags *flags, 103 int optimize, 104 int compile_mode); 105 106 PyAPI_FUNC(PyObject*) _PyCompile_OptimizeCfg( 107 PyObject *instructions, 108 PyObject *consts, 109 int nlocals); 110 111 PyAPI_FUNC(PyCodeObject*) 112 _PyCompile_Assemble(_PyCompile_CodeUnitMetadata *umd, PyObject *filename, 113 PyObject *instructions); 114 115 #ifdef __cplusplus 116 } 117 #endif 118 #endif /* !Py_INTERNAL_COMPILE_H */
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™