From 070263d3b49860d45f8d2d7d0593e3799cd66a7d Mon Sep 17 00:00:00 2001 From: Gabriel Darbord Date: Wed, 17 Apr 2024 17:04:23 +0200 Subject: [PATCH] Exporter: Remove unused classes and methods --- .../FamixValue2ASTVisitor.class.st | 6 -- .../FamixValue2PharoVisitor.class.st | 12 --- .../FamixValueReferenceCountVisitor.class.st | 86 ------------------- 3 files changed, 104 deletions(-) delete mode 100644 src/Famix-Value-Exporter/FamixValueReferenceCountVisitor.class.st diff --git a/src/Famix-Value-Exporter/FamixValue2ASTVisitor.class.st b/src/Famix-Value-Exporter/FamixValue2ASTVisitor.class.st index af84c19..2a7ac45 100644 --- a/src/Famix-Value-Exporter/FamixValue2ASTVisitor.class.st +++ b/src/Famix-Value-Exporter/FamixValue2ASTVisitor.class.st @@ -71,12 +71,6 @@ FamixValue2ASTVisitor >> varNameFor: value [ ifAbsentPut: [ value varName , self nextId asString ] ] -{ #category : #visiting } -FamixValue2ASTVisitor >> visit: value [ - - ^ value accept: self -] - { #category : #visiting } FamixValue2ASTVisitor >> visitCollection: collection [ diff --git a/src/Famix-Value-Exporter/FamixValue2PharoVisitor.class.st b/src/Famix-Value-Exporter/FamixValue2PharoVisitor.class.st index 8c09dcf..7f88db9 100644 --- a/src/Famix-Value-Exporter/FamixValue2PharoVisitor.class.st +++ b/src/Famix-Value-Exporter/FamixValue2PharoVisitor.class.st @@ -25,18 +25,6 @@ FamixValue2PharoVisitor >> ensureVisited: value [ ^ node ] -{ #category : #visiting } -FamixValue2PharoVisitor >> findRequiredVariablesFor: rootValue [ - "Values referenced at least twice and the root value will be in variables." - - (FamixValueReferenceCountVisitor visit: rootValue) keysAndValuesDo: [ - :value - :count | - count > 1 ifTrue: [ "ifFalse: [ varNameDict at: value put: nil ]" - self varNameFor: value ] ]. - self varNameFor: rootValue -] - { #category : #accessing } FamixValue2PharoVisitor >> statementBlock [ diff --git a/src/Famix-Value-Exporter/FamixValueReferenceCountVisitor.class.st b/src/Famix-Value-Exporter/FamixValueReferenceCountVisitor.class.st deleted file mode 100644 index 9a890bd..0000000 --- a/src/Famix-Value-Exporter/FamixValueReferenceCountVisitor.class.st +++ /dev/null @@ -1,86 +0,0 @@ -Class { - #name : #FamixValueReferenceCountVisitor, - #superclass : #Object, - #instVars : [ - 'references' - ], - #category : #'Famix-Value-Exporter' -} - -{ #category : #visiting } -FamixValueReferenceCountVisitor class >> visit: value [ - - ^ self new visit: value -] - -{ #category : #initialization } -FamixValueReferenceCountVisitor >> initialize [ - - references := Dictionary new -] - -{ #category : #visiting } -FamixValueReferenceCountVisitor >> visit: value [ - - value accept: self. - ^ references -] - -{ #category : #visiting } -FamixValueReferenceCountVisitor >> visitCollection: collection [ - - references - at: collection - ifPresent: [ :count | ^ references at: collection put: count + 1 ] - ifAbsentPut: 1. - collection value do: [ :element | element value accept: self ] -] - -{ #category : #visiting } -FamixValueReferenceCountVisitor >> visitDictionary: dictionary [ - - references - at: dictionary - ifPresent: [ :count | ^ references at: dictionary put: count + 1 ] - ifAbsentPut: 1. - dictionary value do: [ :assoc | - assoc key accept: self. - assoc value accept: self ] -] - -{ #category : #visiting } -FamixValueReferenceCountVisitor >> visitEnumValue: enumValue [ - - references - at: enumValue - ifPresent: [ :count | references at: enumValue put: count + 1 ] - ifAbsentPut: 1 -] - -{ #category : #visiting } -FamixValueReferenceCountVisitor >> visitObject: object [ - - references - at: object - ifPresent: [ :count | ^ references at: object put: count + 1 ] - ifAbsentPut: 1. - object value do: [ :attribute | attribute value accept: self ] -] - -{ #category : #visiting } -FamixValueReferenceCountVisitor >> visitPrimitive: primitive [ - - references - at: primitive - ifPresent: [ :count | references at: primitive put: count + 1 ] - ifAbsentPut: 1 -] - -{ #category : #visiting } -FamixValueReferenceCountVisitor >> visitValueOfUnknownType: unknown [ - - references - at: unknown - ifPresent: [ :count | references at: unknown put: count + 1 ] - ifAbsentPut: 1 -]