diff --git a/src/EsopeImporter/FamixEsopeCommand.extension.st b/src/EsopeImporter/FamixEsopeCommand.extension.st index 050bc01..03159b3 100644 --- a/src/EsopeImporter/FamixEsopeCommand.extension.st +++ b/src/EsopeImporter/FamixEsopeCommand.extension.st @@ -1,9 +1,16 @@ -Extension { #name : #FamixEsopeCommand } +Extension { #name : 'FamixEsopeCommand' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixEsopeCommand >> famixImportSanityCheck [ super famixImportSanityCheck. self sanityCheck: (variable declaredType isEsopeSegment) description: 'EsopeCommand on non-pointer variable'. ] + +{ #category : '*EsopeImporter' } +FamixEsopeCommand class >> metamodel [ + "temporary solution to issue https://github.com/moosetechnology/Famix/issues/808" + + ^ FamixEsopeModel metamodel +] diff --git a/src/EsopeImporter/FamixEsopeDimentionalInteger.extension.st b/src/EsopeImporter/FamixEsopeDimentionalInteger.extension.st new file mode 100644 index 0000000..e4363cb --- /dev/null +++ b/src/EsopeImporter/FamixEsopeDimentionalInteger.extension.st @@ -0,0 +1,8 @@ +Extension { #name : 'FamixEsopeDimentionalInteger' } + +{ #category : '*EsopeImporter' } +FamixEsopeDimentionalInteger class >> metamodel [ + "temporary solution to issue https://github.com/moosetechnology/Famix/issues/808" + + ^ FamixEsopeModel metamodel +] diff --git a/src/EsopeImporter/FamixEsopeImplicitPointer.extension.st b/src/EsopeImporter/FamixEsopeImplicitPointer.extension.st new file mode 100644 index 0000000..14648be --- /dev/null +++ b/src/EsopeImporter/FamixEsopeImplicitPointer.extension.st @@ -0,0 +1,8 @@ +Extension { #name : 'FamixEsopeImplicitPointer' } + +{ #category : '*EsopeImporter' } +FamixEsopeImplicitPointer class >> metamodel [ + "temporary solution to issue https://github.com/moosetechnology/Famix/issues/808" + + ^ FamixEsopeModel metamodel +] diff --git a/src/EsopeImporter/FamixEsopeImportingContext.extension.st b/src/EsopeImporter/FamixEsopeImportingContext.extension.st new file mode 100644 index 0000000..815a161 --- /dev/null +++ b/src/EsopeImporter/FamixEsopeImportingContext.extension.st @@ -0,0 +1,8 @@ +Extension { #name : 'FamixEsopeImportingContext' } + +{ #category : '*EsopeImporter' } +FamixEsopeImportingContext class >> metamodel [ + "temporary solution to issue https://github.com/moosetechnology/Famix/issues/808" + + ^ FamixEsopeModel metamodel +] diff --git a/src/EsopeImporter/FamixEsopeResolver.class.st b/src/EsopeImporter/FamixEsopeResolver.class.st index 707adf5..d278c1a 100644 --- a/src/EsopeImporter/FamixEsopeResolver.class.st +++ b/src/EsopeImporter/FamixEsopeResolver.class.st @@ -2,22 +2,24 @@ For symbol resolution " Class { - #name : #FamixEsopeResolver, - #superclass : #Object, + #name : 'FamixEsopeResolver', + #superclass : 'Object', #instVars : [ 'model', 'errorHandler' ], - #category : #'EsopeImporter-Importer' + #category : 'EsopeImporter-Importer', + #package : 'EsopeImporter', + #tag : 'Importer' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } FamixEsopeResolver class >> intrinsicRoutines [ ^#( abort . abs . access . achar . acos . adjustl . adjustr . aimag . aint . alarm . all . allocated . alog . alog10 . amax0 . amax1 . amin0 . amin1 . amod . and . anint . any . asin . associated . atan . atan2 . besj0 . besj1 . besjn . besy0 . besy1 . besyn . bit_size . btest . cabs . ccos . ceiling . cexp . char . chdir . chmod . clog . cmplx . complex . conjg . cos . cosh . count . cpu_time . cshift . csin . csqrt . ctime . ctime . dabs . dacos . dasin . datan . datan2 . date_and_time . dbesj0 . dbesj1 . dbesjn . dbesy0 . dbesy1 . dbesyn . dble . dcos . dcosh . ddim . derf . derfc . dexp . digits . dim . dint . dlog . dlog10 . dmax1 . dmin1 . dmod . dnint . dot_product . dprod . dsign . dsin . dsinh . dsqrt . dtan . dtanh . dtime . eoshift . epsilon . erf . erfc . etime . etime . exit . exp . exponent . fdate . fdate . fget . fgetc . float . floor . flush . fnum . fput . fputc . fraction . fseek . fstat . fstat . ftell . ftell . gerror . getarg . getcwd . getcwd . getenv . getgid . getlog . getpid . getuid . gmtime . hostnm . hostnm . huge . iabs . iachar . iand . iargc . ibclr . ibits . ibset . ichar . idate . idim . idint . idnint . ieor . ierrno . ifix . imag . imagpart . index . int . int2 . int8 . ior . irand . isatty . ishft . ishftc . isign . itime . kill . kind . lbound . len . len_trim . lge . lgt . link . lle . llt . lnblnk . loc . log . log10 . logical . long . lshift . lstat . lstat . ltime . matmul . max . max0 . max1 . maxexponent . maxloc . maxval . mclock . mclock8 . merge . min . min0 . min1 . minexponent . minloc . minval . mod . modulo . mvbits . nearest . nint . not . or . pack . perror . precision . present . product . radix . rand . random_number . random_seed . range . real . realpart . rename . repeat . reshape . rrspacing . rshift . scale . scan . second . second . selected_int_kind . selected_real_kind . set_exponent . shape . short . sign . signal . sin . sinh . sleep . sngl . spacing . spread . sqrt . srand . stat . stat . sum . symlnk . system . system_clock . tan . tanh . time . time8 . tiny . transfer . transpose . trim . ttynam . ttynam . ubound . umask . unlink . unpack . verify . write . xor . zabs . zcos . zexp . zlog . zsin . zsqrt ) ] -{ #category : #'private-helper' } +{ #category : 'private-helper' } FamixEsopeResolver class >> on: aMooseModel [ "Answer an instance with same model as aMooseModel." ^self new @@ -25,7 +27,7 @@ FamixEsopeResolver class >> on: aMooseModel [ yourself ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> ensureVariableNamed: variableName in: famixProgramUnit [ ^(self resolveVariableNamed: variableName in: famixProgramUnit) @@ -34,25 +36,25 @@ FamixEsopeResolver >> ensureVariableNamed: variableName in: famixProgramUnit [ ] -{ #category : #accessing } +{ #category : 'accessing' } FamixEsopeResolver >> errorHandler [ ^errorHandler ifNil: [ errorHandler := FortranErrorManager new ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixEsopeResolver >> errorHandler: anErrorHandler [ errorHandler := anErrorHandler ] -{ #category : #private } +{ #category : 'private' } FamixEsopeResolver >> isIntrinsicRoutine: invocated [ ^self class intrinsicRoutines includes: invocated entityName ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> makePointerVariableForEsopeCommand: esopeCmd [ "esopeCmd is a kind of Access where the variable is an Esope pointeur We need to: @@ -69,7 +71,7 @@ FamixEsopeResolver >> makePointerVariableForEsopeCommand: esopeCmd [ ] -{ #category : #private } +{ #category : 'private' } FamixEsopeResolver >> mergeVariable: variableToRemove into: variableToKeep [ "merge meaningfull properties from variableToRemove into variableToKeep then remove links between variableToRemove and other entities (associations are @@ -99,26 +101,26 @@ FamixEsopeResolver >> mergeVariable: variableToRemove into: variableToKeep [ model removeEntity: variableToRemove ] -{ #category : #accessing } +{ #category : 'accessing' } FamixEsopeResolver >> model [ ^ model ] -{ #category : #accessing } +{ #category : 'accessing' } FamixEsopeResolver >> model: anObject [ model := anObject ] -{ #category : #private } +{ #category : 'private' } FamixEsopeResolver >> newEntity: aFamixClass [ ^aFamixClass new mooseModel: model; yourself ] -{ #category : #run } +{ #category : 'run' } FamixEsopeResolver >> propagatePointerType [ (model allWithType: FamixEsopeCommand) do: [ :esopeCmd | @@ -128,7 +130,7 @@ FamixEsopeResolver >> propagatePointerType [ ] ] -{ #category : #run } +{ #category : 'run' } FamixEsopeResolver >> registerImplicitsDeclarations [ "find IMPLICIT declaration statements in all program units and register them in the respective implicitDictionary-s" @@ -140,7 +142,7 @@ FamixEsopeResolver >> registerImplicitsDeclarations [ ] ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> requalifyFunctionDeclaration: external [ "external declaration of function followed by a VariableDeclaration of the same function we simply remove the VariableDeclaration @@ -162,7 +164,7 @@ FamixEsopeResolver >> requalifyFunctionDeclaration: external [ ] ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> requalifyFunctionDeclarations [ "VariableDeclaration that are actually functions are simply removed We know it is a function because there is an 'external' declaration for that name" @@ -172,7 +174,7 @@ FamixEsopeResolver >> requalifyFunctionDeclarations [ ] ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> requalifyParameterDeclaration: param [ "looks for a VariableDeclaration in the same program unit with the same name then merge the VariableDeclaration into param, but keeping the declaredType @@ -188,7 +190,7 @@ FamixEsopeResolver >> requalifyParameterDeclaration: param [ ] ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> requalifyParameterDeclarations [ "For each parameter, try to find a matching VariableDeclaration to merge them together" @@ -197,7 +199,7 @@ FamixEsopeResolver >> requalifyParameterDeclarations [ ] ] -{ #category : #run } +{ #category : 'run' } FamixEsopeResolver >> requalifyVariableDeclarations [ "some LocalVariable entities are actually Functions for some other, there is a Parameter and a LocalVariable for the same Fortran entity" @@ -206,7 +208,7 @@ FamixEsopeResolver >> requalifyVariableDeclarations [ self requalifyFunctionDeclarations. ] -{ #category : #run } +{ #category : 'run' } FamixEsopeResolver >> resolve [ self resolvingSteps do: [ :step | @@ -216,7 +218,7 @@ FamixEsopeResolver >> resolve [ ] ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> resolveAccess: aFamixAccess [ "set #variable property of anAccess from the IASTVariable it contains. Might create a new Famix variable if none is found @@ -250,7 +252,7 @@ FamixEsopeResolver >> resolveAccess: aFamixAccess [ ] -{ #category : #run } +{ #category : 'run' } FamixEsopeResolver >> resolveAccesses [ "Access-es do not have #variable at this point but an IASTVariable sets the #variable property of all Access-es" @@ -259,7 +261,7 @@ FamixEsopeResolver >> resolveAccesses [ self resolveAccess: access ] ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> resolveAllVariablesNamed: variableName in: accessor [ | found | @@ -271,21 +273,21 @@ FamixEsopeResolver >> resolveAllVariablesNamed: variableName in: accessor [ ^found ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> resolveAsImplicitAttribute: variableName in: anAccessor [ ^(anAccessor allTypes flatCollect: [ :type | type attributes ]) select: [ :entity | entity name = variableName ] ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> resolveAsLocalVariable: variableName in: anAccessor [ ^anAccessor allLocalVariables select: [ :entity | entity name = variableName ] ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> resolveAttributeAccess: anAccess forPointer: aPointerVariable [ "resolve access to a segment attribute" @@ -299,7 +301,7 @@ FamixEsopeResolver >> resolveAttributeAccess: anAccess forPointer: aPointerVaria ] -{ #category : #run } +{ #category : 'run' } FamixEsopeResolver >> resolveDeclaredTypeOfPointers [ "sets the declaredType of pointers" @@ -318,7 +320,7 @@ FamixEsopeResolver >> resolveDeclaredTypeOfPointers [ ]. ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> resolveEsopeVariable: aFamixVariable [ "sets the declaredType of pointer esopeVariable" @@ -334,7 +336,7 @@ FamixEsopeResolver >> resolveEsopeVariable: aFamixVariable [ ifFound: [ :segment | aFamixVariable declaredType: segment ] ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> resolveImplicitFunctionType: function [ function declaredType: @@ -343,7 +345,7 @@ FamixEsopeResolver >> resolveImplicitFunctionType: function [ ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> resolveImplicitVariableType: aVariable [ "Tries to guess the type of an implicitly defined variable - can be a pointer to an Esope segment @@ -355,7 +357,7 @@ FamixEsopeResolver >> resolveImplicitVariableType: aVariable [ ] -{ #category : #run } +{ #category : 'run' } FamixEsopeResolver >> resolveImplicits [ "put a declaredType based on IMPLICIT declarations for all variables with no declaredType" @@ -377,7 +379,7 @@ FamixEsopeResolver >> resolveImplicits [ ] -{ #category : #run } +{ #category : 'run' } FamixEsopeResolver >> resolveIncludes [ "links FamixF77IncludedFile with the FamixF77Include_s that concern them" @@ -391,7 +393,7 @@ FamixEsopeResolver >> resolveIncludes [ ] ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> resolveInvocables: invocable [ (model allWithSubTypesOf: FamixF77PUProcedure) @@ -404,7 +406,7 @@ FamixEsopeResolver >> resolveInvocables: invocable [ ^nil ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> resolveInvocation: anInvocation [ | invocated | @@ -417,7 +419,7 @@ FamixEsopeResolver >> resolveInvocation: anInvocation [ ifTrue: [ anInvocation addCandidate: (model newIntrinsicRoutine name: invocated entityName) ] ] ] -{ #category : #run } +{ #category : 'run' } FamixEsopeResolver >> resolveInvocations [ (self model allWithType: FamixF77Invocation) do: [ :invocation | @@ -427,7 +429,7 @@ FamixEsopeResolver >> resolveInvocations [ ] ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> resolveTypeName: aName [ "Finds a FamixType from its name" @@ -438,7 +440,7 @@ FamixEsopeResolver >> resolveTypeName: aName [ ifNone: [ self model newTypeUnknown ] ] -{ #category : #'symbols resolution' } +{ #category : 'symbols resolution' } FamixEsopeResolver >> resolveVariableNamed: variableName in: accessor [ | found | found := self resolveAllVariablesNamed: variableName in: accessor. @@ -449,7 +451,7 @@ FamixEsopeResolver >> resolveVariableNamed: variableName in: accessor [ ^nil ] -{ #category : #run } +{ #category : 'run' } FamixEsopeResolver >> resolvingSteps [ ^ #( @@ -467,7 +469,7 @@ FamixEsopeResolver >> resolvingSteps [ ] -{ #category : #run } +{ #category : 'run' } FamixEsopeResolver >> setImplicitDeclaredType: anEntity in: owner [ "put a declaredType to anEntity based on IMPLICIT declarations in owner Note: implicit types are intrinsic types so we could simplify the use of #resolveTypeName: diff --git a/src/EsopeImporter/FamixEsopeSegment.extension.st b/src/EsopeImporter/FamixEsopeSegment.extension.st index 1064373..3a26f30 100644 --- a/src/EsopeImporter/FamixEsopeSegment.extension.st +++ b/src/EsopeImporter/FamixEsopeSegment.extension.st @@ -1,17 +1,24 @@ -Extension { #name : #FamixEsopeSegment } +Extension { #name : 'FamixEsopeSegment' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixEsopeSegment >> addLocalVariable: aVariable [ self addAttribute: aVariable ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixEsopeSegment >> isEsopeSegment [ ^true ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixEsopeSegment >> localVariableClass [ ^FamixFortranAttribute ] + +{ #category : '*EsopeImporter' } +FamixEsopeSegment class >> metamodel [ + "temporary solution to issue https://github.com/moosetechnology/Famix/issues/808" + + ^ FamixEsopeModel metamodel +] diff --git a/src/EsopeImporter/FamixF03DerivedType.extension.st b/src/EsopeImporter/FamixF03DerivedType.extension.st new file mode 100644 index 0000000..5f75faa --- /dev/null +++ b/src/EsopeImporter/FamixF03DerivedType.extension.st @@ -0,0 +1,8 @@ +Extension { #name : 'FamixF03DerivedType' } + +{ #category : '*EsopeImporter' } +FamixF03DerivedType class >> metamodel [ + "temporary solution to issue https://github.com/moosetechnology/Famix/issues/808" + + ^ FamixF03Model metamodel +] diff --git a/src/EsopeImporter/FamixF03Module.extension.st b/src/EsopeImporter/FamixF03Module.extension.st new file mode 100644 index 0000000..623c2ec --- /dev/null +++ b/src/EsopeImporter/FamixF03Module.extension.st @@ -0,0 +1,8 @@ +Extension { #name : 'FamixF03Module' } + +{ #category : '*EsopeImporter' } +FamixF03Module class >> metamodel [ + "temporary solution to issue https://github.com/moosetechnology/Famix/issues/808" + + ^ FamixF03Model metamodel +] diff --git a/src/EsopeImporter/FamixF77Access.extension.st b/src/EsopeImporter/FamixF77Access.extension.st index 99fe047..6ed5a24 100644 --- a/src/EsopeImporter/FamixF77Access.extension.st +++ b/src/EsopeImporter/FamixF77Access.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixF77Access } +Extension { #name : 'FamixF77Access' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77Access >> famixImportSanityCheck [ super famixImportSanityCheck. diff --git a/src/EsopeImporter/FamixF77Entity.extension.st b/src/EsopeImporter/FamixF77Entity.extension.st index 8c1a910..91d2c6c 100644 --- a/src/EsopeImporter/FamixF77Entity.extension.st +++ b/src/EsopeImporter/FamixF77Entity.extension.st @@ -1,17 +1,17 @@ -Extension { #name : #FamixF77Entity } +Extension { #name : 'FamixF77Entity' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77Entity >> famixImportSanityCheck [ "nothing special by default" ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77Entity >> isEsopeSegment [ ^false ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77Entity >> sanityCheck: aBlock description: aString [ "copied from Object>>assert:description: with our own exception" diff --git a/src/EsopeImporter/FamixF77IncludedFile.extension.st b/src/EsopeImporter/FamixF77IncludedFile.extension.st index 49b9c92..7bf19bc 100644 --- a/src/EsopeImporter/FamixF77IncludedFile.extension.st +++ b/src/EsopeImporter/FamixF77IncludedFile.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixF77IncludedFile } +Extension { #name : 'FamixF77IncludedFile' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77IncludedFile >> allTypes [ "empty collection because because members of included files are treated by the including files" @@ -8,7 +8,7 @@ FamixF77IncludedFile >> allTypes [ ^#() ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77IncludedFile >> createUnresolveVariable: variableName with: resolver [ "If a variable was not resolved within the IncludedFile, it means it depends on its includer to define this variable. @@ -18,7 +18,7 @@ FamixF77IncludedFile >> createUnresolveVariable: variableName with: resolver [ ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77IncludedFile >> famixImportSanityCheck [ super famixImportSanityCheck. diff --git a/src/EsopeImporter/FamixF77IntrinsicRoutine.extension.st b/src/EsopeImporter/FamixF77IntrinsicRoutine.extension.st index 6943ee5..052a98a 100644 --- a/src/EsopeImporter/FamixF77IntrinsicRoutine.extension.st +++ b/src/EsopeImporter/FamixF77IntrinsicRoutine.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixF77IntrinsicRoutine } +Extension { #name : 'FamixF77IntrinsicRoutine' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77IntrinsicRoutine >> famixImportSanityCheck [ "not calling super because does not have a parent Programfile" diff --git a/src/EsopeImporter/FamixF77Invocation.extension.st b/src/EsopeImporter/FamixF77Invocation.extension.st index bb7077f..720d1a0 100644 --- a/src/EsopeImporter/FamixF77Invocation.extension.st +++ b/src/EsopeImporter/FamixF77Invocation.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixF77Invocation } +Extension { #name : 'FamixF77Invocation' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77Invocation >> famixImportSanityCheck [ | sig | diff --git a/src/EsopeImporter/FamixF77PUBlockdata.extension.st b/src/EsopeImporter/FamixF77PUBlockdata.extension.st index abbca61..fb3d4ee 100644 --- a/src/EsopeImporter/FamixF77PUBlockdata.extension.st +++ b/src/EsopeImporter/FamixF77PUBlockdata.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixF77PUBlockdata } +Extension { #name : 'FamixF77PUBlockdata' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77PUBlockdata >> resolveVariable: variableName with: resolver [ self shouldBeImplemented diff --git a/src/EsopeImporter/FamixF77PUFunction.extension.st b/src/EsopeImporter/FamixF77PUFunction.extension.st index d0fab9c..0470917 100644 --- a/src/EsopeImporter/FamixF77PUFunction.extension.st +++ b/src/EsopeImporter/FamixF77PUFunction.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixF77PUFunction } +Extension { #name : 'FamixF77PUFunction' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77PUFunction >> famixImportSanityCheck [ super famixImportSanityCheck. diff --git a/src/EsopeImporter/FamixF77PUMain.extension.st b/src/EsopeImporter/FamixF77PUMain.extension.st index 71b6d41..ca1c950 100644 --- a/src/EsopeImporter/FamixF77PUMain.extension.st +++ b/src/EsopeImporter/FamixF77PUMain.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixF77PUMain } +Extension { #name : 'FamixF77PUMain' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77PUMain >> allTypes [ self flag: #FIXME. "Find better way to flatmap types" diff --git a/src/EsopeImporter/FamixF77PUProcedure.extension.st b/src/EsopeImporter/FamixF77PUProcedure.extension.st index d6a2482..4262621 100644 --- a/src/EsopeImporter/FamixF77PUProcedure.extension.st +++ b/src/EsopeImporter/FamixF77PUProcedure.extension.st @@ -1,13 +1,13 @@ -Extension { #name : #FamixF77PUProcedure } +Extension { #name : 'FamixF77PUProcedure' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77PUProcedure >> allLocalVariables [ ^self parameters , super allLocalVariables ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77PUProcedure >> allTypes [ self flag: #FIXME. "Find better way to flatmap types" diff --git a/src/EsopeImporter/FamixF77Parameter.extension.st b/src/EsopeImporter/FamixF77Parameter.extension.st index df78974..6ecf457 100644 --- a/src/EsopeImporter/FamixF77Parameter.extension.st +++ b/src/EsopeImporter/FamixF77Parameter.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixF77Parameter } +Extension { #name : 'FamixF77Parameter' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77Parameter >> famixImportSanityCheck [ super famixImportSanityCheck. diff --git a/src/EsopeImporter/FamixF77ProgramUnit.extension.st b/src/EsopeImporter/FamixF77ProgramUnit.extension.st index c50573a..38bed0d 100644 --- a/src/EsopeImporter/FamixF77ProgramUnit.extension.st +++ b/src/EsopeImporter/FamixF77ProgramUnit.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixF77ProgramUnit } +Extension { #name : 'FamixF77ProgramUnit' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> allDeclaredTypesInMyScope [ "returns all types declared directly in receiver or in the files it includes" @@ -15,7 +15,7 @@ FamixF77ProgramUnit >> allDeclaredTypesInMyScope [ ^return asOrderedCollection ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> allLocalVariables [ ^self localVariables @@ -29,7 +29,7 @@ FamixF77ProgramUnit >> allLocalVariables [ ) ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> createUnresolveVariable: variableName with: resolver [ "If the variable could not be resolved within an access, it means it is a use of an implicit variable @@ -50,7 +50,7 @@ FamixF77ProgramUnit >> createUnresolveVariable: variableName with: resolver [ ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> defaultImplicit [ ^ (($a to: $z) collect: [ :char | @@ -60,7 +60,7 @@ FamixF77ProgramUnit >> defaultImplicit [ ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> famixImportSanityCheck [ super famixImportSanityCheck. @@ -68,13 +68,13 @@ FamixF77ProgramUnit >> famixImportSanityCheck [ self sanityCheck: programFile isNotNil description: name , ' without parent ProgramFile'. ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> implicitDictionary [ ^ self attributeAt: #implicitDictionary ifAbsentPut: [ self defaultImplicit ] ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> implicitFortranTypeFor: variableName [ self implicitDictionary @@ -84,7 +84,7 @@ FamixF77ProgramUnit >> implicitFortranTypeFor: variableName [ ^nil ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> implicitSegmentTypeFor: variableName [ self implicitDictionary @@ -94,7 +94,7 @@ FamixF77ProgramUnit >> implicitSegmentTypeFor: variableName [ ^nil ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> implicitTypeFor: variableName [ "find a type according to the first letter of the variable's name - first search for a segment with that (full) name @@ -109,19 +109,19 @@ FamixF77ProgramUnit >> implicitTypeFor: variableName [ ^FamixF77TypeUnknown defaultName ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> implicits [ ^ self attributeAt: #implicits ifAbsent: [ #() ] ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> localVariableClass [ ^FamixF77Variable ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> registerImplicit: iASTTypeRef range: aRange [ "for letters in aRange register in receiver's implicit dictionary the corresponding iASTTypeRef" @@ -138,7 +138,7 @@ FamixF77ProgramUnit >> registerImplicit: iASTTypeRef range: aRange [ ] ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> registerImplicitSegment: famixType [ "registers in the receiver's implicit dictionary the famixType (which should be an EsopeSegment) If the segment's name is one character, it could be confused for a Fortran IMPLICIT declaration" @@ -151,7 +151,7 @@ FamixF77ProgramUnit >> registerImplicitSegment: famixType [ ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> registerImplicits [ "find all IMPLICIT declaration statement in receiver and register them in its implicitDictionary @@ -176,7 +176,7 @@ FamixF77ProgramUnit >> registerImplicits [ ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> removeFortranImplicits [ "Removes allimplicit declaration for Fortran type They are recognized because the key is a letter, not a string" @@ -186,7 +186,7 @@ FamixF77ProgramUnit >> removeFortranImplicits [ ifTrue: [ self implicitDictionary removeKey: association key ] ] ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77ProgramUnit >> symbolTable [ self flag: 'TO REMOVE?'. diff --git a/src/EsopeImporter/FamixF77StatementFunction.extension.st b/src/EsopeImporter/FamixF77StatementFunction.extension.st index 7954800..d3e9ee0 100644 --- a/src/EsopeImporter/FamixF77StatementFunction.extension.st +++ b/src/EsopeImporter/FamixF77StatementFunction.extension.st @@ -1,18 +1,18 @@ -Extension { #name : #FamixF77StatementFunction } +Extension { #name : 'FamixF77StatementFunction' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77StatementFunction >> allLocalVariables [ ^self parameters ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77StatementFunction >> allTypes [ ^#() ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77StatementFunction >> createUnresolveVariable: variableName with: resolver [ "StatementFunctions have Parameters and no LocalVariable, unresolved accesses may be found in their parentEntity" @@ -21,7 +21,7 @@ FamixF77StatementFunction >> createUnresolveVariable: variableName with: resolve ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77StatementFunction >> famixImportSanityCheck [ super famixImportSanityCheck. @@ -29,13 +29,13 @@ FamixF77StatementFunction >> famixImportSanityCheck [ self sanityCheck: parentEntity isNotNil description: 'StatementFunction without parentEntity'. ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77StatementFunction >> implicitDictionary [ ^parentEntity implicitDictionary ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77StatementFunction >> implicitTypeFor: variableName [ "statementFunction cannot declare IMPLICIT statement or declare SEGMENT, therefore delegate this message to the parentEntity" diff --git a/src/EsopeImporter/FamixF77TypeUnknown.extension.st b/src/EsopeImporter/FamixF77TypeUnknown.extension.st index 378b4c9..7c41392 100644 --- a/src/EsopeImporter/FamixF77TypeUnknown.extension.st +++ b/src/EsopeImporter/FamixF77TypeUnknown.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #FamixF77TypeUnknown } +Extension { #name : 'FamixF77TypeUnknown' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77TypeUnknown class >> defaultName [ ^#unknownType ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77TypeUnknown >> initialize [ super initialize. diff --git a/src/EsopeImporter/FamixF77UnknownVariable.extension.st b/src/EsopeImporter/FamixF77UnknownVariable.extension.st index 17c3158..970daf4 100644 --- a/src/EsopeImporter/FamixF77UnknownVariable.extension.st +++ b/src/EsopeImporter/FamixF77UnknownVariable.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixF77UnknownVariable } +Extension { #name : 'FamixF77UnknownVariable' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77UnknownVariable >> famixImportSanityCheck [ super famixImportSanityCheck. diff --git a/src/EsopeImporter/FamixF77Variable.extension.st b/src/EsopeImporter/FamixF77Variable.extension.st index e9cc19d..0787877 100644 --- a/src/EsopeImporter/FamixF77Variable.extension.st +++ b/src/EsopeImporter/FamixF77Variable.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixF77Variable } +Extension { #name : 'FamixF77Variable' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77Variable >> famixImportSanityCheck [ super famixImportSanityCheck. @@ -9,13 +9,13 @@ FamixF77Variable >> famixImportSanityCheck [ self sanityCheck: declaredType isNotNil description: 'Variable ', name , ' without declaredType'. ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77Variable >> segment [ ^self attributeAt: #segmentName ifAbsent: [ nil ] ] -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixF77Variable >> segment: aString [ ^self attributeAt: #segmentName put: aString diff --git a/src/EsopeImporter/FamixFortranAttribute.extension.st b/src/EsopeImporter/FamixFortranAttribute.extension.st index e624199..5edf947 100644 --- a/src/EsopeImporter/FamixFortranAttribute.extension.st +++ b/src/EsopeImporter/FamixFortranAttribute.extension.st @@ -1,9 +1,16 @@ -Extension { #name : #FamixFortranAttribute } +Extension { #name : 'FamixFortranAttribute' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixFortranAttribute >> famixImportSanityCheck [ "not calling super because does not have a parentBehaviouralEntity" self sanityCheck: parentType isNotNil description: 'Attribute ', name , ' without parentType'. self sanityCheck: declaredType isNotNil description: 'Attribute ', name , ' without declaredType'. ] + +{ #category : '*EsopeImporter' } +FamixFortranAttribute class >> metamodel [ + "temporary solution to issue https://github.com/moosetechnology/Famix/issues/808" + + ^ FamixFortranModel metamodel +] diff --git a/src/EsopeImporter/FamixFortranEntity.extension.st b/src/EsopeImporter/FamixFortranEntity.extension.st index c48cfd2..9b544e3 100644 --- a/src/EsopeImporter/FamixFortranEntity.extension.st +++ b/src/EsopeImporter/FamixFortranEntity.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixFortranEntity } +Extension { #name : 'FamixFortranEntity' } -{ #category : #'*EsopeImporter' } +{ #category : '*EsopeImporter' } FamixFortranEntity >> famixImportSanityCheck [ "nothing special by default" ] diff --git a/src/EsopeImporter/FamixFortranUserDefinedType.extension.st b/src/EsopeImporter/FamixFortranUserDefinedType.extension.st new file mode 100644 index 0000000..d8a6d91 --- /dev/null +++ b/src/EsopeImporter/FamixFortranUserDefinedType.extension.st @@ -0,0 +1,8 @@ +Extension { #name : 'FamixFortranUserDefinedType' } + +{ #category : '*EsopeImporter' } +FamixFortranUserDefinedType class >> metamodel [ + "temporary solution to issue https://github.com/moosetechnology/Famix/issues/808" + + ^ FamixFortranModel metamodel +] diff --git a/src/EsopeImporter/FortranAbstractJsonVisitor.class.st b/src/EsopeImporter/FortranAbstractJsonVisitor.class.st index 2eb8b02..a67580a 100644 --- a/src/EsopeImporter/FortranAbstractJsonVisitor.class.st +++ b/src/EsopeImporter/FortranAbstractJsonVisitor.class.st @@ -4,12 +4,14 @@ An abstrat visitor for the JSON output of [camfort/fortran-src](https://github.c Defines all the needed `#visitXYZ:` methods and go to the JSON tree " Class { - #name : #FortranAbstractJsonVisitor, - #superclass : #Object, - #category : #'EsopeImporter-Visitor' + #name : 'FortranAbstractJsonVisitor', + #superclass : 'Object', + #category : 'EsopeImporter-Visitor', + #package : 'EsopeImporter', + #tag : 'Visitor' } -{ #category : #'private - helpers' } +{ #category : 'private - helpers' } FortranAbstractJsonVisitor >> esopeCommand: anEsopeCommentString [ "returns a collection of 2 words: {'command' . 'argument'} first word after Esope marker is the 'command', after comes the 'argument'" @@ -25,7 +27,7 @@ FortranAbstractJsonVisitor >> esopeCommand: anEsopeCommentString [ ifFalse: [ { anEsopeCommentString copyFrom: wordBoundaries first to: wordBoundaries second } ] ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> esopeExtraSpan: commentSpan comment: commentText command: esopeCommand [ "Compute the span of just the Esope command (without 'C@_ ') - same start line @@ -40,7 +42,7 @@ FortranAbstractJsonVisitor >> esopeExtraSpan: commentSpan comment: commentText c ] -{ #category : #'private - helpers' } +{ #category : 'private - helpers' } FortranAbstractJsonVisitor >> findWordBoundaries: anEsopeCommentString [ "search for word boundaries starting from 6th position" @@ -78,19 +80,19 @@ FortranAbstractJsonVisitor >> findWordBoundaries: anEsopeCommentString [ ^ wordBoundaries ] -{ #category : #testing } +{ #category : 'testing' } FortranAbstractJsonVisitor >> isEsopeComment: aCommentString [ ^aCommentString asLowercase beginsWith: '@_' ] -{ #category : #testing } +{ #category : 'testing' } FortranAbstractJsonVisitor >> isEsopeTransformation: aString [ aString isString ifFalse: [ ^ false ]. ^ #( #d__ #s__ ) includes: aString ] -{ #category : #testing } +{ #category : 'testing' } FortranAbstractJsonVisitor >> isTaggedStatement: aStatementNode [ "If aStatementNode has already a statement, no need to do (aStatementNode at: 'statement')" @@ -99,7 +101,7 @@ FortranAbstractJsonVisitor >> isTaggedStatement: aStatementNode [ includesKey: 'tag' ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> processEsopeComment: anEsopeCommentNode [ "For Esope comments the treatment is similar for most of them We also return 2 spans: @@ -119,27 +121,27 @@ FortranAbstractJsonVisitor >> processEsopeComment: anEsopeCommentNode [ , esopeCommand ] -{ #category : #helpers } +{ #category : 'helpers' } FortranAbstractJsonVisitor >> processEsopeIfComment: anEsopeIfCommentNode [ self shouldBeImplemented. ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitAddition: anAdditionOperatorNode [ ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitAnd: anAndOperatorNode [ ^ '.and.' ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitArgs: anEntryArgsList [ anEntryArgsList ifNil: [ ^#() ]. ^(anEntryArgsList at: 'list') collect: [ :each | self visitJsonElement: each] ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitArgument: anArgumentNode [ "used for argument in subprogram calls and parameter in subprogram definition So can take different forms :-(" @@ -149,38 +151,38 @@ FortranAbstractJsonVisitor >> visitArgument: anArgumentNode [ ifFalse: [ self visitJsonMap: anArgumentNode keys: #(span expr) ] ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitArguments: anArgumentList [ anArgumentList ifNil: [ ^#() ]. ^(anArgumentList at: 'list') collect: [ :each | self visitArgument: each] ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitArrayDeclarationDim: arrayDeclarationDim [ ^self visitJsonMap: arrayDeclarationDim keys: #(span lower upper) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitArrayDeclarationDims: arrayDeclarationDimsList [ ^arrayDeclarationDimsList collect: [ :each | self visitArrayDeclarationDim: each ] ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitArrayDimensionBoundary: aLimit [ ^ aLimit ifNotNil: [ self visitJsonMap: aLimit ] ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitAssign_expression: anAssignExpressionNode [ ^self visitJsonMap: anAssignExpressionNode keys: #(span target expression) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitAssign_expressionStatement: anAssignExpressionNode [ "assign_expression and assign_expressionStatement are the same" @@ -188,82 +190,82 @@ FortranAbstractJsonVisitor >> visitAssign_expressionStatement: anAssignExpressio ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitAttributes: aNode [ ^nil ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitBackspaceStatement: aBackspaceStatementNode [ ^self visitJsonMap: aBackspaceStatementNode keys: #( span specification ) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitBase_type: aString [ "to offer the possibility to handle each baseType differently, we create #visitXYZBaseType: methods" ^ self visitKey: aString , 'BaseType' value: aString ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitBinary: aBinaryExpressionNode [ ^self visitJsonMap: aBinaryExpressionNode keys: #( span left op right) ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitBlockDataBlocks: aBlockDataBlockList [ "a BlockData contains a list of 'statement' which are tagged 'common' " ^aBlockDataBlockList collect: [ :each | self visitJsonElement: each ] ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitBlock_data: aBlockDataNode [ ^(self visitJsonMap: aBlockDataNode keys: #(span name)) , { self visitBlockDataBlocks: (aBlockDataNode at: 'blocks') } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitBlocks: aBlockList [ ^self visitBody: aBlockList ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitBody: aNode [ aNode ifNil: [ ^#() ]. ^self visitJsonElement: aNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitCall: aCallNode [ ^self visitCallStatement: aCallNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitCallStatement: aCallStatementNode [ ^self visitJsonMap: aCallStatementNode keys: #(span function arguments) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitCharacterBaseType: aString [ ^aString ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitCloseStatement: aCloseStatementNode [ ^self visitJsonMap: aCloseStatementNode keys: #( span specification ) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitComment: aCommentNode [ "Separates comments that are genuine fortran comments and the one that contain Esope commands" | content | @@ -275,7 +277,7 @@ FortranAbstractJsonVisitor >> visitComment: aCommentNode [ ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitCommonGroup: aCommonGroupNode [ ^{ self visitSpan: (aCommonGroupNode at: 'span') . @@ -284,7 +286,7 @@ FortranAbstractJsonVisitor >> visitCommonGroup: aCommonGroupNode [ } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitCommonGroupName: aCommonGroupNameNode [ ^aCommonGroupNameNode ifNil: [ nil ] @@ -296,51 +298,51 @@ FortranAbstractJsonVisitor >> visitCommonGroupName: aCommonGroupNameNode [ ] ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitCommonGroupVars: aCommonGroupVarList [ ^aCommonGroupVarList collect: [ :each | self visitDeclarator: each ] ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitCommonStatement: aCommonStatementNode [ ^self visitJsonMap: aCommonStatementNode keys: #(span common_groups) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitCommon_groups: aCommonGroupsNode [ ^(aCommonGroupsNode at: 'list') collect: [ :each | self visitCommonGroup: each ] ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitComplexBaseType: aString [ ^aString ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitConcatenation: anConcatenationOperatorNode [ ^ '//' ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitCondition: aLogicalIfConditionNode [ ^ self visitIfCondition: aLogicalIfConditionNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitConditions: aConditionList [ ^aConditionList collect: [ :aCondition | { self visitIfCondition: aCondition first . self visitThenPart: aCondition second } ] ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitContinueStatement: aContinueStatementNode [ ^self visitSpan: (aContinueStatementNode at: 'span') ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDataGroup: aDataGroup [ ^{ @@ -350,24 +352,24 @@ FortranAbstractJsonVisitor >> visitDataGroup: aDataGroup [ } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDataGroupInitializers: initializersCollection [ ^self visitJsonArray: (initializersCollection at: #list) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDataGroupNames: namesCollection [ ^self visitJsonArray: (namesCollection at: #list) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDataStatement: aDataStatement [ ^self visitJsonMap: aDataStatement keys: #(span data_groups) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitData_groups: dataGroupCollection [ ^{ @@ -379,7 +381,7 @@ FortranAbstractJsonVisitor >> visitData_groups: dataGroupCollection [ } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDeclarationStatement: aDeclarationStatementNode [ "tagged element 'declaration'" @@ -387,7 +389,7 @@ FortranAbstractJsonVisitor >> visitDeclarationStatement: aDeclarationStatementNo ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDeclarator: aDeclaratorNode [ "visit method for the last two have special names - 'type' contains a string which is not compatible with #visitType: @@ -400,13 +402,13 @@ FortranAbstractJsonVisitor >> visitDeclarator: aDeclaratorNode [ self visitDeclaratorVariable: (aDeclaratorNode at: 'variable') } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDeclaratorType: aString [ "Note: this is not the data type of a declared variable but something like 'scalar'" ^aString ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDeclaratorVariable: aDeclaratorVariableNode [ ^{ @@ -415,12 +417,12 @@ FortranAbstractJsonVisitor >> visitDeclaratorVariable: aDeclaratorVariableNode [ } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDeclaratorVariableContent: aString [ ^aString ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDeclarators: aDeclaratorsList [ "visit span and list of declarators" @@ -431,67 +433,67 @@ FortranAbstractJsonVisitor >> visitDeclarators: aDeclaratorsList [ ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitDeref: aDerefNode [ ^self visitJsonMap: aDerefNode keys: #(span expression field) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDimensionStatement: aDimensionStatementNode [ ^self visitJsonMap: aDimensionStatementNode keys: #(span declarators) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDims: anArrayDeclarationDimsNode [ ^self visitArrayDeclarationDims: (anArrayDeclarationDimsNode at: #list) ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitDivision: aDivisionOperatorNode [ ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDo: aDoNode [ ^self visitJsonMap: aDoNode keys: #(span label do_spec target body end_label) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitDo_spec: aDoSpecNode [ ^self visitJsonMap: aDoSpecNode keys: #(span initial limit increment) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitElements: anImplicitElementsNode [ ^(anImplicitElementsNode at: 'list') collect: [ :each | self visitImplicitStatementRange: each ] ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitEnd_label: aValueNode [ ^self visitJsonElement: aValueNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitEntryStatement: anEntryNode [ ^self visitJsonMap: anEntryNode keys: #(span name args return) ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitEq: anEqualtoOperatorNode [ ^ '.eq.' ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitEqualLabel: aLabelReference [ ^self visitLabelReference: aLabelReference ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitEquivalenceGroup: equivalenceGroupNode [ ^{ @@ -501,19 +503,19 @@ FortranAbstractJsonVisitor >> visitEquivalenceGroup: equivalenceGroupNode [ } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitEquivalenceStatement: anEquivalenceStatementNode [ ^self visitJsonMap: anEquivalenceStatementNode keys: #(span groups) ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitEqv: aEqvtoOperatorNode [ ^ '.eqv.' ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> visitEsopeComment: anEsopeCommentNode [ "we separate each Esope command in a different visit methdo to give opportunity to concrete visitors (subclasses) to treat them differently. @@ -527,7 +529,7 @@ FortranAbstractJsonVisitor >> visitEsopeComment: anEsopeCommentNode [ ^ self visitKey: key value: anEsopeCommentNode ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> visitEsopeEndComment: anEsopeCommentNode [ "delegate to a method with a more explicit name subclasses should override #visitEsopeEndSegmentComment: not this method" @@ -535,80 +537,80 @@ FortranAbstractJsonVisitor >> visitEsopeEndComment: anEsopeCommentNode [ ^self visitEsopeEndsegmentComment: anEsopeCommentNode ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> visitEsopeEndsegmentComment: anEsopeCommentNode [ ^self processEsopeComment: anEsopeCommentNode ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitEsopeIfComment: anEsopeIfCommentNode [ ^self processEsopeIfComment: anEsopeIfCommentNode ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> visitEsopeIncludeComment: anEsopeIncludeCommentNode [ ^self processEsopeComment: anEsopeIncludeCommentNode ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> visitEsopePointeurComment: anEsopeCommentNode [ ^self processEsopeComment: anEsopeCommentNode ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> visitEsopeSegactComment: anEsopeCommentNode [ ^self processEsopeComment: anEsopeCommentNode ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> visitEsopeSegadjComment: anEsopeCommentNode [ ^self processEsopeComment: anEsopeCommentNode ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> visitEsopeSegdesComment: anEsopeCommentNode [ ^self processEsopeComment: anEsopeCommentNode ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> visitEsopeSeginiComment: anEsopeCommentNode [ ^self processEsopeComment: anEsopeCommentNode ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> visitEsopeSegmentComment: anEsopeCommentNode [ ^self processEsopeComment: anEsopeCommentNode ] -{ #category : #'visiting esope' } +{ #category : 'visiting esope' } FortranAbstractJsonVisitor >> visitEsopeSegsupComment: anEsopeCommentNode [ ^self processEsopeComment: anEsopeCommentNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitExitStatement: anExitNode [ ^self visitJsonMap: anExitNode keys: #(span var) ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitExponent: aRealLiteralExponentNode [ ^(aRealLiteralExponentNode at: #num) = '0' @@ -622,11 +624,11 @@ FortranAbstractJsonVisitor >> visitExponent: aRealLiteralExponentNode [ ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitExponentiation: aExponentiationOperatorNode [ ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitExpr: anExprNode [ "Typically a node contains a key 'expr' with value a dictionary containing a tag 'expr' therefore a 1st #visitExpr: will end up calling a 2nd #visitExpr: @@ -636,47 +638,47 @@ FortranAbstractJsonVisitor >> visitExpr: anExprNode [ ifFalse: [ self visitJsonElement: (anExprNode at: 'contents') ] ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitExpression: aExpressionNode [ ^self visitJsonElement: aExpressionNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitExternalStatement: anExternalStatementNode [ ^ self visitJsonMap: anExternalStatementNode keys: #( span vars ) ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitFalseLiteralValue: aString [ "Camfort puts 'false' so we return the normal Fortran value instead" ^'.false.' ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitField: aFieldNode [ ^self visitJsonElement: aFieldNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitFormat: aFormatDescription [ "formatDescription is a String" ^aFormatDescription ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitFormatArgument: aFormatArgumentNode [ ^self visitArgument: aFormatArgumentNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitFormatStatement: aFormatStatement [ ^self visitJsonMap: aFormatStatement keys: #(span format) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitFortranComment: aFortranCommentNode [ "A real Fortran comment as opposed to a comment that contains an Esope command cannot call visitJsonMap: because contains a key 'comment' that would recursively loop on this method" @@ -686,13 +688,13 @@ FortranAbstractJsonVisitor >> visitFortranComment: aFortranCommentNode [ ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitFrom: aString [ "start of a range for an implicit statement: a string of one character" ^aString ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitFunction: aFunctionNode [ ^(aFunctionNode includesKey: 'blocks') ifTrue: [ self visitFunctionWithBlocks: aFunctionNode ] @@ -700,26 +702,26 @@ FortranAbstractJsonVisitor >> visitFunction: aFunctionNode [ ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitFunctionAsValue: aFunctionNode [ ^{self visitSpan: (aFunctionNode at: 'span') . self visitFunctionCalledName: (aFunctionNode at: 'value' at: 'contents') } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitFunctionCalledName: aString [ ^aString ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitFunctionParameters: aParameterList [ aParameterList ifNil: [ ^#() ]. ^self visitJsonArray: (aParameterList at: #list) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitFunctionStatement: aFunctionStatementNode [ "'name' is an object, not a string so, cannot call #visitName: on it" ^{ self visitSpan: (aFunctionStatementNode at: 'span') . @@ -728,13 +730,13 @@ FortranAbstractJsonVisitor >> visitFunctionStatement: aFunctionStatementNode [ self visitFunctionStatementBody: (aFunctionStatementNode at: 'body') } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitFunctionStatementBody: aNode [ "a specific method for function statement body which contains only 1 statement" ^self visitJsonElement: aNode ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitFunctionWithBlocks: aFunctionNode [ ^{ @@ -754,30 +756,30 @@ FortranAbstractJsonVisitor >> visitFunctionWithBlocks: aFunctionNode [ ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitFunction_call: aFunctionCallNode [ ^self visitJsonMap: aFunctionCallNode keys: #(span function arguments) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitGotoStatement: aGotoStatementNode [ ^self visitJsonMap: aGotoStatementNode keys: #(span target) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitGoto_computedStatement: aGotoComputedStatementNode [ ^self visitJsonMap: aGotoComputedStatementNode keys: #(span labels target) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitGreaterLabel: aLabelReference [ ^self visitLabelReference: aLabelReference ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitGroups: anEquivalenceGroupCollection [ ^{ @@ -789,31 +791,31 @@ FortranAbstractJsonVisitor >> visitGroups: anEquivalenceGroupCollection [ } ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitGt: aGreaterthanOperatorNode [ ^ '.gt.' ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitGte: anOperatorNode [ ^ '.ge.' ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitIOParameter: anIOParameterNode [ ^self visitJsonMap: anIOParameterNode keys: #(span name expr) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitIOParameters: anIOParametersCollection [ ^(anIOParametersCollection at: 'list') collect: [ :each | self visitIOParameter: each ] ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitIf: anIfNode [ "The THEN-Part is in 'conditions', the ELSE-PART in 'blocks', if no ELSE-PART, then 'blocks' is nil' ignoring key: end_label" @@ -822,12 +824,12 @@ FortranAbstractJsonVisitor >> visitIf: anIfNode [ ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitIfCondition: anIfConditionNode [ ^self visitJsonElement: anIfConditionNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitIf_arithmeticStatement: anIfArithmeticStatement [ ^(self visitJsonMap: anIfArithmeticStatement keys: #(span expression)) , @@ -838,7 +840,7 @@ FortranAbstractJsonVisitor >> visitIf_arithmeticStatement: anIfArithmeticStateme } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitIf_logicalStatement: anIfNode [ "the statement part is special, it has no 'label', so we cannot use the default visit_statement:" @@ -848,18 +850,18 @@ FortranAbstractJsonVisitor >> visitIf_logicalStatement: anIfNode [ { (self visitJsonTaggedStatement: (anIfNode at: #statement)) } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitImplicitStatement: anImplicitStatementNode [ ^self visitJsonMap: anImplicitStatementNode keys: #(span items) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitImplicitStatementRange: anImplicitStatementRangeNode [ ^self visitJsonMap: anImplicitStatementRangeNode keys: #(span from to) ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitImplied_do: anImpliedDoListsNode [ ^{ self visitSpan: (anImpliedDoListsNode at: 'span') . @@ -870,31 +872,31 @@ FortranAbstractJsonVisitor >> visitImplied_do: anImpliedDoListsNode [ collect: [ :expr | self visitJsonMap: expr ]) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitIncrement: anIncrementNode [ ^self visitJsonElement: anIncrementNode ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitIndex: anArrayIndexNode [ ^self visitJsonElement: anArrayIndexNode ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitIndices: anArrayIndicesNode [ ^self visitJsonArray: (anArrayIndicesNode at: 'list') ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitInitial: anInitialNode [ "DO statement initialization, a tagged JSon entity that will redirect to #visitAssign_expression:" ^self visitJsonElement: anInitialNode ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitInquireStatement: anInquireStatement [ ^{ @@ -903,36 +905,36 @@ FortranAbstractJsonVisitor >> visitInquireStatement: anInquireStatement [ } ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitInteger: anIntegerNode [ "to be more explicit, Integer nodes are 'transformed' in IntegerLiteralValue nodes" ^self visitIntegerLiteralValue: (anIntegerNode at: 'contents') ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitIntegerBaseType: aString [ ^aString ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitIntegerLiteralValue: anIntegerLiteralValueNode [ ^anIntegerLiteralValueNode first ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitIntrinsic: anIntrinsicIdentifier [ ^anIntrinsicIdentifier at: 'contents' ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitIntrinsicStatement: anIntrinsicStatement [ ^self visitJsonMap: anIntrinsicStatement keys: #(span vars) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitItems: anImplicitItemsNode [ "'items' in implicit statement" @@ -951,19 +953,19 @@ FortranAbstractJsonVisitor >> visitItems: anImplicitItemsNode [ ] ] -{ #category : #'visiting reflectivity' } +{ #category : 'visiting reflectivity' } FortranAbstractJsonVisitor >> visitJsonArray: aCollection [ ^aCollection collect: [ :each | self visitJsonElement: each ] ] -{ #category : #'visiting reflectivity' } +{ #category : 'visiting reflectivity' } FortranAbstractJsonVisitor >> visitJsonElement: aNode [ aNode ifNil: [ ^nil ]. aNode isDictionary ifTrue: [ ^self visitJsonMap: aNode ]. aNode isArray ifTrue: [ ^self visitJsonArray: aNode ]. ] -{ #category : #'visiting reflectivity' } +{ #category : 'visiting reflectivity' } FortranAbstractJsonVisitor >> visitJsonMap: jsonDictionary [ "If dicionary contains key 'tag', performs a visit of the whole node for this tag, otherwise, perform a visit of each value for their key @@ -978,7 +980,7 @@ FortranAbstractJsonVisitor >> visitJsonMap: jsonDictionary [ self visitKey: assoc key value: assoc value ] ] ] -{ #category : #'visiting reflectivity' } +{ #category : 'visiting reflectivity' } FortranAbstractJsonVisitor >> visitJsonMap: jsonDictionary keys: aCollection [ "visit only the keys listed in aCollection in the jsonDictionary" @@ -987,12 +989,12 @@ FortranAbstractJsonVisitor >> visitJsonMap: jsonDictionary keys: aCollection [ ] ] -{ #category : #'visiting reflectivity' } +{ #category : 'visiting reflectivity' } FortranAbstractJsonVisitor >> visitJsonNode: aJsonNode key: key [ ^self visitKey: key value: (aJsonNode at: key) ] -{ #category : #'visiting reflectivity' } +{ #category : 'visiting reflectivity' } FortranAbstractJsonVisitor >> visitJsonTaggedElement: jsonDictionary [ "similar to #visitJsonNode: , but removes first the 'tag' key from the JsonDisctionary so that it is not visited again (not sure this is needed ...?)" @@ -1002,7 +1004,7 @@ FortranAbstractJsonVisitor >> visitJsonTaggedElement: jsonDictionary [ ^ self visitKey: key value: jsonDictionary ] -{ #category : #'visiting reflectivity' } +{ #category : 'visiting reflectivity' } FortranAbstractJsonVisitor >> visitJsonTaggedStatement: aStatementNode [ "a statementNode containing a tagged element Similar to #visitJsonTaggedElement: on the tagged element, but adds 'Statement' to the selector" @@ -1013,7 +1015,7 @@ FortranAbstractJsonVisitor >> visitJsonTaggedStatement: aStatementNode [ ^ self visitKey: key , 'Statement' value: value ] -{ #category : #'visiting reflectivity' } +{ #category : 'visiting reflectivity' } FortranAbstractJsonVisitor >> visitKey: key value: aNode [ | selector | selector := ('visit' , key capitalized , ':') asSymbol. @@ -1021,51 +1023,51 @@ FortranAbstractJsonVisitor >> visitKey: key value: aNode [ ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitKind: aKindNode [ ^self visitJsonElement: aKindNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitLabel: aLabelNode [ ^self visitJsonElement: aLabelNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitLabelReference: aLabelReference [ ^self visitJsonElement: aLabelReference ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitLabels: aLabelCollection [ ^(aLabelCollection at: 'list') collect: [ :each | self visitLabel: each] ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitLeft: aLeftNode [ ^self visitJsonElement: aLeftNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitLength: aNode [ ^aNode ifNil: [ nil ] ifNotNil: [ self visitJsonMap: aNode ] ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitLessLabel: aLabelReference [ ^self visitLabelReference: aLabelReference ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitLimit: aLimitNode [ ^self visitJsonElement: aLimitNode ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitList: aListNode [ "key 'list' used for different things. Once we are in the list we might no not what its elements are. Therefore should be treated upstream and never reach this point @@ -1076,19 +1078,19 @@ FortranAbstractJsonVisitor >> visitList: aListNode [ self shouldNotImplement ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitLogical: aLogicalNode [ "to be more explicit, Logical nodes are 'transformed' in LogicalLiteralValue nodes" ^self visitLogicalLiteralValue: (aLogicalNode at: 'contents') ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitLogicalBaseType: aString [ ^aString ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitLogicalLiteralValue: aLogicalLiteralValue [ "to be more explicit, we create #visitTrueLiteralValue: and #visitFalseLiteralValue:" ^aLogicalLiteralValue first @@ -1096,62 +1098,62 @@ FortranAbstractJsonVisitor >> visitLogicalLiteralValue: aLogicalLiteralValue [ ifFalse: [ self visitFalseLiteralValue: aLogicalLiteralValue ] ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitLower: aLowerNode [ ^ self visitArrayDimensionBoundary: aLowerNode ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitLt: aLessthanOperatorNode [ ^ '.lt.' ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitLte: aLessThanorEqualOperatorNode [ ^'.le.' ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitMain: aMainProgramNode [ ^self visitJsonMap: aMainProgramNode keys: #(span name blocks subprograms) ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitMessage: aMessageNode [ "STOP or PAUSE message" ^self visitJsonElement: aMessageNode ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitMeta: aMetaNode [ ^self visitJsonMap: aMetaNode keys: #(miVersion miFilename) ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitMiFilename: aString [ ^aString ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitMiVersion: aString [ ^aString ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitMinus: aMinusOperatorNode [ "unary minus" ^'-' ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitMultiplication: aMultiplicationOperatorNode [ ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitName: aNode [ ^aNode isString @@ -1159,31 +1161,31 @@ FortranAbstractJsonVisitor >> visitName: aNode [ ifFalse: [ self visitJsonElement: aNode ] ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitNe: aNotEqualtoOperatorNode [ ^ '.ne.' ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitNeqv: aNeqvtoOperatorNode [ ^ '.neqv.' ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitNot: aNotToOperatorNode [ ^ '.not.' ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitOp: anOpNode [ ^self visitJsonTaggedElement: anOpNode ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitOpenStatement: anOpenStatement [ ^{ @@ -1192,28 +1194,28 @@ FortranAbstractJsonVisitor >> visitOpenStatement: anOpenStatement [ } ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitOr: anOrOperatorNode [ ^ '.or.' ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitParameterStatement: aParameterStatementNode [ ^self visitJsonMap: aParameterStatementNode keys: #(span declarators) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitPauseStatement: aPauseStatementNode [ ^self visitJsonMap: aPauseStatementNode keys: #(span message) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitPrintFormat: aPrintFormatNode [ ^self visitJsonElement: aPrintFormatNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitPrintStatement: aPrintStatementNode [ "format for WRITE and PRINT statements can be quite different, so we created two different visit rules" @@ -1223,17 +1225,17 @@ FortranAbstractJsonVisitor >> visitPrintStatement: aPrintStatementNode [ self visitArguments: (aPrintStatementNode at: 'arguments') } ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitProgramFile: aProgramFileNode [ ^self visitJsonMap: aProgramFileNode keys: #(meta program_units) ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitProgram_units: aNode [ ^self visitJsonArray: aNode ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitRange: aRangeNode [ ^{ self visitSpan: (aRangeNode at: 'span') . self visitJsonElement: (aRangeNode at: 'lower') . @@ -1241,7 +1243,7 @@ FortranAbstractJsonVisitor >> visitRange: aRangeNode [ self visitJsonElement: (aRangeNode at: 'stride') } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitReadStatement: aReadStatementNode [ ^{ @@ -1251,24 +1253,24 @@ FortranAbstractJsonVisitor >> visitReadStatement: aReadStatementNode [ } ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitReal: aRealNode [ "to be more explicit, Real nodes are 'transformed' in RealLiteralValue nodes" ^self visitRealLiteralValue: (aRealNode at: 'contents') ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitRealBaseType: aString [ ^aString ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitRealLiteralValue: aRealLiteralValueNode [ ^self visitJsonMap: aRealLiteralValueNode first keys: #(significand exponent) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitReturn: anEntryReturnNode [ ^anEntryReturnNode @@ -1276,17 +1278,17 @@ FortranAbstractJsonVisitor >> visitReturn: anEntryReturnNode [ ifNotNil: [ self shouldBeImplemented ] ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitReturnStatement: aReturnStatementNode [ ^self visitJsonMap: aReturnStatementNode keys: #(span target) ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitReturn_spec: aReturn_specNode [ ^self visitJsonMap: aReturn_specNode keys: #(span target) ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitRewind2Statement: aRewindStatement [ "a form of rewind with only a unit specified: REWIND 3" @@ -1297,7 +1299,7 @@ FortranAbstractJsonVisitor >> visitRewind2Statement: aRewindStatement [ } ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitRewindStatement: aRewindStatement [ "a form of rewind with a list of IOParameters" @@ -1307,19 +1309,19 @@ FortranAbstractJsonVisitor >> visitRewindStatement: aRewindStatement [ } ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitRight: aRightNode [ ^self visitJsonElement: aRightNode ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitSaveStatement: aSaveStatementNode [ ^self visitJsonMap: aSaveStatementNode keys: #( span vars ) ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitSelector: aSelectorNode [ ^aSelectorNode @@ -1327,18 +1329,18 @@ FortranAbstractJsonVisitor >> visitSelector: aSelectorNode [ ifNotNil: [ self visitJsonMap: aSelectorNode keys: #(span kind length) ] ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitSignificand: aRealLiteralSignificandNode [ ^aRealLiteralSignificandNode ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitSingle: anArraySingleIndexNode [ ^self visitJsonMap: anArraySingleIndexNode keys: #(span index) ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitSpan: aSpanString [ "converts aSpanString (1:2)-(3:4) into two points {1@2 . 3@4}" @@ -1358,19 +1360,19 @@ FortranAbstractJsonVisitor >> visitSpan: aSpanString [ three asInteger @ (four asInteger + 1) } ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitSpecification: aSpecificationNode [ ^self visitJsonElement: aSpecificationNode ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitStar: aStarNode [ ^nil ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitStatement: aStatementNode [ ^(self visitJsonMap: aStatementNode keys: #(span label)) , @@ -1379,18 +1381,18 @@ FortranAbstractJsonVisitor >> visitStatement: aStatementNode [ ifFalse: [ self visitJsonElement: (aStatementNode at: 'statement') ]) } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitStopStatement: aStopStatementNode [ ^self visitJsonMap: aStopStatementNode keys: #(span message) ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitString: aStringLiteralNode [ "to be more explicit, String nodes are 'transformed' in StringLiteralValue nodes" ^self visitStringLiteralValue: aStringLiteralNode ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitStringLiteralValue: aStringLiteralNode [ "Strings in Fortran are single quotes. And to print a single-quote, it is doubled in the string (same as Pharo). @@ -1405,38 +1407,38 @@ FortranAbstractJsonVisitor >> visitStringLiteralValue: aStringLiteralNode [ ] ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitSubprograms: aNode [ ^nil ] -{ #category : #'visiting prog-unit' } +{ #category : 'visiting prog-unit' } FortranAbstractJsonVisitor >> visitSubroutine: aSubroutineNode [ ^self visitJsonMap: aSubroutineNode keys: #(span name arguments blocks) ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitSubscript: aSubscriptNode [ ^self visitJsonMap: aSubscriptNode keys: #(span expression indices) ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitSubtraction: aSubtractionOperatorNode [ ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitTarget: aTargetNode [ ^self visitJsonElement: aTargetNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitThenPart: aThenPartNode [ ^self visitBody: aThenPartNode ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitTo: aString [ "end of a range for an implicit statement: a string of one character" ^aString @@ -1444,59 +1446,59 @@ FortranAbstractJsonVisitor >> visitTo: aString [ ifNotNil: [ aString ] ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitTrueLiteralValue: aString [ "Camfort puts 'true' so we return the normal Fortran value instead" ^'.true.' ] -{ #category : #visiting } +{ #category : 'visiting' } FortranAbstractJsonVisitor >> visitType: aTypeNode [ ^self visitJsonMap: aTypeNode keys: #(span base_type selector) ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitUnary: aUnaryNode [ ^self visitJsonMap: aUnaryNode keys: #(span op expression) ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitUpper: aUpperNode [ ^ self visitArrayDimensionBoundary: aUpperNode ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitValue: aValueNode [ ^{ self visitSpan: (aValueNode at: 'span') . self visitJsonTaggedElement: (aValueNode at: 'value') } ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitVar: anExitStatementVarNode [ self flag: #TODO. ^nil ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitVariable: aVariableNode [ ^self visitVariableName: (aVariableNode at: 'contents') ] -{ #category : #'visiting expression' } +{ #category : 'visiting expression' } FortranAbstractJsonVisitor >> visitVariableName: aString [ ^aString ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitVars: anExternalStatementVarList [ "ignoring 'span' here" ^self visitJsonArray: (anExternalStatementVarList at: 'list') ] -{ #category : #'visiting statement' } +{ #category : 'visiting statement' } FortranAbstractJsonVisitor >> visitWriteStatement: aWriteStatementNode [ ^{ diff --git a/src/EsopeImporter/FortranErrorManager.class.st b/src/EsopeImporter/FortranErrorManager.class.st index cab781a..fca33ee 100644 --- a/src/EsopeImporter/FortranErrorManager.class.st +++ b/src/EsopeImporter/FortranErrorManager.class.st @@ -2,29 +2,31 @@ I register errors during the import process and allow to proceed, ignoring them " Class { - #name : #FortranErrorManager, - #superclass : #Object, + #name : 'FortranErrorManager', + #superclass : 'Object', #instVars : [ 'contexts', 'errors', 'stop' ], - #category : #'EsopeImporter-Importer' + #category : 'EsopeImporter-Importer', + #package : 'EsopeImporter', + #tag : 'Importer' } -{ #category : #accessing } +{ #category : 'accessing' } FortranErrorManager >> enterContext: aString [ contexts addLast: aString ] -{ #category : #accessing } +{ #category : 'accessing' } FortranErrorManager >> enterFile: aFilename [ self enterContext: 'file:' , aFilename ] -{ #category : #accessing } +{ #category : 'accessing' } FortranErrorManager >> error: anException [ stop ifTrue: [ anException pass ]. @@ -37,13 +39,13 @@ FortranErrorManager >> error: anException [ -> anException) ] -{ #category : #accessing } +{ #category : 'accessing' } FortranErrorManager >> errors [ ^ errors ] -{ #category : #api } +{ #category : 'api' } FortranErrorManager >> handleErrorsFor: context running: runningBlock [ "1. register the context 2. executes the runningBlock @@ -66,7 +68,7 @@ FortranErrorManager >> handleErrorsFor: context running: runningBlock [ ] -{ #category : #initialization } +{ #category : 'initialization' } FortranErrorManager >> initialize [ super initialize. @@ -76,49 +78,49 @@ FortranErrorManager >> initialize [ stop := false ] -{ #category : #testing } +{ #category : 'testing' } FortranErrorManager >> isEmpty [ ^errors isEmpty ] -{ #category : #testing } +{ #category : 'testing' } FortranErrorManager >> isNotEmpty [ ^errors isNotEmpty ] -{ #category : #accessing } +{ #category : 'accessing' } FortranErrorManager >> leaveContext [ contexts removeLast ] -{ #category : #accessing } +{ #category : 'accessing' } FortranErrorManager >> leaveFile [ self leaveContext ] -{ #category : #'error management' } +{ #category : 'error management' } FortranErrorManager >> resumeOnError [ self stopOnError: false ] -{ #category : #'error management' } +{ #category : 'error management' } FortranErrorManager >> stop [ ^stop ] -{ #category : #'error management' } +{ #category : 'error management' } FortranErrorManager >> stopOnError [ self stopOnError: true ] -{ #category : #'error management' } +{ #category : 'error management' } FortranErrorManager >> stopOnError: aBoolean [ stop := aBoolean diff --git a/src/EsopeImporter/FortranProjectImporter.class.st b/src/EsopeImporter/FortranProjectImporter.class.st index b85608b..2c78429 100644 --- a/src/EsopeImporter/FortranProjectImporter.class.st +++ b/src/EsopeImporter/FortranProjectImporter.class.st @@ -41,8 +41,8 @@ error := importer errorHandler. ``` " Class { - #name : #FortranProjectImporter, - #superclass : #Object, + #name : 'FortranProjectImporter', + #superclass : 'Object', #instVars : [ 'famixModel', 'iastmodel', @@ -58,24 +58,26 @@ Class { 'includeFolder', 'srcFolder' ], - #category : #'EsopeImporter-Importer' + #category : 'EsopeImporter-Importer', + #package : 'EsopeImporter', + #tag : 'Importer' } -{ #category : #importing } +{ #category : 'importing' } FortranProjectImporter class >> import [