coins.sym
クラス UnionTypeImpl

java.lang.Object
  |
  +--coins.sym.SymImpl
        |
        +--coins.sym.TypeImpl
              |
              +--coins.sym.UnionTypeImpl
すべての実装インタフェース:
java.lang.Cloneable, HasStringObject, Sym, Sym0, Type, UnionType

public class UnionTypeImpl
extends TypeImpl
implements UnionType

UnionTypeImpl Class


フィールドの概要
protected  int fAlignment
           
protected  IrList fElemList
           
protected  SymTable fLocalSymTable
           
protected  Sym fTag
           
 
クラス coins.sym.TypeImpl から継承したフィールド
fCompleteType, fConst, fOrigin, fRestrict, fTypeCore, fTypeKind, fVolatile
 
クラス coins.sym.SymImpl から継承したフィールド
fDbgLevel, fDefinedIn, fFlagBox, fKind, fName, fNextSym, fRecordedIn, fSourceInf, fSymInf, fType, fUniqueNameSym, fWork, machineParam, sourceLanguage, symRoot
 
インタフェース 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
 
インタフェース coins.sym.Sym から継承したフィールド
KIND_NAME, VISIBILITY
 
インタフェース coins.sym.Sym0 から継承したフィールド
FLAG_ADDRESS_TAKEN, FLAG_CASTLESS_SUBP, FLAG_COMMON, FLAG_COMPLEX_STRUCT, FLAG_DERIVED_SYM, FLAG_GENERATED_SYM, FLAG_INCOMPLETE_TYPE, FLAG_POINTER_OPERATION, FLAG_REGION_ELEM, FLAG_RESERVED_NAME, FLAG_SIZEOF_TAKEN, FLAG_UNFIXED_SIZE, FLAG_UNIFORM_SIZE, FLAG_VALUE_IS_ASSIGNED, KIND_AREG, KIND_BOOL_CONST, KIND_CHAR_CONST, KIND_CONST_FIRST, KIND_CONST_LAST, KIND_ELEM, KIND_EXP_ID, KIND_FLOAT_CONST, KIND_INT_CONST, KIND_LABEL, KIND_MREG, KIND_NAMED_CONST, KIND_OTHER, KIND_PARAM, KIND_REMOVED, KIND_STRING_CONST, KIND_TAG, KIND_TYPE, KIND_VAR, SYM_COMPILE_UNIT, SYM_EXTERN, SYM_PRIVATE, SYM_PROTECTED, SYM_PUBLIC
 
コンストラクタの概要
UnionTypeImpl(SymRoot pSymRoot, java.lang.String pTypeName, IrList pElemList)
          UnionTypeImpl constructor Make an instance of UnionType in symRoot.symTableCurrent.
 
メソッドの概要
 void addElem(Elem pElem)
          addElem Add element to this union type.
 void finishUnionType(boolean pSeparately)
          finishUnionType Finish to define this union 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()
           
 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 Set alignment value to be equal to the pAlignment.
 void setSymTable(SymTable pSymTable)
           
 void setTag(Sym pTag)
           
 java.lang.String toStringDetail()
          toStringDetail Get detailed attributes of this symbol in text which is not interned.
 
クラス coins.sym.TypeImpl から継承したメソッド
getAlignmentGap, getDimension, getElemListString, getElemListString, getEnumListString, getFinalOrigin, getOrigin, getPointedType, getSizeExp, getSizeValue, getTypeKind, getTypeRank, getUnqualifiedType, isBasicType, isConst, isFloating, isInteger, isRestrict, isScalar, isSizeEvaluable, isUnsigned, isVolatile, makeConstType, makeRestrictType, makeVolatileType, searchTypeCompatibleWithThis, setOrigin, setSizeExp, setSizeValue, setStaticTable, toString, toStringShort
 
クラス coins.sym.SymImpl から継承したメソッド
bareStringConst, baseType, boolConst, charConst, charConst, charConst, definedType, definedType, defineElem, defineLabel, defineParam, defineRegionVar, defineSubp, defineVar, defineVar, derivedSym, enumType, enumType, floatConst, floatConst, getDefinedColumn, getDefinedFile, getDefinedIn, getDefinedInName, getDefinedLine, getFlag, getInf, getName, getNameOrNull, getNextSym, getOrAddInf, getOriginalSym, getOriginalSym, getPureName, getRecordedIn, getSourceInf, getSymKind, getSymKindName, getSymType, getUniqueName, getWork, intConst, intConst, intObject, isGlobal, isHIR, isRemoved, isSym, linkSym, makeCstring, makeCstringWithTrailing0, makeEnumTypeName, makeExpString, makeJavaString, makeStructUnionTypeName, makeSubpTypeName, makeSubpTypeName, makeVectorTypeName, makeVectorTypeName, makeVectorTypeName, namedConst, namedConst, pointerType, pointerType, pointerType, pointerType, pointerType, print, print, regionType, regionType, remove, setDefinedFile, setDefinedIn, setDefinedLine, setFlag, setOriginalSym, setParameters, setRecordedIn, setSourceInf, setSymKind, setSymType, setUniqueNameSym, setWork, stringConst, stringConstFromQuotedString, structType, structType, subpType, subpType, symbol, unionType, unionType, vectorType, vectorType, vectorType, vectorType, vectorTypeUnfixed, vectorTypeUnfixed
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
インタフェース 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
 
