470,638 Members | 1,577 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,638 developers. It's quick & easy.

Parsing other languages -> function map

Hi - [This is a Python question - bear with me !] I've got quite a
number of PHP scripts which include many functions which call each
other. I'm interested in having a means to determine which function
gets called from which other functions.

I feel I could do this using Python without too much pain (although
the output of the raw data will be a bit more tricky) but before I
started I wondered if anyone here could suggest an existing code base
which would give me a flying start ? I've had a look in Parnassus but
there's nothing very obvious there.

I feel sure my requirement is an instance of a much more general
requirement which has probably been solved many times over.

Be interested to hear from anyone with bright ideas.

thanks

richard shea.
Jul 18 '05 #1
2 1070
Hello Richard,
Hi - [This is a Python question - bear with me !] I've got quite a
number of PHP scripts which include many functions which call each
other. I'm interested in having a means to determine which function
gets called from which other functions.

I feel I could do this using Python without too much pain (although
the output of the raw data will be a bit more tricky) but before I
started I wondered if anyone here could suggest an existing code base
which would give me a flying start ? I've had a look in Parnassus but
there's nothing very obvious there.

pychecker (http://pychecker.sourceforge.net/) has an option to check for
unreachable code (-8).

HTH.
Bye.
--
------------------------------------------------------------------------
Miki Tebeka <mi*********@zoran.com>
http://tebeka.spymac.net
The only difference between children and adults is the price of the toys
Jul 18 '05 #2
Hi Richard,

On 19 Jul 2004 17:52:32 -0700, Richard Shea <ri*********@fastmail.fm> wrote:
Hi - [This is a Python question - bear with me !] I've got quite a
number of PHP scripts which include many functions which call each
other. I'm interested in having a means to determine which function
gets called from which other functions.


I use cscope ( http://cscope.sourceforge.net/ ) for most of my
code browsing (actually cscope+the cscope_maps.vim plugin). Although
it was designed for looking at C code, due to the fact that it's
parsing is more text oriented rather than specific to any language, it
does a great job with python. I suggest you give it a spin with php
code and see how things work.

At a tangential thread, the idea of a tool like cscope which can
support different languages using a plugin mechanism is really
appealing. There always are things like source-navigator (
http://sourcenav.sourceforge.net/ ) , but that is more of an IDE
including the kitchen-sink, which I personally do not like. It'd be
cool to have a tool that just does one thing and does it properly,
also, the coolness factor increases tremendously when the output can
be obtained at stdout because we can then write a nice lil' plugin for
our editor and instantly gloat that the _other_ editor cannot do this
:).
I'd be interested in writing one up if there is someone out there
who could help out with the design and stuff. (pyscope anyone ?)
Regards
Steve
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

303 posts views Thread by mike420 | last post: by
14 posts views Thread by Viktor Rosenfeld | last post: by
5 posts views Thread by jwang | last post: by
2 posts views Thread by Pavils Jurjans | last post: by
10 posts views Thread by Tony | last post: by
reply views Thread by Blacktiger | last post: by
3 posts views Thread by Jon Slaughter | last post: by
reply views Thread by Ole Nielsby | last post: by
1 post views Thread by Korara | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.