ModifiedTypeSpec¶
-
public final class
ModifiedTypeSpec
extends TypeSpec¶ A type with additional modifications, e.g. size.
Constructors¶
ModifiedTypeSpec¶
-
public
ModifiedTypeSpec
(WrapperTypeSpec elementType, Tree sizeModifier, SymbolTable symbolTable)¶ Create a modified type around the given elementType, with given modifiers.
ModifiedTypeSpec¶
-
public
ModifiedTypeSpec
(WrapperTypeSpec elementType, ModifiedTypeSpec model)¶ Create a modified type around the given elementType, following the given model modified type.
Methods¶
addUsedSymbolsInType¶
-
public void
addUsedSymbolsInType
(TapList<SymbolDecl> toDependsOn, SymbolTable symbolTable)¶
baseTypeSpec¶
-
public WrapperTypeSpec
baseTypeSpec
(boolean stopOnPointer)¶
collectUsedTrees¶
compareModifiersWith¶
-
protected static boolean
compareModifiersWith
(int leftModifierInteger, Tree leftModifierTree, int rightModifierInteger, Tree rightModifierTree, int comparison)¶ Convention: integer size modifiers may be: n>0 for a known size in bytes, -> in this case the "Tree" modifier is the size expression, that could be evaluated to n 0 for unmodified base type size (but not explicited because compiler_dependent) -> in this case the "Tree" modifier is null, since there was no modifier! -1 for unknown size value (specified by Tree T) -> in this case the "Tree" modifier is the size expression, which could not be evaluated -2 for double base type size -> in this case the "Tree" modifier is op_intCst:-2 meaning "double" or "long" -3 for short, -> in this case the "Tree" modifier is op_intCst:-3 meaning "short" -4 for double double base type size. -> in this case the "Tree" modifier is op_intCst:-4 meaning "long double" or "long long" In the tables below, leftmodifier is on the left, rightmodifier on the top, tt means ok, ff means not-ok, * means acceptable but possible accuracy problem
- Parameters
leftModifierInteger –
leftModifierTree –
rightModifierInteger –
rightModifierTree –
comparison –
complexDuplModifier¶
complexHalfModifier¶
cumulActiveParts¶
-
protected void
cumulActiveParts
(TapList diffInfos, SymbolTable symbolTable)¶
differentiateTypeSpec¶
-
public WrapperTypeSpec
differentiateTypeSpec
(SymbolTable symbolTable, SymbolTable srcSymbolTable, int diffUnitSort, String fSuffix, boolean localDecl, boolean multiDirMode, ArrayDim multiDirDimensionMax, String hintArrayNameInText, String hintArrayNameInIdent, Tree hintArrayNameTree, Tree nameTree)¶
doUpdateAfterImports¶
-
public void
doUpdateAfterImports
(SymbolTable symbolTable, TapList<TypeSpec> dejaVu)¶
elementType¶
-
public WrapperTypeSpec
elementType
()¶ The unmodified type inside.
generateTree¶
-
public Tree
generateTree
(SymbolTable symbolTable, TapList<SymbolDecl> dependsOn, TapList<SymbolDecl> shortNames, boolean useShortNames, TapList<TypeSpec> dejaVu)¶
getModifierFrom¶
-
protected void
getModifierFrom
(ModifiedTypeSpec model)¶ Set the modifier of this modified type, following the given model modified type.
intToReal¶
localize¶
preciseDimensions¶
precisionSize¶
-
public int
precisionSize
()¶ - Returns
the size in bytes of this numeric type, or -1 for unknown, or -2, -3, or -4 for double,short,or quadruple.
realToComplex¶
resolveSizeModifier¶
-
protected void
resolveSizeModifier
(SymbolTable symbolTable)¶ Tries to evaluate the sizeModifier expression tree that is used to declare this modified type. If sizeModifier is null (e.g. modifier is only an “unsigned”) then evaluation returns null. Else if the expression is “double”, “long”, “long long”, etc then the evaluation returns intCst -2 or -4. Else if the expression evaluates to an integer value, then the evaluation returns this value in an intCst. Else if the expression is a constant with an initial value, returns the evaluation of this initial value. Else returns the sizeModifier itself.
sizeModifierIntegerSmaller¶
-
protected static boolean
sizeModifierIntegerSmaller
(int smallSize, int largeSize)¶
sizeModifierValue¶
-
public int
sizeModifierValue
()¶ - Returns
the size of this modified type, if statically known, else returns -1. If size is a dynamic variable, returns -1. If the size is defined relatively (e.g. “double”), then doesn’t compute the final, compiler-dependent value, and instead returns -2 or -4 for “long double”.