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

moosetechnology / FAST-JAVA / 6736545635

02 Nov 2023 06:07PM CUT coverage: 61.407% (-0.05%) from 61.459%
6736545635

push

github

web-flow
Merge pull request #179 from moosetechnology/178-FASTJavaExporter-does-not-export-finally-

178 fast java exporter does not export finally

114 of 114 new or added lines in 7 files covered. (100.0%)

5106 of 8315 relevant lines covered (61.41%)

0.61 hits per line

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

0.0
/src/FAST-Java-Model-Generator/FASTJavaMetamodelGenerator.class.st
1
"
2
I contains the generator to create the Java FAST Metamodel
3

4

5
Use this to re generate the metamodel.
6

7
```st
8
FASTJavaMetamodelGenerator new generate.
9
FASTJavaMetamodelGenerator resetMetamodel.
10
```
11
"
12
Class {
13
        #name : #FASTJavaMetamodelGenerator,
14
        #superclass : #FamixMetamodelGenerator,
15
        #instVars : [
16
                'javaBreakStatement',
17
                'javaCaseStatement',
18
                'javaCharacterLiteral',
19
                'javaContinueStatement',
20
                'javaDoWhileStatement',
21
                'javaFieldAccess',
22
                'javaFloatLiteral',
23
                'javaForStatement',
24
                'javaIdentifier',
25
                'javaIfStatement',
26
                'javaInfixOperation',
27
                'javaIntegerLiteral',
28
                'javaMethodEntity',
29
                'javaMethodInvocation',
30
                'javaNullLiteral',
31
                'javaStringLiteral',
32
                'javaSwitchStatement',
33
                'javaThis',
34
                'javaVarDeclStatement',
35
                'javaVariableDeclarator',
36
                'javaWhileStatement',
37
                'javaCastExpression',
38
                'javaClassProperty',
39
                'javaForEachStatement',
40
                'javaUnaryExpression',
41
                'javaNewExpression',
42
                'javaNewClassExpression',
43
                'javaNewArray',
44
                'javaConditionalExpression',
45
                'javaArrayAccess',
46
                'javaInitializer',
47
                'javaOuterThis',
48
                'javaThrowStatement',
49
                'javaLabeledCaseStatement',
50
                'javaDefaultCaseStatement',
51
                'javaEmptyMethodDeclaration',
52
                'javaArrayInitializer',
53
                'javaClassDeclaration',
54
                'javaModifier',
55
                'javaCatchPartStatement',
56
                'javaLambdaExpression',
57
                'javaMethodReference',
58
                'javaSynchronizedStatement',
59
                'javaTypeName',
60
                'javaQualifiedTypeName',
61
                'javaTypeExpression',
62
                'javaArrayTypeExpression',
63
                'javaClassTypeExpression',
64
                'javaPrimitiveTypeExpression',
65
                'javaBooleanTypeExpression',
66
                'javaByteTypeExpression',
67
                'javaCharTypeExpression',
68
                'javaDoubleTypeExpression',
69
                'javaFloatTypeExpression',
70
                'javaIntTypeExpression',
71
                'javaLongTypeExpression',
72
                'javaShortTypeExpression',
73
                'javaVoidTypeExpression',
74
                'javaParameterExpression',
75
                'javaAssertStatement',
76
                'javaAnnotationExpression',
77
                'javaVariableExpression',
78
                'javaStatementBlock',
79
                'javaReturnStatement',
80
                'javaExpressionStatement',
81
                'javaStatement',
82
                'javaBooleanLiteral',
83
                'tDeclaration',
84
                'tWithDeclarations',
85
                'tModifier',
86
                'tWithModifiers',
87
                'tWithReceiver',
88
                'tReceiver',
89
                'tNamedEntity',
90
                'tEntity',
91
                'tExpression',
92
                'tStatement',
93
                'tCharacterLiteral',
94
                'tLiteral',
95
                'tVariableExpression',
96
                'tNamedBehaviouralEntity',
97
                'tNullPointerLiteral',
98
                'tStringLiteral',
99
                'tScopableEntity',
100
                'tVariableEntity',
101
                'tStatementBlock',
102
                'tExpressionStatement',
103
                'tWithParameters',
104
                'tReturnStatement',
105
                'tBooleanLiteral',
106
                'javaEnumDeclaration',
107
                'javaInterfaceDeclaration',
108
                'packageDeclaration',
109
                'importDeclaration',
110
                'qualifiedName',
111
                'javaLabeledStatement',
112
                'javaTypeParameter',
113
                'javaAssignmentExpression',
114
                'tAssignable',
115
                'tWithAssignable',
116
                'tWithQualifiedName',
117
                'javaTryCatchStatement',
118
                'compilationUnit',
119
                'javaLongLiteral',
120
                'javaDoubleLiteral',
121
                'tInvocation',
122
                'tComment',
123
                'tWithComments',
124
                'javaEntity',
125
                'javaComment',
126
                'javaEmptyDimExpression',
127
                'javaEnumConstant'
128
        ],
129
        #category : #'FAST-Java-Model-Generator'
130
}
131

