Skip to content

Commit

Permalink
Merge pull request #62 from moosetechnology/unknown-variable
Browse files Browse the repository at this point in the history
Created FamixF77UnkownVariable
  • Loading branch information
NicolasAnquetil authored Jun 15, 2024
2 parents 196556b + 23f5513 commit bcdff5a
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 3 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 @@ -169,6 +169,13 @@ FamixF77ImportingContext >> importTypeUnknown [
^ self importConcreteEntity: (self class fm3ClassNamed: #TypeUnknown)
]

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

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

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

Expand Down Expand Up @@ -330,6 +337,13 @@ FamixF77ImportingContext >> shouldImportTypeUnknown [
^ self shouldImport: #TypeUnknown
]

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

<generated>
^ self shouldImport: #UnknownVariable
]

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

Expand Down
7 changes: 7 additions & 0 deletions src/Famix-Fortran77-Entities/FamixF77PUComment.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ FamixF77PUComment class >> annotation [
<generated>
^ self
]

{ #category : #'as yet unclassified' }
FamixF77PUComment >> resolveVariable: variableName with: resolver [
"PUComment should not exist, a Comment is not a ProgramUnit :-("

^nil
]
14 changes: 14 additions & 0 deletions src/Famix-Fortran77-Entities/FamixF77TEntityCreator.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,20 @@ FamixF77TEntityCreator >> newTypeUnknown [
^ self add: FamixF77TypeUnknown new
]

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

<generated>
^ self add: FamixF77UnknownVariable new
]

{ #category : #'entity creation' }
FamixF77TEntityCreator >> newUnknownVariableNamed: aName [

<generated>
^ self add: (FamixF77UnknownVariable named: aName)
]

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

Expand Down
43 changes: 43 additions & 0 deletions src/Famix-Fortran77-Entities/FamixF77UnknownVariable.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"
Variable used but not resolved
## Relations
======================
### Incoming dependencies
| Relation | Origin | Opposite | Type | Comment |
|---|
| `incomingAccesses` | `FamixTAccessible` | `variable` | `FamixTAccess` | All Famix accesses pointing to this structural entity|
### 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.|
| `name` | `String` | nil | Basic name of the entity, not full reference.|
"
Class {
#name : #FamixF77UnknownVariable,
#superclass : #FamixF77Entity,
#traits : 'FamixTUnknownVariable',
#classTraits : 'FamixTUnknownVariable classTrait',
#category : #'Famix-Fortran77-Entities-Entities'
}

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

<FMClass: #UnknownVariable super: #FamixF77Entity>
<package: #'Famix-Fortran77-Entities'>
<generated>
^ self
]
14 changes: 11 additions & 3 deletions src/Famix-Fortran77-Generator/FamixFortran77Generator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ Class {
'externalDeclaration',
'implicit',
'statementFunction',
'tWithStatements'
'tWithStatements',
'unknownVariable'
],
#category : #'Famix-Fortran77-Generator'
}
Expand Down Expand Up @@ -185,7 +186,12 @@ FamixFortran77Generator >> defineClasses [

variable := builder
newClassNamed: #Variable
comment: self variableEntityComment
comment: self variableEntityComment.

unknownVariable := builder
newClassNamed: #UnknownVariable
comment: 'Variable used but not resolved'.

]

{ #category : #definition }
Expand Down Expand Up @@ -277,7 +283,9 @@ FamixFortran77Generator >> defineHierarchy [

typeUnknown --|> type.

variable --|> #TLocalVariable
variable --|> #TLocalVariable.

unknownVariable --|> #TUnknownVariable
]

{ #category : #definition }
Expand Down

0 comments on commit bcdff5a

Please sign in to comment.