author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 22 Aug 2011 11:53:10 +0100 | |
branch | jv |
changeset 17851 | 09d75924b034 |
parent 17781 | 63650a976621 |
child 17859 | cc167a69671c |
permissions | -rw-r--r-- |
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
1 |
" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
3 |
All Rights Reserved |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
4 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
5 |
This software is furnished under a license and may be used |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
10 |
hereby transferred. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
11 |
" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
12 |
"{ Package: 'stx:libbasic' }" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
13 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
14 |
Object subclass:#Annotation |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
15 |
instanceVariableNames:'' |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
16 |
classVariableNames:'' |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
17 |
poolDictionaries:'' |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
18 |
category:'Kernel-Extensions' |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
19 |
! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
20 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
21 |
Annotation subclass:#NameSpace |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
22 |
instanceVariableNames:'nameSpace' |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
23 |
classVariableNames:'' |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
24 |
poolDictionaries:'' |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
25 |
privateIn:Annotation |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
26 |
! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
27 |
|
17781
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
28 |
Annotation subclass:#Resource |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
29 |
instanceVariableNames:'type value' |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
30 |
classVariableNames:'' |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
31 |
poolDictionaries:'' |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
32 |
privateIn:Annotation |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
33 |
! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
34 |
|
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
35 |
Annotation subclass:#Unknown |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
36 |
instanceVariableNames:'key arguments' |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
37 |
classVariableNames:'' |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
38 |
poolDictionaries:'' |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
39 |
privateIn:Annotation |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
40 |
! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
41 |
|
17851 | 42 |
Annotation comment:'I represent an occurrence of a pragma in a compiled method. A pragma is a literal message pattern that occurs between angle brackets at the start of a method after any temporaries. A common example is the primitive pragma: |
43 |
<primitive: 123 errorCode: ''errorCode''> |
|
44 |
but one can add one''s own and use them as metadata attached to a method. Because pragmas are messages one can browsse senders and implementors and perform them. One can query a method for its pragmas by sendng it the pragmas message, which answers an Array of instances of me, one for each pragma in the method. |
|
45 |
I can provide information about the defining class, method, its selector, as well as the information about the pragma keyword and its arguments. See the two ''accessing'' protocols for details. ''accessing-method'' provides information about the method the pragma is found in, while ''accessing-pragma'' is about the pragma itself. |
|
46 |
Instances are retrieved using one of the pragma search methods of the ''finding'' protocol on the class side. |
|
47 |
To browse all methods with pragmas in the system evaluate |
|
48 |
SystemNavigation default browseAllSelect: [:m| m pragmas notEmpty] |
|
49 |
and to browse all nonprimitive methods with pragmas evaluate |
|
50 |
SystemNavigation default browseAllSelect: [:m| m primitive isZero and: [m pragmas notEmpty]]' |
|
51 |
! |
|
52 |
||
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
53 |
!Annotation class methodsFor:'documentation'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
54 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
55 |
copyright |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
56 |
" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
57 |
COPYRIGHT (c) 2006 by eXept Software AG |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
58 |
All Rights Reserved |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
59 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
60 |
This software is furnished under a license and may be used |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
61 |
only in accordance with the terms of that license and with the |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
62 |
inclusion of the above copyright notice. This software may not |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
63 |
be provided or otherwise made available to, or used by, any |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
64 |
other person. No title to or ownership of the software is |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
65 |
hereby transferred. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
66 |
" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
67 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
68 |
|
17851 | 69 |
!Annotation class methodsFor:'initialization'! |
70 |
||
71 |
initialize |
|
72 |
"Invoked at system start or when the class is dynamically loaded." |
|
73 |
||
74 |
Pragma := self. |
|
75 |
||
76 |
"Modified: / 20-08-2011 / 21:21:24 / cg" |
|
77 |
! ! |
|
78 |
||
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
79 |
!Annotation class methodsFor:'instance creation'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
80 |
|
17851 | 81 |
for: aMethod selector: aSelector arguments: anArray |
82 |
^self new |
|
83 |
setMethod: aMethod; |
|
84 |
setKeyword: aSelector; |
|
85 |
setArguments: anArray; |
|
86 |
yourself |
|
87 |
! |
|
88 |
||
17775
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
89 |
key: key arguments: arguments |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
90 |
|
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
91 |
^(self respondsTo: key) |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
92 |
ifTrue: |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
93 |
[self |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
94 |
perform: key |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
95 |
withArguments: arguments] |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
96 |
ifFalse: |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
97 |
[Annotation::Unknown new |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
98 |
key: key |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
99 |
arguments: arguments] |
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
100 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
101 |
"Created: / 19-05-2010 / 16:47:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17775
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
102 |
"Modified: / 02-07-2010 / 16:22:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
103 |
! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
104 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
105 |
namespace: aString |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
106 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
107 |
^Annotation::NameSpace new nameSpaceName: aString |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
108 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
109 |
"Created: / 19-05-2010 / 16:01:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17781
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
110 |
! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
111 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
112 |
resource: type |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
113 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
114 |
^Annotation::Resource new type: type |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
115 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
116 |
"Created: / 16-07-2010 / 11:31:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
117 |
! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
118 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
119 |
resource: type value: value |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
120 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
121 |
^Annotation::Resource new |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
122 |
type: type; |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
123 |
value: value |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
124 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
125 |
"Created: / 16-07-2010 / 11:31:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
126 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
127 |
|
17851 | 128 |
!Annotation class methodsFor:'finding'! |
129 |
||
130 |
allNamed: aSymbol from: aSubClass to: aSuperClass |
|
131 |
"Answer a collection of all pragmas found in methods of all classes between aSubClass and aSuperClass (inclusive) whose keyword is aSymbol." |
|
132 |
||
133 |
^ Array streamContents: [ :stream | |
|
134 |
aSubClass withAllSuperclassesDo: [ :class | |
|
135 |
self withPragmasIn: class do: [ :pragma | |
|
136 |
pragma keyword = aSymbol |
|
137 |
ifTrue: [ stream nextPut: pragma ] ]. |
|
138 |
aSuperClass = class |
|
139 |
ifTrue: [ ^ stream contents ] ] ]. |
|
140 |
! |
|
141 |
||
142 |
allNamed: aSymbol from: aSubClass to: aSuperClass sortedByArgument: anInteger |
|
143 |
"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." |
|
144 |
||
145 |
^ self allNamed: aSymbol from: aSubClass to: aSuperClass sortedUsing: [ :a :b | (a argumentAt: anInteger) < (b argumentAt: anInteger) ]. |
|
146 |
! |
|
147 |
||
148 |
allNamed: aSymbol from: aSubClass to: aSuperClass sortedUsing: aSortBlock |
|
149 |
"Answer a collection of all pragmas found in methods of all classes between aSubClass and aSuperClass (inclusive) whose keyword is aSymbol, sorted according to aSortBlock." |
|
150 |
||
151 |
^ (self allNamed: aSymbol from: aSubClass to: aSuperClass) sort: aSortBlock. |
|
152 |
! |
|
153 |
||
154 |
allNamed: aSymbol in: aClass |
|
155 |
"Answer a collection of all pragmas found in methods of aClass whose keyword is aSymbol." |
|
156 |
||
157 |
^ Array streamContents: [ :stream | |
|
158 |
self withPragmasIn: aClass do: [ :pragma | |
|
159 |
pragma keyword = aSymbol |
|
160 |
ifTrue: [ stream nextPut: pragma ] ] ]. |
|
161 |
! |
|
162 |
||
163 |
allNamed: aSymbol in: aClass sortedByArgument: anInteger |
|
164 |
"Answer a collection of all pragmas found in methods of aClass whose keyword is aSymbol, sorted according to argument anInteger." |
|
165 |
||
166 |
^ self allNamed: aSymbol in: aClass sortedUsing: [ :a :b | (a argumentAt: anInteger) < (b argumentAt: anInteger) ]. |
|
167 |
! |
|
168 |
||
169 |
allNamed: aSymbol in: aClass sortedUsing: aSortBlock |
|
170 |
"Answer a collection of all pragmas found in methods of aClass whose keyword is aSymbol, sorted according to aSortBlock." |
|
171 |
||
172 |
^ (self allNamed: aSymbol in: aClass) sort: aSortBlock. |
|
173 |
! ! |
|
174 |
||
175 |
!Annotation class methodsFor:'private'! |
|
176 |
||
177 |
keyword: aSymbol arguments: anArray |
|
178 |
^ self new |
|
179 |
setKeyword: aSymbol; |
|
180 |
setArguments: anArray; |
|
181 |
yourself. |
|
182 |
! |
|
183 |
||
184 |
withPragmasIn: aClass do: aBlock |
|
185 |
aClass selectorsAndMethodsDo: [ :selector :method | method annotationsDo: aBlock ]. |
|
186 |
||
187 |
"Modified: / 20-08-2011 / 21:31:49 / cg" |
|
188 |
! ! |
|
189 |
||
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
190 |
!Annotation methodsFor:'accessing'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
191 |
|
17775
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
192 |
first |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
193 |
|
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
194 |
^self key |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
195 |
|
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
196 |
"Created: / 10-07-2010 / 21:38:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
197 |
! |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
198 |
|
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
199 |
key |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
200 |
|
17781
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
201 |
^self subclassResponsibility |
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
202 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
203 |
"Created: / 19-05-2010 / 16:23:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17781
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
204 |
"Modified: / 16-07-2010 / 11:29:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
205 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
206 |
|
17851 | 207 |
!Annotation methodsFor:'accessing-method'! |
208 |
||
209 |
method |
|
210 |
"Answer the compiled-method containing the pragma." |
|
211 |
||
212 |
self halt:'inimplemented' |
|
213 |
||
214 |
"Modified: / 21-08-2011 / 12:44:37 / cg" |
|
215 |
! |
|
216 |
||
217 |
methodClass |
|
218 |
"Answer the class of the method containing the pragma." |
|
219 |
||
220 |
^ self method methodClass |
|
221 |
||
222 |
"Modified: / 21-08-2011 / 12:44:47 / cg" |
|
223 |
! |
|
224 |
||
225 |
selector |
|
226 |
"Answer the selector of the method containing the pragma. |
|
227 |
Do not confuse this with the selector of the pragma's message pattern." |
|
228 |
||
229 |
^ self method selector |
|
230 |
||
231 |
"Modified: / 21-08-2011 / 12:45:20 / cg" |
|
232 |
! ! |
|
233 |
||
234 |
!Annotation methodsFor:'accessing-pragma'! |
|
235 |
||
236 |
argumentAt: anInteger |
|
237 |
"Answer one of the arguments of the pragma." |
|
238 |
||
239 |
^ self arguments at: anInteger. |
|
240 |
! |
|
241 |
||
242 |
arguments |
|
243 |
"Answer the arguments of the receiving pragma. For a pragma defined as <key1: val1 key2: val2> this will answer #(val1 val2)." |
|
244 |
||
245 |
self subclassResponsibility |
|
246 |
||
247 |
"Modified: / 21-08-2011 / 12:43:54 / cg" |
|
248 |
! |
|
249 |
||
250 |
keyword |
|
251 |
"Answer the keyword of the pragma (the selector of its message pattern). |
|
252 |
For a pragma defined as <key1: val1 key2: val2> this will answer #key1:key2:." |
|
253 |
||
254 |
self subclassResponsibility |
|
255 |
||
256 |
"Modified: / 21-08-2011 / 12:45:07 / cg" |
|
257 |
! |
|
258 |
||
259 |
message |
|
260 |
"Answer the message of the receiving pragma." |
|
261 |
||
262 |
^ Message selector: self keyword arguments: self arguments. |
|
263 |
! |
|
264 |
||
265 |
numArgs |
|
266 |
"Answer the number of arguments in the pragma." |
|
267 |
||
268 |
^ self arguments size. |
|
269 |
! ! |
|
270 |
||
271 |
!Annotation methodsFor:'comparing'! |
|
272 |
||
273 |
analogousCodeTo: anObject |
|
274 |
^self class == anObject class |
|
275 |
and: [self keyword == anObject keyword |
|
276 |
and: [self arguments = anObject arguments]] |
|
277 |
||
278 |
"Modified: / 21-08-2011 / 12:45:37 / cg" |
|
279 |
! ! |
|
280 |
||
281 |
!Annotation methodsFor:'initialization'! |
|
282 |
||
283 |
setArguments: anArray |
|
284 |
self subclassResponsibility |
|
285 |
||
286 |
"Modified: / 21-08-2011 / 12:45:51 / cg" |
|
287 |
! |
|
288 |
||
289 |
setKeyword: aSymbol |
|
290 |
self subclassResponsibility |
|
291 |
||
292 |
"Modified: / 21-08-2011 / 12:46:06 / cg" |
|
293 |
! |
|
294 |
||
295 |
setMethod: aCompiledMethod |
|
296 |
self subclassResponsibility |
|
297 |
||
298 |
"Modified: / 21-08-2011 / 12:46:16 / cg" |
|
299 |
! ! |
|
300 |
||
301 |
!Annotation methodsFor:'printing'! |
|
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
302 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
303 |
printOn:aStream |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
304 |
"append a printed representation if the receiver to the argument, aStream" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
305 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
306 |
self storeOn:aStream. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
307 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
308 |
"Modified: / 19-05-2010 / 16:25:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17851 | 309 |
! ! |
310 |
||
311 |
!Annotation methodsFor:'printing & storing'! |
|
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
312 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
313 |
storeOn:aStream |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
314 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
315 |
self subclassResponsibility |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
316 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
317 |
"Created: / 19-05-2010 / 16:26:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
318 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
319 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
320 |
!Annotation methodsFor:'processing'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
321 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
322 |
annotatesClass: aClass |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
323 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
324 |
^self subclassResponsibility |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
325 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
326 |
"Created: / 20-05-2010 / 11:15:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
327 |
! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
328 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
329 |
annotatesMethod: aMethod |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
330 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
331 |
^self subclassResponsibility |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
332 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
333 |
"Created: / 20-05-2010 / 11:15:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17851 | 334 |
! |
335 |
||
336 |
sendTo: anObject |
|
337 |
"Send the pragma keyword together with its arguments to anObject and answer the result." |
|
338 |
||
339 |
^ anObject perform: self keyword withArguments: self arguments |
|
340 |
! |
|
341 |
||
342 |
withArgumentsDo: aBlock |
|
343 |
"Pass the arguments of the receiving pragma into aBlock and answer the result." |
|
344 |
||
345 |
^ aBlock valueWithArguments: self arguments |
|
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
346 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
347 |
|
17775
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
348 |
!Annotation methodsFor:'testing'! |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
349 |
|
17851 | 350 |
hasLiteral: aLiteral |
351 |
^self keyword == aLiteral |
|
352 |
or: [self arguments hasLiteral: aLiteral] |
|
353 |
||
354 |
"Modified: / 21-08-2011 / 12:46:44 / cg" |
|
355 |
! |
|
356 |
||
357 |
hasLiteralSuchThat: aBlock |
|
358 |
"Answer true if litBlock returns true for any literal in the receiver, even if embedded in further array structure. |
|
359 |
This method is only intended for private use by CompiledMethod hasLiteralSuchThat:" |
|
360 |
^(aBlock value: self keyword) |
|
361 |
or: [self arguments hasLiteralSuchThat: aBlock] |
|
362 |
||
363 |
"Modified: / 21-08-2011 / 12:46:31 / cg" |
|
364 |
! |
|
365 |
||
17775
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
366 |
isUnknown |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
367 |
^ false |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
368 |
! ! |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
369 |
|
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
370 |
!Annotation::NameSpace methodsFor:'accessing'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
371 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
372 |
key |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
373 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
374 |
^#namespace: |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
375 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
376 |
"Created: / 19-05-2010 / 16:23:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
377 |
! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
378 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
379 |
nameSpace |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
380 |
^ nameSpace |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
381 |
! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
382 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
383 |
nameSpace:something |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
384 |
nameSpace := something. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
385 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
386 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
387 |
!Annotation::NameSpace methodsFor:'initialization'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
388 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
389 |
nameSpaceName: aString |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
390 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
391 |
self nameSpace: (NameSpace name: aString) |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
392 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
393 |
"Created: / 19-05-2010 / 16:02:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
394 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
395 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
396 |
!Annotation::NameSpace methodsFor:'printing & storing'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
397 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
398 |
storeOn:aStream |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
399 |
"superclass Annotation says that I am responsible to implement this method" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
400 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
401 |
aStream nextPutAll: '(Annotation namespace: '. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
402 |
nameSpace name storeOn: aStream. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
403 |
aStream nextPut:$) |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
404 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
405 |
"Modified: / 19-05-2010 / 16:27:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
406 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
407 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
408 |
!Annotation::NameSpace methodsFor:'processing'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
409 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
410 |
annotatesClass:aClass |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
411 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
412 |
"Nothing to do" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
413 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
414 |
"Modified: / 20-05-2010 / 11:16:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
415 |
! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
416 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
417 |
annotatesMethod:aMethod |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
418 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
419 |
aMethod lookupObject: NamespaceAwareLookup instance |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
420 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
421 |
"Modified: / 20-05-2010 / 11:18:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
422 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
423 |
|
17781
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
424 |
!Annotation::Resource methodsFor:'accessing'! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
425 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
426 |
key |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
427 |
"superclass Annotation says that I am responsible to implement this method" |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
428 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
429 |
^value |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
430 |
ifNil:[#resource:] |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
431 |
ifNotNil:[#resource:value:] |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
432 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
433 |
"Modified: / 16-07-2010 / 11:30:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
434 |
! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
435 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
436 |
type |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
437 |
^ type |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
438 |
! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
439 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
440 |
type:something |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
441 |
type := something. |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
442 |
! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
443 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
444 |
value |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
445 |
^ value |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
446 |
! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
447 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
448 |
value:something |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
449 |
value := something. |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
450 |
! ! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
451 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
452 |
!Annotation::Resource methodsFor:'printing & storing'! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
453 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
454 |
storeOn:aStream |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
455 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
456 |
aStream nextPutAll: '(Annotation resource: '. |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
457 |
type storeOn: aStream. |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
458 |
value ifNotNil: |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
459 |
[aStream nextPutAll: ' value: '. |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
460 |
value storeOn: aStream]. |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
461 |
aStream nextPut:$) |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
462 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
463 |
"Modified: / 16-07-2010 / 11:36:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
464 |
! ! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
465 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
466 |
!Annotation::Resource methodsFor:'processing'! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
467 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
468 |
annotatesClass:aClass |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
469 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
470 |
"Nothing to do" |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
471 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
472 |
"Modified: / 16-07-2010 / 11:28:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
473 |
! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
474 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
475 |
annotatesMethod:aMethod |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
476 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
477 |
"Nothing to do" |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
478 |
|
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
479 |
"Modified: / 16-07-2010 / 11:28:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
480 |
! ! |
63650a976621
- added resource annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17775
diff
changeset
|
481 |
|
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
482 |
!Annotation::Unknown methodsFor:'accessing'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
483 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
484 |
arguments |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
485 |
^ arguments |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
486 |
! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
487 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
488 |
key |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
489 |
^ key |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
490 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
491 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
492 |
!Annotation::Unknown methodsFor:'initialization'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
493 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
494 |
key:keyArg arguments:argumentsArg |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
495 |
key := keyArg. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
496 |
arguments := argumentsArg. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
497 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
498 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
499 |
!Annotation::Unknown methodsFor:'printing & storing'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
500 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
501 |
storeOn:aStream |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
502 |
"superclass Annotation says that I am responsible to implement this method" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
503 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
504 |
aStream nextPutAll: '(Annotation key: '. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
505 |
key storeOn: aStream. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
506 |
aStream nextPutAll: ' arguments: '. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
507 |
arguments storeOn: aStream. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
508 |
aStream nextPut: $). |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
509 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
510 |
"Modified: / 19-05-2010 / 16:46:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
511 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
512 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
513 |
!Annotation::Unknown methodsFor:'processing'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
514 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
515 |
annotatesClass:aClass |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
516 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
517 |
"Nothing to do" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
518 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
519 |
"Modified: / 20-05-2010 / 11:15:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
520 |
! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
521 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
522 |
annotatesMethod:aMethod |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
523 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
524 |
"Nothing to do" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
525 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
526 |
"Modified: / 20-05-2010 / 11:15:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
527 |
! ! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
528 |
|
17775
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
529 |
!Annotation::Unknown methodsFor:'testing'! |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
530 |
|
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
531 |
isUnknown |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
532 |
^ true |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
533 |
! ! |
90a5bae0a710
Lazy evaluation of annotations (required for stc compiled code)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17766
diff
changeset
|
534 |
|
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
535 |
!Annotation class methodsFor:'documentation'! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
536 |
|
17851 | 537 |
version_CVS |
538 |
^ '§Header: /cvs/stx/stx/libbasic/Annotation.st,v 1.3 2011/08/21 10:47:20 cg Exp §' |
|
539 |
! |
|
540 |
||
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
541 |
version_SVN |
17851 | 542 |
^ '$Id: Annotation.st 10675 2011-08-22 10:53:10Z vranyj1 $' |
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
543 |
! ! |
17851 | 544 |
|
545 |
Annotation initialize! |