public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* RE: How to find cross reference for local variables.
@ 2001-05-09  5:40 Bernard Dautrevaux
  0 siblings, 0 replies; 3+ messages in thread
From: Bernard Dautrevaux @ 2001-05-09  5:40 UTC (permalink / raw)
  To: 'Umair Rasool', sourcenav

> -----Original Message-----
> From: Umair Rasool [ mailto:umairr@ifi.uio.no ]
> Sent: Wednesday, May 09, 2001 12:20 PM
> To: sourcenav@sources.redhat.com
> Subject: How to find cross reference for local variables.
> 
> 
> Dear Sir,
> 
> My question is regarding finding references to a class.
> Please consider the following example
> 
> public class Database{
> // class body
> public void writeToDatabase(){
>  // method body
> }
> }
> 
> 
> public class AnotherClass{
> Database db = new Database;

Which C++ compiler were you using? I didn't kown it was valid C++ to
initialize class members in the class definintion; they are deemed to be
initialized in the various constructors IIRC :-)

This is a feature I would have loved, as it would have allowed to simply
avoid *any* uininitialized member, but I'm afraid it's not standard C++
(PLEASE if I'm wrong can anybody point me on th erelevant section of the
standard?)

If I'm true, then there is no sense in SN understanding an invalid
declaration as having a valid semantics :-)

Regards,

	Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: How to find cross reference for local variables.
@ 2001-05-09 10:07 Bernard Dautrevaux
  0 siblings, 0 replies; 3+ messages in thread
From: Bernard Dautrevaux @ 2001-05-09 10:07 UTC (permalink / raw)
  To: 'Umair Rasool', sourcenav

> -----Original Message-----
> From: Umair Rasool [ mailto:umairr@ifi.uio.no ]
> Sent: Wednesday, May 09, 2001 3:15 PM
> To: Bernard Dautrevaux
> Subject: Re: How to find cross reference for local variables.
> 
> 
> Dear Dautrevaux,
> 
> First of all I would like to thank you for your response. After this I
> would  apologize for not mentioning the fact that the example code was
> supposed to be "Java Code". 

I should've think at it ;-)

> I have a Java application that I am trying to
> find cross-references for and there I am having the problem 
> that I mentioned
> in my previous e-mail. In Java it is possible to initalize 
> class members in
> the class definitions. So does this means that the designers 
> have overlooked
> this feature of Java?

Yes, I'm afraid at the time SN was designed, the languages of choice were
only C and C++, and probably Java was not anticipated 8-0
 
You there run into the fact that Java is like C++ (at least syntactically)
so a C++-oriented tool will work fine one it, but not really the same so
some features of the language may not be supported :-(

Hopefully it should not be too difficult to add the right rule in SN's
parser, although I've never even looked at the source code yet :-)

Regards,

	Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* How to find cross reference for local variables.
@ 2001-05-09  3:09 Umair Rasool
  0 siblings, 0 replies; 3+ messages in thread
From: Umair Rasool @ 2001-05-09  3:09 UTC (permalink / raw)
  To: sourcenav

Dear Sir,

My question is regarding finding references to a class.
Please consider the following example

public class Database{
// class body
public void writeToDatabase(){
 // method body
}
}


public class AnotherClass{
Database db = new Database;
public void useDb(){
db.writeToDatabsse
}
}

In this example I want to find all the places in other classes where the
class Database is used. By using the xref feature in Source Navigator I
don't get any references to the class Database. In other words Source
Navigator is unable to find references to class Database, because the
variable (db in this example)  is defined (and initilalized) in the
class body of class AnotherClass.  If the varialbe in defined (or
initlized)  in  a class method then Source Navigator gives all
references to this particular class. Is there any way of finding out all
the classes in the source code that are using  the class
underconsideration in their bodies and not in their methods? Are there
som preferences that I may have to set to get through this problem?

Thanking you in anticipation

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-05-09 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-09  5:40 How to find cross reference for local variables Bernard Dautrevaux
  -- strict thread matches above, loose matches on Subject: below --
2001-05-09 10:07 Bernard Dautrevaux
2001-05-09  3:09 Umair Rasool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).