454
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
|
|
14 |
|
713
|
15 |
"{ Package: 'stx:libjava' }"
|
|
16 |
|
1
|
17 |
JavaRef subclass:#JavaFieldref
|
80
|
18 |
instanceVariableNames:'offset type'
|
255
|
19 |
classVariableNames:'T_LONG T_DOUBLE'
|
1
|
20 |
poolDictionaries:''
|
713
|
21 |
category:'Languages-Java-Reader-Support'
|
1
|
22 |
!
|
|
23 |
|
454
|
24 |
!JavaFieldref class methodsFor:'documentation'!
|
|
25 |
|
|
26 |
copyright
|
|
27 |
"
|
|
28 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
29 |
All Rights Reserved
|
|
30 |
|
|
31 |
This software is furnished under a license and may be used
|
|
32 |
only in accordance with the terms of that license and with the
|
|
33 |
inclusion of the above copyright notice. This software may not
|
|
34 |
be provided or otherwise made available to, or used by, any
|
|
35 |
other person. No title to or ownership of the software is
|
|
36 |
hereby transferred.
|
|
37 |
"
|
|
38 |
|
|
39 |
|
|
40 |
! !
|
1
|
41 |
|
255
|
42 |
!JavaFieldref class methodsFor:'initialization'!
|
|
43 |
|
|
44 |
initialize
|
|
45 |
T_LONG := 1.
|
|
46 |
T_DOUBLE := 2.
|
|
47 |
|
|
48 |
"
|
|
49 |
self initialize
|
|
50 |
"
|
|
51 |
|
|
52 |
"Created: / 10.1.1998 / 11:45:00 / cg"
|
|
53 |
! !
|
|
54 |
|
243
|
55 |
!JavaFieldref methodsFor:'accessing'!
|
|
56 |
|
|
57 |
nameandType
|
|
58 |
^ nameandType
|
|
59 |
|
|
60 |
"Created: 19.8.1997 / 13:54:35 / cg"
|
|
61 |
!
|
|
62 |
|
|
63 |
nameandType:aJavaNameandType
|
423
|
64 |
nameandType := aJavaNameandType.
|
|
65 |
self resolveType.
|
243
|
66 |
|
423
|
67 |
"Created: / 19.8.1997 / 14:01:27 / cg"
|
|
68 |
"Modified: / 5.11.1998 / 17:11:51 / cg"
|
243
|
69 |
! !
|
|
70 |
|
41
|
71 |
!JavaFieldref methodsFor:'printing & storing'!
|
|
72 |
|
|
73 |
displayString
|
87
|
74 |
class isNil ifTrue:[
|
423
|
75 |
^ 'JavaFieldRef ( ** unknown class ** ''' , nameandType displayString , ''')'
|
87
|
76 |
].
|
429
|
77 |
^ 'JavaFieldRef (' , class displayString "fullName" , ' '
|
423
|
78 |
, '''' , nameandType name , '''' , nameandType signature
|
|
79 |
, ' offs=' , offset printString
|
|
80 |
, ')'
|
|
81 |
|
429
|
82 |
"Modified: / 10.11.1998 / 12:23:54 / cg"
|
41
|
83 |
! !
|
|
84 |
|
27
|
85 |
!JavaFieldref methodsFor:'resolving'!
|
|
86 |
|
80
|
87 |
isDouble
|
255
|
88 |
type isNil ifTrue:[
|
|
89 |
self resolveType
|
|
90 |
].
|
|
91 |
^ type == T_DOUBLE
|
|
92 |
|
|
93 |
"Modified: / 10.1.1998 / 11:51:52 / cg"
|
80
|
94 |
!
|
|
95 |
|
|
96 |
isLong
|
255
|
97 |
type isNil ifTrue:[
|
|
98 |
self resolveType
|
|
99 |
].
|
|
100 |
^ type == T_LONG
|
|
101 |
|
|
102 |
"Modified: / 10.1.1998 / 11:51:36 / cg"
|
80
|
103 |
!
|
|
104 |
|
54
|
105 |
name
|
|
106 |
^ nameandType name
|
|
107 |
!
|
|
108 |
|
27
|
109 |
offset
|
255
|
110 |
offset isNil ifTrue:[
|
|
111 |
self resolve.
|
|
112 |
].
|
252
|
113 |
^ offset.
|
|
114 |
|
255
|
115 |
"Modified: / 10.1.1998 / 11:48:19 / cg"
|
252
|
116 |
!
|
|
117 |
|
|
118 |
resolve
|
255
|
119 |
|nm cls|
|
252
|
120 |
|
|
121 |
class isUnresolved ifTrue:[
|
255
|
122 |
self halt:'unresolved class'.
|
426
|
123 |
^ nil.
|
252
|
124 |
].
|
|
125 |
|
255
|
126 |
self resolveType.
|
252
|
127 |
nm := nameandType name asSymbol.
|
|
128 |
offset := class instVarOffsetOf:nm.
|
426
|
129 |
^ offset
|
252
|
130 |
|
426
|
131 |
"Modified: / 9.11.1998 / 23:00:48 / cg"
|
252
|
132 |
!
|
|
133 |
|
|
134 |
resolveStatic
|
255
|
135 |
|nm cls|
|
252
|
136 |
|
|
137 |
cls := class javaClass.
|
|
138 |
cls ~~ class ifTrue:[
|
|
139 |
class := cls.
|
|
140 |
].
|
426
|
141 |
class isNil ifTrue:[^ nil].
|
252
|
142 |
|
255
|
143 |
self resolveType.
|
252
|
144 |
nm := nameandType name asSymbol.
|
|
145 |
offset := class class instVarOffsetOf:nm.
|
426
|
146 |
^ offset
|
252
|
147 |
|
|
148 |
"Created: / 2.1.1998 / 17:16:55 / cg"
|
426
|
149 |
"Modified: / 9.11.1998 / 23:01:10 / cg"
|
255
|
150 |
!
|
|
151 |
|
|
152 |
resolveType
|
|
153 |
type := JavaMethod typeFromSignature:(nameandType signature) in:nil.
|
|
154 |
type == #long ifTrue:[
|
|
155 |
type := T_LONG.
|
|
156 |
] ifFalse:[
|
|
157 |
type == #double ifTrue:[
|
|
158 |
type := T_DOUBLE
|
|
159 |
]
|
|
160 |
].
|
|
161 |
|
|
162 |
"Created: / 10.1.1998 / 11:49:36 / cg"
|
252
|
163 |
!
|
|
164 |
|
|
165 |
staticOffset
|
255
|
166 |
offset isNil ifTrue:[
|
|
167 |
self resolveStatic.
|
|
168 |
].
|
252
|
169 |
^ offset.
|
|
170 |
|
255
|
171 |
"Modified: / 10.1.1998 / 11:47:59 / cg"
|
252
|
172 |
!
|
|
173 |
|
|
174 |
type
|
255
|
175 |
type isNil ifTrue:[
|
|
176 |
self resolveType.
|
|
177 |
].
|
|
178 |
type == T_LONG ifTrue:[
|
|
179 |
^ #long.
|
|
180 |
].
|
|
181 |
type == T_DOUBLE ifTrue:[
|
|
182 |
^ #double
|
27
|
183 |
].
|
|
184 |
|
255
|
185 |
^ type.
|
80
|
186 |
|
255
|
187 |
"Modified: / 10.1.1998 / 11:50:54 / cg"
|
27
|
188 |
! !
|
|
189 |
|
135
|
190 |
!JavaFieldref class methodsFor:'documentation'!
|
1
|
191 |
|
|
192 |
version
|
2108
|
193 |
^ '$Header: /cvs/stx/stx/libjava/Attic/JavaFieldref.st,v 1.23 2002-11-22 20:11:56 cg Exp $'
|
1
|
194 |
! !
|
713
|
195 |
|
255
|
196 |
JavaFieldref initialize!
|