Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Better way of getting parsed Python rather than an AST?

Reply
Thread Tools

Better way of getting parsed Python rather than an AST?

 
 
Kenneth McDonald
Guest
Posts: n/a
 
      10-10-2004
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
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
=?iso-8859-1?Q?Fran=E7ois?= Pinard
Guest
Posts: n/a
 
      10-10-2004
[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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GL2 better than the XLs? Consumer grade HDs better than pro-sumer Mini DVs? dh@. DVD Video 1 08-28-2008 07:20 PM
Is splint really better than lint? Is there a better tool than splint? Peter Bencsik C Programming 2 09-21-2006 10:02 PM
Getting RolePrincipal to use RoleProvider.IsInRole rather than RoleProvider.GetRolesForUser Keith Patrick ASP .Net Security 1 08-20-2006 09:23 AM
why use #!/usr/bin/env python rather than #!python? Adriano Ferreira Python 9 12-03-2005 12:25 AM
Cookie problem - getting double rather than updating =?Utf-8?B?RGVudmVyIERldmVsb3Blcg==?= ASP .Net 0 12-13-2004 11:03 PM



Advertisments