132
{ #category : #accessing }
133
FASTJavaMetamodelGenerator class >> packageName [
×
134

×
135
        ^ #'FAST-Java-Model'
×
136
]
×
137

138
{ #category : #accessing }
139
FASTJavaMetamodelGenerator class >> prefix [
×
140
        ^ #FASTJava
×
141
]
×
142

143
{ #category : #accessing }
144
FASTJavaMetamodelGenerator class >> submetamodels [
×
145
        ^ { FASTMetamodelGenerator }
×
146
]
×
147

148
{ #category : #comments }
149
FASTJavaMetamodelGenerator >> commentForAssertStatement [
×
150
        ^ 'I represent an assert statement
×
151

×
152
example:
×
153

×
154
void method (){
×
155
        assert condition1 || condition2 : "error message"
×
156
}
×
157
'
×
158
]
×
159

160
{ #category : #comments }
161
FASTJavaMetamodelGenerator >> commentForJavaAnnotation [
×
162
        ^ 'I reprensent a Java Annotation
×
163

×
164
example:
×
165

×
166
@Override'
×
167
]
×
168

169
{ #category : #comments }
170
FASTJavaMetamodelGenerator >> commentForJavaArrayAccess [
×
171
        ^ 'I represent a java array access
×
172
        
×
173
ex:
×
174

×
175
liste[i]'
×
176
]
×
177

178
{ #category : #comments }
179
FASTJavaMetamodelGenerator >> commentForJavaArrayInitializer [
×
180
        ^ 'I represent the array initializer and I have many initializers
×
181
        
×
182
ex:
×
183
String patate = {"hello", "world"}
×
184

×
185

×
186
I am : {"hello", "world"} 
×
187
My initializers are 
×
188
"hello" and "world"
×
189
 '
×
190
]
×
191

×
192
{ #category : #comments }
×
193
FASTJavaMetamodelGenerator >> commentForJavaAssignmentExpression [
×
194
        ^ 'An assignment expression mode.
×
195

×
196
Contains a referances to an assignee assignee and the expression that''s being assigned.'
×
197
]
×
198

×
199
{ #category : #comments }
×
200
FASTJavaMetamodelGenerator >> commentForJavaBooleanLiteral [
×
201
        ^ 'I represent a boolean literal node.'
×
202
]
×
203

×
204
{ #category : #comments }
×
205
FASTJavaMetamodelGenerator >> commentForJavaBreakStatement [
×
206
        ^ 'A node representing break statement in java'
×
207
]
×
208

×
209
{ #category : #comments }
×
210
FASTJavaMetamodelGenerator >> commentForJavaCaseStatement [
×
211
        ^ 'case part of switch statement'
×
212
]
×
213

×
214
{ #category : #comments }
×
215
FASTJavaMetamodelGenerator >> commentForJavaCharacterLiteral [
×
216
        ^ 'I represent a character literal node.
×
217
example:
×
218
```java
×
219
char c = ''a'';
×
220
```
×
221
`''a''` is the literal'
×
222
]
×
223

×
224
{ #category : #comments }
×
225
FASTJavaMetamodelGenerator >> commentForJavaClassDeclaration [
×
226
        ^ 'I represent a class declaration
×
227
example
×
228

×
229
public class ClassName extends SomeClass implements OneClass, TwoClass {
×
230

×
231
        int oneDeclaration;
×
232
        
×
233
        void methodDeclaration(){
×
234
        }
×
235
}'
×
236
]
×
237

×
238
{ #category : #comments }
×
239
FASTJavaMetamodelGenerator >> commentForJavaClassProperty [
×
240
        ^ 'A FASTJavaClassProperty corresponds to the access to a class property
×
241
        
×
242
        It is not the same as the field access because there are some specific usage of class property to access the current object.
×
243
        
×
244
ex.
×
245

×
246
class Enclosing {
×
247
    void method(Enclosing other) {
×
248
        // ...
×
249
    }
×
250

×
251
    void otherMethod() {
×
252
        new Runnable() {
×
253
            public void run() {
×
254
                method(this);
×
255

×
256

×
257
                                                                --> Does not compile. ''this'' is a Runnable!
×
258

×
259

×
260

×
261
                method(Enclosing.this);
×
262

×
263
                                                                --> Compiles fine.
×
264

×
265

×
266
            }
×
267
        }.run();
×
268
    }
×
269
}
×
270
'
×
271
]
×
272

×
273
{ #category : #comments }
×
274
FASTJavaMetamodelGenerator >> commentForJavaComment [
×
275
        ^ 'I represent a Java comment (block or line comment)'
×
276
]
×
277

×
278
{ #category : #comments }
×
279
FASTJavaMetamodelGenerator >> commentForJavaConditionalStatement [
×
280
        ^ 'I represent a Java conditionnal Statement
×
281

×
282
ex:
×
283

×
284
(h.get() == 2) ? thenPart : elsePart'
×
285
]
×
286

×
287
{ #category : #comments }
×
288
FASTJavaMetamodelGenerator >> commentForJavaContinueStatement [
×
289
        ^ 'A node representing continue statement in java'
×
290
]
×
291

×
292
{ #category : #comments }
×
293
FASTJavaMetamodelGenerator >> commentForJavaDefaultCaseStatement [
×
294
        ^ 'I represent a default case
×
295
        
×
296
ex.:
×
297

×
298
default:'
×
299
]
×
300

×
301
{ #category : #comments }
×
302
FASTJavaMetamodelGenerator >> commentForJavaDoWhileStatement [
×
303
        ^ 'A node of a do-while statement.
×
304

×
305
eg.
×
306
do {
×
307
...
×
308
} while(...);'
×
309
]
×
310

×
311
{ #category : #comments }
×
312
FASTJavaMetamodelGenerator >> commentForJavaDoubleLiteral [
×
313
        ^ 'I represent a double literal node.
×
314
example:
×
315
```java
×
316
double d1 = 12.3;
×
317
double d2 = 12.3d;
×
318
```
×
319
`12.3` and `12.3d` are double literals'
×
320
]
×
321

×
322
{ #category : #comments }
×
323
FASTJavaMetamodelGenerator >> commentForJavaEmptyDimExpression [
×
324
        ^ 'A node representing an empty expression when creating an array, for example:
×
325
        
×
326
        new String[] {"a"};'
×
327
]
×
328

×
329
{ #category : #comments }
×
330
FASTJavaMetamodelGenerator >> commentForJavaEmptyMethodDeclaration [
×
331
        ^ 'I reprensent an empty method declaration
×
332
        
×
333
ex.:
×
334
void newMethod() {
×
335
        new Patate() {
×
336
                //The empty method declaration is ";" 
×
337
                ;
×
338
                
×
339
        };
×
340
}'
×
341
]
×
342

×
343
{ #category : #comments }
×
344
FASTJavaMetamodelGenerator >> commentForJavaEnumDeclaration [
×
345
        ^ 'I represent an enum declaration
×
346
example
×
347

×
348
public enum MyEnum {
×
349
        
×
350
        HELLO;
×
351
        
×
352
        int oneDeclaration;
×
353
        
×
354
        void methodDeclaration(){
×
355
        }
×
356
}'
×
357
]
×
358

×
359
{ #category : #comments }
×
360
FASTJavaMetamodelGenerator >> commentForJavaFieldAccess [
×
361
        ^ 'A FASTJavaFieldAccess corresponds to an access to an instance variable (field)'
×
362
]
×
363

×
364
{ #category : #comments }
×
365
FASTJavaMetamodelGenerator >> commentForJavaFloatLiteral [
×
366
        ^ 'I represent a float literal node.
×
367
example:
×
368
```java
×
369
float f = 12.3f;
×
370
```
×
371
`12.3f` is the literal'
×
372
]
×
373

×
374
{ #category : #comments }
×
375
FASTJavaMetamodelGenerator >> commentForJavaForEachStatement [
×
376
        ^ 'A node of a for loop statement.
×
377

×
378
eg.
×
379
for(Patate p : list) {
×
380
...
×
381
}'
×
382
]
×
383

×
384
{ #category : #comments }
×
385
FASTJavaMetamodelGenerator >> commentForJavaForStatement [
×
386
        ^ 'A node of a for loop statement.
×
387

×
388
eg.
×
389
for(_;_;_) {
×
390
...
×
391
}'
×
392
]
×
393

×
394
{ #category : #comments }
×
395
FASTJavaMetamodelGenerator >> commentForJavaIdentifier [
×
396
        ^ 'A FASTJavaIdentifier is an identifier in a Java program'
×
397
]
×
398

×
399
{ #category : #comments }
×
400
FASTJavaMetamodelGenerator >> commentForJavaIfStatement [
×
401
        ^ 'A node of a if statement or an if-else statement.
×
402

×
403
eg.
×
404
if(...) {
×
405
...
×
406
} else {
×
407
...
×
408
}'
×
409
]
×
410

×
411
{ #category : #comments }
×
412
FASTJavaMetamodelGenerator >> commentForJavaInfixOperation [
×
413
        ^ 'Binary java operations in  format: <expr> <operator> <expr>
×
414

×
415
ex:
×
416
        a + b
×
417
        3 == 6
×
418
        a = 6'
×
419
]
×
420

×
421
{ #category : #comments }
×
422
FASTJavaMetamodelGenerator >> commentForJavaInitializer [
×
423
        ^ 'I represent a Java initializer
×
424
        
×
425
ex.:
×
426

×
427
new Button(){
×
428

×
429
{ something }
×
430

×
431
}
×
432
'
×
433
]
×
434

×
435
{ #category : #comments }
×
436
FASTJavaMetamodelGenerator >> commentForJavaIntegerLiteral [
×
437
        ^ 'I represent an integer literal node.'
×
438
]
×
439

×
440
{ #category : #comments }
×
441
FASTJavaMetamodelGenerator >> commentForJavaInterfaceDeclaration [
×
442
        ^ 'I represent an interface declaration
×
443
example
×
444

×
445
```java
×
446
public interface MyInterface {
×
447

×
448
    public static final String CODE = "SEME";
×
449

×
450
}
×
451
```
×
452
'
×
453
]
×
454

×
455
{ #category : #comments }
×
456
FASTJavaMetamodelGenerator >> commentForJavaLabeledCaseStatement [
×
457
        ^ 'I represent a Labeled case
×
458
        
×
459
ex.:
×
460

×
461
case LABEL:'
×
462
]
×
463

×
464
{ #category : #comments }
×
465
FASTJavaMetamodelGenerator >> commentForJavaLongLiteral [
×
466
        ^ 'I represent a long literal node.
×
467
example:
×
468
```java
×
469
long l = 2147483648L;
×
470
```
×
471
`2147483648L` is the literal'
×
472
]
×
473

×
474
{ #category : #comments }
×
475
FASTJavaMetamodelGenerator >> commentForJavaMethodEntity [
×
476
        ^ 'Represents a Java method'
×
477
]
×
478

×
479
{ #category : #comments }
×
480
FASTJavaMetamodelGenerator >> commentForJavaMethodInvocation [
×
481
        ^ 'A node representing method invocation'
×
482
]
×
483

×
484
{ #category : #comments }
×
485
FASTJavaMetamodelGenerator >> commentForJavaModifier [
×
486
        ^ 'I am a Java modifier
×
487

×
488
example: 
×
489
for classes: 
×
490

×
491
- public
×
492
- default
×
493
- final
×
494
- abstract
×
495

×
496
for methods:
×
497

×
498
- public
×
499
- private
×
500
- default
×
501
- protected
×
502
- final
×
503
- static
×
504
- abstract
×
505
- transient
×
506
- synchronized
×
507
- volatile
×
508

×
509

×
510
'
×
511
]
×
512

×
513
{ #category : #comments }
×
514
FASTJavaMetamodelGenerator >> commentForJavaNewArray [
×
515
        ^ 'I represent a java new array node.
×
516
ex.
×
517

×
518
new String()["10px", "Hello world"]'
×
519
]
×
520

×
521
{ #category : #comments }
×
522
FASTJavaMetamodelGenerator >> commentForJavaNewClassExpression [
×
523
        ^ 'I represent a new class expression (which is most of the time a new anonymous class)
×
524
        
×
525
        
×
526
ex. for SecureAsyncCallback
×
527

×
528
new SecureAsyncCallback<Void>() {
×
529
        @Override
×
530
        public void onSuccess(final Void result) {}
×
531
        
×
532
        @Override
×
533
        public void onFailure(final Throwable caught) {
×
534
                super.onFailure(caught);
×
535
        }
×
536
}'
×
537
]
×
538

×
539
{ #category : #comments }
×
540
FASTJavaMetamodelGenerator >> commentForJavaNewExpression [
×
541
        ^ 'I represent the invocation of a Class constructor with the keyword ''new''
×
542

×
543
ex.
×
544

×
545
new Patate()'
×
546
]
×
547

×
548
{ #category : #comments }
×
549
FASTJavaMetamodelGenerator >> commentForJavaNullLiteral [
×
550
        ^ 'I represent a `null` literal node.'
×
551
]
×
552

×
553
{ #category : #comments }
×
554
FASTJavaMetamodelGenerator >> commentForJavaOuterThis [
×
555
        ^ 'I represent a java outer this (only a call to ''this'' to a class)
×
556
        
×
557
ex.:
×
558

×
559
hello(MyClass.this)'
×
560
]
×
561

×
562
{ #category : #comments }
×
563
FASTJavaMetamodelGenerator >> commentForJavaQualifiedTypeName [
×
564
        ^ 'I represent a qualified name for a type
×
565

×
566
example:
×
567

×
568
new Canard.Poulet(){
×
569

×
570
}
×
571

×
572
"Canard.Poulet" is the qualified name
×
573

×
574
"Poulet" is the main name
×
575

×
576
"Canard" is the namespace of the main name 
×
577
'
×
578
]
×
579

580
{ #category : #comments }
581
FASTJavaMetamodelGenerator >> commentForJavaStringLiteral [
×
582
        ^ 'I represent a string literal node.'
×
583
]
×
584

585
{ #category : #comments }
586
FASTJavaMetamodelGenerator >> commentForJavaSwitchStatement [
×
587
        ^ 'A node representing switch statement
×
588

×
589
eg.
×
590
switch (_) {
×
591
...
×
592
}'
×
593
]
×
594

595
{ #category : #comments }
596
FASTJavaMetamodelGenerator >> commentForJavaTAssignable [
×
597
        ^ 'You can assign something to me
×
598
example:
×
599

×
600
this.hello = "hello"'
×
601
]
×
602

603
{ #category : #comments }
604
FASTJavaMetamodelGenerator >> commentForJavaTModifier [
×
605
        ^ 'I am a modifier in java
×
606
example:
×
607

×
608
public, proctected, private'
×
609
]
×
610

611
{ #category : #comments }
612
FASTJavaMetamodelGenerator >> commentForJavaThis [
×
613
        ^ 'A FASTJavaThis corresponds to ''this'' in Java'
×
614
]
×
615

616
{ #category : #comments }
617
FASTJavaMetamodelGenerator >> commentForJavaThrowStatement [
×
618
        ^ 'I represent a java throw statement
×
619
        
×
620
ex:
×
621

×
622
throw new Hello();'
×
623
]
×
624

625
{ #category : #comments }
626
FASTJavaMetamodelGenerator >> commentForJavaTryCatchStatement [
×
627
        ^ 'I represent the java try catch statement. I must have two parts: the ''Try'' part and the ''catch'' part. 
×
628
        
×
629
ex.
×
630

×
631
void tryCatch() {
×
632
        int x;
×
633
        try {
×
634
                x = 1;
×
635
   } catch (Exception e) {
×
636
                Patate.displayError(e.getMessage());
×
637
        };
×
638
}
×
639

×
640
'
×
641
]
×
642

643
{ #category : #comments }
644
FASTJavaMetamodelGenerator >> commentForJavaUnaryExpression [
×
645
        ^ 'I represent a Java Unary Expression
×
646
        
×
647
It can be :
×
648

×
649
++i
×
650
i++
×
651
--i
×
652
i--
×
653
!b
×
654
+i
×
655
-i
×
656

×
657
see: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op1.html'
×
658
]
×
659

660
{ #category : #comments }
661
FASTJavaMetamodelGenerator >> commentForJavaVarDeclStatement [
×
662
        ^ 'A statement of variable declaration.
×
663
A variable declaration statement can contain several declarators.
×
664

×
665
eg.
×
666

×
667
int d = 3, e, f = 5;
×
668
statement has 3 declarators separated by commas. Second declarator has no expression.'
×
669
]
×
670

671
{ #category : #comments }
672
FASTJavaMetamodelGenerator >> commentForJavaVariableDeclarator [
×
673
        ^ 'A part of variable declaration statement containing a variable (named entity) and an expression (optional) that is assigned to it.
×
674
A variable declaration statement can contain several declarators.
×
675

×
676
eg.
×
677

×
678
int d = 3, e, f = 5;
×
679
statement has 3 declarators separated by commas. Second declarator has no expression.'
×
680
]
×
681

682
{ #category : #comments }
683
FASTJavaMetamodelGenerator >> commentForJavaWhileStatement [
×
684
        ^ 'A node of a while statement.
×
685

×
686
eg.
×
687
while(...) {
×
688
...
×
689
}'
×
690
]
×
691

692
{ #category : #definition }
693
FASTJavaMetamodelGenerator >> defineClasses [
×
694
        super defineClasses.
×
695
        
×
696
        javaEntity  := builder newClassNamed: #Entity.
×
697

×
698
        javaComment := builder newClassNamed: #Comment comment: self commentForJavaComment.
×
699
        javaFieldAccess := builder newClassNamed: #FieldAccess comment: self commentForJavaFieldAccess.
×
700
        javaIdentifier := builder newClassNamed: #Identifier comment: self commentForJavaIdentifier.
×
701
        javaInfixOperation := builder newClassNamed: #InfixOperation comment: self commentForJavaInfixOperation.
×
702
        javaMethodEntity := builder newClassNamed: #MethodEntity comment: self commentForJavaMethodEntity.
×
703
        javaMethodInvocation := builder newClassNamed: #MethodInvocation comment: self commentForJavaMethodInvocation.
×
704
        javaThis := builder newClassNamed: #This comment: self commentForJavaThis.
×
705
        javaOuterThis := builder newClassNamed: #OuterThis comment: self commentForJavaOuterThis.
×
706
        javaVariableDeclarator := builder newClassNamed: #VariableDeclarator comment: self commentForJavaVariableDeclarator.
×
707
        javaClassProperty := builder newClassNamed: #ClassProperty comment: self commentForJavaClassProperty.
×
708
        javaNewArray := builder newClassNamed: #NewArray comment: self commentForJavaNewArray.
×
709
        javaArrayAccess := builder newClassNamed: #ArrayAccess comment: self commentForJavaArrayAccess.
×
710
        javaInitializer := builder newClassNamed: #Initializer comment: self commentForJavaInitializer.
×
711
        javaArrayInitializer :=  builder newClassNamed: #ArrayInitializer comment: self commentForJavaArrayInitializer.
×
712
        javaModifier := builder newClassNamed: #Modifier comment: self commentForJavaModifier.        
×
713
        javaEnumConstant := builder newClassNamed: #EnumConstant.
×
714

×
715
        javaLambdaExpression := builder newClassNamed: #LambdaExpression comment: 'I represent a lambda expression'.
×
716
        javaMethodReference := builder newClassNamed: #MethodReference comment: 'I represent a method reference'.
×
717
        javaSynchronizedStatement := builder newClassNamed: #SynchronizedStatement comment: 'I represent a ''synchronized'' statement'.
×
718

×
719
        "type name"
×
720
        javaTypeName := builder newClassNamed: #TypeName comment: 'I represent the name of a type'.
×
721
        javaQualifiedTypeName := builder newClassNamed: #QualifiedTypeName comment: self commentForJavaQualifiedTypeName.
×
722

×
723
        "literals"
×
724
        javaCharacterLiteral := builder newClassNamed: #CharacterLiteral comment: self commentForJavaCharacterLiteral.
×
725
        javaFloatLiteral := builder newClassNamed: #FloatLiteral comment: self commentForJavaFloatLiteral.
×
726
        javaIntegerLiteral := builder newClassNamed: #IntegerLiteral comment: self commentForJavaIntegerLiteral.
×
727
        javaNullLiteral := builder newClassNamed: #NullLiteral comment: self commentForJavaNullLiteral.
×
728
        javaStringLiteral := builder newClassNamed: #StringLiteral comment: self commentForJavaStringLiteral.
×
729
        javaBooleanLiteral := builder newClassNamed: #BooleanLiteral comment: self commentForJavaBooleanLiteral.
×
730
        javaLongLiteral := builder newClassNamed: #LongLiteral comment: self commentForJavaLongLiteral.
×
731
        javaDoubleLiteral := builder newClassNamed: #DoubleLiteral comment: self commentForJavaDoubleLiteral.
×
732

×
733
        "type expressions"
×
734
        javaTypeExpression := builder newClassNamed: #TypeExpression comment: 'I am an abstract class representing a type'.
×
735
        javaArrayTypeExpression := builder newClassNamed: #ArrayTypeExpression comment: 'I represent an array type'.
×
736
        javaClassTypeExpression := builder newClassNamed: #ClassTypeExpression comment: 'I represent a class type'.
×
737
        javaPrimitiveTypeExpression := builder newClassNamed: #PrimitiveTypeExpression comment: 'I represent a primitive type'.
×
738
        javaTypeParameter := builder newClassNamed: #TypeParameterExpression comment: 'I represent JavaTypeParameter such as `void <T extends Hello> T myMethod()`'.
×
739

×
740
        "primitive type expressions"
×
741
        javaBooleanTypeExpression := builder newClassNamed: #BooleanTypeExpression comment: 'I represent a boolean type'.
×
742
        javaByteTypeExpression := builder newClassNamed: #ByteTypeExpression comment: 'I represent a byte type'.
×
743
        javaCharTypeExpression := builder newClassNamed: #CharTypeExpression comment: 'I represent a char type'.
×
744
        javaDoubleTypeExpression := builder newClassNamed: #DoubleTypeExpression comment: 'I represent a double type'.
×
745
        javaFloatTypeExpression := builder newClassNamed: #FloatTypeExpression comment: 'I represent a float type'.
×
746
        javaIntTypeExpression := builder newClassNamed: #IntTypeExpression comment: 'I represent an int type'.
×
747
        javaLongTypeExpression := builder newClassNamed: #LongTypeExpression comment: 'I represent a long type'.
×
748
        javaShortTypeExpression := builder newClassNamed: #ShortTypeExpression comment: 'I represent a short type'.
×
749
        javaVoidTypeExpression := builder newClassNamed: #VoidTypeExpression comment: 'I represent a short type'.
×
750

×
751
        "expressions"
×
752
        javaUnaryExpression := builder newClassNamed: #UnaryExpression comment: self commentForJavaUnaryExpression.
×
753
        javaNewExpression := builder newClassNamed: #NewExpression comment: self commentForJavaNewExpression.
×
754
        javaNewClassExpression := builder newClassNamed: #NewClassExpression comment: self commentForJavaNewClassExpression.
×
755
        javaAssignmentExpression := builder newClassNamed: #AssignmentExpression comment: self commentForJavaAssignmentExpression.
×
756
        javaCastExpression := builder newClassNamed: #CastExpression comment: 'I represent a cast expression, e.g. `(int) 0.5`'.
×
757
        javaParameterExpression := builder newClassNamed: #Parameter comment: 'I represent a parameter of a method declaration'.
×
758
        javaConditionalExpression := builder newClassNamed: #ConditionalExpression comment: self commentForJavaConditionalStatement.
×
759
        javaAnnotationExpression := builder newClassNamed: #Annotation comment: self commentForJavaAnnotation.
×
760
        javaVariableExpression := builder newClassNamed: #VariableExpression.
×
761
        javaEmptyDimExpression := builder newClassNamed: #EmptyDimExpression comment: self commentForJavaEmptyDimExpression.
×
762

×
763
        "statements"
×
764
        javaStatement := builder newClassNamed: #Statement.
×
765
        javaIfStatement := builder newClassNamed: #IfStatement comment: self commentForJavaIfStatement.
×
766
        javaForStatement := builder newClassNamed: #ForStatement comment: self commentForJavaForStatement.
×
767
        javaBreakStatement := builder newClassNamed: #BreakStatement comment: self commentForJavaBreakStatement.
×
768
        javaSwitchStatement := builder newClassNamed: #SwitchStatement comment: self commentForJavaSwitchStatement.
×
769
        javaCaseStatement := builder newClassNamed: #CaseStatement comment: self commentForJavaCaseStatement.
×
770
        javaContinueStatement := builder newClassNamed: #ContinueStatement comment: self commentForJavaContinueStatement.
×
771
        javaWhileStatement := builder newClassNamed: #WhileStatement comment: self commentForJavaWhileStatement.
×
772
        javaDoWhileStatement := builder newClassNamed: #DoWhileStatement comment: self commentForJavaDoWhileStatement.
×
773
        javaThrowStatement := builder newClassNamed: #ThrowStatement comment: self commentForJavaThrowStatement.
×
774
        javaTryCatchStatement := builder newClassNamed: #TryCatchStatement comment: self commentForJavaTryCatchStatement.
×
775
        javaCatchPartStatement := builder newClassNamed: #CatchPartStatement comment: 'I represent the ''catch'' part of the TryCatch Statement'.
×
776
        javaForEachStatement := builder newClassNamed: #ForEachStatement comment: self commentForJavaForEachStatement.
×
777
        javaLabeledCaseStatement := builder newClassNamed: #LabeledCaseStatement comment: self commentForJavaLabeledCaseStatement.
×
778
        javaDefaultCaseStatement := builder newClassNamed: #DefaultCaseStatement comment: self commentForJavaDefaultCaseStatement.
×
779
        javaVarDeclStatement := builder newClassNamed: #VarDeclStatement comment: self commentForJavaVarDeclStatement.
×
780
        javaAssertStatement := builder newClassNamed: #AssertStatement comment: self commentForAssertStatement. 
×
781
        javaStatementBlock := builder newClassNamed: #StatementBlock.
×
782
        javaReturnStatement := builder newClassNamed: #ReturnStatement.
×
783
        javaExpressionStatement := builder newClassNamed: #ExpressionStatement.
×
784
        javaLabeledStatement := builder newClassNamed: #LabeledStatement.
×
785
        
×
786
        "declarations"
×
787
        javaClassDeclaration := builder newClassNamed: #ClassDeclaration comment: self commentForJavaClassDeclaration.
×
788
        javaEnumDeclaration := builder newClassNamed: #EnumDeclaration comment: self commentForJavaEnumDeclaration.
×
789
        javaInterfaceDeclaration := builder newClassNamed: #InterfaceDeclaration comment: self commentForJavaInterfaceDeclaration.
×
790
        javaEmptyMethodDeclaration := builder newClassNamed: #EmptyMethodDeclaration comment: self commentForJavaEmptyMethodDeclaration.
×
791
        compilationUnit := builder newClassNamed: #CompilationUnit comment: 'I represent a compilation unit, I can contain declarations for a package, imports, and types'.
×
792
        packageDeclaration := builder newClassNamed: #PackageDeclaration comment: 'I represent a package declaration, e.g. `package fr.inria;`'.
×
793
        importDeclaration := builder newClassNamed: #ImportDeclaration comment: 'I represent an import declaration, e.g. `import java.util.List;`'.
×
794
        qualifiedName := builder newClassNamed: #QualifiedName.
×
795
]
×
796

797
{ #category : #definition }
798
FASTJavaMetamodelGenerator >> defineHierarchy [
×
799

×
800
        "define class hierarchy"
×
801

×
802
        super defineHierarchy.
×
803

×
804
        javaEntity --|> tEntity.
×
805
        javaEntity --|> tWithComments.
×
806

×
807
        javaComment --|> tComment.
×
808

×
809
        javaAssignmentExpression --|> tExpression.
×
810
        javaAssignmentExpression --|> tReceiver.
×
811
        javaAssignmentExpression --|> tWithAssignable.
×
812

×
813
        javaFieldAccess --|> tExpression.
×
814
        javaFieldAccess --|> tAssignable.
×
815
        javaFieldAccess --|> tWithReceiver.
×
816
        javaFieldAccess --|> tReceiver.
×
817

×
818
        javaInfixOperation --|> tExpression.
×
819
        javaInfixOperation --|> tReceiver.
×
820

×
821
        javaBreakStatement --|> tStatement.
×
822
        javaCaseStatement --|> tStatementBlock.
×
823
        javaContinueStatement --|> tStatement.
×
824
        javaDoWhileStatement --|> tStatement.
×
825
        javaForStatement --|> tStatement.
×
826

×
827
        javaIdentifier --|> javaVariableExpression.
×
828
        javaIdentifier --|> tReceiver.
×
829

×
830
        javaIfStatement --|> tStatement.
×
831

×
832
        javaNullLiteral --|> tNullPointerLiteral.
×
833
        javaCharacterLiteral --|> tCharacterLiteral.
×
834
        javaCharacterLiteral --|> tReceiver.
×
835
        javaStringLiteral --|> tStringLiteral.
×
836
        javaStringLiteral --|> tReceiver.
×
837
        javaIntegerLiteral --|> tLiteral.
×
838
        javaIntegerLiteral --|> tReceiver.
×
839
        javaFloatLiteral --|> tLiteral.
×
840
        javaFloatLiteral --|> tReceiver.
×
841
        javaBooleanLiteral --|> tLiteral.
×
842
        javaBooleanLiteral --|> tReceiver.
×
843
        javaLongLiteral --|> tLiteral.
×
844
        javaLongLiteral --|> tReceiver.
×
845
        javaDoubleLiteral --|> tLiteral.
×
846
        javaDoubleLiteral --|> tReceiver.
×
847

×
848
        javaMethodEntity --|> tNamedBehaviouralEntity.
×
849
        javaMethodEntity --|> #THasImmediateSource.
×
850
        javaMethodEntity --|> tDeclaration.
×
851
        javaMethodEntity --|> tWithModifiers.
×
852

×
853
        javaClassDeclaration --|> tStatement.
×
854
        javaClassDeclaration --|> tDeclaration.
×
855
        javaClassDeclaration --|> tWithDeclarations.
×
856
        javaClassDeclaration --|> tWithModifiers.
×
857
        javaClassDeclaration --|> tNamedEntity.
×
858
        javaClassDeclaration --|> #THasImmediateSource.
×
859
        javaClassDeclaration withPrecedenceOf: #THasImmediateSource.
×
860

×
861
        javaEnumDeclaration --|> tStatement.
×
862
        javaEnumDeclaration --|> tDeclaration.
×
863
        javaEnumDeclaration --|> tWithDeclarations.
×
864
        javaEnumDeclaration --|> tWithModifiers.
×
865
        javaEnumDeclaration --|> tNamedEntity.
×
866
        javaEnumDeclaration --|> #THasImmediateSource.
×
867
        javaEnumDeclaration withPrecedenceOf: #THasImmediateSource.
×
868

×
869
        javaEnumConstant --|> javaVariableExpression.
×
870

×
871
        javaInterfaceDeclaration --|> tStatement.
×
872
        javaInterfaceDeclaration --|> tDeclaration.
×
873
        javaInterfaceDeclaration --|> tWithDeclarations.
×
874
        javaInterfaceDeclaration --|> tWithModifiers.
×
875
        javaInterfaceDeclaration --|> tNamedEntity.
×
876
        javaInterfaceDeclaration --|> #THasImmediateSource.
×
877
        javaInterfaceDeclaration withPrecedenceOf: #THasImmediateSource.
×
878

×
879
        javaMethodInvocation --|> tInvocation.
×
880
        javaMethodInvocation --|> tWithReceiver.
×
881
        javaMethodInvocation --|> tReceiver.
×
882

×
883
        javaSwitchStatement --|> tStatement.
×
884
        javaThis --|> javaVariableExpression.
×
885

×
886
        javaVarDeclStatement --|> tStatement.
×
887
        javaVarDeclStatement --|> tDeclaration.
×
888
        javaVarDeclStatement --|> tScopableEntity.
×
889
        javaVarDeclStatement --|> tWithModifiers.
×
890

×
891
        javaVariableDeclarator --|> tEntity.
×
892
        javaWhileStatement --|> tStatement.
×
893
        javaMethodInvocation --|> tNamedEntity.
×
894
        javaCastExpression --|> tExpression.
×
895
        javaCastExpression --|> tReceiver.
×
896

×
897
        javaClassProperty --|> javaVariableExpression.
×
898
        javaClassProperty --|> tReceiver.
×
899

×
900
        javaTryCatchStatement --|> tStatement.
×
901
        javaForEachStatement --|> tStatement.
×
902
        javaUnaryExpression --|> tExpression.
×
903

×
904
        javaNewExpression --|> tExpression.
×
905
        javaNewExpression --|> #TWithArguments.
×
906
        javaNewExpression --|> tReceiver.
×
907
        javaNewExpression --|> tWithReceiver.
×
908

×
909
        javaNewClassExpression --|> javaNewExpression.
×
910
        javaNewClassExpression --|> tWithDeclarations.
×
911
        javaNewClassExpression --|> #TWithArguments.
×
912

×
913
        javaNewArray --|> javaNewExpression.
×
914
        javaEmptyDimExpression --|> tExpression.
×
915
        javaConditionalExpression --|> tExpression.
×
916

×
917
        javaArrayAccess --|> tExpression.
×
918
        javaArrayAccess --|> tAssignable.
×
919
        javaArrayAccess --|> tReceiver.
×
920

×
921
        javaVariableExpression --|> tVariableExpression.
×
922
        javaVariableExpression --|> tAssignable.
×
923
        javaVariableExpression --|> tReceiver.
×
924

×
925
        javaThrowStatement --|> tStatement.
×
926
        javaLabeledCaseStatement --|> javaCaseStatement.
×
927
        javaDefaultCaseStatement --|> javaCaseStatement.
×
928
        javaEmptyMethodDeclaration --|> javaMethodEntity.
×
929
        javaArrayInitializer --|> tExpression.
×
930

×
931
        javaInitializer --|> tScopableEntity.
×
932
        javaInitializer --|> #THasImmediateSource.
×
933
        javaInitializer --|> tDeclaration.
×
934

×
935
        javaOuterThis --|> tExpression.
×
936
        javaOuterThis --|> tReceiver.
×
937

×
938
        javaCatchPartStatement --|> tStatement.
×
939

×
940
        javaLambdaExpression --|> tExpression.
×
941
        javaLambdaExpression --|> tWithParameters.
×
942

×
943
        javaMethodReference --|> tExpression.
×
944
        javaMethodReference --|> tNamedEntity.
×
945

×
946
        javaSynchronizedStatement --|> tStatement.
×
947

×
948
        "types name"
×
949
        javaTypeName --|> tNamedEntity.
×
950
        javaTypeName --|> tExpression.
×
951
        javaQualifiedTypeName --|> javaTypeName.
×
952

×
953
        "types"
×
954
        javaTypeExpression --|> javaVariableExpression.
×
955
        javaArrayTypeExpression --|> javaTypeExpression.
×
956
        javaPrimitiveTypeExpression --|> javaTypeExpression.
×
957
        javaBooleanTypeExpression --|> javaPrimitiveTypeExpression.
×
958
        javaByteTypeExpression --|> javaPrimitiveTypeExpression.
×
959
        javaCharTypeExpression --|> javaPrimitiveTypeExpression.
×
960
        javaDoubleTypeExpression --|> javaPrimitiveTypeExpression.
×
961
        javaFloatTypeExpression --|> javaPrimitiveTypeExpression.
×
962
        javaIntTypeExpression --|> javaPrimitiveTypeExpression.
×
963
        javaLongTypeExpression --|> javaPrimitiveTypeExpression.
×
964
        javaShortTypeExpression --|> javaPrimitiveTypeExpression.
×
965
        javaVoidTypeExpression --|> javaPrimitiveTypeExpression.
×
966

×
967
        javaClassTypeExpression --|> javaTypeExpression.
×
968
        javaClassTypeExpression --|> #TWithArguments.
×
969

×
970
        javaTypeParameter --|> tExpression.
×
971
        javaTypeParameter --|> tNamedEntity.
×
972

×
973
        javaModifier --|> tModifier.
×
974
        javaModifier --|> tExpression.
×
975

×
976
        javaAnnotationExpression --|> tNamedEntity.
×
977
        javaAnnotationExpression --|> tModifier.
×
978
        javaAnnotationExpression --|> #TWithArguments.
×
979

×
980
        javaParameterExpression --|> tExpression.
×
981
        javaParameterExpression --|> tVariableEntity.
×
982
        javaConditionalExpression --|> tReceiver.
×
983

×
984
        javaStatement --|> tStatement.
×
985
        javaStatementBlock --|> tStatementBlock.
×
986
        javaReturnStatement --|> tReturnStatement.
×
987
        javaAssertStatement --|> tStatement.
×
988
        javaExpressionStatement --|> tExpressionStatement.
×
989
        javaLabeledStatement --|> tStatement.
×
990

×
991
        qualifiedName --|> tNamedEntity.
×
992
        qualifiedName --|> tEntity.
×
993
        qualifiedName --|> tAssignable.
×
994

×
995
        compilationUnit --|> tEntity.
×
996

×
997
        "package and import do not use TDeclaration on purpose: they are only contained in a compilation unit"
×
998
        packageDeclaration --|> tEntity.
×
999
        packageDeclaration --|> tWithQualifiedName.
×
1000

×
1001
        importDeclaration --|> tEntity.
×
1002
        importDeclaration --|> tWithQualifiedName
×
1003
]
×
1004

1005
{ #category : #definition }
1006
FASTJavaMetamodelGenerator >> defineProperties [
×
1007

×
1008
        super defineProperties.
×
1009

×
1010
        (javaAssignmentExpression property: #operator type: #String) comment:
×
1011
                'The assignement operator: =, +=, /=, ...'.
×
1012

×
1013
        (javaFieldAccess property: #fieldName type: #String) comment:
×
1014
                'Name of accessed field'.
×
1015
        (javaInfixOperation property: #operator type: #String) comment:
×
1016
                'operator s symbol'.
×
1017
        (javaClassProperty property: #fieldName type: #String) comment:
×
1018
                'Name of accessed field'.
×
1019

×
1020
        (javaUnaryExpression property: #operator type: #String) comment:
×
1021
                'The operator string to apply to the expression'.
×
1022
        (javaUnaryExpression
×
1023
                 property: #isPrefixedUnaryExpression
×
1024
                 type: #Boolean) comment:
×
1025
                'True if the expression is prefixed (ex. ++i) else false'.
×
1026

×
1027
        (javaModifier property: #token type: #String) comment:
×
1028
                'The modifier value'.
×
1029

×
1030
        (javaLabeledStatement property: #label type: #String) comment:
×
1031
                'The label of the labeled statement'.
×
1032

×
1033
        (importDeclaration
×
1034
                 property: #isStatic
×
1035
                 type: #Boolean
×
1036
                 defaultValue: false) comment: 'True if importing static members'.
×
1037
        (importDeclaration
×
1038
                 property: #isOnDemand
×
1039
                 type: #Boolean
×
1040
                 defaultValue: false) comment:
×
1041
                'Whether this import is on-demand (wildcard) or single-type'
×
1042
]
×
1043

1044
{ #category : #definition }
1045
FASTJavaMetamodelGenerator >> defineRelations [
×
1046

×
1047
        super defineRelations.
×
1048
        ((javaArrayInitializer property: #initializers) comment:
×
1049
                 'My initializers')
×
1050
        <>-* ((tExpression property: #javaArrayInitializers) comment:
×
1051
                         'The owner of the expression').
×
1052

×
1053
        ((javaVarDeclStatement property: #declarators) comment:
×
1054
                 'The declarators for the type')
×
1055
        <>-* ((javaVariableDeclarator property: #varDeclOwner) comment:
×
1056
                         'The owner of the declarator').
×
1057

×
1058
        ((javaSwitchStatement property: #cases) comment:
×
1059
                 'The cases of the switch statement')
×
1060
        <>-*
×
1061
                ((javaCaseStatement property: #javaCaseStatementSwitchOwner) 
×
1062
                         comment: 'The switch owner').
×
1063

×
1064
        ((javaVariableDeclarator property: #expression) comment:
×
1065
                 'Expression to be assigned to the var during declaration')
×
1066
        <>- ((tExpression property: #javaVariableDeclaratorExpressionOwner) 
×
1067
                         comment: 'The javaVariableDeclarator owner (if possible)').
×
1068
        ((javaVariableDeclarator property: #variable) comment:
×
1069
                 'The variable that is being declared')
×
1070
        <>-
×
1071
                ((javaVariableExpression property: #javaVariableDeclaratorOwner) 
×
1072
                         comment: 'The javaVariableDeclarator owner (if possible)').
×
1073

×
1074
        ((javaAssignmentExpression property: #expression) comment:
×
1075
                 'Expression to be assigned to the var during declaration')
×
1076
        <>- ((tExpression property: #javaAssignmentExpressionOwner) comment:
×
1077
                         'The javaAssignmentExpression owner (if possible)').
×
1078

×
1079
        ((javaCastExpression property: #expression) comment:
×
1080
                 'The expression to cast')
×
1081
        <>- ((tExpression property: #javaCastExpressionOwner) comment:
×
1082
                         'The javaCastExpression owner (if possible)').
×
1083
        ((javaCastExpression property: #type) comment:
×
1084
                 'The type into which the expression will be cast')
×
1085
        <>-
×
1086
                ((javaVariableExpression property: #javaCastExpressionTypeOwner) 
×
1087
                         comment: 'The javaCastExpression owner (if possible)').
×
1088

×
1089
        ((javaClassProperty property: #type) comment:
×
1090
                 'The type of the property')
×
1091
        <>-
×
1092
                ((javaVariableExpression property: #javaClassPropertyOwner) 
×
1093
                         comment: 'The javaClassProperty owner (if possible)').
×
1094

×
1095
        ((javaUnaryExpression property: #expression) comment:
×
1096
                 'The affected expression')
×
1097
        <>- ((tExpression property: #javaUnaryExpressionOwner) comment:
×
1098
                         'The javaUnaryExpression owner (if possible)').
×
1099

×
1100
        ((javaNewExpression property: #type) comment: 'The type of the array')
×
1101
        <>-
×
1102
                ((javaVariableExpression property: #javaNewExpressionOwner) 
×
1103
                         comment: 'The javaNewExpression owner (if possible)').
×
1104

×
1105
        ((javaArrayAccess property: #expression) comment:
×
1106
                 'The accessed index')
×
1107
        <>- ((tExpression property: #javaArrayAccessOwner) comment:
×
1108
                         'The javaArrayAccess owner (if possible)').
×
1109
        ((javaArrayAccess property: #array) comment: 'Name of accessed field')
×
1110
        <>- ((tExpression property: #javaArrayArrayAccessOwner) comment:
×
1111
                         'The javaArrayArrayAccess owner (if possible)').
×
1112

×
1113
        ((javaOuterThis property: #type) comment: 'The accessed type')
×
1114
        <>- ((javaVariableExpression property: #javaOuterThisOwner) comment:
×
1115
                         'The javaOuterThis owner (if possible)').
×
1116

×
1117
        ((javaThrowStatement property: #expression) comment:
×
1118
                 'The thrown element')
×
1119
        <>- ((tExpression property: #javaThrowStatementOwner) comment:
×
1120
                         'The javaThrowStatement owner (if possible)').
×
1121

×
1122
        ((javaLabeledCaseStatement property: #label) comment:
×
1123
                 'The label of the case statement')
×
1124
        <>- ((tExpression property: #javaLabeledCaseStatementOwner) comment:
×
1125
                         'The javaLabeledCaseStatement owner (if possible)').
×
1126

×
1127
        ((javaForEachStatement property: #body) comment:
×
1128
                 'The body of the for-each statement')
×
1129
        <>- ((tStatement property: #javaForEachStatementOwner) comment:
×
1130
                         'The javaForEachStatement owner (if possible)').
×
1131
        ((javaForEachStatement property: #list) comment:
×
1132
                 'The list that the for-each statement iterates over')
×
1133
        <>- ((tExpression property: #javaForEachStatementOwner) comment:
×
1134
                         'The javaForEachStatement owner (if possible)').
×
1135
        ((javaForEachStatement property: #fieldname) comment:
×
1136
                 'The identifier of the created local variable')
×
1137
        <>- ((javaIdentifier property: #javaForEachStatementFieldNameOwner) 
×
1138
                         comment: 'The javaForEachStatement owner (if possible)').
×
1139
        ((javaForEachStatement property: #type) comment:
×
1140
                 'The type of the created local variable')
×
1141
        <>- ((javaTypeExpression property: #javaForEachStatementTypeOwner) 
×
1142
                         comment: 'The javaForEachStatement owner (if possible)').
×
1143

×
1144
        ((javaTryCatchStatement property: #try) comment:
×
1145
                 'I represent the ''try'' part of the TryCatch Statement')
×
1146
        <>- ((javaStatementBlock property: #javaTryCatchOwner) comment:
×
1147
                         'The javaTryCatch owner (if possible)').
×
1148
        ((javaTryCatchStatement property: #catches) comment:
×
1149
                 'I contain all the catch statements')
×
1150
        <>-* ((javaCatchPartStatement property: #tryOwner) comment:
×
1151
                         'The try part that owns me').
×
1152
        ((javaTryCatchStatement property: #finally) comment:
×
1153
                 'I contain the ''finally'' part of the try/catch/finally')
×
1154
        <>- ((javaStatementBlock property: #javaTryFinallyOwner) comment:
×
1155
                         'The try/finally part that owns me').
×
1156

×
1157
        ((javaCatchPartStatement property: #body) comment:
×
1158
                 'The body of the catch part')
×
1159
        <>- ((javaStatementBlock property: #javaCatchPartStatementOwner) comment:
×
1160
                         'The javaCatchPartStatementOwner owner (if possible)').
×
1161
        ((javaCatchPartStatement property: #catchedTypes) comment:
×
1162
                         'The types (exception) that are catched')
×
1163
        <>-* ((javaTypeExpression property: #catchOwner) comment:
×
1164
                         'The catch part that owns me (ie. where I am catched)').
×
1165
        ((javaCatchPartStatement property: #parameter) comment:
×
1166
                 'The parameter of the catch part')
×
1167
        <>- ((javaVariableExpression property: #javaCatchParameterOwnler) 
×
1168
                         comment: 'The javaCatchPartParameterOwner owner (if possible)').
×
1169

×
1170
        ((javaIfStatement property: #condition) comment:
×
1171
                 'The condition of the statement')
×
1172
        <>- ((tExpression property: #ifConditionOwner) comment:
×
1173
                         'I represent a condition for my owner').
×
1174
        ((javaIfStatement property: #elsePart) comment: 'else part')
×
1175
        <>- ((tStatement property: #ifElsePartOwner) comment:
×
1176
                         'The if owner (if possible)').
×
1177
        ((javaIfStatement property: #thenPart) comment: 'then part')
×
1178
        <>- ((tStatement property: #ifThenPartOwner) comment:
×
1179
                         'The if owner (if possible)').
×
1180

×
1181
        ((javaConditionalExpression property: #condition) comment:
×
1182
                 'The condition of the statement')
×
1183
        <>- ((tExpression property: #conditionalConditionOwner) comment:
×
1184
                         'I represent a condition for my owner').
×
1185
        ((javaConditionalExpression property: #elsePart) comment: 'else part')
×
1186
        <>- ((tExpression property: #conditionalElsePartOwner) comment:
×
1187
                         'The if owner (if possible)').
×
1188
        ((javaConditionalExpression property: #thenPart) comment: 'then part')
×
1189
        <>- ((tExpression property: #conditionalThenPartOwner) comment:
×
1190
                         'The if owner (if possible)').
×
1191

×
1192
        ((javaInfixOperation property: #leftOperand) comment: 'leftOperand')
×
1193
        <>-
×
1194
                ((tExpression property: #infixOperationLeftOperandOwner) comment:
×
1195
                         'The left operand (if possible)').
×
1196
        ((javaInfixOperation property: #rightOperand) comment: 'rightOperand')
×
1197
        <>-
×
1198
                ((tExpression property: #infixOperationRightOperandOwner) comment:
×
1199
                         'The right operand (if possible)').
×
1200

×
1201
        ((javaForStatement property: #condition) comment:
×
1202
                 'The condition of the statement')
×
1203
        <>- ((tExpression property: #forConditionOwner) comment:
×
1204
                         'I represent a condition for my owner').
×
1205
        ((javaForStatement property: #incrementor) comment:
×
1206
                 'Expression evaluated at the end of each loop')
×
1207
        <>- ((tStatement property: #forIncrementorOwner) comment:
×
1208
                         'I am the incrementor of the for').
×
1209
        ((javaForStatement property: #initializer) comment:
×
1210
                 'Expression used at initialization phase of a for loop')
×
1211
        <>- ((tStatement property: #forIninitializerOwner) comment:
×
1212
                         'I am the initializer of the for').
×
1213
        ((javaForStatement property: #body) comment:
×
1214
                 'A statement to be evaluated in the loop')
×
1215
        <>- ((tStatement property: #forBodyOwner) comment:
×
1216
                         'I am the body of the for').
×
1217

×
1218
        ((javaSwitchStatement property: #condition) comment:
×
1219
                 'The condition of the statement')
×
1220
        <>- ((tExpression property: #switchConditionOwner) comment:
×
1221
                         'I represent a condition for my owner').
×
1222

×
1223
        ((javaDoWhileStatement property: #condition) comment:
×
1224
                 'The condition of the statement')
×
1225
        <>- ((tExpression property: #doConditionOwner) comment:
×
1226
                         'I represent a condition for my owner').
×
1227
        ((javaDoWhileStatement property: #body) comment:
×
1228
                 'A statement to be evaluated in the loop')
×
1229
        <>- ((tStatement property: #doBodyOwner) comment:
×
1230
                         'I am the body of the do').
×
1231

×
1232
        ((javaWhileStatement property: #condition) comment:
×
1233
                 'The condition of the statement')
×
1234
        <>- ((tExpression property: #whileConditionOwner) comment:
×
1235
                         'I represent a condition for my owner').
×
1236
        ((javaWhileStatement property: #body) comment:
×
1237
                 'A statement to be evaluated in the loop')
×
1238
        <>- ((tStatement property: #whileBodyOwner) comment:
×
1239
                         'I am the body of the do').
×
1240

×
1241
        ((javaInitializer property: #statementBlock) comment:
×
1242
                 'Statements block of the behavioural entity')
×
1243
        <>- ((tStatementBlock property: #javaInitializerOwner) comment:
×
1244
                         'Behavioural entity containing the statement block').
×
1245

×
1246
        ((javaLabeledStatement property: #labeledStatement) comment:
×
1247
                 'Inner statement that is labeled')
×
1248
        <>- ((tStatement property: #labelStatementOwner) comment:
×
1249
                         'Label Statement entity containing this statement').
×
1250

×
1251
        ((javaNewArray property: #initializer) comment:
×
1252
                 'The initializer of the array')
×
1253
        <>- ((tExpression property: #javaNewArrayInitialOwner) comment:
×
1254
                         'I belong to a new array initialization').
×
1255

×
1256
        ((javaLambdaExpression property: #expression) comment:
×
1257
                 'Expression to be executed as part of the lambda.')
×
1258
        <>- ((tEntity property: #javaLambdaExpressionOwner) comment:
×
1259
                         'The expression owner (if possible)').
×
1260

×
1261
        ((javaMethodReference property: #receiver) comment:
×
1262
                 'The method of the reference')
×
1263
        <>- ((javaVariableExpression property: #javaMethodReferenceOwner) 
×
1264
                         comment: 'The owner of the method reference (if possible)').
×
1265

×
1266
        ((javaSynchronizedStatement property: #expression) comment:
×
1267
                 'The instance on which the statement block is synchronized')
×
1268
        <>-
×
1269
                ((tExpression property: #javaSynchronizedStatementOwner) comment:
×
1270
                         'The owner of the synchronized block (if possible)').
×
1271
        ((javaSynchronizedStatement property: #block) comment:
×
1272
                 'The block that is synchronized')
×
1273
        <>-
×
1274
                ((tStatementBlock property: #javaSynchronizedStatementOwner) 
×
1275
                         comment: 'The owner of the synchronized block (if possible)').
×
1276

×
1277
        ((javaMethodEntity property: #type) comment: 'The type of the method')
×
1278
        <>-
×
1279
                ((javaVariableExpression property: #javaMethodTypeOwner) comment:
×
1280
                         'The variable expression owner (if possible)').
×
1281
        ((javaMethodEntity property: #throws) comment:
×
1282
                 'The list of throws exception')
×
1283
        <>-*
×
1284
                ((javaClassTypeExpression property: #javaMethodThrowsOwner) 
×
1285
                         comment: 'The method that throws me').
×
1286
        ((javaMethodEntity property: #typeParameters) comment:
×
1287
                 'The list of type parameter')
×
1288
        <>-*
×
1289
                ((javaTypeParameter property: #javaMethodTypeParameterOwner) 
×
1290
                         comment: 'The method that use me').
×
1291

×
1292
        ((javaTypeParameter property: #types) comment:
×
1293
                 'The list of types I extend or implements')
×
1294
        <>-*
×
1295
                ((javaClassTypeExpression property: #typeParameterOwner) comment:
×
1296
                         'The type parameter I specify').
×
1297

×
1298
        ((javaParameterExpression property: #type) comment:
×
1299
                 'The type of the parameter')
×
1300
        <>-
×
1301
                ((javaVariableExpression property: #javaParameterTypeOwner) 
×
1302
                         comment: 'The variable expression owner (if possible)').
×
1303
        ((javaParameterExpression property: #variable) comment:
×
1304
                 'parameter variable')
×
1305
        <>- ((javaVariableExpression property: #javaParameterVariableOwner) 
×
1306
                         comment: 'The variable expression owner (if possible)').
×
1307

×
1308
        ((javaVarDeclStatement property: #type) comment:
×
1309
                 'The type of the declared variables')
×
1310
        <>-
×
1311
                ((javaVariableExpression property: #javaVarDeclTypeOwner) comment:
×
1312
                         'The variable expression owner (if possible)').
×
1313

×
1314
        ((javaArrayTypeExpression property: #baseType) comment:
×
1315
                 'The type of the array')
×
1316
        <>- ((tExpression property: #javaArrayTypeNameOwner) comment:
×
1317
                         'The variable expression owner (if possible)').
×
1318

×
1319
        ((javaClassTypeExpression property: #typeName) comment:
×
1320
                 'The name of the type')
×
1321
        <>-
×
1322
                ((javaTypeName property: #javaTypeNameTypeExpressionOwner) comment:
×
1323
                         'The type expression that owns me').
×
1324

×
1325
        ((javaQualifiedTypeName property: #namespace) comment:
×
1326
                 'The namespace of the name')
×
1327
        <>- ((javaTypeName property: #javaTypeNameQualify) comment:
×
1328
                         'the name I qualify').
×
1329

×
1330
        ((javaAssertStatement property: #condition) comment:
×
1331
                 'The condition of the statement')
×
1332
        <>- ((tExpression property: #assertConditionOwner) comment:
×
1333
                         'I represent a condition for my owner').
×
1334
        ((javaAssertStatement property: #message) comment:
×
1335
                 'The error message that is raised if the condition is false')
×
1336
        <>- ((javaStringLiteral property: #javaStringAssertStatementOwner) 
×
1337
                         comment: 'The assertion that can raise me').
×
1338

×
1339
        ((javaClassDeclaration property: #superclass) comment:
×
1340
                 'My superclass')
×
1341
        <>-
×
1342
                ((javaTypeExpression property: #javaClassDeclarationSuperclassOwner) 
×
1343
                         comment: 'The class that extends me').
×
1344
        ((javaClassDeclaration property: #interfaces) comment:
×
1345
                 'The interfaces I implement')
×
1346
        <>-*
×
1347
                ((javaTypeExpression property: #javaClassDeclarationInterfaceOwner) 
×
1348
                         comment: 'The class that implements me').
×
1349

×
1350
        ((javaEnumDeclaration property: #interfaces) comment:
×
1351
                 'The interfaces I implement')
×
1352
        <>-*
×
1353
                ((javaTypeExpression property: #javaEnumDeclarationInterfaceOwner) 
×
1354
                         comment: 'The enum that implements me').
×
1355

×
1356
        ((javaEnumDeclaration property: #constants) comment:
×
1357
                 'The constants I define')
×
1358
        <>-*
×
1359
                ((javaEnumConstant property: #parentEnum) 
×
1360
                         comment: 'The enum type that contains me').
×
1361

×
1362
        ((javaInterfaceDeclaration property: #interfaces) comment:
×
1363
                 'My super interfaces')
×
1364
        <>-*
×
1365
                ((javaTypeExpression property:
×
1366
                          #javaInterfaceDeclarationInterfaceOwner) comment:
×
1367
                         'The interface that extends me').
×
1368

×
1369
        ((tWithDeclarations property: #declarations) comment:
×
1370
                 'The elements I declare')
×
1371
        <>-* ((tDeclaration property: #javaDeclarationOwner) comment:
×
1372
                         'The element that declares me').
×
1373

×
1374
        ((tWithModifiers property: #modifiers) comment: 'My modifiers')
×
1375
        <>-* ((tModifier property: #javaModifierOwner) comment:
×
1376
                         'The owner of the modifier').
×
1377

×
1378
        ((tWithAssignable property: #variable) comment: 'My variable')
×
1379
        <>- ((tAssignable property: #javaVariableAssignmentOwner) comment:
×
1380
                         'The owner of the assignment').
×
1381

×
1382
        ((tWithReceiver property: #receiver) comment: 'My receiver')
×
1383
        <>- ((tReceiver property: #receiverOwner) comment:
×
1384
                         'The owner of the receiver').
×
1385

×
1386
        ((qualifiedName property: #namespace) comment:
×
1387
                 'The namespace that qualifies me')
×
1388
        <>- ((qualifiedName property: #namespaceOwner) comment:
×
1389
                         'The namespace I qualify').
×
1390

×
1391
        ((tWithQualifiedName property: #qualifiedName) comment:
×
1392
                 'The name that qualifies me')
×
1393
        <>- ((qualifiedName property: #qualifiedNameOwner) comment:
×
1394
                         'The owner of the qualified name').
×
1395

×
1396
        "do not use TDeclaration and TWithDeclaration on purpose: what a compilation unit can contain is strict"
×
1397
        ((compilationUnit property: #packageDeclaration) comment:
×
1398
                 'My package declaration, or nil for the default package')
×
1399
        <>- ((packageDeclaration property: #compilationUnit) comment:
×
1400
                         'The compilation unit that owns me').
×
1401
        ((compilationUnit property: #importDeclarations) comment:
×
1402
                 'My import declarations')
×
1403
        <>-* ((importDeclaration property: #compilationUnit) comment:
×
1404
                         'The compilation unit that owns me').
×
1405
        ((compilationUnit property: #classDeclarations) comment:
×
1406
                 'My class declarations')
×
1407
        <>-* ((javaClassDeclaration property: #compilationUnit) comment:
×
1408
                         'The compilation unit that owns me').
×
1409
        ((compilationUnit property: #interfaceDeclarations) comment:
×
1410
                 'My interface declarations')
×
1411
        <>-* ((javaInterfaceDeclaration property: #compilationUnit) comment:
×
1412
                         'The compilation unit that owns me').
×
1413
        ((compilationUnit property: #enumDeclarations) comment:
×
1414
                 'My enum declaration')
×
1415
        <>-* ((javaEnumDeclaration property: #compilationUnit) comment:
×
1416
                         'The compilation unit that owns me')
×
1417
]
×
1418

1419
{ #category : #definition }
1420
FASTJavaMetamodelGenerator >> defineTraits [
×
1421
        super defineTraits. 
×
1422
        tDeclaration := builder newTraitNamed: #TDeclaration comment: 'I am a declaration in java'.
×
1423
        tWithDeclarations := builder newTraitNamed: #TWithDeclarations comment: 'I have declarations'.
×
1424
        
×
1425
        tModifier := builder newTraitNamed: #TModifier comment: self commentForJavaTModifier. 
×
1426
        tWithModifiers := builder newTraitNamed: #TWithModifiers comment: 'I have modifiers'.
×
1427
        
×
1428
        tAssignable := builder newTraitNamed: #TAssignable comment: self commentForJavaTAssignable. 
×
1429
        tWithAssignable := builder newTraitNamed: #TWithAssignable comment: 'I have an assignable'.
×
1430
        
×
1431
        tReceiver := builder newTraitNamed: #TReceiver comment: 'I receive a message from someone'.
×
1432
        tWithReceiver := builder newTraitNamed: #TWithReceiver comment: 'I can send a message to someone'.
×
1433
        
×
1434
        tWithQualifiedName := builder newTraitNamed: #TWithQualifiedName comment: 'I have a qualified name.'.
×
1435
        
×
1436
        "From FAST"
×
1437
        tEntity := self remoteTrait: #TEntity withPrefix: #FAST.
×
1438
        tComment := self remoteTrait: #TComment withPrefix: #FAST.
×
1439
        tWithComments := self remoteTrait: #TWithComments withPrefix: #FAST.
×
1440
        tExpression := self remoteTrait: #TExpression withPrefix: #FAST. 
×
1441
        tStatement := self remoteTrait: #TStatement withPrefix: #FAST.
×
1442
        tCharacterLiteral := self remoteTrait: #TCharacterLiteral withPrefix: #FAST.
×
1443
        tLiteral := self remoteTrait: #TLiteral withPrefix: #FAST.
×
1444
        tVariableExpression := self remoteTrait: #TVariableExpression withPrefix: #FAST.
×
1445
        tNamedBehaviouralEntity := self remoteTrait: #TNamedBehaviouralEntity withPrefix: #FAST.
×
1446
        tNullPointerLiteral := self remoteTrait: #TNullPointerLiteral withPrefix: #FAST.
×
1447
        tStringLiteral := self remoteTrait: #TStringLiteral withPrefix: #FAST.
×
1448
        tScopableEntity := self remoteTrait: #TScopableEntity withPrefix: #FAST.
×
1449
        tVariableEntity := self remoteTrait: #TVariableEntity withPrefix: #FAST.
×
1450
        tStatementBlock := self remoteTrait: #TStatementBlock withPrefix: #FAST.
×
1451
        tExpressionStatement := self remoteTrait: #TExpressionStatement withPrefix: #FAST.
×
1452
        tWithParameters := self remoteTrait: #TWithParameters withPrefix: #FAST.
×
1453
        tNamedEntity := self remoteTrait: #TNamedEntity withPrefix: #FAST.
×
1454
        tReturnStatement := self remoteTrait: #TReturnStatement withPrefix: #FAST.
×
1455
        tBooleanLiteral := self remoteTrait: #TBooleanLiteral withPrefix: #FAST.
×
1456
        tInvocation := self remoteTrait: #TInvocation withPrefix: #FAST
×
1457
]
×
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