I’ll try my best. But essentially,
the CModel does not provide information like this. The CModel really just
provides a table of contents to the source. What you are more interested in is
the index that links function calls to their definitions. The CModel and the
DOM/index are pretty much unrelated.
Unfortunately we don’t really have
documentation available to describe how to do this. You may want to look how
the FindAction works. This action implements the search actions in the Outline
view amongst other things. We only map to source locations for the references, though
and do not map directly to scopes. This will probably be added when we add the
Call Hierarchy view in CDT 4.0.
Hi all,
Would
anyone be able to answer the query from Jagan's e-mail below?
I
also have some questions in addition to Jagan's, the set-up of interest being
Eclipse 3.1.2 / CDT 3.0.2, for the moment:
1)
First of all, is CModel actually capable of giving you this type of information
easily (without your own code having to do some parsing itself)? If not, then
is there some other mechanism via which to achieve this, e.g. by querying the
DOM/AST directly? (Is the DOM even used in CDT 3.0.2?) Or would the best option
be to do some parsing using the CDT parser (IParser)?
2)
As I understand it, the CModel hierarchy is wrapped around the indexer somehow.
Is this true?
I
realize that these are a lot of questions. However, as there isn't much
documentation on the CModel, DOM and indexer on the CDT WIKI or source code,
any answers would be greatly appreciated.
Many
thanks,
Deniz
--
Deniz Özsen
Graduate Software Engineer
Engineering Tools, PTD
BR2, 3rd floor
+44 20 7154 1769
http://www.symbian.com/
Jagan Reddy
<jaganreddy_v@xxxxxxxxx>
Sent
by: cdt-dev-bounces@xxxxxxxxxxx
20/07/2006 13:37
Please
respond to
"CDT General developers list."
<cdt-dev@xxxxxxxxxxx>
|
|
To
|
cdt-dev@xxxxxxxxxxx
|
cc
|
|
Subject
|
[cdt-dev] How to find find the scope of a
function/variable usage.
|
|
I am using CModel
Given
a function usage (org.eclipse.cdt.core.model.IFunction) within some translation
unit, how does one obtain the scope within which this function is called?
SomeScope::someMemberFunction
{
foo();
}
2)
Given a function usage, where the function is called explicitly on an object,
how does one obtain the scope of this function call, i.e. the type of the
variable that the function is called on?
SomeScope::someMemberFunction
{
someVariable->foo();
someVariable2.foo();
}
Regards
Jagan
Do you Yahoo!?
Get on board. You're
invited to try the new Yahoo! Mail Beta._______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
*******************************************************************
*** Symbian Software Ltd is a company
registered in England
and
Wales with registered number 4190020 and registered office at
2-6
Boundary Row, Southwark, London, SE1
8HP, UK.
This message is
intended only for use by the named
addressee and may contain
privileged and/or confidential
information. If you are not the
named addressee you should not
disseminate, copy or take any action
in reliance on it. If you have received
this message in error
please notify postmaster@xxxxxxxxxxx
and delete the message and any
attachments accompanying it
immediately. Neither Symbian nor any of
its Affiliates accepts liability for
any corruption, interception,
amendment, tampering or viruses
occurring to this message in
transit or for any message sent by its
employees which is not in
compliance with Symbian corporate
policy. *************************
*********************************************
*********************************************