FortranStuff

public final class FortranStuff

Fortran language specific methods.

Fields

callGraph

public CallGraph callGraph

The current CallGraph

implicitDeclarations

protected TapList<TapPair<String, Instruction>> implicitDeclarations

listFortranCEDS

public TapList<TapPair<Tree, SymbolTable>> listFortranCEDS

List of Fortran declarations of Common, Equivalence, Data, or Save, that are kept here for future, delayed usage to build the MemoryMaps

publicPrivateDefault

protected String publicPrivateDefault

refSymbolTable

public SymbolTable refSymbolTable

The related Unit’s public SymbolTable, of else the fortranRootSymbolTable

statementFunctions

protected TapList<Tree> statementFunctions

List of this Unit’s statement-functions (in reverse order)

unit

public Unit unit

The Unit that holds this FortranStuff. TODO REMOVE ?

Methods

activateArrayAccessOrCall

protected void activateArrayAccessOrCall(boolean val)

addBindCDecl

protected void addBindCDecl(SymbolTable symbolTable, Tree instructionTree)

addPublicPrivateDecl

protected void addPublicPrivateDecl(String publicPrivateDecl, Tree instructionTree)

checkArrayAccessOrCall

protected Tree checkArrayAccessOrCall(SymbolTable symbolTable, Tree tree)

Assume tree is an arrayAccess. When its array name is not declared as an array, and no index is an arrayTriplet, transform tree into a procedure or function call. Because Fortran indices are in reverse of natural IL order, inverse the order of indexes in tree.down(2) if tree remains an arrayAccess.

checkStatementFunctionCall

protected Tree checkStatementFunctionCall(Tree tree)

checkStatementFunctionDecl

protected boolean checkStatementFunctionDecl(SymbolTable symbolTable, Tree tree)

When it is in reality a statement function declaration, transform tree into a statement function declaration.

collectFortranCEDSForLater

protected void collectFortranCEDSForLater(Instruction instr, SymbolTable symbolTable)

Register for future use a Fortran declaration of Common, Equivalence, Data, Save, Bind, etc.

computeSaveVarDecl

protected void computeSaveVarDecl(SymbolTable symbolTable, VariableDecl varDecl)

computeSaveVarDecls

protected void computeSaveVarDecls(SymbolTable symbolTable, TapList<SymbolDecl> varDecls)

declareBindCInMemoryMap

protected void declareBindCInMemoryMap()

Global mixed-language variables CVarDecl and fortranVarDecl are declared in the globalRootSymbolTable equivalence between CVarDecl and fortranVarDecl (or fortran common) is declared in callGraph.declaredMemoryMap.

getSaveAll

protected boolean getSaveAll()

initFortranSymbolTable

public static void initFortranSymbolTable(SymbolTable symbolTable)

Inserts predefined FORTRAN stuff into this initial symbolTable.

isStatementFunctionDecl

protected static boolean isStatementFunctionDecl(SymbolTable symbolTable, Tree tree)

Return true when tree is in reality a statement function declaration, i.e. tree is an assign, its left-hand side is an arrayAccess, but it was not declared as an array.

setSaveAll

protected void setSaveAll()