473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1129
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
14
by: Viktor Rosenfeld | last post by:
Hi, I need to create a parser for a Python project, and I'd like to use process kinda like lex/yacc. I've looked at various parsing packages online, but didn't find anything useful for me: -...
5
by: LFM | last post by:
I have a table I'm importing from our SQL accounting database. The Employee Name is in one field. For the purpose of my needs, I need to extract the last name, first name and middle initial. ...
5
by: jwang | last post by:
I'm currently writing some C code that uses libxml. I've seen several example of parsing xml when the xml are in files. However, I would like to parse the xml from a char buffer. Currently I am ...
2
by: Pavils Jurjans | last post by:
Hello, Is there some class among the thousands of .Net classes, that would do the tab-delimited text data parsing into, say, jagged array (an array of arrays). I have some code sources in other...
10
by: Tony | last post by:
I'm wondering if anyone has run any tests to compare the speed of parsing XML vs text in simple lists - such as: <?xml version="1.0" encoding="ISO-8859-1"?> <users> <user>User 1</user>...
0
by: Blacktiger | last post by:
Hi all, I'm new to this list because I had a question about parsing python block structure. I am taking a programming languages course this semester and for our final project we are writing an...
3
by: Jon Slaughter | last post by:
Is there anything like yacc or spirit for C#? What is the "standard" method for parsing grammars in C#? The last few days I have been looking at boost spirit and really like how it works. What I...
0
by: Ole Nielsby | last post by:
(sorry, wrong button, here is the real post:) I'm working on a C++ parser which is to be used for various code analysis and transformation tools. (It's part of my PILS programming system which...
1
by: Sidhartha | last post by:
Hi, I am facing a problem while parsing local language characters using sax parser. We use DOM to parse and SAX to read the source. But when our application parses strings with local language...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.