@@ -72,7 +72,8 @@ IASTAbstractFamixVisitor >> model [
72
72
{ #category : ' accessing' }
73
73
IASTAbstractFamixVisitor >> model: anObject [
74
74
75
- model := anObject
75
+ model := anObject.
76
+ self setIntrinsicTypes
76
77
]
77
78
78
79
{ #category : ' private-creation' }
@@ -83,33 +84,30 @@ IASTAbstractFamixVisitor >> newEntity: aClass [
83
84
yourself
84
85
]
85
86
86
- { #category : ' initialization' }
87
- IASTAbstractFamixVisitor >> retrieveType: aTypeName from: aMooseModel [
88
-
89
- ^ (aMooseModel
90
- attributeAt: #instrinsicTypes
91
- ifAbsent: [
92
- aMooseModel
93
- attributeAt: #unknownType
94
- ifAbsent: self typeNotFoundBlock.
95
- ]
96
- ) at: aTypeName ifAbsent: self typeNotFoundBlock.
97
- ]
98
-
99
87
{ #category : ' initialization' }
100
88
IASTAbstractFamixVisitor >> retrieveTypeFrom: aName [
101
89
90
+ | typeNotFoundBlock |
91
+ typeNotFoundBlock := [ self newEntity: FamixF77TypeUnknown ].
92
+
102
93
^ (self model
103
94
attributeAt: #instrinsicTypes
104
95
ifAbsent: [
105
96
self model
106
97
attributeAt: #unknownType
107
- ifAbsent: self typeNotFoundBlock.
98
+ ifAbsent: typeNotFoundBlock.
108
99
]
109
- ) at: aName ifAbsent: self typeNotFoundBlock.
100
+ ) at: aName ifAbsent: typeNotFoundBlock.
110
101
]
111
102
112
- { #category : ' as yet unclassified' }
103
+ { #category : ' private - helpers' }
104
+ IASTAbstractFamixVisitor >> setIntrinsicTypes [
105
+
106
+ model attributeAt: #instrinsicTypes put: model intrinsicTypes.
107
+ model attributeAt: #unknownType put: [ model newTypeUnknown ]
108
+ ]
109
+
110
+ { #category : ' spawn' }
113
111
IASTAbstractFamixVisitor >> spawn: aVisitorClass [
114
112
^ aVisitorClass new
115
113
model: self model ;
@@ -129,26 +127,20 @@ IASTAbstractFamixVisitor >> stack: anObject [
129
127
stack := anObject
130
128
]
131
129
132
- { #category : ' as yet unclassified ' }
130
+ { #category : ' symbols resolution ' }
133
131
IASTAbstractFamixVisitor >> symbolTable: anEntity at: key [
134
132
135
133
^ anEntity attributeAt: key asSymbol ifAbsent: [ ]
136
134
]
137
135
138
- { #category : ' as yet unclassified ' }
136
+ { #category : ' symbols resolution ' }
139
137
IASTAbstractFamixVisitor >> symbolTable: anEntity at: key put: value [
140
138
141
139
(self symbolTable: anEntity at: #symbolTable )
142
140
at: key asSymbol
143
141
put: value
144
142
]
145
143
146
- { #category : ' initialization' }
147
- IASTAbstractFamixVisitor >> typeNotFoundBlock [
148
-
149
- ^ [ self newEntity: FamixF77TypeUnknown ]
150
- ]
151
-
152
144
{ #category : ' visiting' }
153
145
IASTAbstractFamixVisitor >> visitIASTParameter: aParameter [
154
146
@@ -183,21 +175,25 @@ IASTAbstractFamixVisitor >> visitIASTVarAccess: aVarAccess [
183
175
- dereferencedVariable for example: deref.var(...) "
184
176
185
177
" Distinguish external accesses from other accesses"
178
+
179
+ | mainAccess |
180
+ mainAccess := (self createFamixF77Access: aVarAccess).
181
+ mainAccess isWrite: aVarAccess isWrite.
186
182
187
183
aVarAccess indices deepFlatten
188
184
do: [ :indice |
189
-
190
185
(indice class = IASTVarAccess and : [ (indice entityName asLowercase = ' s__' ) not ])
191
186
ifTrue: [ (self createFamixF77Access: indice) isWrite: indice isWrite ]
192
187
].
193
188
194
189
aVarAccess dereferencedVariable
195
190
ifNotNil: [ :dereferencedVariable |
196
- (self createFamixF77Access: dereferencedVariable) isWrite: dereferencedVariable isWrite
191
+ (self createFamixF77Access: dereferencedVariable)
192
+ isWrite: dereferencedVariable isWrite;
193
+ attributeAt: #parentAccess put: mainAccess
197
194
].
198
195
199
-
200
- ^ (self createFamixF77Access: aVarAccess) isWrite: aVarAccess isWrite
196
+ ^ mainAccess
201
197
]
202
198
203
199
{ #category : ' visiting' }
0 commit comments