• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / FAST-JAVA / 19820501334

01 Dec 2025 11:07AM UTC coverage: 65.505% (-0.1%) from 65.643%
19820501334

Pull #254

github

web-flow
Merge bcfcafe5c into 6cbc7da8e
Pull Request #254: Atribute get fast

0 of 26 new or added lines in 1 file covered. (0.0%)

29 existing lines in 2 files now uncovered.

8141 of 12428 relevant lines covered (65.51%)

1.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.09
/src/FAST-Java-SmaCC-Importer/JavaSmaCCProgramNodeImporterVisitor.class.st
1
"
2
I parse a java method string and convert it into a FASTJava model.
3

4
API:
5

6
JavaSmaCCProgramNodeImporterVisitor parseCodeMethodString: 'TheString'.
7

8
A stack of created entities (used to set the #parentNode) is created by cloning the visitor and calling the clone on child nodes
9
"
10
Class {
11
        #name : 'JavaSmaCCProgramNodeImporterVisitor',
12
        #superclass : 'JavaProgramNodeVisitor',
13
        #instVars : [
14
                'model',
15
                'currentFASTEntity',
16
                'parentFASTVisitor',
17
                'withComments',
18
                'parser'
19
        ],
20
        #classInstVars : [
21
                'hello'
22
        ],
23
        #category : 'FAST-Java-SmaCC-Importer',
24
        #package : 'FAST-Java-SmaCC-Importer'
25
}
26

