Parsing other languages -> function map

R

Richard Shea

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.
 
S

Steve

Hi 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 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
 
M

Miki Tebeka

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.
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top