WrapperTypeSpec¶
-
public final class
WrapperTypeSpec
extends TypeSpec¶ A simple wrapper around another type. Used to build a type (possibly empty) that can later be created or modified by anyone sharing this wrapper, so that everyone sharing the wrapper will see the modification. In principle all wrappers may be removed when all type choices are done, i.e. after type-checking.
Constructors¶
Methods¶
addMultiDirDimension¶
-
protected WrapperTypeSpec
addMultiDirDimension
(ArrayDim dimension)¶
addRefDiffTypeSpec¶
-
protected void
addRefDiffTypeSpec
(SymbolTable symbolTable, SymbolTable srcSymbolTable)¶
addWith¶
-
public WrapperTypeSpec
addWith
(WrapperTypeSpec type)¶
baseTypeSpec¶
-
public WrapperTypeSpec
baseTypeSpec
(boolean stopOnPointer)¶
buildTypeNameForProcName¶
-
public String
buildTypeNameForProcName
(TapList<Tree> toArraySize, SymbolTable symbolTable)¶ - Returns
a String that represents the present WrapperTypeSpec, to be used in a procedure name that is specialized for this type.
Examples: INTEGER4, INTEGER8, REAL4, REAL8, REAL8ARRAY,… “toArraySize” must contain upon input a Tree which is the size of this WrapperTypeSpec if it is an array, null otherwise. Upon output this size is modified when this typeSpec is a string: it is multiplied by the number of characters.
canMatchPointerTo¶
-
public boolean
canMatchPointerTo
(WrapperTypeSpec destTypeSpec)¶ - Returns
true if the 2 types are similar enough so that a pointer to “this” may point to a “destTypeSpec”.
canReceiveVectorialDim¶
-
public static boolean
canReceiveVectorialDim
(WrapperTypeSpec typeSpec, boolean passedArray)¶ - Returns
true if this type is deep/simple enough to receive the extra vectorial dimension. Example: REAL(:,:), REAL → true RECORD, REAL*, REAL(:,:)(:) → false.
checkArray¶
-
protected boolean
checkArray
()¶ - Returns
true if this type is a wrapper around an array type. If this wrapper is free, fills it with an array type of free element type.
checkBoolean¶
-
protected boolean
checkBoolean
()¶ - Returns
true if this type is a wrapper around boolean type. If this wrapper is free, fills it with boolean type.
checkNoneDimensionsOfNewSH¶
-
public WrapperTypeSpec
checkNoneDimensionsOfNewSH
(String hintNameInText, String hintNameInIdent, Tree hintTreeInCallSize, SymbolTable symbolTable, NewSymbolHolder symbolHolder)¶
checkNumeric¶
-
protected boolean
checkNumeric
()¶ - Returns
true if this type is a wrapper around some numeric type. If this wrapper is free, fills it with a “generic” numeric type.
checkNumericInt¶
-
protected boolean
checkNumericInt
()¶ - Returns
true if this type is a wrapper around integer type. If this wrapper is free, fills it with integer type.
checkPointer¶
-
protected boolean
checkPointer
()¶ - Returns
true if this type is a wrapper around a pointer type. If this wrapper is free, fills it with a pointer to free type.
checkRecord¶
-
protected boolean
checkRecord
()¶ - Returns
true if this type is a wrapper around a composite type. If this wrapper is free, fills it with a composite RECORD type.
combineWith¶
-
public WrapperTypeSpec
combineWith
(WrapperTypeSpec newTypeSpec, SymbolTable symbolTable)¶
conformingTypeSpec¶
-
protected WrapperTypeSpec
conformingTypeSpec
(WrapperTypeSpec type1, WrapperTypeSpec type2)¶ Expand this type into an array type that makes it conform with array types type1 (and type2 if non-null).
cumulActiveParts¶
-
public void
cumulActiveParts
(TapList diffInfos, SymbolTable symbolTable)¶
differentiateTypeSpecMemo¶
-
public WrapperTypeSpec
differentiateTypeSpecMemo
(SymbolTable symbolTable, SymbolTable srcSymbolTable, int diffUnitSort, String fSuffix, boolean localDecl, boolean multiDirMode, ArrayDim multiDirDimensionMax, String hintArrayNameInText, String hintArrayNameInIdent, Tree hintArraySize, Tree nameTree)¶
doUpdateAfterImports¶
-
public void
doUpdateAfterImports
(SymbolTable symbolTable, TapList<TypeSpec> dejaVu)¶
easilyDeclared¶
-
public boolean
easilyDeclared
()¶ - Returns
true if a declaration of a variable of this WrapperTypeSpec is cheap and easy Example: a primitive, a pointer, a void Counter example: an array of dynamic size (⇒ requiring a decl with ISIZEOF).
elementType¶
-
public WrapperTypeSpec
elementType
()¶
equalsDiffTypeSpecAndTypeSpec¶
-
public WrapperTypeSpec
equalsDiffTypeSpecAndTypeSpec
()¶
generateTree¶
-
public Tree
generateTree
(SymbolTable symbolTable, TapList<SymbolDecl> dependsOn, TapList<SymbolDecl> shortNames, boolean useShortNames, TapList<TypeSpec> dejaVu)¶
hasAnArrayDimension¶
-
protected static boolean
hasAnArrayDimension
(WrapperTypeSpec typeSpec)¶
hasPointerOnTop¶
-
public static boolean
hasPointerOnTop
(WrapperTypeSpec typeSpec)¶ - Returns
true if contains a Pointer level before reaching an array or record type.
intToReal¶
-
public static WrapperTypeSpec
intToReal
(WrapperTypeSpec origType, TapList<TapPair<TypeSpec, TypeSpec>> dejaVu, SymbolTable symbolTable)¶ When the given origType is non-differentiable (e.g. integer), returns a copied WrapperTypeSpec with integers replaced with reals. Otherwise returns the same origType.
isAnIOTypeSpec¶
-
public boolean
isAnIOTypeSpec
(SymbolTable symbolTable)¶
isFree¶
-
public static boolean
isFree
(WrapperTypeSpec typeSpec)¶
isFunctionOrPointerToFunction¶
-
public static boolean
isFunctionOrPointerToFunction
(WrapperTypeSpec typeSpec)¶
isNullOrVoid¶
-
public static boolean
isNullOrVoid
(WrapperTypeSpec typeSpec)¶
isPointerOrArrayOfPointer¶
-
public static boolean
isPointerOrArrayOfPointer
(WrapperTypeSpec typeSpec)¶
localize¶
modifiedBaseTypeSpec¶
-
public WrapperTypeSpec
modifiedBaseTypeSpec
()¶
pointerToArrayTypeSpec¶
-
protected WrapperTypeSpec
pointerToArrayTypeSpec
()¶
preciseDimensions¶
-
public static WrapperTypeSpec
preciseDimensions
(WrapperTypeSpec mainType, WrapperTypeSpec complementType, TapList<TapPair<TypeSpec, TypeSpec>> dejaVu, SymbolTable symbolTable)¶ - Returns
a WrapperTypeSpec built from “mainType” by replacing wherever possible imprecise dimensions by fixed dimensions found in the matching complementType. We assume that mainType and complementType have similar shapes except possibly for dimensions. The returned result may share parts with mainType, or may even be strictly eq to it.
realToComplex¶
-
protected WrapperTypeSpec
realToComplex
(TapList<TapPair<TypeSpec, TypeSpec>> dejaVu, WrapperTypeSpec complexTypeSpec)¶
scalarTypeSpec¶
-
public WrapperTypeSpec
scalarTypeSpec
(boolean stopOnPointer, SymbolTable symbolTable)¶ Seeks into this type the deepest array element type.