From 2dc06c9b4f0c3bda5c14a11530f33944abdbdd8e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 20 Dec 2024 15:26:26 +0100 Subject: [PATCH] Finish to use new reference infra --- .../FamixPythonContainerEntity.class.st | 24 ------ .../FamixPythonFunction.class.st | 31 +------- .../FamixPythonFunctionReference.class.st | 78 ------------------- .../FamixPythonTEntityCreator.trait.st | 7 -- 4 files changed, 3 insertions(+), 137 deletions(-) delete mode 100644 src/Famix-Python-Entities/FamixPythonFunctionReference.class.st diff --git a/src/Famix-Python-Entities/FamixPythonContainerEntity.class.st b/src/Famix-Python-Entities/FamixPythonContainerEntity.class.st index 9db5f22..201a777 100644 --- a/src/Famix-Python-Entities/FamixPythonContainerEntity.class.st +++ b/src/Famix-Python-Entities/FamixPythonContainerEntity.class.st @@ -10,7 +10,6 @@ ### Outgoing dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `outgoingFunctionReferences` | `FamixPythonContainerEntity` | `referencer` | `FamixPythonFunctionReference` | | | `outgoingImports` | `FamixTWithImports` | `importingEntity` | `FamixTImport` | | | `unknowAccessesOrReferences` | `FamixPythonContainerEntity` | `accessorOrReferencer` | `FamixPythonUnknowAccessOrReference` | | @@ -23,7 +22,6 @@ Class { #traits : 'FamixTWithClasses + FamixTWithImports', #classTraits : 'FamixTWithClasses classTrait + FamixTWithImports classTrait', #instVars : [ - '#outgoingFunctionReferences => FMMany type: #FamixPythonFunctionReference opposite: #referencer', '#unknowAccessesOrReferences => FMMany type: #FamixPythonUnknowAccessOrReference opposite: #accessorOrReferencer' ], #category : 'Famix-Python-Entities-Entities', @@ -48,34 +46,12 @@ FamixPythonContainerEntity class >> isAbstract [ ^ self == FamixPythonContainerEntity ] -{ #category : 'adding' } -FamixPythonContainerEntity >> addOutgoingFunctionReference: anObject [ - - ^ self outgoingFunctionReferences add: anObject -] - { #category : 'adding' } FamixPythonContainerEntity >> addUnknowAccessesOrReference: anObject [ ^ self unknowAccessesOrReferences add: anObject ] -{ #category : 'accessing' } -FamixPythonContainerEntity >> outgoingFunctionReferences [ - "Relation named: #outgoingFunctionReferences type: #FamixPythonFunctionReference opposite: #referencer" - - - - ^ outgoingFunctionReferences -] - -{ #category : 'accessing' } -FamixPythonContainerEntity >> outgoingFunctionReferences: anObject [ - - - outgoingFunctionReferences value: anObject -] - { #category : 'accessing' } FamixPythonContainerEntity >> unknowAccessesOrReferences [ "Relation named: #unknowAccessesOrReferences type: #FamixPythonUnknowAccessOrReference opposite: #accessorOrReferencer" diff --git a/src/Famix-Python-Entities/FamixPythonFunction.class.st b/src/Famix-Python-Entities/FamixPythonFunction.class.st index 56ede6e..0402ecb 100644 --- a/src/Famix-Python-Entities/FamixPythonFunction.class.st +++ b/src/Famix-Python-Entities/FamixPythonFunction.class.st @@ -27,9 +27,9 @@ ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingFunctionReferences` | `FamixPythonFunction` | `referredFunction` | `FamixPythonFunctionReference` | | | `incomingImports` | `FamixTImportable` | `importedEntity` | `FamixTImport` | List of imports of this entity| | `incomingInvocations` | `FamixTInvocable` | `candidates` | `FamixTInvocation` | Incoming invocations from other behaviours computed by the candidate operator.| +| `incomingReferences` | `FamixTReferenceable` | `referredType` | `FamixTReference` | References to this entity by other entities.| ### Other | Relation | Origin | Opposite | Type | Comment | @@ -54,11 +54,8 @@ Class { #name : 'FamixPythonFunction', #superclass : 'FamixPythonContainerEntity', - #traits : 'FamixTFunction + FamixTImportable + FamixTShadowable + FamixTShadower + FamixTWithAnnotationInstances + FamixTWithComments + FamixTWithFunctions + FamixTWithImplicitVariables + FamixTWithInvocations + FamixTWithLambdas', - #classTraits : 'FamixTFunction classTrait + FamixTImportable classTrait + FamixTShadowable classTrait + FamixTShadower classTrait + FamixTWithAnnotationInstances classTrait + FamixTWithComments classTrait + FamixTWithFunctions classTrait + FamixTWithImplicitVariables classTrait + FamixTWithInvocations classTrait + FamixTWithLambdas classTrait', - #instVars : [ - '#incomingFunctionReferences => FMMany type: #FamixPythonFunctionReference opposite: #referredFunction' - ], + #traits : 'FamixTFunction + FamixTImportable + FamixTReferenceable + FamixTShadowable + FamixTShadower + FamixTWithAnnotationInstances + FamixTWithComments + FamixTWithFunctions + FamixTWithImplicitVariables + FamixTWithInvocations + FamixTWithLambdas', + #classTraits : 'FamixTFunction classTrait + FamixTImportable classTrait + FamixTReferenceable classTrait + FamixTShadowable classTrait + FamixTShadower classTrait + FamixTWithAnnotationInstances classTrait + FamixTWithComments classTrait + FamixTWithFunctions classTrait + FamixTWithImplicitVariables classTrait + FamixTWithInvocations classTrait + FamixTWithLambdas classTrait', #category : 'Famix-Python-Entities-Entities', #package : 'Famix-Python-Entities', #tag : 'Entities' @@ -72,25 +69,3 @@ FamixPythonFunction class >> annotation [ ^ self ] - -{ #category : 'adding' } -FamixPythonFunction >> addIncomingFunctionReference: anObject [ - - ^ self incomingFunctionReferences add: anObject -] - -{ #category : 'accessing' } -FamixPythonFunction >> incomingFunctionReferences [ - "Relation named: #incomingFunctionReferences type: #FamixPythonFunctionReference opposite: #referredFunction" - - - - ^ incomingFunctionReferences -] - -{ #category : 'accessing' } -FamixPythonFunction >> incomingFunctionReferences: anObject [ - - - incomingFunctionReferences value: anObject -] diff --git a/src/Famix-Python-Entities/FamixPythonFunctionReference.class.st b/src/Famix-Python-Entities/FamixPythonFunctionReference.class.st deleted file mode 100644 index ff3e1eb..0000000 --- a/src/Famix-Python-Entities/FamixPythonFunctionReference.class.st +++ /dev/null @@ -1,78 +0,0 @@ -" -## Relations -====================== - -### Association source -| Relation | Origin | Opposite | Type | Comment | -|---| -| `referencer` | `FamixPythonFunctionReference` | `outgoingFunctionReferences` | `FamixPythonContainerEntity` | | - -### Association target -| Relation | Origin | Opposite | Type | Comment | -|---| -| `referredFunction` | `FamixPythonFunctionReference` | `incomingFunctionReferences` | `FamixPythonFunction` | | - -### Other -| Relation | Origin | Opposite | Type | Comment | -|---| -| `next` | `FamixTAssociation` | `previous` | `FamixTAssociation` | Next association in an ordered collection of associations. Currently not supported by the Moose importer| -| `previous` | `FamixTAssociation` | `next` | `FamixTAssociation` | Previous association in an ordered collection of associations. Currently not supported by the Moose importer| -| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| - - - -" -Class { - #name : 'FamixPythonFunctionReference', - #superclass : 'FamixPythonEntity', - #traits : 'FamixTAssociation', - #classTraits : 'FamixTAssociation classTrait', - #instVars : [ - '#referencer => FMOne type: #FamixPythonContainerEntity opposite: #outgoingFunctionReferences', - '#referredFunction => FMOne type: #FamixPythonFunction opposite: #incomingFunctionReferences' - ], - #category : 'Famix-Python-Entities-Entities', - #package : 'Famix-Python-Entities', - #tag : 'Entities' -} - -{ #category : 'meta' } -FamixPythonFunctionReference class >> annotation [ - - - - - ^ self -] - -{ #category : 'accessing' } -FamixPythonFunctionReference >> referencer [ - "Relation named: #referencer type: #FamixPythonContainerEntity opposite: #outgoingFunctionReferences" - - - - ^ referencer -] - -{ #category : 'accessing' } -FamixPythonFunctionReference >> referencer: anObject [ - - - referencer := anObject -] - -{ #category : 'accessing' } -FamixPythonFunctionReference >> referredFunction [ - "Relation named: #referredFunction type: #FamixPythonFunction opposite: #incomingFunctionReferences" - - - - ^ referredFunction -] - -{ #category : 'accessing' } -FamixPythonFunctionReference >> referredFunction: anObject [ - - - referredFunction := anObject -] diff --git a/src/Famix-Python-Entities/FamixPythonTEntityCreator.trait.st b/src/Famix-Python-Entities/FamixPythonTEntityCreator.trait.st index e47481f..df09f63 100644 --- a/src/Famix-Python-Entities/FamixPythonTEntityCreator.trait.st +++ b/src/Famix-Python-Entities/FamixPythonTEntityCreator.trait.st @@ -76,13 +76,6 @@ FamixPythonTEntityCreator >> newFunctionNamed: aName [ ^ self add: (FamixPythonFunction named: aName) ] -{ #category : 'entity creation' } -FamixPythonTEntityCreator >> newFunctionReference [ - - - ^ self add: FamixPythonFunctionReference new -] - { #category : 'entity creation' } FamixPythonTEntityCreator >> newGlobalVariable [