Python 语言服务¶
Python 提供了许多模块来帮助使用 Python 语言。 这些模块支持标记化、解析、语法分析、字节码反汇编以及各种其他工具。
这些模块包括:
ast
--- 抽象语法树symtable
——访问编译器的符号表token
--- 与Python解析树一起使用的常量tok_name
ISTERMINAL()
ISNONTERMINAL()
ISEOF()
ENDMARKER
NAME
NUMBER
STRING
NEWLINE
INDENT
DEDENT
LPAR
RPAR
LSQB
RSQB
COLON
COMMA
SEMI
PLUS
MINUS
STAR
SLASH
VBAR
AMPER
LESS
GREATER
EQUAL
DOT
PERCENT
LBRACE
RBRACE
EQEQUAL
NOTEQUAL
LESSEQUAL
GREATEREQUAL
TILDE
CIRCUMFLEX
LEFTSHIFT
RIGHTSHIFT
DOUBLESTAR
PLUSEQUAL
MINEQUAL
STAREQUAL
SLASHEQUAL
PERCENTEQUAL
AMPEREQUAL
VBAREQUAL
CIRCUMFLEXEQUAL
LEFTSHIFTEQUAL
RIGHTSHIFTEQUAL
DOUBLESTAREQUAL
DOUBLESLASH
DOUBLESLASHEQUAL
AT
ATEQUAL
RARROW
ELLIPSIS
COLONEQUAL
EXCLAMATION
OP
TYPE_IGNORE
TYPE_COMMENT
SOFT_KEYWORD
FSTRING_START
FSTRING_MIDDLE
FSTRING_END
COMMENT
NL
ERRORTOKEN
N_TOKENS
NT_OFFSET
ENCODING
keyword
--- 检验Python关键字tokenize
--- 对 Python 代码使用的标记解析器tabnanny
--- 模糊缩进检测pyclbr
--- Python 模块浏览器支持py_compile
--- 编译 Python 源文件compileall
--- 字节编译 Python 库dis
--- Python 字节码反汇编器- 命令行接口
- 字节码分析
- 分析函数
- Python字节码说明
Instruction
Instruction.opcode
Instruction.opname
Instruction.baseopcode
Instruction.baseopname
Instruction.arg
Instruction.oparg
Instruction.argval
Instruction.argrepr
Instruction.offset
Instruction.start_offset
Instruction.cache_offset
Instruction.end_offset
Instruction.starts_line
Instruction.line_number
Instruction.is_jump_target
Instruction.jump_target
Instruction.positions
Positions
- 操作码集合
pickletools
--- pickle 开发者工具集