Ben Finney wrote: > As I understand it, the point was not what the code does, but to give > a sample input (a Python program) for the "simple text processor" you > described to wade through.
Ah, well then, there's no need for a full-blown parser. It should suffice to recognize a class definition and modify the parameter list of every def indented one level further than that. Then pick out the static methods and 'undo' those. Can be done in one pass by keeping the class definition in memory until you've scanned the whole thing, then adding self where needed as you spit it back out. Implementation is left as an exercise for the reader. :) -- http://mail.python.org/mailman/listinfo/python-list