Re: #line compiler directives in results.

"Chris Grebeldinger" <[email protected]>
Newsgroups gmane.comp.gnu.global.general
Message-ID <[email protected]>
I've decided it is probably easier to work-around my issue within my
editor.  So I just created an emacs function which parses the #line
directive (after using gtags-find-tag) and loads the referenced file and
line number.  This seems almost as good as post-processing the tags file.

Thanks


On Sat, Feb 9, 2008 at 9:46 AM, Chris Grebeldinger <[email protected]>
wrote:

> I understand that I can add my special suffix, but what I really want is
> to process c++ files but have each tag point back to the original
> pre-processed file via the embedded #line directives:
>
> /v/main/src/myclass.pre -special syntax c++
> eg:
> CLASSDECL myclass
> CONSTRUCTOR myclass
> ENDCLASSDECL
>
>
> /v/main/work/myclass.cxx  - plain c++ with #line directives pointing back
> to myclass.pre
> eg:
> #line 1 "/v/main/src/myclass.pre"
> class myclass {
> public:
> #line 2 "/v/main/src/myclass.pre"
>   myclass();
> #line 3 "/v/main/src/myclass.pre"
> }
>
> So I run gtags on myclass.cxx, which generates tags properly, but i want
> all the tags to respect the #line directives for file & line information in
> the tags file.
>
> so that tag:
> myclass::myclass() ---> myclass.pre, line 2
> instead of myclass.cxx, line 5
>
> Thanks!
>
>
>
> On Feb 7, 2008 7:17 AM, Shigio YAMAGUCHI <[email protected]> wrote:
>
> > >   Many of the source files I am working with are pre-processed C++
> > with
> > > their own special syntax, and the resulting .cpp files have #line
> > directives
> > > throughout which refer back to the un-processed source.  I am
> > generating
> > > tags from the resulting .cpp files.  Is there any way to configure
> > global to
> > > handle those directives, so that search results only include the
> > > un-processed files?
> >
> > Hi,
> > You can configure it. Please copy and rewrite configuration file for
> > gtags.
> > It is assumed that the suffix of your files is '.XYZ'.
> >
> > $ cp /usr/local/share/gtags.conf $HOME/.globalrc        # copy
> > configuration file into
> >                                                        # your home
> > directory
> > $ vi $HOME/.globalrc                                    # rewrite cpp:
> > entry
> >
> >
> > +------------------------------------------------------------------------------------
> >
> > |:langmap=c\:.c.h,yacc\:.y,asm\:.s.S,java\:.java,cpp\:.c++.cc.cpp.cxx.hxx.hpp.C.H,
> >                                                               |
> >                                                               v
> >
> > +------------------------------------------------------------------------------------
> >
> > |:langmap=c\:.c.h,yacc\:.y,asm\:.s.S,java\:.java,cpp\:.c++.cc.XYZ.cxx.hxx.hpp.C.H,
> >
> > $ cd [your source directory]
> > $ gtags
> >
> > But I don't know whether gtags can treat the special syntax in your
> > source file.
> > Luck is wished.
> > --
> > Shigio YAMAGUCHI <[email protected]> - GNU Project
> > PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3
> >
>
>

_______________________________________________
Help-global mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-global
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.