On 21/05/2013 09:23, Fábio Santos wrote:
On 21 May 2013 09:10, "Frank Millman" <[email protected]
<mailto:[email protected]>> 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.
Or pick one from this lot http://nedbatchelder.com/text/python-parsers.html
--
If you're using GoogleCrap™ please read this
http://wiki.python.org/moin/GoogleGroupsPython.
Mark Lawrence
--
http://mail.python.org/mailman/listinfo/python-list