M
M1st0
where I can find the grammar of python bytecode ? ( better if is in BCF
).
).
M1st0 said:where I can find the grammar of python bytecode ? ( better if is in BCF
).
M1st0 said:Ops yes is BNF 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.
M1st0 said:Ops yes is BNF 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 said:where I can find the grammar of python bytecode ? ( better if is in BCF
Terry Reedy said:I believe the top-level production is something like
BYTECODE := (OPCODE ARGS)*
Peter Dembinski said:ROTFL
Terry Reedy said:Glad to make your day ;-)
M1st0 said:Ops yes is BNF Bacus Normal Form if I am not wrong...
Well, Raymond Hettinger wrote a decorator to optimize functions in various ways,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....
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.