how to get all the send to super?
Hi I would like to study the use of super. Any idea how I can query them? Stef
On 28 Jun 2015, at 17:25, stepharo <stepharo@free.fr> wrote:
Hi I would like to study the use of super. Any idea how I can query them?
Hi Stef, To get all methods that have a super send you can do: superSenders := CompiledMethod allInstances select: #sendsToSuper If you need more advanced search you can do it with RBParseTreeSearcher. For exemple to get each super message node: superSends := OrderedCollection new. searcher := RBParseTreeSearcher new matches: 'super ``@msg: ``@args' do: [ :node :ans | superSends add: node ]. superSenders do: [ :each | searcher executeTree: each ast ]. superSends Camille
Stef
Tx! Stef Le 28/6/15 17:40, Camille a écrit :
On 28 Jun 2015, at 17:25, stepharo <stepharo@free.fr <mailto:stepharo@free.fr>> wrote:
Hi I would like to study the use of super. Any idea how I can query them?
Hi Stef,
To get all methods that have a super send you can do:
superSenders := CompiledMethod allInstances select: #sendsToSuper
If you need more advanced search you can do it with RBParseTreeSearcher. For exemple to get each super message node:
superSends := OrderedCollection new. searcher := RBParseTreeSearcher new matches: 'super ``@msg: ``@args' do: [ :node :ans | superSends add: node ]. superSenders do: [ :each | searcher executeTree: each ast ]. superSends
Camille
Stef
2015-06-28 17:25 GMT+02:00 stepharo <stepharo@free.fr>:
Hi
I would like to study the use of super. Any idea how I can query them?
Stef
| rule result | rule := CodeSearchingRule new matcher: (RBParseTreeSearcher new matches: 'super' do: [ :node :answer | node ]; yourself); yourself. result := RBSmalllintChecker runRule: rule onEnvironment: RBBrowserEnvironment default. MessageBrowser browse: result result methods title:'super' autoSelect:'super'
participants (3)
-
Camille -
Nicolai Hess -
stepharo