code indexer

K

Kevin Collins

Hi,

I posted this message a few days ago in comp.unix.shell and got zero
responses. Can anyone here point me in the right direction?

Thanks,

Kevin
-----

Hi,

does anyone know of a tool I can use to create an index / search
engine for source code (ksh, sh, bash, perl, tcl, expect, awk, C,
java, etc)?

I'm thinking of something that would generate an index based on
keywords, "text", operators, functions, etc... I'm sure I can't be the
1st person to want something like this and I don't want to re-invent
the wheel.

I've looked at Exhuberant Ctags and its not quite what I need, but its
in the general vicinity.

I suspect that I could somehow use ViM syntax-highlighting to produce
indices on a file-by-file basis somehow since it knows all the "stuff"
I want to index for all those languages (it needs to for the
highlighting).

Any ideas?

Thanks,

Kevin
 
K

Kris Wempa

You can pretty much use any language that can build a parser for each of the
languages you want to do that for. I used a program called 'cscope' which
did something like that for C. You could type in a symbol and what you were
specifically looking for (definition, prototype, instance, etc.) and it
would search an entire directory structure for it. Your problem however is
far more complicated since you want it to apply to multiple languages.
Therefore, you would basically need a builtin parser for EACH language. I
would recommend getting the source code to one of the newer editors such as
the 'vim' that comes with Linux. This tool changes the color of your text,
depending on what type of file you are editing. It seems understand quite a
few languages and does a surprisingly good job. So far, it's worked on
HTML, C, Perl, C++, shell scripts and .conf files.

Kris
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top