4506 and:[ Smalltalk includesKey: node name asSymbol ] |
4506 and:[ Smalltalk includesKey: node name asSymbol ] |
4507 ] |
4507 ] |
4508 thenCollect:[:node | node name asSymbol]. |
4508 thenCollect:[:node | node name asSymbol]. |
4509 |
4509 |
4510 usedSymbols := searchTree usedSymbols. |
4510 usedSymbols := searchTree usedSymbols. |
|
4511 |
|
4512 "/ cannot use literals to speedup the search, because stc does not store |
|
4513 "/ constants in the literal-array. |
|
4514 "/ literalsUsed := searchTree usedLiterals. |
|
4515 "/ literalsUsed := literalsUsed select:[:lit | lit isString]. |
4511 |
4516 |
4512 searcher := ParseTreeSearcher new. |
4517 searcher := ParseTreeSearcher new. |
4513 isMethod ifTrue:[ |
4518 isMethod ifTrue:[ |
4514 searcher |
4519 searcher |
4515 matchesMethod:searchTree |
4520 matchesMethod:searchTree |
4677 SystemBrowser findStringLiteral:'error' in:(Array with:Object) ignoreCase:true match:true |
4684 SystemBrowser findStringLiteral:'error' in:(Array with:Object) ignoreCase:true match:true |
4678 SystemBrowser findStringLiteral:'error' in:(Array with:Object) ignoreCase:true match:false |
4685 SystemBrowser findStringLiteral:'error' in:(Array with:Object) ignoreCase:true match:false |
4679 SystemBrowser findStringLiteral:'error' in:(Array with:Object) ignoreCase:false match:true |
4686 SystemBrowser findStringLiteral:'error' in:(Array with:Object) ignoreCase:false match:true |
4680 SystemBrowser findStringLiteral:'error' in:(Array with:Object) ignoreCase:false match:false |
4687 SystemBrowser findStringLiteral:'error' in:(Array with:Object) ignoreCase:false match:false |
4681 " |
4688 " |
4682 ! |
|
4683 |
|
4684 xxfindImplementorsOf:aSelectorString in:aCollectionOfClasses ignoreCase:ignoreCase |
|
4685 "search for all implementors of aSelector in |
|
4686 the classes contained in aCollectionOfClasses and its metaclasses. |
|
4687 Return a collection of methods" |
|
4688 |
|
4689 |list sel srchST srchJava lcSelector| |
|
4690 |
|
4691 aSelectorString size == 0 ifTrue:[ ^ #() ]. |
|
4692 |
|
4693 list := IdentitySet new. |
|
4694 |
|
4695 "/ ((aSelectorString ~= '*') and:[aSelectorString includesMatchCharacters]) ifTrue:[ |
|
4696 "/ "a matchString" |
|
4697 "/ |
|
4698 "/ ignoreCase == true ifTrue:[ |
|
4699 "/ lcSelector := aSelectorString asLowercase. |
|
4700 "/ |
|
4701 "/ srchST := [:aSelector :aMethod | |
|
4702 "/ (lcSelector match:aSelector asLowercase) ifTrue:[ |
|
4703 "/ list add:aMethod |
|
4704 "/ ] |
|
4705 "/ ]. |
|
4706 "/ srchJava := [:aSelector :aMethod | |
|
4707 "/ (aSelector match:aMethod name asLowercase) ifTrue:[ |
|
4708 "/ list add:aMethod |
|
4709 "/ ] |
|
4710 "/ ]. |
|
4711 "/ ] ifFalse:[ |
|
4712 "/ srchST := [:aSelector :aMethod | |
|
4713 "/ (aSelectorString match:aSelector) ifTrue:[ |
|
4714 "/ list add:aMethod |
|
4715 "/ ] |
|
4716 "/ ]. |
|
4717 "/ srchJava := [:aSelector :aMethod | |
|
4718 "/ (aSelectorString match:aMethod name) ifTrue:[ |
|
4719 "/ list add:aMethod |
|
4720 "/ ] |
|
4721 "/ ]. |
|
4722 "/ ]. |
|
4723 "/ ] ifFalse:[ |
|
4724 |
|
4725 sel := aSelectorString asSymbolIfInterned. |
|
4726 sel isNil ifTrue:[ |
|
4727 ^ #() |
|
4728 ]. |
|
4729 |
|
4730 ignoreCase == true ifTrue:[ |
|
4731 lcSelector := sel asLowercase. |
|
4732 srchJava := [:aSelector :aMethod | |
|
4733 "/ allow search for signature AND |
|
4734 "/ search for plain name |
|
4735 ((aMethod name asLowercase = lcSelector) |
|
4736 or:[aSelector asLowercase = lcSelector]) ifTrue:[ |
|
4737 list add:aMethod |
|
4738 ] |
|
4739 ]. |
|
4740 srchST := [:aSelector :aMethod | |
|
4741 (aSelector asLowercase = lcSelector) ifTrue:[ |
|
4742 list add:aMethod |
|
4743 ] |
|
4744 ]. |
|
4745 ] ifFalse:[ |
|
4746 srchJava := [:aSelector :aMethod | |
|
4747 "/ allow search for signature AND |
|
4748 "/ search for plain name |
|
4749 ((aMethod name = sel) |
|
4750 or:[aSelector == sel]) ifTrue:[ |
|
4751 list add:aMethod |
|
4752 ] |
|
4753 ]. |
|
4754 srchST := [:aSelector :aMethod | |
|
4755 (aSelector == sel) ifTrue:[ |
|
4756 list add:aMethod |
|
4757 ] |
|
4758 ]. |
|
4759 ]. |
|
4760 "/ ]. |
|
4761 |
|
4762 aCollectionOfClasses do:[:aClass | |
|
4763 |srchBlock| |
|
4764 |
|
4765 aClass isObsolete ifFalse:[ |
|
4766 aClass isJavaClass ifTrue:[ |
|
4767 srchBlock := srchJava |
|
4768 ] ifFalse:[ |
|
4769 srchBlock := srchST |
|
4770 ]. |
|
4771 aClass methodDictionary keysAndValuesDo:srchBlock. |
|
4772 aClass isMeta ifFalse:[ |
|
4773 aClass class methodDictionary keysAndValuesDo:srchBlock |
|
4774 ] |
|
4775 ] |
|
4776 ]. |
|
4777 |
|
4778 ^ list |
|
4779 |
|
4780 " |
|
4781 SystemBrowser findImplementorsOf:#+ |
|
4782 in:(Array with:Number |
|
4783 with:Float |
|
4784 with:SmallInteger) |
|
4785 " |
|
4786 ! ! |
4689 ! ! |
4787 |
4690 |
4788 !SystemBrowser class methodsFor:'startup'! |
4691 !SystemBrowser class methodsFor:'startup'! |
4789 |
4692 |
4790 browseAllSelect:aBlock |
4693 browseAllSelect:aBlock |