27
{ #category : 'parsing' }
28
JavaSmaCCProgramNodeImporterVisitor class >> parseCodeMethodString: aCodeString [
×
29
        ^ self new parseCodeMethodString: aCodeString
×
30
]
×
31

32
{ #category : 'initialization' }
33
JavaSmaCCProgramNodeImporterVisitor >> addToModel: anEntity [
3✔
34
        self model silentlyAdd: anEntity.
3✔
35
        ^ anEntity
3✔
36
]
3✔
37

38
{ #category : 'private - comments' }
39
JavaSmaCCProgramNodeImporterVisitor >> attach: aFastComment [
3✔
40
        (aFastComment isBlockComment
3✔
41
                ifTrue: [ self closestNextNode: aFastComment ]
3✔
42
                ifFalse:  [ self closestPreviousNode: aFastComment ])
3✔
43
        ifNotNil: [ :node | aFastComment container: node ]
3✔
44
]
3✔
45

46
{ #category : 'private - comments' }
47
JavaSmaCCProgramNodeImporterVisitor >> attachComments: aCodeString [
3✔
48

3✔
49

3✔
50
        parser scanner comments do: [ :pos |
3✔
51
                | fastComment |
3✔
52
                fastComment := self
3✔
53
                                       createComment: aCodeString
3✔
54
                                       from: pos first
3✔
55
                                       to: pos second.
3✔
56
                self attach: fastComment ]
3✔
57
]
3✔
58

59
{ #category : 'copying' }
60
JavaSmaCCProgramNodeImporterVisitor >> clone [
3✔
61
        ^ self class new
3✔
62
                        model: self model ;
3✔
63
                        parentFASTVisitor: self ; 
3✔
64
                        yourself.
3✔
65
]
3✔
66

67
{ #category : 'private - comments' }
68
JavaSmaCCProgramNodeImporterVisitor >> closestNextNode: aFastComment [
3✔
69
        ^self closestNodeTo: aFastComment relation: #>
3✔
70
]
3✔
71

72
{ #category : 'private - comments' }
73
JavaSmaCCProgramNodeImporterVisitor >> closestNodeTo: aFastComment relation: comparator [
3✔
74
        | closest |
3✔
75
        closest := nil.
3✔
76
        aFastComment mooseModel entities do: [ :node |
3✔
77
                (self compare: node to: aFastComment comparator: comparator)
3✔
78
                ifTrue: [
3✔
79
                        closest
3✔
80
                                ifNil: [ closest := node ]
3✔
81
                                ifNotNil: [ (self compare: closest to: node comparator: comparator)
3✔
82
                                        ifTrue: [ closest := node ]
3✔
83
                                ]
3✔
84
                ]
3✔
85
        ].
3✔
86
        ^closest
3✔
87
]
3✔
88

89
{ #category : 'private - comments' }
90
JavaSmaCCProgramNodeImporterVisitor >> closestPreviousNode: aFastComment [
3✔
91
        ^self closestNodeTo: aFastComment relation: #<
3✔
92
]
3✔
93

94
{ #category : 'private - comments' }
95
JavaSmaCCProgramNodeImporterVisitor >> compare: node1 to: node2 comparator: comparator [
3✔
96
        ^node1 startPos perform: comparator with: node2 startPos
3✔
97
]
3✔
98

99
{ #category : 'creating' }
100
JavaSmaCCProgramNodeImporterVisitor >> create: anEntity from: aNodeEntity [
3✔
101
        currentFASTEntity := self addToModel: anEntity new.
3✔
102
        self setStartEndPos: aNodeEntity.
3✔
103
        ^ currentFASTEntity
3✔
104
]
3✔
105

106
{ #category : 'creating' }
107
JavaSmaCCProgramNodeImporterVisitor >> createComment: aCodeString from: start to: end [
3✔
108
        | comment |
3✔
109
        comment := FASTJavaComment new
3✔
110
                content: (aCodeString copyFrom: start to: end) ;
3✔
111
                startPos: start ;
3✔
112
                endPos: end ;
3✔
113
                yourself.
3✔
114
        
3✔
115
        self addToModel: comment.
3✔
116
        ^comment
3✔
117
]
3✔
118

119
{ #category : 'visitor' }
120
JavaSmaCCProgramNodeImporterVisitor >> createTypeName: aName [
3✔
121
        "I am a helper for visitNew"
3✔
122

3✔
123
        | classTypeExpression |
3✔
124
        classTypeExpression := self addToModel: FASTJavaClassTypeExpression new.
3✔
125
        currentFASTEntity := classTypeExpression.
3✔
126
        self setStartEndPos: aName.
3✔
127
        currentFASTEntity
3✔
128
                typeName:
3✔
129
                        ((self addToModel: FASTJavaTypeName new)
3✔
130
                                name: aName value;
3✔
131
                                yourself).
3✔
132
        currentFASTEntity := currentFASTEntity typeName.
3✔
133
        self setStartEndPos: aName.
3✔
134
        ^ classTypeExpression
3✔
135
]
3✔
136

137
{ #category : 'initialization' }
138
JavaSmaCCProgramNodeImporterVisitor >> currentFASTEntity [
3✔
139
        ^ currentFASTEntity 
3✔
140
]
3✔
141

142
{ #category : 'initialization' }
NEW
143
JavaSmaCCProgramNodeImporterVisitor >> currentFASTEntity: anObject [
×
NEW
144

×
NEW
145
        currentFASTEntity := anObject 
×
NEW
146
]
×
147

148
{ #category : 'initialization' }
149
JavaSmaCCProgramNodeImporterVisitor >> initialize [
3✔
150
        super initialize.
3✔
151
        model := FASTJavaModel new.
3✔
152
        withComments := false
3✔
153
]
3✔
154

155
{ #category : 'creating' }
156
JavaSmaCCProgramNodeImporterVisitor >> isOutsideTypeDeclaration [
3✔
157

3✔
158
        ({ FASTJavaClassDeclaration . FASTJavaInterfaceDeclaration . FASTJavaEnumDeclaration . FASTJavaMethodEntity }
3✔
159
                includes: currentFASTEntity class )
3✔
160
                ifTrue: [ ^ false ].
3✔
161

3✔
162
        ^self parentFASTVisitor
3✔
163
                ifNil: [ true ]
3✔
164
                ifNotNil: [ self parentFASTVisitor isOutsideTypeDeclaration ]
3✔
165
]
3✔
166

167
{ #category : 'initialization' }
168
JavaSmaCCProgramNodeImporterVisitor >> model [
3✔
169
        ^ model
3✔
170
]
3✔
171

172
{ #category : 'initialization' }
173
JavaSmaCCProgramNodeImporterVisitor >> model: aModel [
3✔
174
        model := aModel
3✔
175
]
3✔
176

177
{ #category : 'initialization' }
178
JavaSmaCCProgramNodeImporterVisitor >> parentFASTEntity [
3✔
179
        
3✔
180
        ^ parentFASTVisitor currentFASTEntity
3✔
181
]
3✔
182

183
{ #category : 'initialization' }
184
JavaSmaCCProgramNodeImporterVisitor >> parentFASTVisitor [
3✔
185
        
3✔
186
        ^ parentFASTVisitor
3✔
187
]
3✔
188

189
{ #category : 'initialization' }
190
JavaSmaCCProgramNodeImporterVisitor >> parentFASTVisitor: anObject [
3✔
191
        
3✔
192
        parentFASTVisitor := anObject
3✔
193
]
3✔
194

195
{ #category : 'initialization' }
NEW
UNCOV
196
JavaSmaCCProgramNodeImporterVisitor >> parseCodeExpressionString: aCodeString [
×
NEW
UNCOV
197

×
NEW
UNCOV
198
        | ast |
×
NEW
UNCOV
199
        parser := JavaParser
×
NEW
UNCOV
200
                          createParserOnStream: (ReadStream on: aCodeString)
×
NEW
UNCOV
201
                          startingAt:
×
NEW
UNCOV
202
                          JavaParser
×
NEW
UNCOV
203
                                  startingStateForexpression.
×
NEW
UNCOV
204

×
NEW
205
        [
×
NEW
206
        ast := parser parse.
×
NEW
207

×
NEW
208
        (ast isKindOf: SmaCCParseNode) ifTrue: [
×
NEW
209
                ast completeSource: aCodeString ] ]
×
NEW
210
                on: Error
×
NEW
211
                do: [ :err |
×
NEW
212
                        ('SmaCC Err parsing: ' , String crlf , aCodeString) record.
×
NEW
213
                        err signal ].
×
NEW
214

×
NEW
215
        ^self accept: ast.
×
NEW
216

×
NEW
217
]
×
218

219
{ #category : 'initialization' }
220
JavaSmaCCProgramNodeImporterVisitor >> parseCodeMethodString: aCodeString [
3✔
221

3✔
222
        | ast |
3✔
223
        parser := JavaParser
3✔
224
                          createParserOnStream: (ReadStream on: aCodeString)
3✔
225
                          startingAt:
3✔
226
                          JavaParser
3✔
227
                                  startingStateForclass_or_interface_body_declaration.
3✔
228

3✔
229
        [
3✔
230
        ast := parser parse.
3✔
231
        (ast isKindOf: SmaCCParseNode) ifTrue: [
3✔
232
                ast completeSource: aCodeString ] ]
3✔
233
                on: Error
3✔
234
                do: [ :err |
3✔
235
                        ('SmaCC Err parsing: ' , String crlf , aCodeString) record.
3✔
236
                        err signal ].
3✔
237

3✔
238
        [ (self accept: ast) source: ast completeSource asString ]
3✔
239
                on: Error
3✔
240
                do: [ :err |
3✔
241
                        ('FAST Err parsing: ' , String crlf , aCodeString) record.
3✔
242
                        err signal ].
3✔
243

3✔
244
        withComments ifTrue: [ self attachComments: aCodeString ].
3✔
245

3✔
246
        ^ self model
3✔
247
]
3✔
248

249
{ #category : 'initialization' }
250
JavaSmaCCProgramNodeImporterVisitor >> parseCodeString: aCodeString [
3✔
251

3✔
252
        | ast |
3✔
253
        parser := JavaParser on: (ReadStream on: aCodeString).
3✔
254

3✔
255
        [ ast := parser parse. ast completeSource: aCodeString]
3✔
256
                on: Error
3✔
257
                do: [ :err |
3✔
258
                        ('SmaCC Err parsing: ' , String crlf , aCodeString) record.
3✔
259
                        err signal ].
3✔
260
        [
3✔
261
        self accept: ast.
3✔
262
        ((self model allWithSubTypesOfAny: {
3✔
263
                          FASTJavaClassDeclaration.
3✔
264
                          FASTJavaInterfaceDeclaration.
3✔
265
                          FASTJavaEnumDeclaration }) detect: [ :classDeclaration |
3✔
266
                 classDeclaration parentNode isNil ]) source:
3✔
267
                ast completeSource asString ]
3✔
268
                on: Error
3✔
269
                do: [ :err |
3✔
270
                        ('FAST Err parsing: ' , String crlf , aCodeString) record.
3✔
271
                        err signal ].
3✔
272

3✔
273
        withComments ifTrue: [ self attachComments: aCodeString ].
3✔
274

3✔
275
        ^ self model
3✔
276
]
3✔
277

278
{ #category : 'initialization' }
279
JavaSmaCCProgramNodeImporterVisitor >> setStartEndPos: aNodeEntity [
3✔
280
        currentFASTEntity startPos: aNodeEntity startPosition.
3✔
281
        currentFASTEntity endPos: aNodeEntity stopPosition
3✔
282
]
3✔
283

284
{ #category : 'visitor' }
285
JavaSmaCCProgramNodeImporterVisitor >> visitAbstractMethodDeclaration: anAbstractMethodDeclaration [
3✔
286

3✔
287
        currentFASTEntity := (self create: FASTJavaMethodEntity from: anAbstractMethodDeclaration)
3✔
288
                name: anAbstractMethodDeclaration declarator name value;
3✔
289
                yourself.
3✔
290

3✔
291
        anAbstractMethodDeclaration declarator parameters do: [ :parameter | 
3✔
292
                currentFASTEntity addParameter: (self clone accept: parameter) ].
3✔
293
        anAbstractMethodDeclaration modifiers do: [ :modifier | 
3✔
294
                currentFASTEntity addModifier: (self clone accept: modifier) ].
3✔
295
        currentFASTEntity type: (self clone accept: anAbstractMethodDeclaration type).
3✔
296

3✔
297
        ^ currentFASTEntity
3✔
298
]
3✔
299

300
{ #category : 'visitor' }
301
JavaSmaCCProgramNodeImporterVisitor >> visitAnnotation: anAnnotation [
3✔
302
        self create: FASTJavaAnnotation from: anAnnotation.
3✔
303
        currentFASTEntity name: anAnnotation name name value.
3✔
304

3✔
305
        anAnnotation values do: [ :expression |
3✔
306
                currentFASTEntity addElement: (self clone accept: expression) ].
3✔
307

3✔
308
        ^ currentFASTEntity
3✔
309
]
3✔
310

311
{ #category : 'visitor' }
312
JavaSmaCCProgramNodeImporterVisitor >> visitArrayAccess: anArrayAccess [
3✔
313
        currentFASTEntity := self addToModel: FASTJavaArrayAccess new.
3✔
314
        self setStartEndPos: anArrayAccess.
3✔
315
        currentFASTEntity array: (self clone accept: anArrayAccess array).
3✔
316
        currentFASTEntity
3✔
317
                expression: (self clone accept: anArrayAccess expression).
3✔
318
        ^ currentFASTEntity
3✔
319
]
3✔
320

321
{ #category : 'visitor' }
322
JavaSmaCCProgramNodeImporterVisitor >> visitArrayInitializer: anArrayInitializer [
3✔
323
        currentFASTEntity := self create: FASTJavaArrayInitializer from: anArrayInitializer.
3✔
324
        anArrayInitializer initializers do: [ :initializer | currentFASTEntity initializers add: (self clone accept: initializer) ].
3✔
325
        ^ currentFASTEntity
3✔
326
]
3✔
327

328
{ #category : 'visitor' }
329
JavaSmaCCProgramNodeImporterVisitor >> visitArrayType: anArrayType [
3✔
330

3✔
331
        currentFASTEntity := self addToModel:
3✔
332
                                     (FASTJavaArrayTypeExpression new
3✔
333
                                              baseType:
3✔
334
                                                      (self clone accept: anArrayType baseType);
3✔
335
                                              yourself).
3✔
336
        currentFASTEntity
3✔
337
                startPos: anArrayType startPosition;
3✔
338
                endPos: (anArrayType rightBrackets at: 1) stopPosition.
3✔
339

3✔
340
        "Arrays with more than one dimension are nested"
3✔
341
        2 to: anArrayType leftBrackets size do: [ :index | 
3✔
342
                currentFASTEntity := self addToModel:
3✔
343
                                             (FASTJavaArrayTypeExpression new
3✔
344
                                                      baseType: currentFASTEntity;
3✔
345
                                                      yourself).
3✔
346
                currentFASTEntity
3✔
347
                        startPos: anArrayType startPosition;
3✔
348
                        endPos: (anArrayType rightBrackets at: index) stopPosition ].
3✔
349

3✔
350
        ^ currentFASTEntity
3✔
351
]
3✔
352

353
{ #category : 'visitor' }
354
JavaSmaCCProgramNodeImporterVisitor >> visitArrayVariableName: anArrayVariableName [
3✔
355
        ^ self accept: anArrayVariableName variable
3✔
356
]
3✔
357

358
{ #category : 'visitor' }
359
JavaSmaCCProgramNodeImporterVisitor >> visitAssertStatement: anAssertStatement [
3✔
360
        currentFASTEntity := self addToModel: FASTJavaAssertStatement new.
3✔
361
        self setStartEndPos: anAssertStatement.
3✔
362
        currentFASTEntity condition: (self clone accept: anAssertStatement testExpression).
3✔
363
        currentFASTEntity message: (self clone accept: anAssertStatement messageExpression).
3✔
364
        ^ currentFASTEntity
3✔
365
]
3✔
366

367
{ #category : 'visitor' }
368
JavaSmaCCProgramNodeImporterVisitor >> visitAssignment: anAssignmentExpression [
3✔
369
        currentFASTEntity := self create: FASTJavaAssignmentExpression from: anAssignmentExpression.
3✔
370
        currentFASTEntity operator: anAssignmentExpression op value.
3✔
371
        currentFASTEntity variable: (self clone accept: anAssignmentExpression variable).
3✔
372
        currentFASTEntity expression: (self clone accept: anAssignmentExpression value).
3✔
373
        ^ currentFASTEntity
3✔
374
]
3✔
375

376
{ #category : 'visitor' }
377
JavaSmaCCProgramNodeImporterVisitor >> visitBinaryExpression: aBinaryExpression [
3✔
378

3✔
379
        currentFASTEntity := self addToModel: FASTJavaInfixOperation new.
3✔
380
        self setStartEndPos: aBinaryExpression.
3✔
381
        currentFASTEntity leftOperand:
3✔
382
                (self clone accept: aBinaryExpression leftExpression).
3✔
383
        currentFASTEntity rightOperand:
3✔
384
                (self clone accept: aBinaryExpression rightExpression).
3✔
385
        currentFASTEntity operator: aBinaryExpression op value.
3✔
386
        ^ currentFASTEntity
3✔
387
]
3✔
388

389
{ #category : 'visitor' }
390
JavaSmaCCProgramNodeImporterVisitor >> visitBlock: aBlock [
3✔
391
        currentFASTEntity := self addToModel: FASTJavaStatementBlock new.
3✔
392
        self setStartEndPos: aBlock.
3✔
393
        aBlock statements
3✔
394
                do: [ :each | currentFASTEntity statements add: (self clone accept: each) ].
3✔
395
        ^ currentFASTEntity
3✔
396
]
3✔
397

398
{ #category : 'visitor' }
399
JavaSmaCCProgramNodeImporterVisitor >> visitBooleanLiteral: aBooleanLiteral [
3✔
400
        currentFASTEntity := self
3✔
401
                addToModel:
3✔
402
                        (FASTJavaBooleanLiteral new
3✔
403
                                primitiveValue: aBooleanLiteral token value;
3✔
404
                                yourself).
3✔
405
        self setStartEndPos: aBooleanLiteral.
3✔
406
        ^ currentFASTEntity
3✔
407
]
3✔
408

409
{ #category : 'visitor' }
410
JavaSmaCCProgramNodeImporterVisitor >> visitBooleanType: aBooleanType [
3✔
411
        currentFASTEntity := self
3✔
412
                addToModel:
3✔
413
                        (FASTJavaBooleanTypeExpression new
3✔
414
                                name: aBooleanType token value;
3✔
415
                                yourself).
3✔
416
        self setStartEndPos: aBooleanType.
3✔
417
        ^ currentFASTEntity
3✔
418
]
3✔
419

420
{ #category : 'visitor' }
421
JavaSmaCCProgramNodeImporterVisitor >> visitBreakStatement: aBreakStatement [
3✔
422
        currentFASTEntity := self addToModel: FASTJavaBreakStatement new.
3✔
423
        self setStartEndPos: aBreakStatement.
3✔
424
        ^ currentFASTEntity
3✔
425
]
3✔
426

427
{ #category : 'visitor' }
428
JavaSmaCCProgramNodeImporterVisitor >> visitByteType: aByteType [
3✔
429
        currentFASTEntity := self
3✔
430
                addToModel:
3✔
431
                        (FASTJavaByteTypeExpression new
3✔
432
                                name: aByteType token value;
3✔
433
                                yourself).
3✔
434
        self setStartEndPos: aByteType.
3✔
435
        ^ currentFASTEntity
3✔
436
]
3✔
437

438
{ #category : 'visitor' }
439
JavaSmaCCProgramNodeImporterVisitor >> visitCastExpression: aCastExpression [
3✔
440
        currentFASTEntity := self addToModel: FASTJavaCastExpression new.
3✔
441
        self setStartEndPos: aCastExpression.
3✔
442
        currentFASTEntity type: (self clone accept: aCastExpression type).
3✔
443
        currentFASTEntity
3✔
444
                expression: (self clone accept: aCastExpression expression).
3✔
445
        ^ currentFASTEntity
3✔
446
]
3✔
447

448
{ #category : 'visitor' }
449
JavaSmaCCProgramNodeImporterVisitor >> visitCatchClause: aCatchClause [
3✔
450
        currentFASTEntity := self addToModel: FASTJavaCatchPartStatement new.
3✔
451
        self setStartEndPos: aCatchClause.
3✔
452
        self clone accept: aCatchClause parameter.
3✔
453
        currentFASTEntity body: (self clone accept: aCatchClause block).
3✔
454
        ^ currentFASTEntity
3✔
455
]
3✔
456

457
{ #category : 'visitor' }
458
JavaSmaCCProgramNodeImporterVisitor >> visitCatchParameter: aCatchParameter [
3✔
459
        | param |
3✔
460
        param := self visitName: aCatchParameter variable.
3✔
461
        self parentFASTEntity parameter: param.
3✔
462
        aCatchParameter types do: [ :catchedType |
3✔
463
                self parentFASTEntity addCatchedType: (self clone accept: catchedType)
3✔
464
        ].
3✔
465
        ^ param
3✔
466
]
3✔
467

468
{ #category : 'visitor' }
469
JavaSmaCCProgramNodeImporterVisitor >> visitCharType: aByteType [
3✔
470
        currentFASTEntity := self
3✔
471
                addToModel:
3✔
472
                        (FASTJavaCharTypeExpression new
3✔
473
                                name: aByteType token value;
3✔
474
                                yourself).
3✔
475
        self setStartEndPos: aByteType.
3✔
476
        ^ currentFASTEntity
3✔
477
]
3✔
478

479
{ #category : 'visitor' }
480
JavaSmaCCProgramNodeImporterVisitor >> visitCharacterLiteral: aCharacterLiteral [
3✔
481
        | tokenValue |
3✔
482
        tokenValue := aCharacterLiteral token value.
3✔
483

3✔
484
        currentFASTEntity := self create: FASTJavaCharacterLiteral from: aCharacterLiteral.
3✔
485
        currentFASTEntity primitiveValue: (tokenValue copyFrom: 2 to: (tokenValue size - 1)).
3✔
486

3✔
487
        ^ currentFASTEntity
3✔
488
]
3✔
489

490
{ #category : 'visitor' }
491
JavaSmaCCProgramNodeImporterVisitor >> visitClassDeclaration: aClassDeclaration [
3✔
492
        self create: FASTJavaClassDeclaration from: aClassDeclaration.
3✔
493
        currentFASTEntity name: aClassDeclaration name value.
3✔
494
        
3✔
495
        aClassDeclaration modifiers do: [ :modifier | currentFASTEntity addModifier: (self clone accept: modifier) ].
3✔
496
        aClassDeclaration superclass ifNotNil: [ :superclass | currentFASTEntity superclass: (self clone accept: superclass) ].
3✔
497
        aClassDeclaration interfaces do: [ :interface | currentFASTEntity addInterface: (self clone accept: interface) ].
3✔
498
        aClassDeclaration declarations do: [ :declaration | currentFASTEntity addDeclaration: (self clone accept: declaration) ].
3✔
499

3✔
500
        ^ currentFASTEntity
3✔
501
]
3✔
502

503
{ #category : 'visitor' }
504
JavaSmaCCProgramNodeImporterVisitor >> visitClassExpression: aClassExpression [
3✔
505
        currentFASTEntity := self addToModel: FASTJavaClassProperty new.
3✔
506
        self setStartEndPos: aClassExpression.
3✔
507

3✔
508
        currentFASTEntity type: (self clone accept: aClassExpression type).
3✔
509
        currentFASTEntity fieldName: aClassExpression classToken value.
3✔
510

3✔
511
        ^ currentFASTEntity
3✔
512
]
3✔
513

514
{ #category : 'visitor' }
515
JavaSmaCCProgramNodeImporterVisitor >> visitClassType: aClassType [
3✔
516
        currentFASTEntity := self addToModel: FASTJavaClassTypeExpression new.
3✔
517
        self setStartEndPos: aClassType.
3✔
518
        currentFASTEntity typeName: (self clone accept: aClassType name).
3✔
519

3✔
520
        aClassType name arguments do: [ :typeArgument |
3✔
521
                currentFASTEntity addArgument: (self clone accept: typeArgument)
3✔
522
        ].
3✔
523

3✔
524
        ^ currentFASTEntity
3✔
525
]
3✔
526

527
{ #category : 'visitor' }
528
JavaSmaCCProgramNodeImporterVisitor >> visitConditionalExpression: aConditionalExpression [
3✔
529
        currentFASTEntity := self
3✔
530
                addToModel: FASTJavaConditionalExpression new.
3✔
531
        self setStartEndPos: aConditionalExpression.
3✔
532
        currentFASTEntity
3✔
533
                condition: (self clone accept: aConditionalExpression testExpression).
3✔
534
        currentFASTEntity
3✔
535
                thenPart: (self clone accept: aConditionalExpression trueExpression).
3✔
536
        aConditionalExpression falseExpression
3✔
537
                ifNotNil: [ currentFASTEntity
3✔
538
                                elsePart: (self clone accept: aConditionalExpression falseExpression) ].
3✔
539
        ^ currentFASTEntity
3✔
540
]
3✔
541

542
{ #category : 'visitor' }
543
JavaSmaCCProgramNodeImporterVisitor >> visitContinueStatement: aContinueStatement [
3✔
544
        currentFASTEntity := self addToModel: FASTJavaContinueStatement new.
3✔
545
        self setStartEndPos: aContinueStatement.
3✔
546
        ^ currentFASTEntity
3✔
547
]
3✔
548

549
{ #category : 'visitor' }
550
JavaSmaCCProgramNodeImporterVisitor >> visitDeclaration: aConstructorDeclaration [
3✔
551
        currentFASTEntity := (self create: FASTJavaMethodEntity from: aConstructorDeclaration)
3✔
552
                name: aConstructorDeclaration name name value;
3✔
553
                yourself.
3✔
554
        self setStartEndPos: aConstructorDeclaration.
3✔
555
        aConstructorDeclaration parameters do: [ :parameter | currentFASTEntity addParameter: (self clone accept: parameter) ].
3✔
556
        currentFASTEntity statementBlock: (self clone accept: aConstructorDeclaration body).
3✔
557
        aConstructorDeclaration modifiers do: [ :modifier | currentFASTEntity addModifier: (self clone accept: modifier) ].
3✔
558
        ^ currentFASTEntity
3✔
559
]
3✔
560

561
{ #category : 'visitor' }
562
JavaSmaCCProgramNodeImporterVisitor >> visitDoWhileStatement: aDoWhileStatement [
3✔
563
        currentFASTEntity := self addToModel: FASTJavaDoWhileStatement new.
3✔
564
        self setStartEndPos: aDoWhileStatement.
3✔
565
        currentFASTEntity
3✔
566
                condition: (self clone accept: aDoWhileStatement expression).
3✔
567
        currentFASTEntity
3✔
568
                body: (self clone accept: aDoWhileStatement statement).
3✔
569
        ^ currentFASTEntity
3✔
570
]
3✔
571

572
{ #category : 'visitor' }
573
JavaSmaCCProgramNodeImporterVisitor >> visitDoubleType: aByteType [
3✔
574
        currentFASTEntity := self
3✔
575
                addToModel:
3✔
576
                        (FASTJavaDoubleTypeExpression new
3✔
577
                                name: aByteType token value;
3✔
578
                                yourself).
3✔
579
        self setStartEndPos: aByteType.
3✔
580
        ^ currentFASTEntity
3✔
581
]
3✔
582

583
{ #category : 'visitor' }
584
JavaSmaCCProgramNodeImporterVisitor >> visitElementArrayInitializer: anElementArrayInitializer [
3✔
585

3✔
586
        currentFASTEntity := self create: FASTJavaArrayAnnotationElement from: anElementArrayInitializer.
3✔
587
        anElementArrayInitializer values do: [ :value |
3✔
588
                currentFASTEntity  addValue: (self clone accept: value) ].
3✔
589
        ^ currentFASTEntity
3✔
590
]
3✔
591

592
{ #category : 'visitor' }
593
JavaSmaCCProgramNodeImporterVisitor >> visitElementValuePair: anElementValuePair [
3✔
594
        "'key = value' as argument of an Annotation
3✔
595
         treat it as an Assignment Expression"
3✔
596

3✔
597
        currentFASTEntity := self create: FASTJavaAssignmentExpression from: anElementValuePair.
3✔
598
        currentFASTEntity variable: (self clone visitVariableName: anElementValuePair).
3✔
599
        currentFASTEntity operator: '='.
3✔
600
        currentFASTEntity expression: (self clone accept: anElementValuePair value).
3✔
601

3✔
602
        ^ currentFASTEntity
3✔
603
]
3✔
604

605
{ #category : 'visitor' }
606
JavaSmaCCProgramNodeImporterVisitor >> visitEmptyDeclaration: anEmptyDeclaration [
3✔
607
        currentFASTEntity := self addToModel: FASTJavaEmptyMethodDeclaration new.
3✔
608
        self setStartEndPos: anEmptyDeclaration.
3✔
609
        ^ currentFASTEntity
3✔
610
]
3✔
611

612
{ #category : 'visitor' }
613
JavaSmaCCProgramNodeImporterVisitor >> visitEmptyDimExpression: aToken [
3✔
614
        currentFASTEntity := self
3✔
615
                addToModel: FASTJavaEmptyDimExpression new.
3✔
616
        self setStartEndPos: aToken.
3✔
617
        ^ currentFASTEntity
3✔
618
]
3✔
619

620
{ #category : 'visitor' }
621
JavaSmaCCProgramNodeImporterVisitor >> visitEmptyStatement: anEmptyStatement [
3✔
622
        currentFASTEntity := self addToModel: FASTJavaStatement new.
3✔
623
        self setStartEndPos: anEmptyStatement.
3✔
624
        ^ currentFASTEntity
3✔
625
]
3✔
626

627
{ #category : 'visitor' }
628
JavaSmaCCProgramNodeImporterVisitor >> visitEnumConstant: anEnumConstant [
3✔
629
        "treat EnumConstant as a Field"
3✔
630

3✔
631
        currentFASTEntity := self addToModel: FASTJavaEnumConstant new.
3✔
632
        self setStartEndPos: anEnumConstant.
3✔
633
        currentFASTEntity
3✔
634
                        name: anEnumConstant name value.
3✔
635

3✔
636
        ^ currentFASTEntity
3✔
637
]
3✔
638

639
{ #category : 'visitor' }
640
JavaSmaCCProgramNodeImporterVisitor >> visitEnumDeclaration: anEnumDeclaration [
3✔
641

3✔
642
        self create: FASTJavaEnumDeclaration from: anEnumDeclaration.
3✔
643
        currentFASTEntity name: anEnumDeclaration name value.
3✔
644

3✔
645
        anEnumDeclaration constants do: [ :constant | currentFASTEntity addConstant: (self clone accept: constant) ].
3✔
646
        anEnumDeclaration declarations do: [ :declaration | currentFASTEntity addDeclaration: (self clone accept: declaration) ].
3✔
647
        anEnumDeclaration interfaces do: [ :interface | currentFASTEntity addInterface: (self clone accept: interface) ].
3✔
648
        anEnumDeclaration modifiers do: [ :modifier | currentFASTEntity addModifier: (self clone accept: modifier) ].
3✔
649
        ^ currentFASTEntity
3✔
650
]
3✔
651

652
{ #category : 'visitor' }
653
JavaSmaCCProgramNodeImporterVisitor >> visitExpressionStatement: anExpressionStatement [
3✔
654
        currentFASTEntity := self addToModel: FASTJavaExpressionStatement new.
3✔
655
        self setStartEndPos: anExpressionStatement.
3✔
656
        currentFASTEntity
3✔
657
                expression: (self clone accept: anExpressionStatement expression).
3✔
658
        ^ currentFASTEntity
3✔
659
]
3✔
660

661
{ #category : 'visitor' }
662
JavaSmaCCProgramNodeImporterVisitor >> visitFieldAccess: aFieldAccess [
3✔
663
        currentFASTEntity := self addToModel: FASTJavaFieldAccess new.
3✔
664
        self setStartEndPos: aFieldAccess.
3✔
665
        aFieldAccess receiver
3✔
666
                ifNotNil: [ :receiver | currentFASTEntity receiver: (self clone accept: receiver) ]
3✔
667
                ifNil: [
3✔
668
                        aFieldAccess superToken
3✔
669
                                ifNotNil: [ currentFASTEntity receiver: (self clone visitSuperMemberAcessor: aFieldAccess) ]
3✔
670
                ].
3✔
671
        currentFASTEntity fieldName: aFieldAccess name value.
3✔
672
        ^ currentFASTEntity
3✔
673
]
3✔
674

675
{ #category : 'visitor' }
676
JavaSmaCCProgramNodeImporterVisitor >> visitFieldDeclaration: aFieldDeclaration [
3✔
677
        currentFASTEntity := self addToModel: FASTJavaVarDeclStatement new.
3✔
678
        self setStartEndPos: aFieldDeclaration.
3✔
679
        aFieldDeclaration type ifNotNil: [ currentFASTEntity type: (self clone accept: aFieldDeclaration type) ].
3✔
680
        aFieldDeclaration variableDeclarations do: [ :each | currentFASTEntity declarators add: (self clone accept: each) ].
3✔
681
                aFieldDeclaration modifiers do: [ :modifier | currentFASTEntity addModifier: (self clone accept: modifier) ].
3✔
682
        ^ currentFASTEntity
3✔
683
]
3✔
684

685
{ #category : 'visitor' }
686
JavaSmaCCProgramNodeImporterVisitor >> visitFinallyClause: aFinallyClause [
3✔
687
        ^self accept: aFinallyClause block
3✔
688
]
3✔
689

690
{ #category : 'visitor' }
691
JavaSmaCCProgramNodeImporterVisitor >> visitFloatLiteral: aFloatLiteral [
3✔
692
        currentFASTEntity := self
3✔
693
                addToModel:
3✔
694
                        (FASTJavaFloatLiteral new
3✔
695
                                primitiveValue: aFloatLiteral token value;
3✔
696
                                yourself).
3✔
697
                self setStartEndPos: aFloatLiteral.
3✔
698
        ^ currentFASTEntity
3✔
699
]
3✔
700

701
{ #category : 'visitor' }
702
JavaSmaCCProgramNodeImporterVisitor >> visitFloatType: aByteType [
3✔
703
        currentFASTEntity := self
3✔
704
                addToModel:
3✔
705
                        (FASTJavaFloatTypeExpression new
3✔
706
                                name: aByteType token value;
3✔
707
                                yourself).
3✔
708
        self setStartEndPos: aByteType.
3✔
709
        ^ currentFASTEntity
3✔
710
]
3✔
711

712
{ #category : 'visitor' }
713
JavaSmaCCProgramNodeImporterVisitor >> visitForEachStatement: aForEachStatement [
3✔
714
        currentFASTEntity := self addToModel: FASTJavaForEachStatement new.
3✔
715
        self setStartEndPos: aForEachStatement.
3✔
716
        currentFASTEntity body:
3✔
717
                (self clone accept: aForEachStatement statement).
3✔
718
        currentFASTEntity fieldname:
3✔
719
                (self clone visitIdentifier: aForEachStatement name).
3✔
720
        currentFASTEntity type: (self clone accept: aForEachStatement type).
3✔
721
        currentFASTEntity list:
3✔
722
                (self clone accept: aForEachStatement expression).
3✔
723
        ^ currentFASTEntity
3✔
724
]
3✔
725

726
{ #category : 'visitor' }
727
JavaSmaCCProgramNodeImporterVisitor >> visitForStatement: aForStatement [
3✔
728
        currentFASTEntity := self addToModel: FASTJavaForStatement new.
3✔
729
        self setStartEndPos: aForStatement.
3✔
730
        aForStatement test
3✔
731
                ifNotNil: [ :test | currentFASTEntity condition: (self clone accept: test) ].
3✔
732
        aForStatement _update
3✔
733
                ifNotNil:
3✔
734
                        [ :_update | currentFASTEntity incrementor: (self clone accept: _update) ].
3✔
735
        aForStatement initial
3✔
736
                ifNotNil:
3✔
737
                        [ :initial | currentFASTEntity initializer: (self clone accept: initial) ].
3✔
738
        aForStatement statement
3✔
739
                ifNotNil:
3✔
740
                        [ :statement | currentFASTEntity body: (self clone accept: statement) ].
3✔
741
        ^ currentFASTEntity
3✔
742
]
3✔
743

744
{ #category : 'visitor' }
745
JavaSmaCCProgramNodeImporterVisitor >> visitIdentifier: aNameNode [
3✔
746
        currentFASTEntity := self addToModel: FASTJavaIdentifier new.
3✔
747
        self setStartEndPos: aNameNode.
3✔
748
        currentFASTEntity name: aNameNode name value.
3✔
749
        ^ currentFASTEntity
3✔
750
]
3✔
751

752
{ #category : 'visitor' }
753
JavaSmaCCProgramNodeImporterVisitor >> visitIfElseStatement: anIfStatementNode [
3✔
754
        currentFASTEntity := self addToModel: FASTJavaIfStatement new.
3✔
755
        self setStartEndPos: anIfStatementNode.
3✔
756
        currentFASTEntity
3✔
757
                condition: (self clone accept: anIfStatementNode expression).
3✔
758
        currentFASTEntity
3✔
759
                thenPart: (self clone accept: anIfStatementNode trueStatement).
3✔
760
        anIfStatementNode falseStatement
3✔
761
                ifNotNil: [ currentFASTEntity
3✔
762
                                elsePart: (self clone accept: anIfStatementNode falseStatement) ].
3✔
763
        ^ currentFASTEntity
3✔
764
]
3✔
765

766
{ #category : 'visitor' }
767
JavaSmaCCProgramNodeImporterVisitor >> visitIfStatement: anIfStatementNode [
3✔
768
        currentFASTEntity := self addToModel: FASTJavaIfStatement new.
3✔
769
                self setStartEndPos: anIfStatementNode.
3✔
770
        currentFASTEntity
3✔
771
                condition: (self clone accept: anIfStatementNode expression).
3✔
772
        currentFASTEntity
3✔
773
                thenPart: (self clone accept: anIfStatementNode trueStatement).
3✔
774
        ^ currentFASTEntity
3✔
775
]
3✔
776

777
{ #category : 'visitor' }
778
JavaSmaCCProgramNodeImporterVisitor >> visitInitializedVariableDeclaration: anInitializedVariableDeclaration [
3✔
779
        currentFASTEntity := self addToModel: FASTJavaVariableDeclarator new.
3✔
780
        self setStartEndPos: anInitializedVariableDeclaration.
3✔
781
        currentFASTEntity
3✔
782
                variable: (self clone accept: anInitializedVariableDeclaration variable).
3✔
783
        currentFASTEntity
3✔
784
                expression: (self clone accept: anInitializedVariableDeclaration initializer).
3✔
785
        ^ currentFASTEntity
3✔
786
]
3✔
787

788
{ #category : 'visitor' }
789
JavaSmaCCProgramNodeImporterVisitor >> visitInitializer: aInitializer [
3✔
790
        currentFASTEntity := FASTJavaInitializer new.
3✔
791
        self setStartEndPos: aInitializer.
3✔
792
        currentFASTEntity statementBlock: (self clone accept: aInitializer block).
3✔
793
        self addToModel: currentFASTEntity.
3✔
794
        ^ currentFASTEntity
3✔
795
]
3✔
796

797
{ #category : 'generated' }
798
JavaSmaCCProgramNodeImporterVisitor >> visitInstanceofPatternExpression: anInstanceofPatternExpression [
3✔
799
        "SmaCC gives a single node representing both the instanceof operation and the type pattern.
3✔
800
        FAST splits it into an infix operation with the type pattern as the right operand."
3✔
801

3✔
802
        self
3✔
803
                create: FASTJavaInfixOperation
3✔
804
                from: anInstanceofPatternExpression.
3✔
805
        currentFASTEntity leftOperand:
3✔
806
                (self clone accept: anInstanceofPatternExpression object).
3✔
807
        currentFASTEntity rightOperand:
3✔
808
                ((self addToModel: FASTJavaTypePattern new)
3✔
809
                         startPos: anInstanceofPatternExpression type startPosition;
3✔
810
                         endPos: anInstanceofPatternExpression variable stopPosition;
3✔
811
                         type: (self clone accept: anInstanceofPatternExpression type);
3✔
812
                         variable:
3✔
813
                                 (self clone accept: anInstanceofPatternExpression variable)).
3✔
814
        currentFASTEntity operator: 'instanceof'.
3✔
815
        ^ currentFASTEntity
3✔
816
]
3✔
817

818
{ #category : 'visitor' }
819
JavaSmaCCProgramNodeImporterVisitor >> visitIntType: aByteType [
3✔
820
        currentFASTEntity := self
3✔
821
                addToModel:
3✔
822
                        (FASTJavaIntTypeExpression new
3✔
823
                                name: aByteType token value;
3✔
824
                                yourself).
3✔
825
        self setStartEndPos: aByteType.
3✔
826
        ^ currentFASTEntity
3✔
827
]
3✔
828

829
{ #category : 'visitor' }
830
JavaSmaCCProgramNodeImporterVisitor >> visitIntegerLiteral: anIntegerLiteral [
3✔
831
        currentFASTEntity := self
3✔
832
                addToModel:
3✔
833
                        (FASTJavaIntegerLiteral new
3✔
834
                                primitiveValue: anIntegerLiteral token value;
3✔
835
                                yourself).
3✔
836
        self setStartEndPos: anIntegerLiteral.
3✔
837
        ^ currentFASTEntity
3✔
838
]
3✔
839

840
{ #category : 'visitor' }
841
JavaSmaCCProgramNodeImporterVisitor >> visitInterfaceDeclaration: anInterfaceDeclaration [
3✔
842
        self create: FASTJavaInterfaceDeclaration from: anInterfaceDeclaration.
3✔
843
        currentFASTEntity name: anInterfaceDeclaration name value.
3✔
844

3✔
845
        anInterfaceDeclaration modifiers do: [ :modifier | currentFASTEntity addModifier: (self clone accept: modifier) ].
3✔
846
        anInterfaceDeclaration interfaceTypes do: [ :interface | currentFASTEntity addInterface: (self clone accept: interface) ].
3✔
847
        anInterfaceDeclaration declarations do: [ :declaration | currentFASTEntity addDeclaration: (self clone accept: declaration) ].
3✔
848

3✔
849
        ^ currentFASTEntity
3✔
850
]
3✔
851

852
{ #category : 'visitor' }
853
JavaSmaCCProgramNodeImporterVisitor >> visitLabeledStatement: aLabeledStatement [
3✔
854

3✔
855
        currentFASTEntity := self addToModel: (FASTJavaLabeledStatement new
3✔
856
                                              label: aLabeledStatement identifier value;
3✔
857
                                              yourself).
3✔
858
        self setStartEndPos: aLabeledStatement.
3✔
859
        currentFASTEntity labeledStatement:        (self clone accept: aLabeledStatement statement).
3✔
860
        ^ currentFASTEntity
3✔
861
]
3✔
862

863
{ #category : 'visitor' }
864
JavaSmaCCProgramNodeImporterVisitor >> visitLambdaExpression: aLambdaExpression [
3✔
865
        currentFASTEntity := self
3✔
866
                addToModel: FASTJavaLambdaExpression new.
3✔
867
        self setStartEndPos: aLambdaExpression.
3✔
868
        aLambdaExpression parameters do: [ :parameter | currentFASTEntity addParameter: (self clone accept: parameter) ].
3✔
869
        currentFASTEntity
3✔
870
                expression: (self clone accept: aLambdaExpression value).
3✔
871
        ^ currentFASTEntity
3✔
872
]
3✔
873

874
{ #category : 'visitor' }
875
JavaSmaCCProgramNodeImporterVisitor >> visitLocalVariableDeclaration: aLocalVariableDeclaration [
3✔
876
        currentFASTEntity := self addToModel: FASTJavaVarDeclStatement new.
3✔
877
        self setStartEndPos: aLocalVariableDeclaration.
3✔
878
        aLocalVariableDeclaration type ifNotNil: [ currentFASTEntity type: (self clone accept: aLocalVariableDeclaration type) ].
3✔
879
        aLocalVariableDeclaration variableDeclarations
3✔
880
                do: [ :each | currentFASTEntity declarators add: (self clone accept: each) ].
3✔
881
        ^ currentFASTEntity
3✔
882
]
3✔
883

884
{ #category : 'visitor' }
885
JavaSmaCCProgramNodeImporterVisitor >> visitLocalVariableDeclarationStatement: aLocalVariableDeclarationStatement [
3✔
886
        currentFASTEntity := self addToModel: FASTJavaVarDeclStatement new.
3✔
887
        self setStartEndPos: aLocalVariableDeclarationStatement.
3✔
888

3✔
889
        aLocalVariableDeclarationStatement declaration type ifNotNil: [ :declaredType |
3✔
890
                currentFASTEntity type: (self clone accept: declaredType) ].
3✔
891
        aLocalVariableDeclarationStatement declaration modifiers do: [ :modifier | 
3✔
892
                currentFASTEntity addModifier: (self clone accept: modifier) ].
3✔
893
        aLocalVariableDeclarationStatement declaration variableDeclarations
3✔
894
                do: [ :each | currentFASTEntity declarators add: (self clone accept: each) ].
3✔
895

3✔
896
        ^ currentFASTEntity
3✔
897
]
3✔
898

899
{ #category : 'visitor' }
UNCOV
900
JavaSmaCCProgramNodeImporterVisitor >> visitLongType: aByteType [
×
UNCOV
901
        currentFASTEntity := self
×
UNCOV
902
                addToModel:
×
UNCOV
903
                        (FASTJavaLongTypeExpression new
×
UNCOV
904
                                name: aByteType token value;
×
UNCOV
905
                                yourself).
×
UNCOV
906
        self setStartEndPos: aByteType.
×
UNCOV
907
        ^ currentFASTEntity
×
UNCOV
908
]
×
909

910
{ #category : 'visitor' }
911
JavaSmaCCProgramNodeImporterVisitor >> visitMethodDeclaration: aMethodDeclaration [
3✔
912

3✔
913
        | methodBody |
3✔
914
        self create: FASTJavaMethodEntity from: aMethodDeclaration.
3✔
915
        currentFASTEntity name: aMethodDeclaration declarator name value.
3✔
916

3✔
917
        aMethodDeclaration modifiers do: [ :modifier | 
3✔
918
                currentFASTEntity addModifier: (self clone accept: modifier) ].
3✔
919

3✔
920
        aMethodDeclaration type ifNotNil: [ 
3✔
921
                currentFASTEntity type: (self clone accept: aMethodDeclaration type) ].
3✔
922

3✔
923
        aMethodDeclaration typeParameters ifNotNil: [ :typeParameters | 
3✔
924
                typeParameters parameters do: [ :typeParameter | 
3✔
925
                        currentFASTEntity addTypeParameter:
3✔
926
                                (self clone accept: typeParameter) ] ].
3✔
927

3✔
928
        aMethodDeclaration declarator parameters do: [ :parameter | 
3✔
929
                currentFASTEntity addParameter: (self clone accept: parameter) ].
3✔
930

3✔
931
        aMethodDeclaration throws ifNotNil: [ :throws | 
3✔
932
                throws classTypes do: [ :classType | 
3✔
933
                        currentFASTEntity addThrow: (self clone accept: classType) ] ].
3✔
934

3✔
935
        methodBody := self clone accept: aMethodDeclaration body.
3✔
936
        (methodBody isKindOf: JavaEmptyMethodBodyNode) ifFalse: [ 
3✔
937
                currentFASTEntity statementBlock: (self clone accept: methodBody) ].
3✔
938

3✔
939
        ^ currentFASTEntity
3✔
940
]
3✔
941

942
{ #category : 'visitor' }
943
JavaSmaCCProgramNodeImporterVisitor >> visitMethodInvocation: aMethodInvocation [
3✔
944
        currentFASTEntity := self addToModel: FASTJavaMethodInvocation new.
3✔
945
        self setStartEndPos: aMethodInvocation.
3✔
946
        aMethodInvocation expressions do: [ :expression | currentFASTEntity addArgument: (self clone accept: expression) ].
3✔
947
        aMethodInvocation receiver
3✔
948
                ifNotNil: [ :receiver | 
3✔
949
                        (receiver isMemberOf: JavaNameNode)
3✔
950
                                ifTrue: [ "If the element is named. It is more than propably an Identifier and not just an named element. So you pass over the normal rules of the importer"
3✔
951
                                        currentFASTEntity
3✔
952
                                                receiver:
3✔
953
                                                        (FASTJavaIdentifier new
3✔
954
                                                                name: receiver name value;
3✔
955
                                                                startPos: receiver startPosition;
3✔
956
                                                                endPos: receiver stopPosition;
3✔
957
                                                                yourself).
3✔
958
                                        self addToModel: currentFASTEntity receiver ]
3✔
959
                                ifFalse: [ currentFASTEntity receiver: (self clone accept: receiver) ] ]
3✔
960
                ifNil: [ aMethodInvocation superToken
3✔
961
                                ifNotNil: [ :superToken | 
3✔
962
                                        currentFASTEntity
3✔
963
                                                receiver:
3✔
964
                                                        (FASTJavaIdentifier new
3✔
965
                                                                name: superToken value;
3✔
966
                                                                startPos: superToken startPosition;
3✔
967
                                                                endPos: superToken stopPosition;
3✔
968
                                                                yourself).
3✔
969
                                        self addToModel: currentFASTEntity receiver ] ].
3✔
970
        currentFASTEntity name: aMethodInvocation name value.
3✔
971
        ^ currentFASTEntity
3✔
972
]
3✔
973

974
{ #category : 'visitor' }
975
JavaSmaCCProgramNodeImporterVisitor >> visitMethodReference: aMethodReference [
3✔
976
        currentFASTEntity := self
3✔
977
                addToModel: FASTJavaMethodReference new.
3✔
978
        self setStartEndPos: aMethodReference.
3✔
979
        currentFASTEntity
3✔
980
                receiver: (self clone accept: aMethodReference receiver).
3✔
981
        currentFASTEntity
3✔
982
                name: (aMethodReference name value).
3✔
983
        ^ currentFASTEntity
3✔
984
]
3✔
985

986
{ #category : 'visitor' }
987
JavaSmaCCProgramNodeImporterVisitor >> visitModifier: aModifier [
3✔
988
        self create: FASTJavaModifier from: aModifier.
3✔
989
        currentFASTEntity token: aModifier token value.
3✔
990
        ^ currentFASTEntity
3✔
991
]
3✔
992

993
{ #category : 'visitor' }
994
JavaSmaCCProgramNodeImporterVisitor >> visitName: aName [
3✔
995

3✔
996
        self isOutsideTypeDeclaration
3✔
997
                ifTrue: [ 
3✔
998
                        currentFASTEntity := self addToModel: FASTJavaQualifiedName new.
3✔
999
                        self setStartEndPos: aName ]
3✔
1000
                ifFalse: [ 
3✔
1001
                        currentFASTEntity := self
3✔
1002
                                                     create: FASTJavaVariableExpression
3✔
1003
                                                     from: aName ].
3✔
1004
        currentFASTEntity name: aName name value.
3✔
1005
        ^ currentFASTEntity
3✔
1006
]
3✔
1007

1008
{ #category : 'visitor' }
1009
JavaSmaCCProgramNodeImporterVisitor >> visitNew: aNewNode [
3✔
1010

3✔
1011
        currentFASTEntity := self addToModel: FASTJavaNewExpression new.
3✔
1012
        self setStartEndPos: aNewNode.
3✔
1013
        aNewNode expressions do: [ :expression | 
3✔
1014
                currentFASTEntity arguments add: (self clone accept: expression) ].
3✔
1015

3✔
1016
        aNewNode primary ifNotNil: [ :primary | 
3✔
1017
                currentFASTEntity receiver: (self clone accept: primary) ].
3✔
1018
        "
3✔
1019
in the following 'InnerClass' is considered as a Name in FAST but should be considered as a Type in FASTJava        
3✔
1020
public void onClick(ClickEvent event) {
3✔
1021
  view.setDisplayView(view.new InnerClass());
3✔
1022
}"
3✔
1023
        aNewNode type
3✔
1024
                ifNotNil: [ 
3✔
1025
                currentFASTEntity type: (self clone accept: aNewNode type) ]
3✔
1026
                ifNil: [ 
3✔
1027
                currentFASTEntity type: (self clone createTypeName: aNewNode name) ].
3✔
1028
        ^ currentFASTEntity
3✔
1029
]
3✔
1030

1031
{ #category : 'visitor' }
1032
JavaSmaCCProgramNodeImporterVisitor >> visitNewArray: aNewArray [
3✔
1033
        | dimExprs emptyExprs |
3✔
1034
        currentFASTEntity := self addToModel: FASTJavaNewArray new.
3✔
1035
                self setStartEndPos: aNewArray.
3✔
1036

3✔
1037
        currentFASTEntity type: (self clone accept: aNewArray type).
3✔
1038
        aNewArray initializer
3✔
1039
                ifNotNil: [ :initialize | 
3✔
1040
                        currentFASTEntity initializer: (self clone accept: initialize) ].
3✔
1041

3✔
1042
        dimExprs := aNewArray dimExpressions
3✔
1043
                collect: [ :dimExpression | self clone accept: dimExpression expression ].
3✔
1044
        "for empty dim, no dimExpression is generated but tokens in 'leftBrackets' collection"
3✔
1045
        emptyExprs := aNewArray leftBrackets
3✔
1046
                collect: [ :emptyDimExpression | self clone visitEmptyDimExpression: emptyDimExpression ].
3✔
1047

3✔
1048
        "put them in correct order following their startPos"
3✔
1049
        currentFASTEntity arguments:
3✔
1050
                ((dimExprs , emptyExprs) sorted: [ :a :b | a startPos < b startPos ]).
3✔
1051

3✔
1052
        ^ currentFASTEntity
3✔
1053
]
3✔
1054

1055
{ #category : 'visitor' }
1056
JavaSmaCCProgramNodeImporterVisitor >> visitNewClass: aNewClass [
3✔
1057

3✔
1058
        currentFASTEntity := self addToModel: FASTJavaNewClassExpression new.
3✔
1059
        self setStartEndPos: aNewClass.
3✔
1060
        aNewClass expressions do: [ :expression | 
3✔
1061
                currentFASTEntity arguments add: (self clone accept: expression) ].
3✔
1062
        aNewClass type
3✔
1063
                ifNotNil: [ 
3✔
1064
                currentFASTEntity type: (self clone accept: aNewClass type) ]
3✔
1065
                ifNil: [ 
3✔
1066
                        currentFASTEntity type: (self clone createTypeName: aNewClass name).
3✔
1067
                        currentFASTEntity receiver: (self clone accept: aNewClass primary) ].
3✔
1068
        aNewClass declarations do: [ :method | 
3✔
1069
                currentFASTEntity declarations add: (self clone accept: method) ].
3✔
1070
        ^ currentFASTEntity
3✔
1071
]
3✔
1072

1073
{ #category : 'visitor' }
1074
JavaSmaCCProgramNodeImporterVisitor >> visitNull: aNull [
3✔
1075
        currentFASTEntity := self
3✔
1076
                addToModel:
3✔
1077
                        (FASTJavaNullLiteral new
3✔
1078
                                primitiveValue: aNull token value;
3✔
1079
                                yourself).
3✔
1080
        self setStartEndPos: aNull.
3✔
1081
        ^ currentFASTEntity
3✔
1082
]
3✔
1083

1084
{ #category : 'visitor' }
1085
JavaSmaCCProgramNodeImporterVisitor >> visitOuterThis: aFASTJavaOuterThis [
3✔
1086
        currentFASTEntity := FASTJavaOuterThis new.
3✔
1087
        self setStartEndPos: aFASTJavaOuterThis.
3✔
1088
        currentFASTEntity type: (self clone accept: aFASTJavaOuterThis name).
3✔
1089
        self addToModel: currentFASTEntity.
3✔
1090
        ^ currentFASTEntity
3✔
1091
]
3✔
1092

1093
{ #category : 'visitor' }
1094
JavaSmaCCProgramNodeImporterVisitor >> visitPackageDeclaration: aPackageDeclaration [
3✔
1095
        currentFASTEntity := self addToModel: FASTJavaPackageDeclaration new.
3✔
1096
        self setStartEndPos: aPackageDeclaration.
3✔
1097
        currentFASTEntity qualifiedName: (self clone accept: aPackageDeclaration name).
3✔
1098
]
3✔
1099

1100
{ #category : 'visitor' }
1101
JavaSmaCCProgramNodeImporterVisitor >> visitParameter: aParameter [
3✔
1102
        currentFASTEntity := self addToModel: FASTJavaParameter new.
3✔
1103
        self setStartEndPos: aParameter.
3✔
1104
        currentFASTEntity variable: (self clone accept: aParameter variable).
3✔
1105
        currentFASTEntity type: (self clone accept: aParameter type).
3✔
1106
        ^ currentFASTEntity
3✔
1107
]
3✔
1108

1109
{ #category : 'visitor' }
1110
JavaSmaCCProgramNodeImporterVisitor >> visitPostDecrementExpression: aPostDecrementExpression [
3✔
1111
        currentFASTEntity := self addToModel: FASTJavaUnaryExpression new.
3✔
1112
        currentFASTEntity
3✔
1113
                expression: (self clone accept: aPostDecrementExpression expression).
3✔
1114
        currentFASTEntity operator: aPostDecrementExpression minusMinus value.
3✔
1115
        currentFASTEntity isPrefixedUnaryExpression: false.
3✔
1116
        self setStartEndPos: aPostDecrementExpression.
3✔
1117
        ^ currentFASTEntity
3✔
1118
]
3✔
1119

1120
{ #category : 'visitor' }
1121
JavaSmaCCProgramNodeImporterVisitor >> visitPostIncrementExpression: aPostIncrementExpression [
3✔
1122
        currentFASTEntity := self addToModel: FASTJavaUnaryExpression new.
3✔
1123
        currentFASTEntity
3✔
1124
                expression: (self clone accept: aPostIncrementExpression expression).
3✔
1125
        currentFASTEntity operator: aPostIncrementExpression plusPlus value.
3✔
1126
        currentFASTEntity isPrefixedUnaryExpression: false.
3✔
1127
        self setStartEndPos: aPostIncrementExpression.
3✔
1128
        ^ currentFASTEntity
3✔
1129
]
3✔
1130

1131
{ #category : 'visitor' }
1132
JavaSmaCCProgramNodeImporterVisitor >> visitPreDecrementExpression: aPreDecrementExpression [
3✔
1133
        currentFASTEntity := self addToModel: FASTJavaUnaryExpression new.
3✔
1134
        currentFASTEntity
3✔
1135
                expression: (self clone accept: aPreDecrementExpression expression).
3✔
1136
        currentFASTEntity operator: aPreDecrementExpression minusMinus value.
3✔
1137
        currentFASTEntity isPrefixedUnaryExpression: true.
3✔
1138
        self setStartEndPos: aPreDecrementExpression.
3✔
1139
        ^ currentFASTEntity
3✔
1140
]
3✔
1141

1142
{ #category : 'visitor' }
1143
JavaSmaCCProgramNodeImporterVisitor >> visitPreIncrementExpression: aPreIncrementExpression [
3✔
1144
        currentFASTEntity := self addToModel: FASTJavaUnaryExpression new.
3✔
1145
        currentFASTEntity
3✔
1146
                expression: (self clone accept: aPreIncrementExpression expression).
3✔
1147
        currentFASTEntity operator: aPreIncrementExpression plusPlus value.
3✔
1148
        currentFASTEntity isPrefixedUnaryExpression: true.
3✔
1149
        self setStartEndPos: aPreIncrementExpression.
3✔
1150
        ^ currentFASTEntity
3✔
1151
]
3✔
1152

1153
{ #category : 'visitor' }
UNCOV
1154
JavaSmaCCProgramNodeImporterVisitor >> visitPrimitiveType: aPrimitiveType [
×
UNCOV
1155
        currentFASTEntity := self
×
UNCOV
1156
                addToModel:
×
UNCOV
1157
                        (FASTJavaPrimitiveTypeExpression new
×
UNCOV
1158
                                name: aPrimitiveType token value;
×
UNCOV
1159
                                yourself).
×
UNCOV
1160
        self setStartEndPos: aPrimitiveType.
×
UNCOV
1161
        ^ currentFASTEntity
×
UNCOV
1162
]
×
1163

1164
{ #category : 'visitor' }
1165
JavaSmaCCProgramNodeImporterVisitor >> visitQualifiedName: aQualifiedName [
3✔
1166

3✔
1167
        self isOutsideTypeDeclaration
3✔
1168
                ifTrue: [
3✔
1169
                        currentFASTEntity := self addToModel: FASTJavaQualifiedName new.
3✔
1170
                        self setStartEndPos: aQualifiedName.
3✔
1171
                        currentFASTEntity namespace: (self clone accept: aQualifiedName nspace).
3✔
1172
                        currentFASTEntity name: aQualifiedName name value ]
3✔
1173
                ifFalse: [ 
3✔
1174
                        currentFASTEntity := self addToModel: FASTJavaClassProperty new.
3✔
1175
                        self setStartEndPos: aQualifiedName.
3✔
1176
                        currentFASTEntity type: (self clone accept: aQualifiedName nspace).
3✔
1177
                        currentFASTEntity fieldName: aQualifiedName name value ].
3✔
1178
        ^ currentFASTEntity
3✔
1179
]
3✔
1180

1181
{ #category : 'visitor' }
1182
JavaSmaCCProgramNodeImporterVisitor >> visitQualifiedTypeName: aQualifiedTypeName [
3✔
1183
        currentFASTEntity := self addToModel: FASTJavaQualifiedTypeName new.
3✔
1184
        self setStartEndPos: aQualifiedTypeName.
3✔
1185
        currentFASTEntity name: aQualifiedTypeName name value.
3✔
1186
        currentFASTEntity namespace: (self clone accept: aQualifiedTypeName nspace).
3✔
1187
        ^ currentFASTEntity
3✔
1188
]
3✔
1189

1190
{ #category : 'visitor' }
1191
JavaSmaCCProgramNodeImporterVisitor >> visitReturnStatement: aReturnStatement [
3✔
1192
        currentFASTEntity := self create: FASTJavaReturnStatement from: aReturnStatement.
3✔
1193

3✔
1194
        currentFASTEntity expression: (self clone accept: aReturnStatement expression).
3✔
1195

3✔
1196
        ^ currentFASTEntity
3✔
1197
]
3✔
1198

1199
{ #category : 'visitor' }
1200
JavaSmaCCProgramNodeImporterVisitor >> visitShortType: aByteType [
3✔
1201
        currentFASTEntity := self
3✔
1202
                addToModel:
3✔
1203
                        (FASTJavaShortTypeExpression new
3✔
1204
                                name: aByteType token value;
3✔
1205
                                yourself).
3✔
1206
        self setStartEndPos: aByteType.
3✔
1207
        ^ currentFASTEntity
3✔
1208
]
3✔
1209

1210
{ #category : 'visitor' }
1211
JavaSmaCCProgramNodeImporterVisitor >> visitSingleTypeImportDeclaration: aSingleTypeImportDeclaration [
3✔
1212
        currentFASTEntity := self addToModel: FASTJavaImportDeclaration new.
3✔
1213
        self setStartEndPos: aSingleTypeImportDeclaration.
3✔
1214
        currentFASTEntity qualifiedName: (self clone accept: aSingleTypeImportDeclaration name).
3✔
1215
]
3✔
1216

1217
{ #category : 'visitor' }
1218
JavaSmaCCProgramNodeImporterVisitor >> visitStatementExpressionList: aStatementExpressionList [
3✔
1219
        currentFASTEntity := self addToModel: FASTJavaExpressionStatement new.
3✔
1220
        self setStartEndPos: aStatementExpressionList.
3✔
1221
        aStatementExpressionList expressions
3✔
1222
                do:
3✔
1223
                        [ :expression | currentFASTEntity expression: (self clone accept: expression) ].
3✔
1224
        ^ currentFASTEntity
3✔
1225
]
3✔
1226

1227
{ #category : 'visitor' }
1228
JavaSmaCCProgramNodeImporterVisitor >> visitStaticInitializer: anInitializer [
3✔
1229
        self visitInitializer: anInitializer.
3✔
1230
        currentFASTEntity isStatic: true.
3✔
1231
        ^ currentFASTEntity
3✔
1232
]
3✔
1233

1234
{ #category : 'visitor' }
1235
JavaSmaCCProgramNodeImporterVisitor >> visitStringLiteral: aStringLiteral [
3✔
1236
        currentFASTEntity := self
3✔
1237
                addToModel:
3✔
1238
                        (FASTJavaStringLiteral new
3✔
1239
                                primitiveValue: ((aStringLiteral token value removePrefix: '"') removeSuffix: '"');
3✔
1240
                                yourself).
3✔
1241
        self setStartEndPos: aStringLiteral.
3✔
1242
        ^ currentFASTEntity
3✔
1243
]
3✔
1244

1245
{ #category : 'visitor' }
1246
JavaSmaCCProgramNodeImporterVisitor >> visitSuperConstructorInvocation: aSuperConstructorInvocation [
3✔
1247
        | expressionStatement |
3✔
1248
        currentFASTEntity := self addToModel: FASTJavaExpressionStatement new.
3✔
1249
        expressionStatement := currentFASTEntity. 
3✔
1250
        self setStartEndPos: aSuperConstructorInvocation.
3✔
1251
        "we encasulate the call inside a fast expression statement"
3✔
1252
        currentFASTEntity expression: (self addToModel: FASTJavaMethodInvocation new).
3✔
1253
        currentFASTEntity := currentFASTEntity expression.
3✔
1254
        self setStartEndPos: aSuperConstructorInvocation.
3✔
1255
        aSuperConstructorInvocation expressions do: [ :expression | currentFASTEntity arguments add: (self clone accept: expression) ].
3✔
1256
        currentFASTEntity name: aSuperConstructorInvocation superToken value.
3✔
1257
        ^ expressionStatement
3✔
1258
]
3✔
1259

1260
{ #category : 'visitor' }
1261
JavaSmaCCProgramNodeImporterVisitor >> visitSuperMemberAcessor: aFieldAccess [
3✔
1262
        currentFASTEntity := self create: FASTJavaVariableExpression from: aFieldAccess superToken.
3✔
1263
        currentFASTEntity name: aFieldAccess superToken value.
3✔
1264
        ^currentFASTEntity 
3✔
1265
]
3✔
1266

1267
{ #category : 'visitor' }
1268
JavaSmaCCProgramNodeImporterVisitor >> visitSwitchBlockStatementGroup: aSwitchBlockStatementGroup [
3✔
1269
        currentFASTEntity := self
3✔
1270
                addToModel:
3✔
1271
                        (aSwitchBlockStatementGroup labels anyOne class = JavaSwitchLabelNode
3✔
1272
                                ifTrue: [ FASTJavaLabeledCaseStatement new
3✔
1273
                                                label: (self clone accept: aSwitchBlockStatementGroup labels anyOne constants anyOne);
3✔
1274
                                                yourself ]
3✔
1275
                                ifFalse: [ FASTJavaDefaultCaseStatement new ]).
3✔
1276
        self setStartEndPos: aSwitchBlockStatementGroup.
3✔
1277
        aSwitchBlockStatementGroup statements do: [ :statement | currentFASTEntity statements add: (self clone accept: statement) ].
3✔
1278
        ^ currentFASTEntity
3✔
1279
]
3✔
1280

1281
{ #category : 'visitor' }
1282
JavaSmaCCProgramNodeImporterVisitor >> visitSwitchStatement: aSwitchStatement [
3✔
1283
        currentFASTEntity := self addToModel: FASTJavaSwitchStatement new.
3✔
1284
        self setStartEndPos: aSwitchStatement.
3✔
1285
        aSwitchStatement block statementGroups do: [ :aStatementGroup |
3✔
1286
                 currentFASTEntity cases add: (self clone accept: aStatementGroup) ].
3✔
1287
        currentFASTEntity condition: (self clone accept: aSwitchStatement expression).
3✔
1288
        ^ currentFASTEntity
3✔
1289
]
3✔
1290

1291
{ #category : 'visitor' }
1292
JavaSmaCCProgramNodeImporterVisitor >> visitSynchronizedStatement: aSynchronizedStatement [
3✔
1293
        currentFASTEntity := self
3✔
1294
                addToModel: FASTJavaSynchronizedStatement new.
3✔
1295
        self setStartEndPos: aSynchronizedStatement.
3✔
1296
        currentFASTEntity
3✔
1297
                expression: (self clone accept: aSynchronizedStatement expression).
3✔
1298
        currentFASTEntity
3✔
1299
                block: (self clone accept: aSynchronizedStatement block).
3✔
1300
        ^ currentFASTEntity
3✔
1301
]
3✔
1302

1303
{ #category : 'visitor' }
1304
JavaSmaCCProgramNodeImporterVisitor >> visitThisConstructorInvocation: aThisConstructorInvocation [
3✔
1305
        | expressionStatement | 
3✔
1306
        currentFASTEntity := self addToModel: FASTJavaExpressionStatement new.
3✔
1307
        expressionStatement := currentFASTEntity. 
3✔
1308
        self setStartEndPos: aThisConstructorInvocation.
3✔
1309
        "we encasulate the call inside a fast expression statement"
3✔
1310
        currentFASTEntity expression: (self addToModel: FASTJavaMethodInvocation new).
3✔
1311
        currentFASTEntity := currentFASTEntity expression.
3✔
1312
        self setStartEndPos: aThisConstructorInvocation.
3✔
1313
        aThisConstructorInvocation expressions
3✔
1314
                do:
3✔
1315
                        [ :expression | currentFASTEntity arguments add: (self clone accept: expression) ].
3✔
1316
        currentFASTEntity name: aThisConstructorInvocation thisToken value.
3✔
1317
        ^ expressionStatement
3✔
1318
]
3✔
1319

1320
{ #category : 'visitor' }
1321
JavaSmaCCProgramNodeImporterVisitor >> visitThrowStatement: aThrowStatement [
3✔
1322
        currentFASTEntity := self addToModel: FASTJavaThrowStatement new.
3✔
1323
        self setStartEndPos: aThrowStatement.
3✔
1324
        currentFASTEntity expression: (self clone accept: aThrowStatement expression).
3✔
1325
        ^ currentFASTEntity
3✔
1326
]
3✔
1327

1328
{ #category : 'visitor' }
1329
JavaSmaCCProgramNodeImporterVisitor >> visitTryStatement: aTryStatement [
3✔
1330
        currentFASTEntity := self create: FASTJavaTryCatchStatement from: aTryStatement.
3✔
1331

3✔
1332
        aTryStatement resources do: [ :tryResource |
3✔
1333
                currentFASTEntity addResource: (self clone accept: tryResource)
3✔
1334
        ].
3✔
1335

3✔
1336
        currentFASTEntity try: (self clone accept: aTryStatement block).
3✔
1337

3✔
1338
        aTryStatement catches
3✔
1339
                do:
3✔
1340
                        [ :aCatchBlock | currentFASTEntity addCatch: (self clone accept: aCatchBlock) ].
3✔
1341

3✔
1342
        currentFASTEntity finally: (self clone accept: aTryStatement finally).
3✔
1343

3✔
1344
        ^ currentFASTEntity
3✔
1345
]
3✔
1346

1347
{ #category : 'visitor' }
1348
JavaSmaCCProgramNodeImporterVisitor >> visitTypeArgument: aTypeArgument [
3✔
1349

3✔
1350
        self flag: 'Would probably be better to introduce a FASTJavaTypeWildCardParameterExpression'.
3✔
1351

3✔
1352
        ^aTypeArgument questionMark
3✔
1353
                ifNil: [  self accept: aTypeArgument type ]
3✔
1354
                ifNotNil: [
3✔
1355
                        currentFASTEntity := self create: FASTJavaTypeParameterExpression  from: aTypeArgument.
3✔
1356
                        currentFASTEntity
3✔
1357
                                name: '?' ;
3✔
1358
                                yourself
3✔
1359
                ]
3✔
1360
]
3✔
1361

1362
{ #category : 'visitor' }
1363
JavaSmaCCProgramNodeImporterVisitor >> visitTypeImportOnDemandDeclaration: aTypeImportOnDemandDeclaration [
3✔
1364

3✔
1365
        currentFASTEntity := self addToModel: FASTJavaImportDeclaration new.
3✔
1366
        self setStartEndPos: aTypeImportOnDemandDeclaration.
3✔
1367
        currentFASTEntity
3✔
1368
                isOnDemand: true;
3✔
1369
                qualifiedName:
3✔
1370
                        (self clone accept: aTypeImportOnDemandDeclaration name)
3✔
1371
]
3✔
1372

1373
{ #category : 'visitor' }
1374
JavaSmaCCProgramNodeImporterVisitor >> visitTypeName: aTypeName [
3✔
1375
        currentFASTEntity := self addToModel: FASTJavaTypeName new.
3✔
1376
        currentFASTEntity name: aTypeName name value.
3✔
1377
        self setStartEndPos: aTypeName.
3✔
1378
        ^ currentFASTEntity
3✔
1379
]
3✔
1380

1381
{ #category : 'visitor' }
1382
JavaSmaCCProgramNodeImporterVisitor >> visitTypeParameter: aTypeParameter [
3✔
1383
        currentFASTEntity := self addToModel: FASTJavaTypeParameterExpression new.
3✔
1384
        self setStartEndPos: aTypeParameter.
3✔
1385
        currentFASTEntity name: aTypeParameter name value.
3✔
1386
        aTypeParameter types do: [ :type |
3✔
1387
                currentFASTEntity addType: (self clone accept: type)
3✔
1388
                 ].
3✔
1389
        ^ currentFASTEntity
3✔
1390
]
3✔
1391

1392
{ #category : 'visitor' }
1393
JavaSmaCCProgramNodeImporterVisitor >> visitUnaryAddition: anUnaryAddition [
3✔
1394
        currentFASTEntity := self addToModel: FASTJavaUnaryExpression new.
3✔
1395
        currentFASTEntity
3✔
1396
                expression: (self clone accept: anUnaryAddition expression).
3✔
1397
        currentFASTEntity operator: anUnaryAddition plus value.
3✔
1398
        currentFASTEntity isPrefixedUnaryExpression: true.
3✔
1399
        self setStartEndPos: anUnaryAddition.
3✔
1400
        ^ currentFASTEntity
3✔
1401
]
3✔
1402

1403
{ #category : 'visitor' }
1404
JavaSmaCCProgramNodeImporterVisitor >> visitUnaryBitInvert: anUnaryBitInvert [
3✔
1405
        currentFASTEntity := self addToModel: FASTJavaUnaryExpression new.
3✔
1406
        currentFASTEntity
3✔
1407
                expression: (self clone accept: anUnaryBitInvert expression).
3✔
1408
        currentFASTEntity operator: anUnaryBitInvert tilde value.
3✔
1409
        currentFASTEntity isPrefixedUnaryExpression: true.
3✔
1410
        self setStartEndPos: anUnaryBitInvert.
3✔
1411
        ^ currentFASTEntity
3✔
1412
]
3✔
1413

1414
{ #category : 'visitor' }
1415
JavaSmaCCProgramNodeImporterVisitor >> visitUnaryNot: aUnaryNotExpression [
3✔
1416
        currentFASTEntity := self addToModel: FASTJavaUnaryExpression new.
3✔
1417
        currentFASTEntity
3✔
1418
                expression: (self clone accept: aUnaryNotExpression expression).
3✔
1419
        currentFASTEntity operator: aUnaryNotExpression bang value.
3✔
1420
        currentFASTEntity isPrefixedUnaryExpression: true.
3✔
1421
        self setStartEndPos: aUnaryNotExpression.
3✔
1422
        ^ currentFASTEntity
3✔
1423
]
3✔
1424

1425
{ #category : 'visitor' }
1426
JavaSmaCCProgramNodeImporterVisitor >> visitUnarySubtraction: anUnarySubtraction [
3✔
1427
        currentFASTEntity := self addToModel: FASTJavaUnaryExpression new.
3✔
1428
        currentFASTEntity
3✔
1429
                expression: (self clone accept: anUnarySubtraction expression).
3✔
1430
        currentFASTEntity operator: anUnarySubtraction minus value.
3✔
1431
        currentFASTEntity isPrefixedUnaryExpression: true.
3✔
1432
        self setStartEndPos: anUnarySubtraction.
3✔
1433
        ^ currentFASTEntity
3✔
1434
]
3✔
1435

1436
{ #category : 'generated' }
1437
JavaSmaCCProgramNodeImporterVisitor >> visitVariableArgumentParameter: aVariableArgumentParameter [
3✔
1438
        self visitParameter: aVariableArgumentParameter.
3✔
1439
        currentFASTEntity hasVariableArguments: true.
3✔
1440
        ^ currentFASTEntity
3✔
1441
]
3✔
1442

1443
{ #category : 'visitor' }
1444
JavaSmaCCProgramNodeImporterVisitor >> visitVariableDeclaration: aVariableDeclaration [
3✔
1445
        currentFASTEntity := self addToModel: FASTJavaVariableDeclarator new.
3✔
1446
        self setStartEndPos: aVariableDeclaration.
3✔
1447
        currentFASTEntity
3✔
1448
                variable: (self clone accept: aVariableDeclaration variable).
3✔
1449
        ^ currentFASTEntity
3✔
1450
]
3✔
1451

1452
{ #category : 'visitor' }
1453
JavaSmaCCProgramNodeImporterVisitor >> visitVariableName: aVariableName [
3✔
1454
        currentFASTEntity := self create: FASTJavaVariableExpression from: aVariableName.
3✔
1455
        currentFASTEntity name: aVariableName name value.
3✔
1456
        ^ currentFASTEntity
3✔
1457
]
3✔
1458

1459
{ #category : 'visitor' }
1460
JavaSmaCCProgramNodeImporterVisitor >> visitVoidType: aVoidType [
3✔
1461
        currentFASTEntity := self
3✔
1462
                addToModel:
3✔
1463
                        (FASTJavaVoidTypeExpression new
3✔
1464
                                name: aVoidType voidToken value;
3✔
1465
                                yourself).
3✔
1466
        self setStartEndPos: aVoidType.
3✔
1467
        ^ currentFASTEntity
3✔
1468
]
3✔
1469

1470
{ #category : 'visitor' }
1471
JavaSmaCCProgramNodeImporterVisitor >> visitWhileStatement: aWhileStatementNode [
3✔
1472
        currentFASTEntity := self addToModel: FASTJavaWhileStatement new.
3✔
1473
        self setStartEndPos: aWhileStatementNode.
3✔
1474
        currentFASTEntity
3✔
1475
                condition: (self clone accept: aWhileStatementNode expression).
3✔
1476
        currentFASTEntity
3✔
1477
                body: (self clone accept: aWhileStatementNode statement).
3✔
1478
        ^ currentFASTEntity
3✔
1479
]
3✔
1480

1481
{ #category : 'initialization' }
1482
JavaSmaCCProgramNodeImporterVisitor >> withComments [
3✔
1483
        withComments := true
3✔
1484
]
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc