Better way of getting parsed Python rather than an AST?

Discussion in 'Python' started by Kenneth McDonald, Oct 10, 2004.

  1. Can anyone recommend something which will do one of the
    following:

    1) Parse a Python file into an "object-oriented" syntax
    tree of some sort (eg. with function definitions represented
    by a "FunDef" class, etc.)

    or

    2) Take an AST as produced by the Python AST module, and
    convert it into a "friendlier" form. Unless I'm missing something,
    the builtin AST representation seems somewhat, um, low-level.

    I try to check the newsgroup regularly, but email as well as
    a posting response would be greatly appreciated.

    Thanks,
    Ken McDonald
    Kenneth McDonald, Oct 10, 2004
    #1
    1. Advertising

  2. [Kenneth McDonald]

    > 2) Take an AST as produced by the Python AST module, and convert it
    > into a "friendlier" form. Unless I'm missing something, the builtin
    > AST representation seems somewhat, um, low-level.


    Use the `compiler' module, standard in Python 2.3. It has tiny problems,
    but overall, it is fairly useful.

    --
    Fran├žois Pinard http://pinard.progiciels-bpi.ca
    =?iso-8859-1?Q?Fran=E7ois?= Pinard, Oct 10, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGVudmVyIERldmVsb3Blcg==?=

    Cookie problem - getting double rather than updating

    =?Utf-8?B?RGVudmVyIERldmVsb3Blcg==?=, Dec 13, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    348
    =?Utf-8?B?RGVudmVyIERldmVsb3Blcg==?=
    Dec 13, 2004
  2. Peter Bencsik
    Replies:
    2
    Views:
    824
  3. Replies:
    4
    Views:
    383
    Ira Baxter
    May 23, 2006
  4. Keith Patrick
    Replies:
    1
    Views:
    622
    Dominick Baier
    Aug 20, 2006
  5. Replies:
    2
    Views:
    52
    Mark H Harris
    May 13, 2014
Loading...

Share This Page