CompositeTypeSpec

public class CompositeTypeSpec extends TypeSpec

A composite type, e.g. a record or a union.

Fields

fields

public FieldDecl[] fields

The fields of this composite type, in order.

isAnIOType

protected boolean isAnIOType

When true, indicates that this CompositeTypeSpec is an IO type (and therefore its zones must be special).

modifiers

public Tree modifiers

The modifiers of this type (e.g. sequence, private for F95 derived types).

name

public String name

When available, the name of this type.

Constructors

CompositeTypeSpec

public CompositeTypeSpec(String name, FieldDecl[] fields, int subKind, Tree modifiers, Unit definingUnit)

Creates a new composite type.

Methods

addDiffTypeSpec

protected void addDiffTypeSpec(SymbolTable symbolTable, SymbolTable srcSymbolTable)

baseTypeName

protected String baseTypeName()

checkNamedFieldType

protected WrapperTypeSpec checkNamedFieldType(Tree instrTree, SymbolTable symbolTable, WrapperTypeSpec typeSpec)

checkTypeSpecValidity

protected boolean checkTypeSpecValidity(TapList<TypeSpec> dejaVu)

collectUsedTrees

public void collectUsedTrees(TapList<Tree> toUsedTrees, TapList<TypeSpec> toDejaVu)

computeSize

protected int computeSize()

containsAPointer

public boolean containsAPointer()

containsMetaType

protected boolean containsMetaType(TapList<TypeSpec> dejaVu)

copy

public TypeSpec copy()
Returns

a copy of this composite type.

copyStopOnComposite

public TypeSpec copyStopOnComposite(Unit publishedUnit)

cumulActiveParts

protected void cumulActiveParts(TapList diffInfos, SymbolTable symbolTable)

differentiateTypeSpec

public WrapperTypeSpec differentiateTypeSpec(SymbolTable symbolTable, SymbolTable srcSymbolTable, int diffUnitSort, String diffTypeSuffix, boolean localDecl, boolean multiDirMode, ArrayDim multiDirDimensionMax, String hintArrayNameInText, String hintArrayNameInIdent, Tree hintArrayNameTree, Tree nameTree)

doUpdateAfterImports

public void doUpdateAfterImports(SymbolTable symbolTable, TapList<TypeSpec> dejaVu)

dump

public void dump()

generateTree

public Tree generateTree(SymbolTable symbolTable, TapList<SymbolDecl> dependsOn, TapList<SymbolDecl> shortNames, boolean useShortNames, TapList<TypeSpec> dejaVu)

getFieldType

public WrapperTypeSpec getFieldType(Tree field)
Returns

the type of “field” in this composite type.

initActiveFields

public void initActiveFields()

isAnIOTypeSpec

protected boolean isAnIOTypeSpec(SymbolTable symbolTable)

isDifferentiated

public boolean isDifferentiated(TapList<TypeSpec> dejaVu)

isDifferentiatedField

public boolean isDifferentiatedField(int i)
Returns

true if the field of rank “i” in this composite type is differentiated.

isEmpty

public boolean isEmpty()
Returns

true if all fields of this composite type are empty.

isRecordType

public boolean isRecordType()
Returns

true is this composite is a record type.

isUnionType

public boolean isUnionType()
Returns

true is this composite is a union type.

localize

protected TypeSpec localize(TapList<TapTriplet<TypeSpec, TypeSpec, Boolean>> toAlreadyCopied, ToBool containsMeta)

namedFieldDecl

public FieldDecl namedFieldDecl(String name)
Returns

the declaration of field “name” in this composite type.

namedFieldOffset

public int namedFieldOffset(String name)
Returns

the offset of field “name” in this composite type.

namedFieldRank

public int namedFieldRank(String name)
Returns

the rank of field “name” in this composite type.

namedFieldType

public WrapperTypeSpec namedFieldType(String name)
Returns

the type of field “name” in this composite type.

needsADiffType

public boolean needsADiffType(TapList<TypeSpec> dejaVu)

shareActiveFields

public void shareActiveFields(CompositeTypeSpec other)

Make all CompositeTypeSpec’s that share this.activeFields (as well as all CompositeTypeSpec’s that share other.activeFields), all now share other.activeFields, and make sure that further sharing is still possible.

showType

public String showType()

testComparesWith

protected boolean testComparesWith(TypeSpec other, int comparison, TypeSpec toThis, TypeSpec toOther, TapList<TapPair<TypeSpec, TypeSpec>> dejaVu)

toString

public String toString()