Skip to content

Commit

Permalink
Merge pull request #53 from moosetechnology/52-should-create-FamixF77…
Browse files Browse the repository at this point in the history
…StatementFunction

fix #52
  • Loading branch information
NicolasAnquetil authored Jun 10, 2024
2 parents a98a4c6 + 9e73f64 commit 91fc1ca
Show file tree
Hide file tree
Showing 10 changed files with 287 additions and 27 deletions.
14 changes: 14 additions & 0 deletions src/Famix-Fortran77-Entities/FamixF77ImportingContext.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ FamixF77ImportingContext >> importSourceTextAnchor [
^ self importConcreteEntity: (self class fm3ClassNamed: #SourceTextAnchor)
]

{ #category : #importing }
FamixF77ImportingContext >> importStatementFunction [

<generated>
^ self importConcreteEntity: (self class fm3ClassNamed: #StatementFunction)
]

{ #category : #importing }
FamixF77ImportingContext >> importType [

Expand Down Expand Up @@ -295,6 +302,13 @@ FamixF77ImportingContext >> shouldImportSourceTextAnchor [
^ self shouldImport: #SourceTextAnchor
]

{ #category : #testing }
FamixF77ImportingContext >> shouldImportStatementFunction [

<generated>
^ self shouldImport: #StatementFunction
]

{ #category : #testing }
FamixF77ImportingContext >> shouldImportType [

Expand Down
5 changes: 3 additions & 2 deletions src/Famix-Fortran77-Entities/FamixF77PUBlockdata.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ a block data for common variable
### Children
| Relation | Origin | Opposite | Type | Comment |
|---|
| `comments` | `FamixTWithComments` | `commentedEntity` | `FamixTComment` | List of comments for the entity|
| `localVariables` | `FamixTWithLocalVariables` | `parentBehaviouralEntity` | `FamixTLocalVariable` | Variables locally defined by this behaviour.|
### Outgoing dependencies
Expand All @@ -33,8 +34,8 @@ a block data for common variable
Class {
#name : #FamixF77PUBlockdata,
#superclass : #FamixF77ProgramUnit,
#traits : 'FamixTWithAccesses + FamixTWithLocalVariables + FamixTWithStatements',
#classTraits : 'FamixTWithAccesses classTrait + FamixTWithLocalVariables classTrait + FamixTWithStatements classTrait',
#traits : 'FamixTWithAccesses + FamixTWithComments + FamixTWithLocalVariables + FamixTWithStatements + TEntityMetaLevelDependency',
#classTraits : 'FamixTWithAccesses classTrait + FamixTWithComments classTrait + FamixTWithLocalVariables classTrait + FamixTWithStatements classTrait + TEntityMetaLevelDependency classTrait',
#category : #'Famix-Fortran77-Entities-Entities'
}

Expand Down
11 changes: 9 additions & 2 deletions src/Famix-Fortran77-Entities/FamixF77PUMain.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ a main program
### Children
| Relation | Origin | Opposite | Type | Comment |
|---|
| `comments` | `FamixTWithComments` | `commentedEntity` | `FamixTComment` | List of comments for the entity|
| `localVariables` | `FamixTWithLocalVariables` | `parentBehaviouralEntity` | `FamixTLocalVariable` | Variables locally defined by this behaviour.|
| `statementFunctions` | `FamixF77TWithStatements` | `parentEntity` | `FamixF77StatementFunction` | Statement functions defined in the body|
| `types` | `FamixTWithTypes` | `typeContainer` | `FamixTType` | Types contained (declared) in this entity, if any. #types is declared in ContainerEntity because different kinds of container can embed types. Types are usually contained in a Famix.Namespace. But types can also be contained in a Famix.Class or Famix.Method (in Java with inner classes for example). Famix.Function can also contain some types such as structs.|
### Outgoing dependencies
Expand All @@ -17,6 +19,11 @@ a main program
| `outgoingInvocations` | `FamixTWithInvocations` | `sender` | `FamixTInvocation` | Outgoing invocations sent by this behaviour.|
| `outgoingReferences` | `FamixTWithReferences` | `referencer` | `FamixTReference` | References from this entity to other entities.|
### Incoming dependencies
| Relation | Origin | Opposite | Type | Comment |
|---|
| `incomingInvocations` | `FamixTInvocable` | `candidates` | `FamixTInvocation` | Incoming invocations from other behaviours computed by the candidate operator.|
### Other
| Relation | Origin | Opposite | Type | Comment |
|---|
Expand All @@ -34,8 +41,8 @@ a main program
Class {
#name : #FamixF77PUMain,
#superclass : #FamixF77ProgramUnit,
#traits : 'FamixTWithAccesses + FamixTWithInvocations + FamixTWithLocalVariables + FamixTWithStatements + FamixTWithTypes',
#classTraits : 'FamixTWithAccesses classTrait + FamixTWithInvocations classTrait + FamixTWithLocalVariables classTrait + FamixTWithStatements classTrait + FamixTWithTypes classTrait',
#traits : 'FamixF77TWithStatements + FamixTWithTypes',
#classTraits : 'FamixF77TWithStatements classTrait + FamixTWithTypes classTrait',
#category : #'Famix-Fortran77-Entities-Entities'
}

Expand Down
6 changes: 4 additions & 2 deletions src/Famix-Fortran77-Entities/FamixF77PUProcedure.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ a procedure
### Children
| Relation | Origin | Opposite | Type | Comment |
|---|
| `comments` | `FamixTWithComments` | `commentedEntity` | `FamixTComment` | List of comments for the entity|
| `localVariables` | `FamixTWithLocalVariables` | `parentBehaviouralEntity` | `FamixTLocalVariable` | Variables locally defined by this behaviour.|
| `parameters` | `FamixTWithParameters` | `parentBehaviouralEntity` | `FamixTParameter` | List of formal parameters declared by this behaviour.|
| `statementFunctions` | `FamixF77TWithStatements` | `parentEntity` | `FamixF77StatementFunction` | Statement functions defined in the body|
| `types` | `FamixTWithTypes` | `typeContainer` | `FamixTType` | Types contained (declared) in this entity, if any. #types is declared in ContainerEntity because different kinds of container can embed types. Types are usually contained in a Famix.Namespace. But types can also be contained in a Famix.Class or Famix.Method (in Java with inner classes for example). Famix.Function can also contain some types such as structs.|
### Outgoing dependencies
Expand Down Expand Up @@ -41,8 +43,8 @@ a procedure
Class {
#name : #FamixF77PUProcedure,
#superclass : #FamixF77ProgramUnit,
#traits : 'FamixTHasSignature + FamixTInvocable + FamixTWithAccesses + FamixTWithInvocations + FamixTWithLocalVariables + FamixTWithParameters + FamixTWithStatements + FamixTWithTypes',
#classTraits : 'FamixTHasSignature classTrait + FamixTInvocable classTrait + FamixTWithAccesses classTrait + FamixTWithInvocations classTrait + FamixTWithLocalVariables classTrait + FamixTWithParameters classTrait + FamixTWithStatements classTrait + FamixTWithTypes classTrait',
#traits : 'FamixF77TWithStatements + FamixTHasSignature + FamixTWithParameters + FamixTWithTypes',
#classTraits : 'FamixF77TWithStatements classTrait + FamixTHasSignature classTrait + FamixTWithParameters classTrait + FamixTWithTypes classTrait',
#category : #'Famix-Fortran77-Entities-Entities'
}

Expand Down
5 changes: 2 additions & 3 deletions src/Famix-Fortran77-Entities/FamixF77ProgramUnit.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ a program unit
### Children
| Relation | Origin | Opposite | Type | Comment |
|---|
| `comments` | `FamixTWithComments` | `commentedEntity` | `FamixTComment` | List of comments for the entity|
| `externalDeclarations` | `FamixF77ProgramUnit` | `programUnit` | `FamixF77ExternalDeclaration` | |
### Outgoing dependencies
Expand All @@ -37,8 +36,8 @@ a program unit
Class {
#name : #FamixF77ProgramUnit,
#superclass : #FamixF77NamedEntity,
#traits : 'FamixTSourceEntity + FamixTWithComments + TEntityMetaLevelDependency',
#classTraits : 'FamixTSourceEntity classTrait + FamixTWithComments classTrait + TEntityMetaLevelDependency classTrait',
#traits : 'FamixTSourceEntity',
#classTraits : 'FamixTSourceEntity classTrait',
#instVars : [
'#programFile => FMOne type: #FamixF77ProgramFile opposite: #programUnits',
'#externalDeclarations => FMMany type: #FamixF77ExternalDeclaration opposite: #programUnit',
Expand Down
91 changes: 91 additions & 0 deletions src/Famix-Fortran77-Entities/FamixF77StatementFunction.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
"
a statement function
## Relations
======================
### Parents
| Relation | Origin | Opposite | Type | Comment |
|---|
| `parentEntity` | `FamixF77StatementFunction` | `statementFunctions` | `FamixF77TWithStatements` | Entity in which body I am defined|
### Children
| Relation | Origin | Opposite | Type | Comment |
|---|
| `comments` | `FamixTWithComments` | `commentedEntity` | `FamixTComment` | List of comments for the entity|
| `localVariables` | `FamixTWithLocalVariables` | `parentBehaviouralEntity` | `FamixTLocalVariable` | Variables locally defined by this behaviour.|
| `parameters` | `FamixTWithParameters` | `parentBehaviouralEntity` | `FamixTParameter` | List of formal parameters declared by this behaviour.|
| `statementFunctions` | `FamixF77TWithStatements` | `parentEntity` | `FamixF77StatementFunction` | Statement functions defined in the body|
| `types` | `FamixTWithTypes` | `typeContainer` | `FamixTType` | Types contained (declared) in this entity, if any. #types is declared in ContainerEntity because different kinds of container can embed types. Types are usually contained in a Famix.Namespace. But types can also be contained in a Famix.Class or Famix.Method (in Java with inner classes for example). Famix.Function can also contain some types such as structs.|
### Outgoing dependencies
| Relation | Origin | Opposite | Type | Comment |
|---|
| `accesses` | `FamixTWithAccesses` | `accessor` | `FamixTAccess` | Accesses to variables made by this behaviour.|
| `outgoingInvocations` | `FamixTWithInvocations` | `sender` | `FamixTInvocation` | Outgoing invocations sent by this behaviour.|
| `outgoingReferences` | `FamixTWithReferences` | `referencer` | `FamixTReference` | References from this entity to other entities.|
### Incoming dependencies
| Relation | Origin | Opposite | Type | Comment |
|---|
| `incomingInvocations` | `FamixTInvocable` | `candidates` | `FamixTInvocation` | Incoming invocations from other behaviours computed by the candidate operator.|
### Other
| Relation | Origin | Opposite | Type | Comment |
|---|
| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any|
| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity|
## Properties
======================
| Name | Type | Default value | Comment |
|---|
| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.|
| `signature` | `String` | nil | Signature of the message being sent|
"
Class {
#name : #FamixF77StatementFunction,
#superclass : #FamixF77NamedEntity,
#traits : 'FamixF77TWithStatements + FamixTHasSignature + FamixTSourceEntity + FamixTTypedEntity + FamixTWithParameters + FamixTWithTypes',
#classTraits : 'FamixF77TWithStatements classTrait + FamixTHasSignature classTrait + FamixTSourceEntity classTrait + FamixTTypedEntity classTrait + FamixTWithParameters classTrait + FamixTWithTypes classTrait',
#instVars : [
'#parentEntity => FMOne type: #FamixF77TWithStatements opposite: #statementFunctions'
],
#category : #'Famix-Fortran77-Entities-Entities'
}

{ #category : #meta }
FamixF77StatementFunction class >> annotation [

<FMClass: #StatementFunction super: #FamixF77NamedEntity>
<package: #'Famix-Fortran77-Entities'>
<generated>
^ self
]

{ #category : #accessing }
FamixF77StatementFunction >> parentEntity [
"Relation named: #parentEntity type: #FamixF77TWithStatements opposite: #statementFunctions"

<generated>
<FMComment: 'Entity in which body I am defined'>
<container>
^ parentEntity
]

{ #category : #accessing }
FamixF77StatementFunction >> parentEntity: anObject [

<generated>
parentEntity := anObject
]

{ #category : #navigation }
FamixF77StatementFunction >> parentEntityGroup [
<generated>
<navigation: 'ParentEntity'>
^ MooseSpecializedGroup with: self parentEntity
]
7 changes: 7 additions & 0 deletions src/Famix-Fortran77-Entities/FamixF77TEntityCreator.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ FamixF77TEntityCreator >> newSourceTextAnchor [
^ self add: FamixF77SourceTextAnchor new
]

{ #category : #'entity creation' }
FamixF77TEntityCreator >> newStatementFunction [

<generated>
^ self add: FamixF77StatementFunction new
]

{ #category : #'entity creation' }
FamixF77TEntityCreator >> newType [

Expand Down
87 changes: 87 additions & 0 deletions src/Famix-Fortran77-Entities/FamixF77TWithStatements.trait.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
"
A trait that factorize several interesting properties for entities with statements
## Relations
======================
### Children
| Relation | Origin | Opposite | Type | Comment |
|---|
| `comments` | `FamixTWithComments` | `commentedEntity` | `FamixTComment` | List of comments for the entity|
| `localVariables` | `FamixTWithLocalVariables` | `parentBehaviouralEntity` | `FamixTLocalVariable` | Variables locally defined by this behaviour.|
| `statementFunctions` | `FamixF77TWithStatements` | `parentEntity` | `FamixF77StatementFunction` | Statement functions defined in the body|
### Outgoing dependencies
| Relation | Origin | Opposite | Type | Comment |
|---|
| `accesses` | `FamixTWithAccesses` | `accessor` | `FamixTAccess` | Accesses to variables made by this behaviour.|
| `outgoingInvocations` | `FamixTWithInvocations` | `sender` | `FamixTInvocation` | Outgoing invocations sent by this behaviour.|
| `outgoingReferences` | `FamixTWithReferences` | `referencer` | `FamixTReference` | References from this entity to other entities.|
### Incoming dependencies
| Relation | Origin | Opposite | Type | Comment |
|---|
| `incomingInvocations` | `FamixTInvocable` | `candidates` | `FamixTInvocation` | Incoming invocations from other behaviours computed by the candidate operator.|
### Other
| Relation | Origin | Opposite | Type | Comment |
|---|
| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity|
## Properties
======================
| Name | Type | Default value | Comment |
|---|
| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.|
"
Trait {
#name : #FamixF77TWithStatements,
#instVars : [
'#statementFunctions => FMMany type: #FamixF77StatementFunction opposite: #parentEntity'
],
#traits : 'FamixTInvocable + FamixTWithAccesses + FamixTWithComments + FamixTWithInvocations + FamixTWithLocalVariables + FamixTWithStatements + TEntityMetaLevelDependency',
#classTraits : 'FamixTInvocable classTrait + FamixTWithAccesses classTrait + FamixTWithComments classTrait + FamixTWithInvocations classTrait + FamixTWithLocalVariables classTrait + FamixTWithStatements classTrait + TEntityMetaLevelDependency classTrait',
#category : #'Famix-Fortran77-Entities-Traits'
}

{ #category : #meta }
FamixF77TWithStatements classSide >> annotation [

<FMClass: #TWithStatements super: #Object>
<package: #'Famix-Fortran77-Entities'>
<generated>
^ self
]

{ #category : #adding }
FamixF77TWithStatements >> addStatementFunction: anObject [
<generated>
^ self statementFunctions add: anObject
]

{ #category : #accessing }
FamixF77TWithStatements >> statementFunctions [
"Relation named: #statementFunctions type: #FamixF77StatementFunction opposite: #parentEntity"

<generated>
<FMComment: 'Statement functions defined in the body'>
<derived>
^ statementFunctions
]

{ #category : #accessing }
FamixF77TWithStatements >> statementFunctions: anObject [

<generated>
statementFunctions value: anObject
]

{ #category : #navigation }
FamixF77TWithStatements >> statementFunctionsGroup [
<generated>
<navigation: 'StatementFunctions'>
^ MooseSpecializedGroup withAll: self statementFunctions asSet
]
Loading

0 comments on commit 91fc1ca

Please sign in to comment.