Skip to content

Commit 0036644

Browse files
committed
Rename some relations + add tests on subscripts
1 parent 679590a commit 0036644

4 files changed

Lines changed: 949 additions & 90 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,10 +732,10 @@ FASTPythonMetamodelGenerator >> defineRelations [
732732
(string property: #interpolations) <>-* (interpolation property: #parentString).
733733

734734
((subscript property: #value) comment: 'The receiver of the subscript')
735-
<>- ((expression property: #subscriptValueOwner) comment: 'My parent if I define the receiver of a subscript (if it''s the case).').
735+
<>- ((expression property: #parentSubscriptValue) comment: 'My parent if I define the receiver of a subscript (if it''s the case).').
736736

737737
((subscript property: #indices) comment: 'The elements defining the indices to select in a subscript.')
738-
<>-* ((expression property: #subscriptIndiceOwner) comment: 'My parent if I am defining an index to select of a subscript (if it''s the case)').
738+
<>-* ((expression property: #parentSubscriptIndice) comment: 'My parent if I am defining an index to select of a subscript (if it''s the case)').
739739

740740
(tDefinition property: #decorators) <>-* (decorator property: #definitionOwner).
741741

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

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side|
3939
| `parentInterpolation` | `FASTPyExpression` | `expression` | `FASTPyInterpolation` | |
4040
| `parentMatchStatement` | `FASTPyExpression` | `subject` | `FASTPyMatchStatement` | |
41+
| `parentSubscriptIndice` | `FASTPyExpression` | `indices` | `FASTPySubscript` | My parent if I am defining an index to select of a subscript (if it's the case)|
42+
| `parentSubscriptValue` | `FASTPyExpression` | `value` | `FASTPySubscript` | My parent if I define the receiver of a subscript (if it's the case).|
4143
| `parentType` | `FASTPyTTypeContent` | `content` | `FASTPyType` | |
4244
| `parentUnaryOperator` | `FASTPyExpression` | `argument` | `FASTPyTUnaryOperator` | Parent unary operator in which I am.|
4345
| `parentWalrus` | `FASTPyExpression` | `value` | `FASTPyWalrus` | |
4446
| `prarentPrintStatement` | `FASTPyExpression` | `expressions` | `FASTPyPrintStatement` | |
4547
| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)|
4648
| `sliceOwner` | `FASTPyExpression` | `components` | `FASTPySlice` | Slice in which I am a component (start, end or step) (If it's the case)'|
47-
| `subscriptIndiceOwner` | `FASTPyExpression` | `indices` | `FASTPySubscript` | My parent if I am defining an index to select of a subscript (if it's the case)|
48-
| `subscriptValueOwner` | `FASTPyExpression` | `value` | `FASTPySubscript` | My parent if I define the receiver of a subscript (if it's the case).|
4949
5050
5151
## Properties
@@ -89,12 +89,12 @@ Class {
8989
'#parentExceptClause => FMOne type: #FASTPyExceptClause opposite: #expressions',
9090
'#parentInterpolation => FMOne type: #FASTPyInterpolation opposite: #expression',
9191
'#parentMatchStatement => FMOne type: #FASTPyMatchStatement opposite: #subject',
92+
'#parentSubscriptIndice => FMOne type: #FASTPySubscript opposite: #indices',
93+
'#parentSubscriptValue => FMOne type: #FASTPySubscript opposite: #value',
9294
'#parentUnaryOperator => FMOne type: #FASTPyTUnaryOperator opposite: #argument',
9395
'#parentWalrus => FMOne type: #FASTPyWalrus opposite: #value',
9496
'#prarentPrintStatement => FMOne type: #FASTPyPrintStatement opposite: #expressions',
95-
'#sliceOwner => FMOne type: #FASTPySlice opposite: #components',
96-
'#subscriptIndiceOwner => FMOne type: #FASTPySubscript opposite: #indices',
97-
'#subscriptValueOwner => FMOne type: #FASTPySubscript opposite: #value'
97+
'#sliceOwner => FMOne type: #FASTPySlice opposite: #components'
9898
],
9999
#category : 'FAST-Python-Model-Entities',
100100
#package : 'FAST-Python-Model',
@@ -736,6 +736,55 @@ FASTPyExpression >> parentMatchStatementGroup [
736736
^ MooseSpecializedGroup with: self parentMatchStatement
737737
]
738738

739+
{ #category : 'accessing' }
740+
FASTPyExpression >> parentSubscriptIndice [
741+
"Relation named: #parentSubscriptIndice type: #FASTPySubscript opposite: #indices"
742+
743+
<generated>
744+
<FMComment: 'My parent if I am defining an index to select of a subscript (if it''s the case)'>
745+
<container>
746+
^ parentSubscriptIndice
747+
]
748+
749+
{ #category : 'accessing' }
750+
FASTPyExpression >> parentSubscriptIndice: anObject [
751+
752+
<generated>
753+
parentSubscriptIndice := anObject
754+
]
755+
756+
{ #category : 'navigation' }
757+
FASTPyExpression >> parentSubscriptIndiceGroup [
758+
<generated>
759+
<navigation: 'ParentSubscriptIndice'>
760+
^ MooseSpecializedGroup with: self parentSubscriptIndice
761+
]
762+
763+
{ #category : 'accessing' }
764+
FASTPyExpression >> parentSubscriptValue [
765+
"Relation named: #parentSubscriptValue type: #FASTPySubscript opposite: #value"
766+
767+
<generated>
768+
<FMComment: 'My parent if I define the receiver of a subscript (if it''s the case).'>
769+
<container>
770+
<derived>
771+
^ parentSubscriptValue
772+
]
773+
774+
{ #category : 'accessing' }
775+
FASTPyExpression >> parentSubscriptValue: anObject [
776+
777+
<generated>
778+
parentSubscriptValue := anObject
779+
]
780+
781+
{ #category : 'navigation' }
782+
FASTPyExpression >> parentSubscriptValueGroup [
783+
<generated>
784+
<navigation: 'ParentSubscriptValue'>
785+
^ MooseSpecializedGroup with: self parentSubscriptValue
786+
]
787+
739788
{ #category : 'accessing' }
740789
FASTPyExpression >> parentUnaryOperator [
741790
"Relation named: #parentUnaryOperator type: #FASTPyTUnaryOperator opposite: #argument"
@@ -831,52 +880,3 @@ FASTPyExpression >> sliceOwnerGroup [
831880
<navigation: 'SliceOwner'>
832881
^ MooseSpecializedGroup with: self sliceOwner
833882
]
834-
835-
{ #category : 'accessing' }
836-
FASTPyExpression >> subscriptIndiceOwner [
837-
"Relation named: #subscriptIndiceOwner type: #FASTPySubscript opposite: #indices"
838-
839-
<generated>
840-
<FMComment: 'My parent if I am defining an index to select of a subscript (if it''s the case)'>
841-
<container>
842-
^ subscriptIndiceOwner
843-
]
844-
845-
{ #category : 'accessing' }
846-
FASTPyExpression >> subscriptIndiceOwner: anObject [
847-
848-
<generated>
849-
subscriptIndiceOwner := anObject
850-
]
851-
852-
{ #category : 'navigation' }
853-
FASTPyExpression >> subscriptIndiceOwnerGroup [
854-
<generated>
855-
<navigation: 'SubscriptIndiceOwner'>
856-
^ MooseSpecializedGroup with: self subscriptIndiceOwner
857-
]
858-
859-
{ #category : 'accessing' }
860-
FASTPyExpression >> subscriptValueOwner [
861-
"Relation named: #subscriptValueOwner type: #FASTPySubscript opposite: #value"
862-
863-
<generated>
864-
<FMComment: 'My parent if I define the receiver of a subscript (if it''s the case).'>
865-
<container>
866-
<derived>
867-
^ subscriptValueOwner
868-
]
869-
870-
{ #category : 'accessing' }
871-
FASTPyExpression >> subscriptValueOwner: anObject [
872-
873-
<generated>
874-
subscriptValueOwner := anObject
875-
]
876-
877-
{ #category : 'navigation' }
878-
FASTPyExpression >> subscriptValueOwnerGroup [
879-
<generated>
880-
<navigation: 'SubscriptValueOwner'>
881-
^ MooseSpecializedGroup with: self subscriptValueOwner
882-
]

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
### Children
1717
| Relation | Origin | Opposite | Type | Comment |
1818
|---|
19-
| `indices` | `FASTPySubscript` | `subscriptIndiceOwner` | `FASTPyExpression` | The elements defining the indices to select in a subscript.|
20-
| `value` | `FASTPySubscript` | `subscriptValueOwner` | `FASTPyExpression` | The receiver of the subscript|
19+
| `indices` | `FASTPySubscript` | `parentSubscriptIndice` | `FASTPyExpression` | The elements defining the indices to select in a subscript.|
20+
| `value` | `FASTPySubscript` | `parentSubscriptValue` | `FASTPyExpression` | The receiver of the subscript|
2121
2222
2323
@@ -28,8 +28,8 @@ Class {
2828
#traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable',
2929
#classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait',
3030
#instVars : [
31-
'#indices => FMMany type: #FASTPyExpression opposite: #subscriptIndiceOwner',
32-
'#value => FMOne type: #FASTPyExpression opposite: #subscriptValueOwner'
31+
'#indices => FMMany type: #FASTPyExpression opposite: #parentSubscriptIndice',
32+
'#value => FMOne type: #FASTPyExpression opposite: #parentSubscriptValue'
3333
],
3434
#category : 'FAST-Python-Model-Entities',
3535
#package : 'FAST-Python-Model',
@@ -53,7 +53,7 @@ FASTPySubscript >> addIndex: anObject [
5353

5454
{ #category : 'accessing' }
5555
FASTPySubscript >> indices [
56-
"Relation named: #indices type: #FASTPyExpression opposite: #subscriptIndiceOwner"
56+
"Relation named: #indices type: #FASTPyExpression opposite: #parentSubscriptIndice"
5757

5858
<generated>
5959
<FMComment: 'The elements defining the indices to select in a subscript.'>
@@ -77,7 +77,7 @@ FASTPySubscript >> indicesGroup [
7777

7878
{ #category : 'accessing' }
7979
FASTPySubscript >> value [
80-
"Relation named: #value type: #FASTPyExpression opposite: #subscriptValueOwner"
80+
"Relation named: #value type: #FASTPyExpression opposite: #parentSubscriptValue"
8181

8282
<generated>
8383
<FMComment: 'The receiver of the subscript'>

0 commit comments

Comments
 (0)