Skip to content

Commit

Permalink
Merge pull request #21 from moosetechnology/cleaning
Browse files Browse the repository at this point in the history
Cleaning
  • Loading branch information
NicolasAnquetil authored May 3, 2023
2 parents f46b5a4 + 1c630ff commit c3c2809
Show file tree
Hide file tree
Showing 37 changed files with 451 additions and 3 deletions.
18 changes: 18 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixJavaClass.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #FamixJavaClass }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixJavaClass >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self bindFASTModel ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne bindFASTModel ]
]
18 changes: 18 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixJavaException.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #FamixJavaException }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixJavaException >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self bindFASTModel ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne bindFASTModel ]
]
18 changes: 18 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixJavaInterface.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #FamixJavaInterface }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixJavaInterface >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self bindFASTModel ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne bindFASTModel ]
]
9 changes: 9 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixJavaInvocation.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Extension { #name : #FamixJavaInvocation }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixJavaInvocation >> generateFastIfNotDoneAndBind [

^ self sender isInitializer
ifTrue: [ self sender parentType generateFastIfNotDoneAndBind ]
ifFalse: [ self sender generateFastIfNotDoneAndBind ]
]
7 changes: 7 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixJavaMethod.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #FamixJavaMethod }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixJavaMethod >> generateFastIfNotDoneAndBind [
self fast ifNotNil: [ ^ self fast mooseModel ].
^ self bindFASTModel
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Extension { #name : #FamixJavaParameterizedType }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixJavaParameterizedType >> generateFastIfNotDoneAndBind [
^ self parameterizableClass generateFastIfNotDoneAndBind
]
18 changes: 18 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixRepTestClass.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #FamixRepTestClass }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixRepTestClass >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self bindFASTModel ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne bindFASTModel ]
]
7 changes: 7 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixRepTestMethod.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #FamixRepTestMethod }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixRepTestMethod >> generateFastIfNotDoneAndBind [
self fast ifNotNil: [ ^ self fast mooseModel ].
^ self bindFASTModel
]
18 changes: 18 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixStClass.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #FamixStClass }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixStClass >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self bindFASTModel ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne bindFASTModel ]
]
9 changes: 9 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixStInvocation.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Extension { #name : #FamixStInvocation }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixStInvocation >> generateFastIfNotDoneAndBind [

^ self sender isInitializer
ifTrue: [ self sender parentType generateFastIfNotDoneAndBind ]
ifFalse: [ self sender generateFastIfNotDoneAndBind ]
]
7 changes: 7 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixStMethod.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #FamixStMethod }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixStMethod >> generateFastIfNotDoneAndBind [
self fast ifNotNil: [ ^ self fast mooseModel ].
^ self bindFASTModel
]
16 changes: 14 additions & 2 deletions src/FAST-Java-SmaCC-Importer/FamixTClass.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Extension { #name : #FamixTClass }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTClass >> generateFastJava [
^ JavaSmaCCProgramNodeImporterVisitor new parseCodeString: self sourceAnchor sourceText
FamixTClass >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self bindFASTModel ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne bindFASTModel ]
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #FamixTClassWithVisibility }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTClassWithVisibility >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self bindFASTModel ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne bindFASTModel ]
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Extension { #name : #FamixTDereferencedInvocation }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTDereferencedInvocation >> generateFastIfNotDoneAndBind [

^ self sender isInitializer
ifTrue: [ self sender parentType generateFastIfNotDoneAndBind ]
ifFalse: [ self sender generateFastIfNotDoneAndBind ]
]
18 changes: 18 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixTException.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #FamixTException }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTException >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self bindFASTModel ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne bindFASTModel ]
]
9 changes: 9 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixTInvocation.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Extension { #name : #FamixTInvocation }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTInvocation >> generateFastIfNotDoneAndBind [

^ self sender isInitializer
ifTrue: [ self sender parentType generateFastIfNotDoneAndBind ]
ifFalse: [ self sender generateFastIfNotDoneAndBind ]
]
8 changes: 7 additions & 1 deletion src/FAST-Java-SmaCC-Importer/FamixTMethod.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Extension { #name : #FamixTMethod }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTMethod >> generateFastJava [
FamixTMethod >> generateFastIfNotDoneAndBind [
self fast ifNotNil: [ ^ self fast mooseModel ].
^ self bindFASTModel
]

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTMethod >> getFASTModel [
^ JavaSmaCCProgramNodeImporterVisitor new parseCodeMethodString: self sourceAnchor sourceText
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Extension { #name : #FamixTParameterizedType }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTParameterizedType >> generateFastIfNotDoneAndBind [
^ self parameterizableClass generateFastIfNotDoneAndBind
]
18 changes: 18 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixTSourceEntity.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #FamixTSourceEntity }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTSourceEntity >> bindFASTModel [
"ask for the FAST model of the Famix receiver entity, if found, put it in Carrefour and
bind it to the Famix model of the receiver"
| fastModel |
fastModel := self getFASTModel.
fastModel ifNotNil: [
fastModel metamodel: CRFModel metamodel.
self bindFastModel: fastModel usingBinder: CRFBinderVisitor new ].
^ fastModel
]

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTSourceEntity >> getFASTModel [
self explicitRequirement
]
6 changes: 6 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixTType.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Extension { #name : #FamixTType }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTType >> getFASTModel [
^ JavaSmaCCProgramNodeImporterVisitor new parseCodeString: self sourceAnchor sourceText
]
18 changes: 18 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixTagTestClass.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #FamixTagTestClass }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTagTestClass >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self bindFASTModel ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne bindFASTModel ]
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Extension { #name : #FamixTagTestInvocation }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTagTestInvocation >> generateFastIfNotDoneAndBind [

^ self sender isInitializer
ifTrue: [ self sender parentType generateFastIfNotDoneAndBind ]
ifFalse: [ self sender generateFastIfNotDoneAndBind ]
]
7 changes: 7 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixTagTestMethod.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #FamixTagTestMethod }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTagTestMethod >> generateFastIfNotDoneAndBind [
self fast ifNotNil: [ ^ self fast mooseModel ].
^ self bindFASTModel
]
18 changes: 18 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixTest1Class.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #FamixTest1Class }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTest1Class >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self bindFASTModel ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne bindFASTModel ]
]
7 changes: 7 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixTest1Method.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #FamixTest1Method }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTest1Method >> generateFastIfNotDoneAndBind [
self fast ifNotNil: [ ^ self fast mooseModel ].
^ self bindFASTModel
]
18 changes: 18 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixTest2Class.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #FamixTest2Class }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTest2Class >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self bindFASTModel ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne bindFASTModel ]
]
18 changes: 18 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixTest3Class.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #FamixTest3Class }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTest3Class >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self bindFASTModel ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne bindFASTModel ]
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Extension { #name : #FamixTest3Invocation }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTest3Invocation >> generateFastIfNotDoneAndBind [

^ self sender isInitializer
ifTrue: [ self sender parentType generateFastIfNotDoneAndBind ]
ifFalse: [ self sender generateFastIfNotDoneAndBind ]
]
7 changes: 7 additions & 0 deletions src/FAST-Java-SmaCC-Importer/FamixTest3Method.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #FamixTest3Method }

{ #category : #'*FAST-Java-SmaCC-Importer' }
FamixTest3Method >> generateFastIfNotDoneAndBind [
self fast ifNotNil: [ ^ self fast mooseModel ].
^ self bindFASTModel
]
Loading

0 comments on commit c3c2809

Please sign in to comment.