[pypy-dev] Metaprogramming with syntax extension
valentin.perrelle at orange.fr
Sun Dec 4 18:58:33 CET 2011
Last months i played a bit with syntax extension in order to develop a
network programming paradigm inspired by the Unreal Script language. I
did that with LUA and the help of metalua which use a lua lua compiler.
I was wondering if i could do the same with Python.
Is it possible with Pypy to dynamically (or even statically) change the
parser in order to accept new syntax constructions ? All i could need is
to perform program transformation : any program with the new syntax
could be translated to a valid python program without the syntax
extension. Basically, i need to change the way some class methods are
called and some properties are accessed. Of course, it could be done
with the dedicated metatmethods. But the amount of code needed to
perform this would be big, repetitive, uninformative and hardly
More information about the pypy-dev