Parsing csh scripts with python

D

David Hirschfield

Is there a module out there that would be able to parse a csh script and
give me back a parse tree?

I need to be able to parse the script, modify some variable settings and
then write the script back out so that the only changes are the
variables I've modified (comments, ordering of statements, etc. must
remain the same).

I looked at shlex, but I don't think it will do what I need.
Any suggestions would be appreciated,
-Dave
 
D

Dave Benjamin

I need to be able to parse the script, modify some variable settings and
then write the script back out so that the only changes are the
variables I've modified (comments, ordering of statements, etc. must
remain the same).

I looked at shlex, but I don't think it will do what I need.

What about regular expressions?
 
G

gene tani

Dave said:
What about regular expressions?

probably overkill here, but you might want to look into one of python's
templating libs. They make generating lots of "similar except for..."
code and markup relatively painless.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top