bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ scoping of cross-reference?


From: Shigio YAMAGUCHI
Subject: Re: C++ scoping of cross-reference?
Date: Tue, 05 Apr 2011 10:38:22 +0900

> I was thinking something along the lines of the class-qualified tag like
> in exuberant c-tags (--extra=+q).
>
> From the ctags man page:
>
>       --extra=[+|-]flags

If possible, could you describe only your proposal?

> This would provide class-qualifier definitions. When searching for a
> definition, I would like to be able to optionally specify the class
> qualifier. For example, consider:
> 
> class A
> {
> public:
>   virtual void dump();
> };
> 
> class B1 : public A
> {
> public:
>   virtual void dump();
> }
> 
> class B2 : public B
> {
> public:
>   virtual void dump();
> }
> 
> class C : public A
> {
> public:
>   virtual void dump();
> }
> 
> If searching with "global -a dump" I would expect to see all of A::dump,
> B1::dump, B2::dump, C::dump in the output. Alternatively, it should be
> possible to search for "global -a B2::dump".

What is the -a option? What occurs without it?

You mean the following behavior?

[Class hierarchy]

        class A
          |- class B
               |- class C

[Source files]

        [classA.cc]
        +--------------------------------
        |...
        |class A { void dump() {...}}

        [classB.cc]
        +--------------------------------
        |...
        |class B : A { void dump() {...}}

        [classC.cc]
        +--------------------------------
        |...
        |class C : B { void dump() {...}}

[Execution image]

        $ global -x A::dump
        A::dump         classA.cc        50 class A { void dump() {...} }
        B::dump         classB.cc       100 class B : A { void dump() {...} }
        C::dump         classC.cc        90 class C : B { void dump() {...} }
        $ _

        $ global -x B::dump
        B::dump         classB.cc       100 class B : A { void dump() {...} }
        C::dump         classC.cc        90 class C : B { void dump() {...} }
        $ _

        $ global -x C::dump
        C::dump         classC.cc        90 class C : B { void dump() {...} }
        $ _

> Hopefully this could be extended to include references to class specific
> methods, e.g. "global -r B2::dump". However I realize that determining
> these kinds of references would likely be a lot harder.

Would you please describe it for example?
Why do you think it is a lot harder?
--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]