coins.ffront
Class TypeUtility

java.lang.Object
  extended bycoins.ffront.TypeUtility

public class TypeUtility
extends java.lang.Object


Field Summary
(package private)  FirToHir fHir
           
(package private)  HirUtility fHirUtil
           
(package private)  HIR hir
           
(package private)  HirRoot hirRoot
           
(package private)  Sym sym
           
(package private)  SymRoot symRoot
           
 
Constructor Summary
TypeUtility(FirToHir fth)
           
 
Method Summary
(package private)  FortranCharacterExp castFortranCharacterExp(Exp exp)
           
(package private)  Type charArray(int length)
           
(package private)  void dp(java.lang.String msg)
           
(package private)  Type getArrayType(Type array_type, FirList dims, DeclManager declMgr)
          make Vector type.
 Type getBoolType()
           
 Type getCharType()
           
 StructType getComplexDoubleStructType()
          Return Double Complex type as a StructType
 StructType getComplexStructType()
          Return Complex type as a StructType
(package private)  Exp getDimSizeParamExp(Node n, DeclManager declMgr)
           
 Elem getDoubleImagPart()
           
 Elem getDoubleRealPart()
           
 Type getDoubleType()
           
 Type getEntryType()
           
(package private)  Exp getFortranCharacterLengthExp(Type type, Node hint)
           
(package private)  Exp getFortranCharacterLengthExp(Type type, java.lang.String name)
           
(package private)  Exp getFortranCharacterVectorLengthExp(VectorType type, java.lang.String name)
           
 Type getGlobalStructType(java.lang.String type_name, java.lang.String[] names, Type[] types)
          make global struct.
 Elem getImagPart()
           
 Elem getImagPart(StructType type)
           
 Type getIntType()
           
 Elem getRealPart()
           
 Elem getRealPart(StructType type)
           
 Type getRealType()
           
(package private)  Type getType(int typeKind)
          Make Sym Type from F77 Type kind
(package private)  Type getType(int typeKind, int length)
          Make Sym Type from F77 Type kind and length
(package private)  Type getType(Pair pTypeName)
          Make Sym Type from F77 Type Pair F77 Type is Pair(type name, optional length spec)
(package private)  Type getVectorBaseType(VectorType vt)
          Get vector base type if base type is char, return char vector type.
 Type getVoidType()
           
(package private)  boolean isComplexType(Type type)
           
(package private)  boolean isDoubleComplexType(Type type)
           
(package private)  boolean isFortranCharacterType(Type type)
          check if type is fortran character type, in other words, coins' Vector ?
(package private)  boolean isFortranCharacterVectorType(VectorType type)
          check if type is vector of fortran character type.
(package private)  Type makeVectorType(Type type, int dimnum, Exp[] dim_lp, Exp[] dim_up, int[] dim_lows, int[] dim_upps)
           
 void popSymTable()
           
 SymTable pushSymTable(Sym pSym)
           
(package private)  Elem searchElem(java.lang.String ident, Type type)
          search "ident" element from Struct or Union type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fHir

FirToHir fHir

fHirUtil

HirUtility fHirUtil

sym

Sym sym

hir

HIR hir

symRoot

SymRoot symRoot

hirRoot

HirRoot hirRoot
Constructor Detail

TypeUtility

public TypeUtility(FirToHir fth)
Method Detail

getDimSizeParamExp

Exp getDimSizeParamExp(Node n,
                       DeclManager declMgr)

getArrayType

Type getArrayType(Type array_type,
                  FirList dims,
                  DeclManager declMgr)
make Vector type. ary(3,4,5) => a[5][4][3] An array dimension is limited to 7.

Parameters:
dims - dimension information

makeVectorType

Type makeVectorType(Type type,
                    int dimnum,
                    Exp[] dim_lp,
                    Exp[] dim_up,
                    int[] dim_lows,
                    int[] dim_upps)

getType

Type getType(Pair pTypeName)
Make Sym Type from F77 Type Pair F77 Type is Pair(type name, optional length spec)

Parameters:
pTypeName -
Returns:
sym-type.

getType

Type getType(int typeKind,
             int length)
Make Sym Type from F77 Type kind and length

Parameters:
typeKind -
length -
Returns:
the Sym type.

getType

Type getType(int typeKind)
Make Sym Type from F77 Type kind

Parameters:
typeKind -
Returns:
the type.

charArray

Type charArray(int length)

getEntryType

public Type getEntryType()

isComplexType

boolean isComplexType(Type type)

isDoubleComplexType

boolean isDoubleComplexType(Type type)

getComplexStructType

public StructType getComplexStructType()
Return Complex type as a StructType
     typedef struct{
        float _real;
        float _imag;
     } _complex_struct;
     

Returns:
complexStructType

getComplexDoubleStructType

public StructType getComplexDoubleStructType()
Return Double Complex type as a StructType
     typedef struct{
        double _real;
        double _imag;
     } _complex_struct;
     

Returns:
complexStructType

getRealPart

public Elem getRealPart()

getImagPart

public Elem getImagPart()

getDoubleRealPart

public Elem getDoubleRealPart()

getDoubleImagPart

public Elem getDoubleImagPart()

getRealPart

public Elem getRealPart(StructType type)

getImagPart

public Elem getImagPart(StructType type)

getGlobalStructType

public Type getGlobalStructType(java.lang.String type_name,
                                java.lang.String[] names,
                                Type[] types)
make global struct. names and types must be same length. ex: "stname", [a, b, c], [int, float, int[10]] is given, this method define following struct type in global scope.
    struct stname{
      int a;
      float b;
      int c[10];
    };
    


searchElem

Elem searchElem(java.lang.String ident,
                Type type)
search "ident" element from Struct or Union type.


getVectorBaseType

Type getVectorBaseType(VectorType vt)
Get vector base type if base type is char, return char vector type.


isFortranCharacterType

boolean isFortranCharacterType(Type type)
check if type is fortran character type, in other words, coins' Vector ?


isFortranCharacterVectorType

boolean isFortranCharacterVectorType(VectorType type)
check if type is vector of fortran character type. in other words, coins' Vector*> ?


castFortranCharacterExp

FortranCharacterExp castFortranCharacterExp(Exp exp)

getFortranCharacterLengthExp

Exp getFortranCharacterLengthExp(Type type,
                                 Node hint)

getFortranCharacterLengthExp

Exp getFortranCharacterLengthExp(Type type,
                                 java.lang.String name)

getFortranCharacterVectorLengthExp

Exp getFortranCharacterVectorLengthExp(VectorType type,
                                       java.lang.String name)

pushSymTable

public SymTable pushSymTable(Sym pSym)

popSymTable

public void popSymTable()

getRealType

public Type getRealType()

getDoubleType

public Type getDoubleType()

getIntType

public Type getIntType()

getBoolType

public Type getBoolType()

getVoidType

public Type getVoidType()

getCharType

public Type getCharType()

dp

void dp(java.lang.String msg)