Skip to content

Commit 24f2a70

Browse files
committed
Manage lists
1 parent 9c96707 commit 24f2a70

14 files changed

Lines changed: 123 additions & 3 deletions

src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ FASTPythonMetamodelGenerator >> defineHierarchy [
346346

347347
integer --|> literal.
348348

349+
list --|> expression.
350+
349351
literal --|> tLiteral.
350352

351353
none --|> literal.
@@ -412,9 +414,13 @@ FASTPythonMetamodelGenerator >> defineRelations [
412414
((import property: #importedEntities) comment: 'List of the imported entities.')
413415
<>-* ((importedEntity property: #import) comment: 'Import declaring me as imported entity.').
414416

415-
((importFromStatement property: #fromModule) comment: 'Module in which the imported entities should be looked for. `from datetime import date` has `datetime` as fromModule..')
417+
((importFromStatement property: #fromModule) comment:
418+
'Module in which the imported entities should be looked for. `from datetime import date` has `datetime` as fromModule..')
416419
<>- ((fromModule property: #import) comment: 'Import declaring me as from import module.').
417420

421+
((list property: #initializers) comment: 'Each initializer defines one element.')
422+
<>-* ((tExpression property: #collectionInitializers) comment: 'The owner of the expression').
423+
418424
((tUnaryOperator property: #argument) comment: 'Expression influanced by the unary operator..')
419425
<>- ((tExpression property: #parentUnaryOperator) comment: 'Parent unary operator in which I am.')
420426
]

src/FAST-Python-Model/FASTPyAssignment.class.st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
99
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
10+
| `collectionInitializers` | `FASTTExpression` | `initializers` | `FASTPyList` | The owner of the expression|
1011
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|
1112
| `parentComparisonOperator` | `FASTTExpression` | `operands` | `FASTPyComparisonOperator` | Parent comparison expression of which I am.|
1213
| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used|

src/FAST-Python-Model/FASTPyBinaryOperator.class.st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
99
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
10+
| `collectionInitializers` | `FASTTExpression` | `initializers` | `FASTPyList` | The owner of the expression|
1011
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|
1112
| `parentComparisonOperator` | `FASTTExpression` | `operands` | `FASTPyComparisonOperator` | Parent comparison expression of which I am.|
1213
| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used|

src/FAST-Python-Model/FASTPyBoolean.class.st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
99
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
10+
| `collectionInitializers` | `FASTTExpression` | `initializers` | `FASTPyList` | The owner of the expression|
1011
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|
1112
| `parentComparisonOperator` | `FASTTExpression` | `operands` | `FASTPyComparisonOperator` | Parent comparison expression of which I am.|
1213
| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used|

src/FAST-Python-Model/FASTPyBooleanOperator.class.st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
99
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
10+
| `collectionInitializers` | `FASTTExpression` | `initializers` | `FASTPyList` | The owner of the expression|
1011
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|
1112
| `parentComparisonOperator` | `FASTTExpression` | `operands` | `FASTPyComparisonOperator` | Parent comparison expression of which I am.|
1213
| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used|

src/FAST-Python-Model/FASTPyCall.class.st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
99
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
10+
| `collectionInitializers` | `FASTTExpression` | `initializers` | `FASTPyList` | The owner of the expression|
1011
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|
1112
| `parentComparisonOperator` | `FASTTExpression` | `operands` | `FASTPyComparisonOperator` | Parent comparison expression of which I am.|
1213
| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used|

src/FAST-Python-Model/FASTPyEntity.class.st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
99
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
10+
| `collectionInitializers` | `FASTTExpression` | `initializers` | `FASTPyList` | The owner of the expression|
1011
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|
1112
| `genericParent` | `FASTPyEntity` | `genericChildren` | `FASTPyEntity` | |
1213
| `parentComparisonOperator` | `FASTTExpression` | `operands` | `FASTPyComparisonOperator` | Parent comparison expression of which I am.|

src/FAST-Python-Model/FASTPyExpression.class.st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
99
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
10+
| `collectionInitializers` | `FASTTExpression` | `initializers` | `FASTPyList` | The owner of the expression|
1011
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|
1112
| `parentComparisonOperator` | `FASTTExpression` | `operands` | `FASTPyComparisonOperator` | Parent comparison expression of which I am.|
1213
| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used|
Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
"
2+
## Relations
3+
======================
4+
5+
### Children
6+
| Relation | Origin | Opposite | Type | Comment |
7+
|---|
8+
| `initializers` | `FASTPyList` | `collectionInitializers` | `FASTTExpression` | Each initializer defines one element.|
9+
10+
11+
12+
"
113
Class {
214
#name : 'FASTPyList',
3-
#superclass : 'FASTPyEntity',
15+
#superclass : 'FASTPyExpression',
416
#category : 'FAST-Python-Model-Entities',
517
#package : 'FAST-Python-Model',
618
#tag : 'Entities'
@@ -9,8 +21,40 @@ Class {
921
{ #category : 'meta' }
1022
FASTPyList class >> annotation [
1123

12-
<FMClass: #List super: #FASTPyEntity>
24+
<FMClass: #List super: #FASTPyExpression>
1325
<package: #'FAST-Python-Model'>
1426
<generated>
1527
^ self
1628
]
29+
30+
{ #category : 'adding' }
31+
FASTPyList >> addInitializer: anObject [
32+
<generated>
33+
^ self initializers add: anObject
34+
]
35+
36+
{ #category : 'accessing' }
37+
FASTPyList >> initializers [
38+
"Relation named: #initializers type: #FASTTExpression opposite: #collectionInitializers"
39+
40+
<generated>
41+
<FMComment: 'Each initializer defines one element.'>
42+
<derived>
43+
<FMProperty: #initializers type: #FASTTExpression opposite: #collectionInitializers>
44+
<multivalued>
45+
^ self attributeAt: #initializers ifAbsentPut: [ FMMultivalueLink on: self opposite: #collectionInitializers: ]
46+
]
47+
48+
{ #category : 'accessing' }
49+
FASTPyList >> initializers: anObject [
50+
51+
<generated>
52+
self initializers value: anObject
53+
]
54+
55+
{ #category : 'navigation' }
56+
FASTPyList >> initializersGroup [
57+
<generated>
58+
<navigation: 'Initializers'>
59+
^ MooseSpecializedGroup withAll: self initializers asSet
60+
]

src/FAST-Python-Model/FASTPyLiteral.class.st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
|---|
88
| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner|
99
| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used|
10+
| `collectionInitializers` | `FASTTExpression` | `initializers` | `FASTPyList` | The owner of the expression|
1011
| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case|
1112
| `parentComparisonOperator` | `FASTTExpression` | `operands` | `FASTPyComparisonOperator` | Parent comparison expression of which I am.|
1213
| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used|

0 commit comments

Comments
 (0)