Skip to content

Commit

Permalink
Exporter: Comment and tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel-Darbord committed Jul 2, 2024
1 parent f24fb0e commit 3810b4e
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 11 deletions.
5 changes: 4 additions & 1 deletion src/Famix-Value-Exporter/FASTBuilder.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
"
I am a helper for the `FamixValue2ASTVisitor` hierarchy of classes to build AST.
"
Class {
#name : #FASTBuilder,
#superclass : #Object,
#instVars : [
'model'
],
#category : #'Famix-Value-Exporter'
#category : #'Famix-Value-Exporter-Helpers'
}

{ #category : #testing }
Expand Down
5 changes: 4 additions & 1 deletion src/Famix-Value-Exporter/FASTJavaBuilder.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
"
I am used to handle Java type references and imports.
"
Class {
#name : #FASTJavaBuilder,
#superclass : #FASTBuilder,
#instVars : [
'typeNameDictionary'
],
#category : #'Famix-Value-Exporter'
#category : #'Famix-Value-Exporter-Helpers'
}

{ #category : #ast }
Expand Down
2 changes: 1 addition & 1 deletion src/Famix-Value-Exporter/FamixValue2ASTVisitor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Class {
'id',
'statementBlock'
],
#category : #'Famix-Value-Exporter'
#category : #'Famix-Value-Exporter-Visitors'
}

{ #category : #testing }
Expand Down
10 changes: 5 additions & 5 deletions src/Famix-Value-Exporter/FamixValue2FASTJavaVisitor.class.st
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"
A visitor for exporting a FamixValue model to FASTJava.
A visitor to export a FamixValue model to FASTJava.
The generated code is a block statement with a variable declared for each value.
Object attributes are initialized by finding the corresponding setters.
Collections and Dictionaries are constructed with the `add(element)` and `put(key, value)` methods respectively.
Collections and Dictionaries are constructed with the methods `add(element)` and `put(key, value)` respectively.
When exporting a `FamixValueOfObjectAttribute`, if the setter for its `FamixTAttribute` cannot be found, they are set using the Java Reflection API.
All attributes that fall in this category are added as `markedForReflection`.
When exporting a `FamixValueOfObjectAttribute`, if the setter for its `FamixTAttribute` cannot be found, it is set using the Java Reflection API.
All attributes that fall into this category are added as `markedForReflection`.
"
Class {
#name : #FamixValue2FASTJavaVisitor,
Expand All @@ -18,7 +18,7 @@ Class {
'staticAttributesCache',
'objectExportStrategy'
],
#category : #'Famix-Value-Exporter'
#category : #'Famix-Value-Exporter-Visitors'
}

{ #category : #private }
Expand Down
7 changes: 4 additions & 3 deletions src/Famix-Value-Exporter/FamixValue2PharoVisitor.class.st
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"
A visitor for exporting a FamixValue model to the Pharo AST, see `RBEntity` and `RBNode`.
A visitor for exporting a FamixValue model to the Pharo AST, see `RBNode`.
Object attributes are initialized by finding the corresponding setters.
Collections and Dictionaries are constructed with the `withAll:` class method.
Collections are constructed using the `withAll:` class method.
Dictionaries are constructed using the `newFrom:` class method.
"
Class {
#name : #FamixValue2PharoVisitor,
#superclass : #FamixValue2ASTVisitor,
#category : #'Famix-Value-Exporter'
#category : #'Famix-Value-Exporter-Visitors'
}

{ #category : #testing }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"
I am a strategy for exporting objects used by the `FamixValue2ASTVisitor` hierarchy of classes.
Objects can be complex to recreate due to deep nesting and circular dependencies, resulting in a lot of code. My subclasses define where that code goes.
"
Class {
#name : #FamixValueAbstractObjectExportStrategy,
#superclass : #Object,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"
I generate the code to recreate objects in helper functions.
For each object, a dedicated function is generated that takes no arguments and returns the recreated object.
"
Class {
#name : #FamixValueHelperObjectExportStrategy,
#superclass : #FamixValueAbstractObjectExportStrategy,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"
I recreate objects inline.
The context of the visitor will contain the code to recreate the objects.
"
Class {
#name : #FamixValueInlineObjectExportStrategy,
#superclass : #FamixValueAbstractObjectExportStrategy,
Expand Down

0 comments on commit 3810b4e

Please sign in to comment.