From 62ac4a04d6dc60925cc64da6ddd937ba8d95505c Mon Sep 17 00:00:00 2001 From: uNouss Date: Mon, 11 Dec 2023 13:29:58 +0100 Subject: [PATCH] Fix external declaration entity --- .../FamixF77ExternalDeclaration.class.st | 28 +++++++++++++++++ .../FamixF77ProgramUnit.class.st | 30 +++++++++++++++++++ .../FamixFortran77Generator.class.st | 2 ++ 3 files changed, 60 insertions(+) diff --git a/src/Famix-Fortran77-Entities/FamixF77ExternalDeclaration.class.st b/src/Famix-Fortran77-Entities/FamixF77ExternalDeclaration.class.st index 1068d32..cb5e475 100644 --- a/src/Famix-Fortran77-Entities/FamixF77ExternalDeclaration.class.st +++ b/src/Famix-Fortran77-Entities/FamixF77ExternalDeclaration.class.st @@ -5,6 +5,11 @@ Im a external declaration. Class { #name : #FamixF77ExternalDeclaration, #superclass : #FamixF77NamedEntity, + #traits : 'FamixTSourceEntity', + #classTraits : 'FamixTSourceEntity classTrait', + #instVars : [ + '#programUnit => FMOne type: #FamixF77ProgramUnit opposite: #externalDeclarations' + ], #category : #'Famix-Fortran77-Entities-Entities' } @@ -16,3 +21,26 @@ FamixF77ExternalDeclaration class >> annotation [ ^ self ] + +{ #category : #accessing } +FamixF77ExternalDeclaration >> programUnit [ + "Relation named: #programUnit type: #FamixF77ProgramUnit opposite: #externalDeclarations" + + + + ^ programUnit +] + +{ #category : #accessing } +FamixF77ExternalDeclaration >> programUnit: anObject [ + + + programUnit := anObject +] + +{ #category : #navigation } +FamixF77ExternalDeclaration >> programUnitGroup [ + + + ^ MooseSpecializedGroup with: self programUnit +] diff --git a/src/Famix-Fortran77-Entities/FamixF77ProgramUnit.class.st b/src/Famix-Fortran77-Entities/FamixF77ProgramUnit.class.st index 3fc6822..8f21e68 100644 --- a/src/Famix-Fortran77-Entities/FamixF77ProgramUnit.class.st +++ b/src/Famix-Fortran77-Entities/FamixF77ProgramUnit.class.st @@ -7,6 +7,7 @@ Class { #traits : 'FamixTSourceEntity + FamixTWithComments + TEntityMetaLevelDependency', #classTraits : 'FamixTSourceEntity classTrait + FamixTWithComments classTrait + TEntityMetaLevelDependency classTrait', #instVars : [ + '#externalDeclarations => FMMany type: #FamixF77ExternalDeclaration opposite: #programUnit', '#includes => FMMany type: #FamixF77Include opposite: #includedBy', '#programFile => FMOne type: #FamixF77ProgramFile opposite: #programUnits' ], @@ -30,6 +31,12 @@ FamixF77ProgramUnit class >> isAbstract [ ^ self == FamixF77ProgramUnit ] +{ #category : #adding } +FamixF77ProgramUnit >> addExternalDeclaration: anObject [ + + ^ self externalDeclarations add: anObject +] + { #category : #adding } FamixF77ProgramUnit >> addInclude: anObject [ @@ -51,6 +58,29 @@ FamixF77ProgramUnit >> dicImplicit [ ^ self attributeAt: #dicImplicit ifAbsentPut: [ self defaultImplicit ] ] +{ #category : #accessing } +FamixF77ProgramUnit >> externalDeclarations [ + "Relation named: #externalDeclarations type: #FamixF77ExternalDeclaration opposite: #programUnit" + + + + ^ externalDeclarations +] + +{ #category : #accessing } +FamixF77ProgramUnit >> externalDeclarations: anObject [ + + + externalDeclarations value: anObject +] + +{ #category : #navigation } +FamixF77ProgramUnit >> externalDeclarationsGroup [ + + + ^ MooseSpecializedGroup withAll: self externalDeclarations asSet +] + { #category : #testing } FamixF77ProgramUnit >> implicits [ diff --git a/src/Famix-Fortran77-Generator/FamixFortran77Generator.class.st b/src/Famix-Fortran77-Generator/FamixFortran77Generator.class.st index 8a101b3..447c33c 100644 --- a/src/Famix-Fortran77-Generator/FamixFortran77Generator.class.st +++ b/src/Famix-Fortran77-Generator/FamixFortran77Generator.class.st @@ -195,6 +195,7 @@ FamixFortran77Generator >> defineHierarchy [ complex --|> typeIntrinsic." externalDeclaration --|> namedEntity. + externalDeclaration --|> #TSourceEntity. indexedFileAnchor --|> sourceAnchor. indexedFileAnchor --|> #TFileNavigation. @@ -311,6 +312,7 @@ FamixFortran77Generator >> defineRelations [ super defineRelations. programFile <>-* programUnit. + programUnit <>-* externalDeclaration. ((include property: #included) comment: 'File included';