インタフェース coins.sym.Sym から継承したメソッド
baseType, boolConst, charConst, defineVar, derivedSym, floatConst, getDefinedColumn, getDefinedInName, getDefinedLine, getInf, getNameOrNull, getOrAddInf, getOriginalSym, getOriginalSym, getPureName, getSymKindName, getWork, intConst, intObject, isRemoved, makeCstring, makeCstringWithTrailing0, makeEnumTypeName, makeJavaString, makeStructUnionTypeName, makeSubpTypeName, makeVectorTypeName, makeVectorTypeName, makeVectorTypeName, namedConst, pointerType, pointerType, pointerType, regionType, remove, setDefinedFile, setDefinedIn, setDefinedLine, setRecordedIn, setSymKind, setSymType, setUniqueNameSym, setWork, stringConstFromQuotedString, symbol, toStringShort, vectorType, vectorType, vectorType, vectorTypeUnfixed
 
インタフェース 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
 

フィールドの詳細

fElemList

protected IrList fElemList

fLocalSymTable

protected SymTable fLocalSymTable

fTag

protected Sym fTag

fAlignment

protected int fAlignment
コンストラクタの詳細

UnionTypeImpl

public UnionTypeImpl(SymRoot pSymRoot,
                     java.lang.String pTypeName,
                     IrList pElemList)
UnionTypeImpl constructor Make an instance of UnionType in symRoot.symTableCurrent. It is not recommended to use this constructor directly but use unionType method of HIR because there are several restrictions in using this constructor.

パラメータ:
pSymRoot - SymRoot instance to be passed to the resultant type.
pTypeName - Name of the union type. It shoul be where tagName is the tag name the union. If it has no tag name, generate it by generateTag() of SymTable.
pElemList - List of elements of the union. If it is not known, then give null and later addElem() and finishUnionType().
メソッドの詳細

getSymTable

public SymTable getSymTable()
定義:
インタフェース UnionType 内の getSymTable

setSymTable

public void setSymTable(SymTable pSymTable)
定義:
インタフェース UnionType 内の setSymTable

getElemList

public IrList getElemList()
インタフェース UnionType の記述:
getElemList

定義:
インタフェース UnionType 内の getElemList
オーバーライド:
クラス TypeImpl 内の getElemList
戻り値:
the list of elements for this union.

addElem

public void addElem(Elem pElem)
インタフェース UnionType の記述:
addElem Add element to this union type. finishUnionType Finish to define this union type. addElem is called after instantiating UnionType without giving element list. After successive call of addElem, finishUnionType should be called. See unionType of Sym.

定義:
インタフェース UnionType 内の addElem
パラメータ:
pElem - Element of this union type.

finishUnionType

public void finishUnionType(boolean pSeparately)
インタフェース UnionType の記述:
finishUnionType Finish to define this union type. After successive call of addElem, finishUnionType should be called. This will make the union type name and then compute the size of this union. See unionType of Sym, addElem.

定義:
インタフェース UnionType 内の finishUnionType
パラメータ:
pSeparately - false if UnionType is constructed with complete element list, true if UnionType is constructed as incomplete and sequence of addElem call is performed and then finishUnionType is called.

getAlignment

public int getAlignment()
インタフェース Type の記述:
getAlignment Get alignment value for this type. It depends on target machine. For basic types, the alignment value is a byte count specified in MachineParam.java. The default value of alignment of VectorType is the alignment of element type which may differ vector by vector. The defalut alignment value of StructType or UnionType is set to that of its element with the largest alignment value which may differ struct by struct or union by union. The alignment value of StructType, UnionType, or VectorType should be set by setAlignment method of corresponding type when the type is defined. As for subprogram, if alignment of return value is required, get it by subp.getReturnValueType().getAlignment(), and if alignment of subprogram object code is required, get it by symRoot.machineParam.getAlignment(Type.KIND_SUBP). //##67

定義:
インタフェース Type 内の getAlignment
オーバーライド:
クラス TypeImpl 内の getAlignment
戻り値:
the alignment number of this type in bytes.

getTag

public Sym getTag()
定義:
インタフェース UnionType 内の getTag

setTag

public void setTag(Sym pTag)
定義:
インタフェース UnionType 内の setTag

isCompatibleWith

public boolean isCompatibleWith(Type pType)
インタフェース Type の記述:
isCompatibleWith The origin type of this type and pType are compared to be equal or not. Strict type compatibility check sh ould be done in the semantic analyzer of each language. This method can not afford to do strict semantic check considering language specifications.

定義:
インタフェース Type 内の isCompatibleWith
オーバーライド:
クラス TypeImpl 内の isCompatibleWith
パラメータ:
pType - a type to be compared with this type.
戻り値:
true if this type is compatible with pType.

getCompleteType

public Type getCompleteType()
インタフェース Type の記述:
getCompleteType Get complete type corresponding to this type. If this is a complete type, return this type. If this is incomplete, find complete type corresponding to this type. If no complete type is found for this type, return null. If the type is neither VectorType, StructType, UnionType, nore EnumType, then return this type.

定義:
インタフェース Type 内の getCompleteType
オーバーライド:
クラス TypeImpl 内の getCompleteType

setAlignment

public void setAlignment(int pAlignment)
インタフェース UnionType の記述:
setAlignment Set alignment value to be equal to the pAlignment. Default value of alignment is set to the alignment of element type with the largest alignment value.

定義:
インタフェース UnionType 内の setAlignment
パラメータ:
pAlignment - alignment value to be set.

toStringDetail

public java.lang.String toStringDetail()
インタフェース Sym の記述:
toStringDetail Get detailed attributes of this symbol in text which is not interned.

定義:
インタフェース Sym 内の toStringDetail
オーバーライド:
クラス TypeImpl 内の toStringDetail