On 21 May 2013 09:10, "Frank Millman" <fr...@chagford.com> wrote: > It doesn't address the issue of brackets. I imagine that the answer is something like - > > maintain a stack of results > for each left bracket, push a level > for each right bracket, pop the result > > or something ... >
Time for me to suggest pyparsing or PLY. You're better off creating your own AST and walking it to produce python or SQL than reinventing the wheel, I think.
-- http://mail.python.org/mailman/listinfo/python-list