Semantic C code indexing and query tool
Baruch Siach
baruch at tkos.co.il
Mon May 14 10:53:20 IDT 2012
Hi Dov,
On Mon, May 14, 2012 at 09:55:46AM +0300, Dov Grobgeld wrote:
> There was just an article on Slashdot about FreeBSD abondoning gcc in favor
> of clang. I hadn't encountered clang before, and have read up on it since.
> The big difference between gcc and clang was that clang was written from
> the very beginning to be reusable tool, around which various
> functionalities can be built. E.g. a package that does syntax aware source
> code completion in emacs and vim. See:
>
> http://kristianrumberg.wordpress.com/2010/04/22/smart-autocompletion-for-c-in-emacs/
> lang.llvm.org
Of all mentioned alternative this one seems to be the closest. clang has full
knowledge of all tags and references types. Exporting this info to an external
tags database doesn't look too hard to do. Has anyone done this already?
baruch
> On Mon, May 14, 2012 at 9:19 AM, Gilboa Davara <gilboad at gmail.com> wrote:
>
> > On Mon, May 14, 2012 at 9:03 AM, Baruch Siach <baruch at tkos.co.il> wrote:
> > > Hi Gilboa,
> > >
> > > On Mon, May 14, 2012 at 08:52:39AM +0300, Gilboa Davara wrote:
> > >> On Mon, May 14, 2012 at 7:34 AM, Baruch Siach <baruch at tkos.co.il>
> > wrote:
> > >> > I'm looking for a tool that can do semantic search is a body of C
> > code.
> > >> > Example query: "give me all references to field y in struct x defined
> > in
> > >> > file z.h". I would prefer an open source, command line driven tool.
> > C++
> > >> > support is an advantage. Does such a tool exist?
> > >>
> > >> I use cscope for more-or-less the same requirements.
> > >
> > > I've tried cscope, but I couldn't find a way to find references to a
> > field in
> > > a specific struct. Can this be done with cscope?
> > >
> > > baruch
> >
> > In theory cscope f t (find text) can do it, but it won't be very
> > efficient and my suffer from high rate of false positives.
> > Per your requirements, I'd suggest you consider using grep to filter
> > the results of cscope find s.
> >
> > - Gilboa
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
More information about the Linux-il
mailing list