[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++ scoping of cross-reference?
From: |
Iain Woolf |
Subject: |
Re: C++ scoping of cross-reference? |
Date: |
Mon, 4 Apr 2011 13:53:39 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8 |
On 03/29/2011 09:07 AM, Shigio YAMAGUCHI wrote:
>> Thanks Shigio. I would like to suggest that global/gtags be extended to
>> support this functionality. Would that be possible?
> What specification are you thinking?
> --
> Shigio YAMAGUCHI <address@hidden>
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
Specifies whether to include extra tag entries for certain
kinds of information. The parameter flags is a set of one-letter
flags, each
representing one kind of extra tag entry to include in the
tag file. If flags is preceded by by either the '+' or '-' character,
the effect
of each flag is added to, or removed from, those currently
enabled; otherwise the flags replace any current settings. The meaning
of each
flag is as follows:
f Include an entry for the base file name of every
source file (e.g. "example.c"), which addresses the first line of the file.
q Include an extra class-qualified tag entry for
each tag which is a member of a class (for languages for which this
information is
extracted; currently C++, Eiffel, and Java). The
actual form of the qualified tag depends upon the language from which
the tag was
derived (using a form that is most natural for
how qualified calls are specified in the language). For C++, it is in
the form
"class::member"; for Eiffel and Java, it is in the
form "class.member". This may allow easier location of a specific tags
when mul-
tiple occurrances of a tag name occur in the tag
file. Note, however, that this could potentially more than double the
size of the
tag file.
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".
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.
What do you think?
--
Iain Woolf W-CDMA Base Software, Alcatel-Lucent
Tel: 613-784-3465 / OnNET 2-825-3465
IM: iwoolf (im.ca.alcatel-lucent.com) / i_woolf (YahooIM)
- Re: C++ scoping of cross-reference?,
Iain Woolf <=