How to get all the references to a class

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get all the references to a class

stéphane ducasse-2
Hi guys

after trying during a small hour, I could not find a way to get all  
the references to a class (without using the browser).
I found MethodCollector, ReferenceFinder, ClassBrowserHelper.... but  
I could not get what I wanted

MethodCollector new
        allClassesReferingTo: Core.OrderedCollection

Does any of you have the answer?

In squeak this is quite simple
SystemNavigation default allClassesReferringTo: ... or something like  
that.

Thanks in advance

Reply | Threaded
Open this post in threaded view
|

Re: How to get all the references to a class

Karsten Kusche
Hi Stephane,

try debugging:
BrowserEnvironment new referencesTo: aLiteral

there's the method referencesTo:in: called and there is: anEnvironment
classesDo:  which does all the magic i think. just have a look at this
method, it should give you an idea about how it works.

Kind Regards
Karsten




stéphane ducasse wrote:

> Hi guys
>
> after trying during a small hour, I could not find a way to get all
> the references to a class (without using the browser).
> I found MethodCollector, ReferenceFinder, ClassBrowserHelper.... but I
> could not get what I wanted
>
> MethodCollector new
>     allClassesReferingTo: Core.OrderedCollection
>
> Does any of you have the answer?
>
> In squeak this is quite simple
> SystemNavigation default allClassesReferringTo: ... or something like
> that.
>
> Thanks in advance
>
>

--
Karsten Kusche - Dipl.Inf. - [hidden email]
Georg Heeg eK - Köthen
Handelsregister: Amtsgericht Dortmund A 12812

Reply | Threaded
Open this post in threaded view
|

Re: How to get all the references to a class

Reinout Heeck-2
In reply to this post by stéphane ducasse-2
stéphane ducasse wrote:

> Hi guys
>
> after trying during a small hour, I could not find a way to get all
> the references to a class (without using the browser).
> I found MethodCollector, ReferenceFinder, ClassBrowserHelper.... but I
> could not get what I wanted
>
> MethodCollector new
>     allClassesReferingTo: Core.OrderedCollection
>
> Does any of you have the answer?

--
*********************************************************************

Dit e-mailbericht is alleen bestemd voor de geadresseerde(n).

Gebruik door anderen is niet toegestaan. Indien u niet degeadresseerde(n) bent wordt u verzocht de verzender hiervan op de hoogte te stellen en het bericht te verwijderen. Door de elektronische verzending kunnen aan de inhoud van dit bericht geen rechten worden ontleend.

Soops B.V. is gevestigd te Amsterdam, Nederland, en is geregistreerd bij de Kamer van Koophandel onder nummer 33240368.
Soops B.V. levert volgens de Fenit voorwaarden, gedeponeerd te Den Haag op 8 december 1994 onder nummer 1994/189.
**********************************************************************

This e-mail message is intended to be exclusively for the addressee.

If you are not the intended recipient you are kindly requested not to make any use whatsoever of the contents and to notify the sender immediately by returning this e-mail message. No rights can be derived from this message.

Soops B.V. is a private limited liability company and has its seat at Amsterdam, The Netherlands and is registered with the Trade Registry of the Chamber of Commerce and Industry under number 33240368.
Soops B.V. delivers according to the General Terms and Conditions of Business of Fenit, registered at The Hague, The Netherlands on December 8th, 1994, under number 1994/189
**********************************************************************


Reply | Threaded
Open this post in threaded view
|

Re: How to get all the references to a class

Reinout Heeck-2
In reply to this post by stéphane ducasse-2
stéphane ducasse wrote:

> Hi guys
>
> after trying during a small hour, I could not find a way to get all
> the references to a class (without using the browser).
> I found MethodCollector, ReferenceFinder, ClassBrowserHelper.... but I
> could not get what I wanted
>
> MethodCollector new
>     allClassesReferingTo: Core.OrderedCollection
>
> Does any of you have the answer?

Hmm... second try:


mc := MethodCollector new.
bindingToSearch := OrderedCollection fullyQualifiedReference binding.
filter := mc referencesTo: bindingToSearch.
result := mc select: filter.




R
-


Reply | Threaded
Open this post in threaded view
|

Re: How to get all the references to a class

stéphane ducasse-2
thanks all

I missed the fullyQualifiedReference binding.
and there is no examples like that in the class.


On 20 déc. 07, at 17:04, Reinout Heeck wrote:

> stéphane ducasse wrote:
>> Hi guys
>>
>> after trying during a small hour, I could not find a way to get  
>> all the references to a class (without using the browser).
>> I found MethodCollector, ReferenceFinder, ClassBrowserHelper....  
>> but I could not get what I wanted
>>
>> MethodCollector new
>>     allClassesReferingTo: Core.OrderedCollection
>>
>> Does any of you have the answer?
>
> Hmm... second try:
>
>
> mc := MethodCollector new.
> bindingToSearch := OrderedCollection fullyQualifiedReference binding.
> filter := mc referencesTo: bindingToSearch.
> result := mc select: filter.
>
>
>
>
> R
> -
>
>

Reply | Threaded
Open this post in threaded view
|

Re: How to get all the references to a class

Dennis smith-4
In reply to this post by Reinout Heeck-2


Reinout Heeck wrote:

> stéphane ducasse wrote:
>> Hi guys
>>
>> after trying during a small hour, I could not find a way to get all
>> the references to a class (without using the browser).
>> I found MethodCollector, ReferenceFinder, ClassBrowserHelper.... but
>> I could not get what I wanted
>>
>> MethodCollector new
>>     allClassesReferingTo: Core.OrderedCollection
>>
>> Does any of you have the answer?
>
> Hmm... second try:
>
>
> mc := MethodCollector new.
> bindingToSearch := OrderedCollection fullyQualifiedReference binding.
> filter := mc referencesTo: bindingToSearch.
> result := mc select: filter.
Hey! neat API -- thought all those API designers worked for MS :)

I know the browser was written to be a browser, but it sure would be
nice if some of the
functions were API'ed -- we had to build a front end to do stuff
reasonable, since we have our
own higher-level browsers that wanted things.
>
>
>
>
> R
> -
>
>

--
Dennis Smith                         +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              sip:[hidden email]
Canada         http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

Reply | Threaded
Open this post in threaded view
|

Re: How to get all the references to a class

stéphane ducasse-2

>
> I know the browser was written to be a browser, but it sure would  
> be nice if some of the
> functions were API'ed -- we had to build a front end to do stuff  
> reasonable, since we have our
> own higher-level browsers that wanted things.

I saw the classBrowserHelper>>classReferences but it requires a  
browser and I do not want
to rely on RB to get references.