Annotation.st
branchjv
changeset 19861 95c7068e30ba
parent 18754 9bfce586253a
parent 19820 18ad092be48d
child 20220 874c664d2cbd
equal deleted inserted replaced
19812:0866264d6eed 19861:95c7068e30ba
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
     2  COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
     5               All Rights Reserved
     3               All Rights Reserved
     6 
     4 
     7 Permission is hereby granted, free of charge, to any person
     5 Permission is hereby granted, free of charge, to any person
   206 !
   204 !
   207 
   205 
   208 allNamed:aSymbol
   206 allNamed:aSymbol
   209     "Answer a collection of all pragmas found in all methods of all classes whose keyword is aSymbol."
   207     "Answer a collection of all pragmas found in all methods of all classes whose keyword is aSymbol."
   210         
   208         
   211     ^ Array streamContents: [ :stream |
   209     ^ Array 
   212         Smalltalk allClassesDo:[:eachClass |
   210         streamContents: [ :stream |
   213             self withPragmasIn: eachClass do: [ :pragma |
   211             Smalltalk allClassesDo:[:eachClass |
   214                     pragma keyword = aSymbol
   212                 self withPragmasIn: eachClass do: [ :pragma |
   215                         ifTrue: [ stream nextPut: pragma ] ] ] ].
   213                     pragma keyword = aSymbol ifTrue: [ 
       
   214                         stream nextPut: pragma 
       
   215                     ] 
       
   216                 ] 
       
   217             ] 
       
   218         ].
   216 
   219 
   217     "
   220     "
   218      Annotation allNamed:'worldMenu'
   221      Annotation allNamed:'worldMenu'
   219     "
   222     "
   220 !
   223 !
   221 
   224 
   222 allNamed: aSymbol from: aSubClass to: aSuperClass
   225 allNamed:aSymbol from:aSubClass to:aSuperClass
   223 	"Answer a collection of all pragmas found in methods of all classes between aSubClass and aSuperClass (inclusive) whose keyword is aSymbol."
   226     "Answer a collection of all pragmas found in methods of all classes 
   224 	
   227      between aSubClass and aSuperClass (inclusive) whose keyword is aSymbol."
   225 	^ Array streamContents: [ :stream |
   228     
   226 		aSubClass withAllSuperclassesDo: [ :class |
   229     ^ Array 
   227 			self withPragmasIn: class do:  [ :pragma |
   230         streamContents:[:stream |
   228 				pragma keyword = aSymbol
   231             aSubClass withAllSuperclassesDo:[:class |
   229 					ifTrue: [ stream nextPut: pragma ] ].
   232                 self withPragmasIn:class do:[:pragma |
   230 			aSuperClass = class
   233                     pragma keyword = aSymbol ifTrue: [ 
   231 				ifTrue: [ ^ stream contents ] ] ].
   234                         stream nextPut: pragma 
       
   235                     ] 
       
   236                 ].
       
   237                 aSuperClass = class ifTrue: [ 
       
   238                     ^ stream contents 
       
   239                 ] 
       
   240             ] 
       
   241         ].
   232 !
   242 !
   233 
   243 
   234 allNamed: aSymbol from: aSubClass to: aSuperClass sortedByArgument: anInteger
   244 allNamed: aSymbol from: aSubClass to: aSuperClass sortedByArgument: anInteger
   235 	"Answer a collection of all pragmas found in methods of all classes between aSubClass and aSuperClass (inclusive) whose keyword is aSymbol, sorted according to argument anInteger."
   245 	"Answer a collection of all pragmas found in methods of all classes between aSubClass and aSuperClass (inclusive) whose keyword is aSymbol, sorted according to argument anInteger."
   236 
   246 
   242 	
   252 	
   243 	^ (self allNamed: aSymbol from: aSubClass to: aSuperClass) sort: aSortBlock.
   253 	^ (self allNamed: aSymbol from: aSubClass to: aSuperClass) sort: aSortBlock.
   244 !
   254 !
   245 
   255 
   246 allNamed: aSymbol in: aClass
   256 allNamed: aSymbol in: aClass
   247 	"Answer a collection of all pragmas found in methods of aClass whose keyword is aSymbol."
   257     "Answer a collection of all pragmas found in methods of aClass whose keyword is aSymbol."
   248 	
   258     
   249 	^ Array streamContents: [ :stream |
   259     ^ Array 
   250 		self withPragmasIn: aClass do: [ :pragma |
   260         streamContents: [ :stream |
   251 			pragma keyword = aSymbol
   261             self withPragmasIn: aClass do: [ :pragma |
   252 				ifTrue: [ stream nextPut: pragma ] ] ].
   262                 pragma keyword = aSymbol ifTrue: [ 
       
   263                     stream nextPut: pragma 
       
   264                 ] 
       
   265             ] 
       
   266         ].
   253 !
   267 !
   254 
   268 
   255 allNamed: aSymbol in: aClass sortedByArgument: anInteger
   269 allNamed: aSymbol in: aClass sortedByArgument: anInteger
   256 	"Answer a collection of all pragmas found in methods of aClass whose keyword is aSymbol, sorted according to argument anInteger."
   270 	"Answer a collection of all pragmas found in methods of aClass whose keyword is aSymbol, sorted according to argument anInteger."
   257 
   271