Carl Friedrich Bolz wrote: > I cannot really say much about how easy it would be to just write a > preprocessor. However, I think what you are trying to do could be done > reasonably easy with the PyPy project: > > http://codespeak.net/pypy > > PyPy is an implementation of a Python interpreter written in Python. > (Disclaimer: I am a PyPy developer). It has a quite flexible > parser/bytecode compiler that could probably be tweaked to support your > new syntax (especially if the new constructs can be mapped to standard > python).
It looks like the lack of thread support means I can't just use PyPy by itself, unfortunately. But the tokeniser, lexer, parser and AST builder could do what I need with modification, then I could walk the generated AST and produce standard Python code from that. How easy would it be to separate these parts out from the rest of PyPy? -- http://mail.python.org/mailman/listinfo/python-list