python字节码语法 [英] python bytecode grammar
问题描述
在哪里可以找到python字节码的语法? (如果在BCF更好
)。
where I can find the grammar of python bytecode ? ( better if is in BCF
).
推荐答案
M1st0写道:
我在哪里可以找到python字节码的语法? (如果在BCF更好
)。
where I can find the grammar of python bytecode ? ( better if is in BCF
).
字节码没有语法 - 就像汇编指令一样。
And什么是BCF应该是什么意思 - BNF是语法的一种形式,BCF I
从未听说过。
除此之外:告诉我们你是什么'之后,我们可能会提供帮助并建议除了创建/操作字节码之外的其他方式,因为这被认为是一个不应该在
实现(如jython)并受到未经宣布的更改
之间的主要修订版本。
Diez
There is no grammar for bytecodes - the are like assembly instructions.
And what''s BCF supposed to mean - BNF is a form for grammars, BCF I
never heard of.
And besides that: tell us what you''re after, we might help and suggest
other ways than creating/manipulating bytecode, as this is considered a
implementation detail that is not supposed to work across
implementations (like jython) and is subject to unannounced changes
between major revisions of python.
Diez
Ops是BNF:P Bacus Normal Form如果我没错的话......
然而......
我尝试识别字节编码文件中的模式,以便优化...
但我想解析即重建它像一个
树..
,以便递归地应用树上的规则。
我有在Python中看到compile.c ...
Ops yes is BNF :P Bacus Normal Form if I am not wrong...
However......
I''am tryng to recognizing patterns in a bytecoded file in orderd to
optimize...
But I would like to "parse" i.e reconstruct it in something like a
tree..
in order to apply rules on a tree recursively.
I have seen compile.c in the Python dist...
M1st0写道:
Ops是BNF:P Bacus Normal Form如果我没有错......
然而......
我正在尝试识别字节编码文件中的模式,以便
优化...
但我想解析即重建它像一个树......
,以递归方式在树上应用规则。
Ops yes is BNF :P Bacus Normal Form if I am not wrong...
However......
I''am tryng to recognizing patterns in a bytecoded file in orderd to
optimize...
But I would like to "parse" i.e reconstruct it in something like a
tree..
in order to apply rules on a tree recursively.
但字节码就像汇编 - 没有树状结构。操作码是
后跟一些参数,oopcodes是一个序列。
然而字节码是以某种方式来自AST的_generated_。也许你可以在这上面工作。另外看看psyco,它已经做了优化
进行数值计算。
此外:我很怀疑你可以在
字节码级别本身,因为它非常高级。优化的努力
就像在psyco中没有改变字节码 - 它们取代它......
Diez
But bytecode is like assembly - there is no tree-structure. A opcode is
followed by a number of arguments, and oopcodes are in a seqence.
However the bytecode is _generated_ from the AST somehow. Maybe you can
work on that. Also take a look at psyco, it already does optimizations
for numeric calculations.
Besides: I serously doubt you can do much optimization on the
bytecodelevel itself, as it is very highlevel. The optimization efforts
like in psyco don''t alter bytecode - they replace it....
Diez
这篇关于python字节码语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!