Skip to content

Commit

Permalink
add sugar method on interface for support of Moose 10
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed Feb 1, 2023
1 parent b9073f7 commit 450f90b
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,36 @@ Extension { #name : #FamixJavaInterface }
FamixJavaInterface >> bindFastModel: fastModel usingBinder: binder [
binder bindFastModel: fastModel fromFamixClassEntity: self
]

{ #category : #'*Carrefour-FastAndBindingGenerator' }
FamixJavaInterface >> generateFastAndBind [
| fastModel |
self assert: self sourceAnchor isNotNil.
fastModel := self generateFastJava
metamodel: CRFModel metamodel;
yourself.
self bindFastModel: fastModel usingBinder: CRFBinderVisitor new.
^ fastModel
]

{ #category : #'*Carrefour-FastAndBindingGenerator' }
FamixJavaInterface >> generateFastIfNotDoneAndBind [

self fastDeclaration ifNotEmpty: [
^ self fastDeclaration anyOne mooseModel ].
self fastTypeDefinition ifNotNil: [
^ self fastTypeDefinition mooseModel ].
^ self isAnonymousClass
ifFalse: [ self generateFastAndBind ]
ifTrue: [
((self
allAtScope: FamixTClass
until: [ :c |
(c isKindOf: FamixJavaClass) and: [ c isAnonymousClass not ] ])
asOrderedCollection \ { self }) anyOne generateFastAndBind ]
]

{ #category : #'*Carrefour-FastAndBindingGenerator' }
FamixJavaInterface >> generateFastJava [
^ JavaSmaCCProgramNodeImporterVisitor new parseCodeString: self sourceAnchor sourceText
]

0 comments on commit 450f90b

Please sign in to comment.