Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45655

Re: Question about ast.literal_eval

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Question about ast.literal_eval
Date 2013-05-21 10:00 +0100
References (6 earlier) <519a4b6a$0$29997$c3e8da3$5496439d@news.astraweb.com> <mailman.1905.1369117820.3114.python-list@python.org> <519b2096$0$6574$c3e8da3$5496439d@news.astraweb.com> <knf9u3$rr0$1@ger.gmane.org> <CAA=1kxRdVJYVD8CGrmJ-033P7yGiRzvZTaXC-wZ-CY8axA3=2Q@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1911.1369126836.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 21/05/2013 09:23, Fábio Santos wrote:
>
> On 21 May 2013 09:10, "Frank Millman" <frank@chagford.com
> <mailto:frank@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.
>

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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: Question about ast.literal_eval Frank Millman <frank@chagford.com> - 2013-05-20 15:26 +0200
  Re: Question about ast.literal_eval Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-20 16:12 +0000
    Re: Question about ast.literal_eval Chris Angelico <rosuav@gmail.com> - 2013-05-21 02:23 +1000
    Re: Question about ast.literal_eval Frank Millman <frank@chagford.com> - 2013-05-21 08:30 +0200
      Re: Question about ast.literal_eval Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-21 07:21 +0000
        Re: Question about ast.literal_eval Frank Millman <frank@chagford.com> - 2013-05-21 10:06 +0200
        Re: Question about ast.literal_eval Fábio Santos <fabiosantosart@gmail.com> - 2013-05-21 09:23 +0100
        Re: Question about ast.literal_eval Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-21 10:00 +0100

csiph-web