|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcoins.sym.SymImpl
coins.sym.TypeImpl
coins.sym.StructTypeImpl
StructTypeImpl Class
| Field Summary | |
protected int |
fAlignment
|
protected IrList |
fElemList
|
protected SymTable |
fLocalSymTable
|
protected Sym |
fTag
|
| Fields inherited from class coins.sym.TypeImpl |
fCompleteType, fConst, fOrigin, fRestrict, fTypeCore, fTypeKind, fVolatile |
| Fields inherited from class coins.sym.SymImpl |
fDbgLevel, fDefinedIn, fFlagBox, fKind, fName, fNextSym, fRecordedIn, fSourceInf, fSymInf, fType, fUniqueNameSym, fWork, machineParam, sourceLanguage, symRoot |
| Fields inherited from interface coins.sym.Type |
KIND_ADDRESS, KIND_ALIGNMENT, KIND_BASE_LIM, KIND_BOOL, KIND_CHAR, KIND_DEFINED, KIND_DOUBLE, KIND_ENUM, KIND_FLOAT, KIND_FLOAT_LOWER_LIM, KIND_FLOAT_UPPER_LIM, KIND_INT, KIND_INT_UPPER_LIM, KIND_LONG, KIND_LONG_DOUBLE, KIND_LONG_LONG, KIND_OFFSET, KIND_POINTER, KIND_RANKS, KIND_REGION, KIND_SHORT, KIND_STRING, KIND_STRUCT, KIND_SUBP, KIND_U_CHAR, KIND_U_INT, KIND_U_LONG, KIND_U_LONG_LONG, KIND_U_SHORT, KIND_UNDEF, KIND_UNION, KIND_UNSIGNED_LOWER_LIM, KIND_VECTOR, KIND_VOID, KIND_WCHAR |
| Fields inherited from interface coins.sym.Sym |
KIND_NAME, VISIBILITY |
| Constructor Summary | |
StructTypeImpl(SymRoot pSymRoot,
java.lang.String pTypeName,
IrList pElemList)
StructTypeImpl constructor Make an instance of StructType in symRoot.symTableCurrent. |
|
| Method Summary | |
void |
addElem(Elem pElem)
addElem Add element to this struct type. |
(package private) Exp |
addStructSizeExp(Elem pElem)
|
(package private) Exp |
computeStructSizeExp(IrList pElemList)
|
void |
finishStructType(boolean pSeparately)
finishStructType: Finish to define this struct type. |
int |
getAlignment()
getAlignment Get alignment value for this type. |
Type |
getCompleteType()
getCompleteType Get complete type corresponding to this type. |
IrList |
getElemList()
getElemList |
SymTable |
getSymTable()
Get the symbol table local to this structure. |
Sym |
getTag()
|
boolean |
isCompatibleWith(Type pType)
isCompatibleWith The origin type of this type and pType are compared to be equal or not. |
void |
setAlignment(int pAlignment)
setAlignment //##47 Set alignment value to be equal to the pAlignment. |
void |
setSymTable(SymTable pSymTable)
Set the symbol table local to this structure. |
void |
setTag(Sym pTag)
|
java.lang.String |
toStringDetail()
toStringDetail Get detailed attributes of this symbol in text which is not interned. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface coins.sym.Type |
getAlignmentGap, getDimension, getElemListString, getFinalOrigin, getOrigin, getPointedType, getSizeExp, getSizeValue, getTypeKind, getTypeRank, getUnqualifiedType, isBasicType, isConst, isFloating, isInteger, isRestrict, isScalar, isSizeEvaluable, isUnsigned, isVolatile, makeConstType, makeRestrictType, makeVolatileType, setOrigin, setSizeExp, setSizeValue |
| Methods inherited from interface coins.sym.Sym0 |
charConst, definedType, defineElem, defineLabel, defineParam, defineSubp, defineVar, enumType, floatConst, getDefinedFile, getDefinedIn, getFlag, getName, getNextSym, getRecordedIn, getSymKind, getSymType, getUniqueName, intConst, isGlobal, namedConst, pointerType, setFlag, stringConst, structType, subpType, unionType, vectorType, vectorTypeUnfixed |
| Field Detail |
protected IrList fElemList
protected SymTable fLocalSymTable
protected Sym fTag
protected int fAlignment
| Constructor Detail |
public StructTypeImpl(SymRoot pSymRoot,
java.lang.String pTypeName,
IrList pElemList)
pSymRoot - SymRoot instance to be passed to the
resultant type.pTypeName - Name of the structure type.
It shoul be pElemList - List of elements of the structure.
If it is not known, then give null and later addElem()
and finishStructType().| Method Detail |
public SymTable getSymTable()
StructType
getSymTable in interface StructTypepublic void setSymTable(SymTable pSymTable)
StructType
setSymTable in interface StructTypepublic IrList getElemList()
StructType
getElemList in interface StructTypegetElemList in class TypeImplpublic void addElem(Elem pElem)
StructType
addElem in interface StructTypepElem - Element of this struct type.public void finishStructType(boolean pSeparately)
StructTypefinishStructType: Finish to define this struct type. After successive call of addElem, finishStructType should be called. This will make the struct type name and compute displacement of each elements, and then compute the size of this struct. See structType of Sym, addElem. The alignment of a struct type is the same to that of its element having the largest alignment among the elements in the structure. Elements of the struct type is aligned according to the alignment of element type. This may cause to place gap between preceeding element. The size of the struct type is multiple of the alignment value of the struct type, thus, there may be a gap at the tail of the struct type if the last element has small alignment value. finishStructType also allocates bit fields (set bit field offset). As for the allocation of bit field, see the explanation of setBitFieldOffset method of the Elem interface.
finishStructType in interface StructTypepSeparately - false if StructType is constructed with complete
element list, true if StructType is constructed as incomplete
and sequence of addElem call is performed and then finishStructType
is called.Exp computeStructSizeExp(IrList pElemList)
Exp addStructSizeExp(Elem pElem)
public int getAlignment()
Type
getAlignment in interface TypegetAlignment in class TypeImplpublic void setAlignment(int pAlignment)
StructType
setAlignment in interface StructTypepAlignment - alignment value to be set.public Sym getTag()
getTag in interface StructTypepublic void setTag(Sym pTag)
setTag in interface StructTypepublic boolean isCompatibleWith(Type pType)
Type
isCompatibleWith in interface TypeisCompatibleWith in class TypeImplpublic Type getCompleteType()
Type
getCompleteType in interface TypegetCompleteType in class TypeImplpublic java.lang.String toStringDetail()
Sym
toStringDetail in interface SymtoStringDetail in class TypeImpl
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||