coins.sym
クラス SymImpl

java.lang.Object
  |
  +--coins.sym.SymImpl
すべての実装インタフェース:
java.lang.Cloneable, HasStringObject, Sym, Sym0
直系の既知のサブクラス:
ConstImpl, ExpIdImpl, LabelImpl, OperandSymImpl, SubpImpl, TypeImpl, VarImpl

public class SymImpl
extends java.lang.Object
implements Sym, HasStringObject, java.lang.Cloneable

SymImpl class that implements Sym. To use methods in this class, read Sym.java. Sym interface is written so that methods can be used without reading SymImpl.java except when user is interested in the implementation of the methods.


フィールドの概要
protected  int fDbgLevel
           
protected  Sym fDefinedIn
          Upper construct that defines this symbol such as subprogram for local variable, struct/union tag name for struct/union element, enum tag for enumeration constant, etc.
protected  FlagBox fFlagBox
          The flag, which represents this symbol's kind by bit mask.
protected  int fKind
          The Symbol kind
protected  java.lang.String fName
          The symbol name in the source file.
protected  Sym fNextSym
          The next symbol
protected  SymTable fRecordedIn
          fRecordedIn Symbol table recording this symbol.
protected  SourceInf fSourceInf
          Source program information -- file name, line number, column defining this symbol.
protected  SymInf fSymInf
          Information attached to this symbol
protected  Type fType
          The type of this symbol
 Sym fUniqueNameSym
          The unique name which has been made by this compiler.
protected  java.lang.Object fWork
          Phase-wise work used for arbitrary purpose in each phase
protected static MachineParam machineParam
           
protected static SourceLanguage sourceLanguage
           
 SymRoot symRoot
           
 
インタフェース 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_SUBP, KIND_TAG, KIND_TYPE, KIND_VAR, SYM_COMPILE_UNIT, SYM_EXTERN, SYM_PRIVATE, SYM_PROTECTED, SYM_PUBLIC
 
コンストラクタの概要
SymImpl()
           
SymImpl(SymRoot pSymRoot)
          SymImpl Constructor to set symRoot.
SymImpl(SymRoot pSymRoot, java.lang.String pInternedName)
           
 
メソッドの概要
 StringConst bareStringConst(java.lang.String pInternedName)
           
 BaseType baseType(java.lang.String pInternedName, int pTypeKind)
          baseType Create an instance of base type.
 BoolConst boolConst(boolean pTrueFalse)
          boolConst Make BoolConst object corresponding to pBoolConst.
 CharConst charConst(char pChar, Type pType)
          Make constant object corresponding to pChar.
 CharConst charConst(int pCharCode, Type pType)
           
 CharConst charConst(java.lang.String pInternedName, Type pType)
          Make constant object corresponding to pInternedName.
 DefinedType definedType(java.lang.String pInternedName, Type pOriginalType)
          definedType with simple parameter Make a defined type having pOrigin as its origin type.
 DefinedType definedType(java.lang.String pInternedName, Type pOriginalType, Sym pDefinedIn)
           
 Elem defineElem(java.lang.String pInternedName, Type pType)
          defineElem Define a struct/union element with the name shown by pInternedName in the current symbol table (symTableCurrent of SymRoot) which will be the local symbol table of the struct or union including the element.
 Label defineLabel(java.lang.String pInternedName)
          defineLabel Define a label named as pInternedName in the symbol table of current subprogram (symRoot.symTableCurrentSubp).
 Param defineParam(java.lang.String pInternedName, Type pType)
          defineParam Define a paramater with the name shown by pInternedName in the current symbol table (symTableCurrent of SymRoot) which will be the local symbol table of current subprogram.
 Var defineRegionVar(java.lang.String pInternedName, RegionType pType)
          defineRegionVar Define the region variable of the region type pType in the symTableRoot.
 Subp defineSubp(java.lang.String pInternedName, Type pType)
          defineSubp Define a subprogram in the current symbol table symRoot.symTableCurrent.
 Var defineVar(java.lang.String pInternedName, Type pType)
          defineVar Define a variable with name shown by pInternedName in the current symbol table (symTableCurrent of SymRoot).
 Var defineVar(java.lang.String pInternedName, Type pType, Sym pDefinedIn)
          defineVar with defined-in parameter Define a variable with name shown by pInternedName in the current symbol table (symTableCurrent of SymRoot).
 Sym derivedSym()
          derivedSym Generate a symbol having the same type and kind as that of this symbol in symTableCurrentSubp, or symTableCurrent if symTableCurrentSubp is null.
 EnumType enumType(IrList pElemList, Sym pTag)
          enumType with element list and tag Make an instance of EnumType in symRoot.symTableCurrent and prepare for making its origin type where nameOfTag is the name string of pTag, enumName is enumeration name and enumValue is value.
 EnumType enumType(java.lang.String pInternedName, IrList pEnumList, Sym pTag)
           
 FloatConst floatConst(double pFloatValue, Type pType)
          Make constant object corresponding to pDoubleConst.
 FloatConst floatConst(java.lang.String pInternedName, Type pType)
          Make constant object corresponding to pInternedName.
 int getDefinedColumn()
          getDefinedColumn Get the column number of the first declaration for this symbol.
 java.lang.String getDefinedFile()
          getDefinedFile Get the symbol table entry representing the name of the file that defined this symbol for the first time.
 Sym getDefinedIn()
          getDefinedIn Get the name of the construct containing the definition of this symbol (see defineUnique, Define, etc.).
 java.lang.String getDefinedInName()
          getDefinedInName Get the name of getDefinedIn().
 int getDefinedLine()
          getDefinedLine Get the line number of the first declaration for this symbol.
 boolean getFlag(int pFlagNumber)
          getFlag getFlag returns the value (true/false) of the flag indicated by pFlagNumber.
 SymInf getInf()
          getInf Get additional information (for optimization, parallelization, etc.)
 java.lang.String getName()
          getName Get the name of this symbol.( The same name as in the source file. )
 java.lang.String getNameOrNull(Sym pSym)
          getNameOrNull If pSym is not null, return its name, else return null.
 Sym getNextSym()
          getNextSym Get the next symbol
 SymInf getOrAddInf()
          getOrAddInf get attached information.
 Sym getOriginalSym()
          Get original symbol corresponding to uniqueNameSym if this is a unique name symbol generated by setUniqueNameToAllSym().
 Sym getOriginalSym(java.lang.String pName)
          Get original symbol corresponding to the symbol named pName.
 java.lang.String getPureName()
          getPureName Get the name of this symbol.
 SymTable getRecordedIn()
          getRecordedIn Get the symbol table that recorded this symbol.
 SourceInf getSourceInf()
           
 int getSymKind()
          getSymKind Get the symbol kind of this symbol (KIND_VAR, KIND_SUBP, etc.).
 java.lang.String getSymKindName()
          getSymKindName Get the symbol kind name from GlobalConstants.
 Type getSymType()
          getSymType Get the type of this symbol.
 java.lang.String getUniqueName()
          getUniqueName Get the UniqueName of this symbol.
 java.lang.Object getWork()
          Get phase-wise work used for arbitrary purpose in each phase.
 IntConst intConst(long pIntValue, Type pType)
          Make integer constant object corresponding to pLongConst.
 IntConst intConst(java.lang.String pInternedName, Type pType)
          Make constant object corresponding to pInternedName.
 java.lang.Integer intObject(int pIntValue)
          Make java.lang.Integer object corresponding to pIntValue.
 boolean isGlobal()
          isGlobal
 boolean isHIR()
          Test if this is an HIR object.
 boolean isRemoved()
          isRemoved
 boolean isSym()
          Test if this is a Sym object.
 void linkSym(Sym pNextSym)
          linkSym Link pNextSym as the next to this symbol.
 java.lang.String makeCstring(java.lang.String pStringBody)
          makeCstring Change the pure string pStringBody to C string representation adding heading, trailing quotes and escape characters if required.
 java.lang.String makeCstringWithTrailing0(java.lang.String pStringBody)
          makeCstringWithTrailing0 Change the pure string pStringBody to C string representation adding heading, trailing quotes and escape characters if required.
 java.lang.String makeEnumTypeName(IrList pElemList)
          Make a string where, name1, name2, ... are the name of enum element 1, element 2, ... , and value1, value2, ... are the value of enum element 1, element 2, ... .
 java.lang.String makeExpString(Exp pExp)
           
 java.lang.String makeJavaString(java.lang.String pStringBody)
          makeJavaString Change the pure string pStringBody to Java String representation adding heading, trailing quotes and escape characters if required.
 java.lang.String makeStructUnionTypeName(boolean pStruct, IrList pElemList)
          Make a string of or where, Type1, Type2, ... are type name of struct/union element 1, element 2, ... .
 java.lang.String makeSubpTypeName(Type pReturnType, IrList pParamList, boolean pOptionalParam)
           
 java.lang.String makeSubpTypeName(Type pReturnType, IrList pParamList, boolean pOptionalParam, boolean pNoParamSpec)
          Make a string optionalParam returnType > where, paramType1, paramType2, ... are the type name of parameter 1, parameter 2, ... , and optionalParam is true or false, and returnType is the type name of return value type.
 java.lang.String makeVectorTypeName(Type pElemType, Exp pElemCountExp, long pElemCount, Exp pLowerBoundExp, long pLowerBound)
          makeVectorTypeName Make a vector type name of the form .
 java.lang.String makeVectorTypeName(Type pElemType, long pElemCount)
          makeVectorTypeName with default lower bound Make a vector type name of the form .
 java.lang.String makeVectorTypeName(Type pElemType, long pElemCount, long pLowerBound)
          makeVectorTypeName Make a vector type name of the form .
 NamedConst namedConst(java.lang.String pInternedName, Const pConst)
          Make a constant named as pInternedName.
 NamedConst namedConst(java.lang.String pInternedName, int pIndex, Type pType)
          Make a constant named as pInternedName.
 PointerType pointerType(java.lang.String pInternedName, Type pPointedType, Sym pDefinedIn)
           
 PointerType pointerType(Type pPointedType)
          pointerType with simple parameter Get the pointer type that points to an object of type pPointedType.
 PointerType pointerType(Type pPointedType, long pElemCount)
          pointerType with element count Get a PointeType that points to an object of type pPointedType with element count.
 PointerType pointerType(Type pPointedType, long pElemCount, long pLowerBound)
          pointerType with element count Get a PointeType that points to an object of type pPointedType with element count and lower bound.
 PointerType pointerType(Type pPointedType, SymTable pSymTable)
          pointerType specifying symbol table Get the pointer type that points to an object of type pPointedType.
 void print(int pIndent)
          Print the object.
 void print(int pIndent, boolean pDetail)
          Print the object.
 RegionType regionType(java.lang.String pRegionNameString)
           
 RegionType regionType(java.lang.String pRegionNameString, int pStorageClass)
          regionType: Make an instance of RegionType in symRoot.symTableRoot.
 void remove()
          remove Remove this symbol.
 void setDefinedFile(java.lang.String pDefinedFile)
          setDefinedFile Set the name of the file defining this symbol.
 void setDefinedIn(Sym pDefiningSym)
          setDefinedIn Set "definedIn" symbol of this symbol if it is not set by defineUnique, Define, and redefine.
 void setDefinedLine(int pDefinedLine)
          setDefinedLine Set the line number of declaration defining this symbol.
 void setFlag(int pFlagNumber, boolean pYesNo)
          setFlag setFlag sets the flag of specified number.
 void setOriginalSym(Sym pOriginalSym)
           
 void setParameters(MachineParam pMachineParam, SourceLanguage pSourceLanguage)
          setParameters makes machineParam and sourceLanguage available to Sym methods.
 void setRecordedIn(SymTable pSymTable)
          setRecordedIn Link to the symbol table that recorded this symbol.
 void setSourceInf(SourceInf pInf)
           
 void setSymKind(int pSymKind)
          setSymKind Set the symbol kind of this symbol (KIND_VAR, KIND_SUBP, etc.).
 void setSymType(Type pSymType)
          setSymType Set the type of this symbol.
 void setUniqueNameSym(Sym pUniqueNameSym)
          setUniqueNameSym Set the UniqueName of this symbol.
 void setWork(java.lang.Object pWork)
          Set phase-wise work used for arbitrary purpose in each phase.
 StringConst stringConst(java.lang.String pInternedName)
          stringConst Make a string constant (StringConst object) from given string pInternedName which has no heading and trailing quotes ('"').
 StringConst stringConstFromQuotedString(java.lang.String pInternedName)
          stringConstFromQuotedString Make a string constant (StringConst object) from given string pInternedName that has heading and trailing quote '"'.
 StructType structType(IrList pElemList, Sym pTag)
          structType with element list and tag Make an instance of StructType in symRoot.symTableCurrent and prepare for making its origin type where nameOfTag is the name string of pTag, elemSym is struct element and elemType is its type.
 StructType structType(java.lang.String pInternedName, IrList pElemList, Sym pTag)
           
 SubpType subpType(Type pReturnType, IrList pParamList, boolean pOptionalParam, boolean pNoParamSpec, Sym pDefinedIn)
          subpType (with pPermitAnyParam) Make subprogram type (SubpType) from parameter list, etc.
 SubpType subpType(Type pReturnType, IrList pParamList, boolean pOptionalParam, Sym pDefinedIn)
           
 Sym symbol(java.lang.String pInternedName, Type pType, Sym pDefinedIn)
          symbol Create a Sym object of pType.
 java.lang.String toString()
          Get the string image of object.
 java.lang.String toStringDetail()
          toStringDetail Get detailed attributes of this symbol in text which is not interned.
 java.lang.String toStringShort()
          toStringShort Get name and index of this symbol in text which is not interned.
 UnionType unionType(IrList pElemList, Sym pTag)
          unionType with element list and tag Make an instance of UnionType in symRoot.symTableCurrent and prepare for making its origin type where nameOfTag is the name string of pTag, elemSym is union element and elemType is its type.
 UnionType unionType(java.lang.String pInternedName, IrList pElemList, Sym pTag)
           
 VectorType vectorType(java.lang.String pTypeName, Type pElemType, Exp pElemCountExp, Exp pLowerBoundExp)
          vectorType with element count and lower bound as expression.
 VectorType vectorType(java.lang.String pTypeName, Type pElemType, long pElemCount, long pLowerBound)
          vectorType with element count and lower bound as integer number.
 VectorType vectorType(Type pElemType, Exp pElemCountExp)
          vectorType with element count given as an expression.
 VectorType vectorType(Type pElemType, long pElemCount)
          vectorType with element count given as integer number.
 VectorType vectorTypeUnfixed(Type pElemType, Exp pLowerBoundExp)
          vectorType having unfixed number of element of pElemType.
 VectorType vectorTypeUnfixed(Type pElemType, long pLowerBound)
          vectorType having unfixed number of element of pElemType.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

symRoot

public final SymRoot symRoot

fUniqueNameSym

public Sym fUniqueNameSym
The unique name which has been made by this compiler.


fName

protected java.lang.String fName
The symbol name in the source file.


fKind

protected int fKind
The Symbol kind


fType

protected Type fType
The type of this symbol


fRecordedIn

protected SymTable fRecordedIn
fRecordedIn Symbol table recording this symbol.


fDefinedIn

protected Sym fDefinedIn
Upper construct that defines this symbol such as subprogram for local variable, struct/union tag name for struct/union element, enum tag for enumeration constant, etc. It may be null if there is no upper construct (in such case as global variable, global subprogram, etc.)


fNextSym

protected Sym fNextSym
The next symbol


fFlagBox

protected FlagBox fFlagBox
The flag, which represents this symbol's kind by bit mask.


fSymInf

protected SymInf fSymInf
Information attached to this symbol


fSourceInf

protected SourceInf fSourceInf
Source program information -- file name, line number, column defining this symbol.


fWork

protected java.lang.Object fWork
Phase-wise work used for arbitrary purpose in each phase


machineParam

protected static MachineParam machineParam

sourceLanguage

protected static SourceLanguage sourceLanguage

fDbgLevel

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

SymImpl

public SymImpl()

SymImpl

public SymImpl(SymRoot pSymRoot)
SymImpl Constructor to set symRoot.


SymImpl

public SymImpl(SymRoot pSymRoot,
               java.lang.String pInternedName)
メソッドの詳細

setParameters

public void setParameters(MachineParam pMachineParam,
                          SourceLanguage pSourceLanguage)
setParameters makes machineParam and sourceLanguage available to Sym methods. setParameters is not recommended to be used except in SymRoot.


boolConst

public BoolConst boolConst(boolean pTrueFalse)
インタフェース Sym の記述:
boolConst Make BoolConst object corresponding to pBoolConst.

定義:
インタフェース Sym 内の boolConst
パラメータ:
pTrueFalse - true or false.
戻り値:
boolConstTrue or boolConstFalse that are the same to those ones in SymRoot corresponding to pInternedName.

charConst

public CharConst charConst(java.lang.String pInternedName,
                           Type pType)
インタフェース Sym の記述:
Make constant object corresponding to pInternedName.

定義:
インタフェース Sym 内の charConst
パラメータ:
pInternedName - Character string representing the constant.
pType - Type of the constant object to be created; It may be typeChar or typeU_Char of SymRoot.
戻り値:
constant object of the type specified by pType.

charConst

public CharConst charConst(char pChar,
                           Type pType)
インタフェース Sym0 の記述:
Make constant object corresponding to pChar.

定義:
インタフェース Sym0 内の charConst
パラメータ:
pChar - Character representing the constant.
pType - Type of the constant object to be created; It may be typeChar or typeU_Char of SymRoot.
戻り値:
constant object of the type specified by pType.

charConst

public CharConst charConst(int pCharCode,
                           Type pType)

intConst

public IntConst intConst(java.lang.String pInternedName,
                         Type pType)
インタフェース Sym の記述:
Make constant object corresponding to pInternedName. The string representation of the constant takes the form specified in the source language. As for C language, when the last character of pInternedname is a digit, L is appended for long int, UL for unsigned long int, U for unsigned int, U for unsigned short.

定義:
インタフェース Sym 内の intConst
パラメータ:
pInternedName - Character string representing an integer constant.
pType - Type of the constant object to be created; It may be typeShort, typeInt, typeLong, typeLongLong, typeU_short, typeU_int, typeU_Long, typeU_LongLong of SymRoot.
戻り値:
constant object of the type specified by pType.

intConst

public IntConst intConst(long pIntValue,
                         Type pType)
インタフェース Sym0 の記述:
Make integer constant object corresponding to pLongConst. The string representation of the constant converted from the binary representation pLongConst takes the form specified in the source language. As for C language, L is appended for long int, UL for unsigned long int, U for unsigned int, U for unsigned short.

定義:
インタフェース Sym0 内の intConst
パラメータ:
pIntValue - Long integer representing the constant.
pType - Type of the constant object to be created; It may be typeShort, typeInt, typeLong, typeLongLong, typeU_short, typeU_int, typeU_Long, typeU_LongLong of SymRoot.
戻り値:
constant object of the type specified by pType.

floatConst

public FloatConst floatConst(java.lang.String pInternedName,
                             Type pType)
インタフェース Sym の記述:
Make constant object corresponding to pInternedName.

定義:
インタフェース Sym 内の floatConst
パラメータ:
pInternedName - Character string representing the constant.
pType - Type of the constant object to be created; It may be typeFloat, typeDouble, typeLongDouble of SymRoot.
戻り値:
constant object of the type specified by pType.

floatConst

public FloatConst floatConst(double pFloatValue,
                             Type pType)
インタフェース Sym0 の記述:
Make constant object corresponding to pDoubleConst.

定義:
インタフェース Sym0 内の floatConst
パラメータ:
pFloatValue - Double constant representing the constant.
pType - Type of the constant object to be created; It may be typeFloat, typeDouble of SymRoot; For LongDouble, this method can not be used, but use another floatConst method.
戻り値:
constant object of the type specified by pType.

stringConst

public StringConst stringConst(java.lang.String pInternedName)
インタフェース Sym0 の記述:
stringConst
  Make a string constant (StringConst object) from
  given string pInternedName which has no heading and trailing
  quotes ('"').
  If the source language requests heading and trailing quotes
  in constant representation, they should be pealed off in
  pInternedName.
  The string constant is recorded as a pure string (processing
  escape characters by makeStringBody of coins.SourceLanguage)
  derived from pInternedName.
  If pInternedName has heading or trailing quotes, they are
  treated as a part of the pure string.
  getStringBody() will give the pure string.
  getName() or getSymName() will give a string that is composed
  of heading quote '"', pure string, and trailing quote '"'.
  Debug print method (toString()) will change the pure string
  to the form of Java String adding heading, trailing '"',
  and escape characters.
  The type of the string constant is set as a vector of characters
  with length given by getStringLength() of SourceLanguage.
  See makeJavaString(), makeCstring(), makeCstringWithTrailing0().

定義:
インタフェース Sym0 内の stringConst
パラメータ:
pInternedName - string from which StringConst is to be made.
戻り値:
the string constant (StringConst object).

stringConstFromQuotedString

public StringConst stringConstFromQuotedString(java.lang.String pInternedName)
インタフェース Sym の記述:
stringConstFromQuotedString Make a string constant (StringConst object) from given string pInternedName that has heading and trailing quote '"'. This method is almost the same as stringConst except that pInternedName has heading and trailing quotes. The string constant is recorded as pure string (peeling off the heading and trailing '"' and processing escape characters by makeStringBody of coins.SourceLanguage) just like stringConst. As for other items, the specifications are the same as stringConst.

定義:
インタフェース Sym 内の stringConstFromQuotedString
パラメータ:
pInternedName - string from which StringConst is to be made; It should have heading and trailing quotes.
戻り値:
the string constant (StringConst object).

bareStringConst

public StringConst bareStringConst(java.lang.String pInternedName)

makeJavaString

public java.lang.String makeJavaString(java.lang.String pStringBody)
インタフェース Sym の記述:
makeJavaString Change the pure string pStringBody to Java String representation adding heading, trailing quotes and escape characters if required.

定義:
インタフェース Sym 内の makeJavaString
パラメータ:
pStringBody - String made by makeStringBody of coins.SourceLanguage.
戻り値:
the interned string changed in Java form.

makeCstring

public java.lang.String makeCstring(java.lang.String pStringBody)
インタフェース Sym の記述:
makeCstring Change the pure string pStringBody to C string representation adding heading, trailing quotes and escape characters if required. Trailing \0 is not added as printable character. See makeCstring of StringConst, and makeCstringWithTrailing0 of Sym.

定義:
インタフェース Sym 内の makeCstring
パラメータ:
pStringBody - String made by makeStringBody of coins.SourceLanguage.
戻り値:
the interned string changed in C form.

makeCstringWithTrailing0

public java.lang.String makeCstringWithTrailing0(java.lang.String pStringBody)
インタフェース Sym の記述:
makeCstringWithTrailing0 Change the pure string pStringBody to C string representation adding heading, trailing quotes and escape characters if required. Trailing \0 is added as printable character. See makeCstringWithTrailing0 of StringConst.

定義:
インタフェース Sym 内の makeCstringWithTrailing0
パラメータ:
pStringBody - String made by makeStringBody of coins.SourceLanguage.
戻り値:
the interned string changed in C form with trailing \0 as printable character; For example, "abc\?d\0" for a pure string abc?d.

namedConst

public NamedConst namedConst(java.lang.String pInternedName,
                             Const pConst)
インタフェース Sym0 の記述:
Make a constant named as pInternedName.

定義:
インタフェース Sym0 内の namedConst
パラメータ:
pInternedName - Name of Sym whose kind is Sym.KIND_NAMED_CONST to represent the constant.
pConst - Constant symbol to be named. If it is an object that can be converted to integer, index of the named constant is computed.
戻り値:
the named constant object.

namedConst

public NamedConst namedConst(java.lang.String pInternedName,
                             int pIndex,
                             Type pType)
インタフェース Sym の記述:
Make a constant named as pInternedName.

定義:
インタフェース Sym 内の namedConst
パラメータ:
pInternedName - Name of Sym whose kind is Sym.KIND_NAMED_CONST to represent the constant.
pIndex - Index to be assigned to the named constant.
pType - Type of the constant to be named; It may be typeChar, typeShort, typeInt, typeU_Char, typeU_short, typeU_int.
戻り値:
the named constant object.

intObject

public java.lang.Integer intObject(int pIntValue)
インタフェース Sym の記述:
Make java.lang.Integer object corresponding to pIntValue.

定義:
インタフェース Sym 内の intObject
パラメータ:
pIntValue - Integer representing the constant.
戻り値:
Integer constant object.

defineVar

public Var defineVar(java.lang.String pInternedName,
                     Type pType)
インタフェース Sym0 の記述:
defineVar Define a variable with name shown by pInternedName in the current symbol table (symTableCurrent of SymRoot). It is treated as a local variable of SymRoot.subpCurrent or global variable if SymRoot.subpCurrent is null. See seach, searchLocal of SymTable for searching defined variable.

定義:
インタフェース Sym0 内の defineVar
パラメータ:
pInternedName - Character string representing the name of the variable to be defined.
pType - Type of the variable to be defined.
戻り値:
the Var object created; If there is already a symbol with the same name in the current symbol table (symTableCurrent), then issue message and return null.

defineVar

public Var defineVar(java.lang.String pInternedName,
                     Type pType,
                     Sym pDefinedIn)
インタフェース Sym の記述:
defineVar with defined-in parameter Define a variable with name shown by pInternedName in the current symbol table (symTableCurrent of SymRoot). Usage and function are the same as previous defineVar except that this has pDefinedIn parameter.

定義:
インタフェース Sym 内の defineVar
パラメータ:
pDefinedIn - outer language construct such as subprogram that defines the variable.

defineRegionVar

public Var defineRegionVar(java.lang.String pInternedName,
                           RegionType pType)
defineRegionVar Define the region variable of the region type pType in the symTableRoot. The region variable is recorded in the region type and the region type is set as the type of the region variable.


defineParam

public Param defineParam(java.lang.String pInternedName,
                         Type pType)
インタフェース Sym0 の記述:
defineParam Define a paramater with the name shown by pInternedName in the current symbol table (symTableCurrent of SymRoot) which will be the local symbol table of current subprogram. (See pushSymTable() of SymTable.java). The parameter is assumed to be a parameter of the current subprogram (symRoot.subpCurrent). See seach, searchLocal of SymTable for searching defined parameter.

定義:
インタフェース Sym0 内の defineParam
パラメータ:
pInternedName - Character string representing the name of the parameter to be defined.
pType - Type of the parameter to be defined.
戻り値:
the Param object created; If there is already a symbol with the same name in the current symbol table (symTableCurrent), then issue message and return null.

defineElem

public Elem defineElem(java.lang.String pInternedName,
                       Type pType)
インタフェース Sym0 の記述:
defineElem Define a struct/union element with the name shown by pInternedName in the current symbol table (symTableCurrent of SymRoot) which will be the local symbol table of the struct or union including the element. It is assumed that a local symbol table is created by pushSymTable(structUnionType) at struct or union processing before calling defineElem, where, structUnionType is the Type object of the struct or union that includes the element. The owner (definedIn) of the element is structUnionType. See searchLocal of SymTable for searching defined element.

定義:
インタフェース Sym0 内の defineElem
パラメータ:
pInternedName - Character string representing the name of the element to be defined.
pType - Type of the element to be defined.
戻り値:
the Elem object created; If there is already a symbol with the same name in the current symbol table (symTableCurrent), then issue message and return null.

defineSubp

public Subp defineSubp(java.lang.String pInternedName,
                       Type pType)
インタフェース Sym0 の記述:
defineSubp
  Define a subprogram in the current symbol table
  symRoot.symTableCurrent.
  In order to define a subprogram symbol,
    make the subprogram symbol by defineSubp(...),
    add formal parameters by addParam(....),
    close the subprogram declaration by closeSubpHeader(....)
  in such way as
    Subp lSubp = symRoot.sym.defineSubp("name".intern(), returnType);
    symRoot.symTableRoot.pushSymTable(lSubp);
    lSubp.addParam(param1);
    lSubp.addParam(param2);
    ....
    lSubp.setOptionalparam(); // only when optional parameter is given.
    lSubp.setVisibility(Sym.SYM_PUBLIC); // only if public.
    lSubp.closeSubpHeader();
    Var lVi = symRoot.sym.defineVar("i".intern(), symRoot.typeInt); // local symbols
    ....
    symRoot.symTableCurrent.popSymTable();
  Above procedsure will make a subprogram object with
  inevitable fields such as parameter list,
  return value type, and subprogram type.
  closeSubpHeader() will make subprogram type of the form
     returnValueType
          optionalParam >
  where, paramType_1, paramType_2, ... are parameter type,
  returnValueType is return value type,
  optionalParam is true or false depending on whether optional
  parameter (... in C) is specified or not.
  The subprogram type of a subprogram lSubp can be get
  by lSubp.getSymType(), whereas the return value type
  can be get by lSubp.getReturnValueType().
  Multiple definition of subprogram symbol is allowed
  because there may be multiple prototype declaration
  or extern declaration for the same subprogram in languages
  such as C. It is the task of semantic analyzer to check
  the inconsistency between the multiple declarations
  and to restrict the update of specifications for previously
  declared subprogram.
  Until closeSubpHeader() is called for the subprogram lSubp,
  lSubp.getSymType() is null, and until subprogram body is
  defined, lSubp.getHirBody() is null. These information
  may be used in checking the declarations for a subprogram.
  See seach method of SymTable for searching subprogram
  with specific name.
  As for detail, see Subp interface, too.
  As for prototype declaration, see also Subp interface.

定義:
インタフェース Sym0 内の defineSubp
パラメータ:
pInternedName - Name of the subprogram.
pType - Return value type; If no value is returned then specify void type (symRoot.typeVoid).

defineLabel

public Label defineLabel(java.lang.String pInternedName)
インタフェース Sym0 の記述:
defineLabel Define a label named as pInternedName in the symbol table of current subprogram (symRoot.symTableCurrentSubp). See seachLocal of SymTable for searching defined label.

定義:
インタフェース Sym0 内の defineLabel
パラメータ:
pInternedName - Name of the label.
戻り値:
the label symbol; If there is already a label with the same name, then message is issued and null is returned.

baseType

public BaseType baseType(java.lang.String pInternedName,
                         int pTypeKind)
インタフェース Sym の記述:
baseType Create an instance of base type. (Usually, it is not necessary to call baseType method because all base types are created in SymRoot.)

定義:
インタフェース Sym 内の baseType
パラメータ:
pInternedName - name of the base type ("int", float", etc.).
pTypeKind - type kind defined in Type.java (KIND_INT, KIND_FLOAT, etc.).
戻り値:
the created Type object.

vectorType

public VectorType vectorType(Type pElemType,
                             long pElemCount)
vectorType with element count given as integer number. Type name is generated by makeVectorTypeName. The lower bound is assumed to be 0. If 0 is given as element count, then the vector type is assumed to be incomplete type.

定義:
インタフェース Sym0 内の vectorType
パラメータ:
pElemType - Type of the vactor element.
pElemCount - Number of elements in the vector.
戻り値:
the vector type.

vectorType

public VectorType vectorType(Type pElemType,
                             Exp pElemCountExp)
vectorType with element count given as an expression. Type name is generated by makeVectorTypeName. The lower bound is assumed to be 0. If 0 is given as element count expression, then the vector type is assumed to be incomplete type.

定義:
インタフェース Sym 内の vectorType
パラメータ:
pElemType - Type of the vactor element.
pElemCountExp - Expression representing the number of elements in the vector. The element count is computed by evaluating this parameter.
戻り値:
the vector type.

vectorType

public VectorType vectorType(java.lang.String pTypeName,
                             Type pElemType,
                             long pElemCount,
                             long pLowerBound)
vectorType with element count and lower bound as integer number. Type name is generated by makeVectorTypeName. If 0 is given as element count, then the vector type is assumed to be incomplete type.

定義:
インタフェース Sym 内の vectorType
パラメータ:
pTypeName - Type name of the vector. It may have const or volatile qualifier attached to ordinary vector type name. If pTypeName is null, a vector type name will be generated by makeVectorTypeName method.
pElemType - Type of the vactor element.
pElemCount - Number of elements in the vector.
pLowerBound - Lower bound of the subscript of the vector.
戻り値:
the vector type.

vectorType

public VectorType vectorType(java.lang.String pTypeName,
                             Type pElemType,
                             Exp pElemCountExp,
                             Exp pLowerBoundExp)
vectorType with element count and lower bound as expression. Type name is generated by makeVectorTypeName. If 0 is given as element count, then the vector type is assumed to be incomplete type.

定義:
インタフェース Sym 内の vectorType
パラメータ:
pElemType - Type of the vactor element.
pElemCountExp - Number of elements in the vector.
pLowerBoundExp - Lower bound of the subscript of the vector.
pTypeName - Interned name of this vector type; It takes the form where, elemCount is the expression represented by pElemCountExp, lowerBound is the expression represented by pLowerBound, elemType is the name of type represented by pElemType; (See makeVectorTypeName below;) The name may have const or volatile qualifier.
戻り値:
the vector type.

vectorTypeUnfixed

public VectorType vectorTypeUnfixed(Type pElemType,
                                    long pLowerBound)
インタフェース Sym0 の記述:
vectorType having unfixed number of element of pElemType. The element count is to be fixed at execution time and at compile time, it is tentatively treated as 0. Its name is . where, elemType is the type represented by pElemType and lowerBound is the value given by pLowerBound. If a vector type with the same element type, element count and lower bound is found, then it is returned. If not found, then VectorType object is created and returned. The vector type is searched or created in the same symbol table where pElemType is defined. For the VectorType with unfixed element count, getFlag(Sym.FLAG_UNFIXED_SIZE) returns true. If pElemType is unfixed length type, then warning message is issued.

定義:
インタフェース Sym0 内の vectorTypeUnfixed
パラメータ:
pElemType - is the type of the vector element.
pLowerBound - is the lower bound of subscript.
戻り値:
the vector type.

vectorTypeUnfixed

public VectorType vectorTypeUnfixed(Type pElemType,
                                    Exp pLowerBoundExp)
インタフェース Sym の記述:
vectorType having unfixed number of element of pElemType. The element count is to be fixed at execution time and at compile time, it is tentatively treated as 0. Its name is . where, elemType is the type represented by pElemType and lowerBound is the expression given by pLowerBoundExp. If a vector type with the same element type, element count and lower bound is found, then it is returned. If not found, then VectorType object is created and returned. The vector type is searched or created in the same symbol table where pElemType is defined. For the VectorType with unfixed element count, getFlag(Sym.FLAG_UNFIXED_SIZE) returns true. If pElemType is unfixed length type, then warning message is issued.

定義:
インタフェース Sym 内の vectorTypeUnfixed
パラメータ:
pElemType - is the type of the vector element.
pLowerBoundExp - is an expression showing the lower bound of subscript.
戻り値:
the vector type.

pointerType

public PointerType pointerType(Type pPointedType)
インタフェース Sym0 の記述:
pointerType with simple parameter Get the pointer type that points to an object of type pPointedType. Its name is . If a pointer type with the same pointed type is found, then it is returned. If not found, then PointerType object is created and returned. The pointer type is searched or created in the current symbol table (symRoot.symTableCurrent) from where pPointedType should be visible.

定義:
インタフェース Sym0 内の pointerType
パラメータ:
pPointedType - type of the object to be pointed.
戻り値:
the pointer type.

pointerType

public PointerType pointerType(Type pPointedType,
                               SymTable pSymTable)
インタフェース Sym の記述:
pointerType specifying symbol table Get the pointer type that points to an object of type pPointedType. Its name is . If a pointer type with the same pointed type is found, then it is returned. If not found, then PointerType object is created and returned. The pointer type is searched or created in pSymTable.

定義:
インタフェース Sym 内の pointerType
パラメータ:
pPointedType - type of the object to be pointed.
pSymTable - the symbol table in which the pointer type is searched or created, where, the pointed type should be visible from the symbol table.
戻り値:
the pointer type.

pointerType

public PointerType pointerType(java.lang.String pInternedName,
                               Type pPointedType,
                               Sym pDefinedIn)

pointerType

public PointerType pointerType(Type pPointedType,
                               long pElemCount)
インタフェース Sym の記述:
pointerType with element count Get a PointeType that points to an object of type pPointedType with element count. It represents a an array. This pointer represents a vector whose element count is pElemCount and lower bound is 0. Its name is . Other items are the same to pointerType.

定義:
インタフェース Sym 内の pointerType
パラメータ:
pPointedType - type of the object to be pointed.
pElemCount - number of elements of the vector represented by the pointer.
戻り値:
the pointer type.

pointerType

public PointerType pointerType(Type pPointedType,
                               long pElemCount,
                               long pLowerBound)
インタフェース Sym の記述:
pointerType with element count Get a PointeType that points to an object of type pPointedType with element count and lower bound. It represents a an array. This pointer represents a vector whose element count is pElemCount and lower bound pLowerBound. Its name is . Other items are the same to pointerType.

定義:
インタフェース Sym 内の pointerType
パラメータ:
pPointedType - type of the object to be pointed.
pElemCount - number of elements of the vector represented by the pointer.
pLowerBound - subscript lower bound of the array represented by the pointer.
戻り値:
the pointer type.

structType

public StructType structType(IrList pElemList,
                             Sym pTag)
インタフェース Sym0 の記述:
structType with element list and tag
  Make an instance of StructType
     
  in symRoot.symTableCurrent and prepare for making its
  origin type
     
  where nameOfTag is the name string of pTag, elemSym is
  struct element and elemType is its type.
  If pElemList is null, addElem of StructType should be called for
  each element of the structure in the order of declaration.
  After all elements has been added, finishStructType of StructType
  should be called to close the declaration of the structure.
  If pElemList is null,  is an incomplete type
  until finishStructType is called. If pElemList is not null,
  the origin type
     
  is also created as a complete type.
  Example of using structType:
    As for
       struct listNode {
         int nodeValue;
         struct listNode *next;
        } listAnchor, listNode1;
    following coding will make corresponding StructType.
      Sym lTag = symRoot.symTableCurrent.generateTag("listNode".intern());
      StructType lListStruct = sym.structType(null, lTag); // Incomplete type.
      PointerType lListPtrType = sym.pointerType(lListStruct);
      PointerType lIntPtrType = sym.pointerType(symRoot.typeInt);
      symRoot.symTableCurrent.pushSymTable(lListStruct);
      Elem lValue = sym.defineElem("nodeValue".intern(), symRoot.typeInt);
      Elem lNext  = sym.defineElem("next".intern(), lListPtrType);
      lListStruct.addElem(lValue);
      lListStruct.addElem(lNext);
      lListStruct.finishStructType(true);
      symRoot.symTableCurrent.popSymTable();
  As for the size, alignment, element displacement of structure type,
  see finishStructType in StructType interface.
  If some element is unfixed-size (getFlag(Sym.FLAG_UNFIXED_SIZE) //##64
  is true), then the resultant StructType become unfixed-size //##64
  and message will be issued informing that. //##64

定義:
インタフェース Sym0 内の structType
パラメータ:
pElemList - List of structure element (may be null); It can be created by statement sequence IrList lElemList = symRoot.hirRoot.hir.irList(); lElemList.add(elem1); lElemList.add(elem2); ... If pElemList is not null, it should contain all elements of the structure.
pTag - Tag name of the struct; If it is not given in source program, give it by generating it by generateTag() of SymTable.
戻り値:
StructType instance.

structType

public StructType structType(java.lang.String pInternedName,
                             IrList pElemList,
                             Sym pTag)

unionType

public UnionType unionType(IrList pElemList,
                           Sym pTag)
インタフェース Sym0 の記述:
unionType with element list and tag
  Make an instance of UnionType
     
  in symRoot.symTableCurrent and prepare for making its
  origin type
     
  where nameOfTag is the name string of pTag, elemSym is
  union element and elemType is its type.
  If pElemList is null, addElem of UnionType should be called for
  each element of the union in the order of declaration.
  After all elements has been added, finishUnionType of UnionType
  should be called to close the declaration of the union.
  If pElemList is null,  is an incomplete type
  until finishUnionType is called. If pElemList is not null,
  the origin type
     
  is also created as a complete type.
  If some element is unfixed-size (getFlag(Sym.FLAG_UNFIXED_SIZE) //##64
  is true), then the resultant UnionType become unfixed-size //##64
  and warning message will be issued informing that. //##64

定義:
インタフェース Sym0 内の unionType
パラメータ:
pElemList - List of union element (may be null); It can be created by statement sequence IrList lElemList = symRoot.hirRoot.hir.irList(); lElemList.add(elem1); lElemList.add(elem2); ... If pElemList is not null, it should contain all elements of the structure.
pTag - Tag name of the union; If it is not given in source program, give it by generating it by generateTag() of SymTable.
戻り値:
UnionType instance.

unionType

public UnionType unionType(java.lang.String pInternedName,
                           IrList pElemList,
                           Sym pTag)

regionType

public RegionType regionType(java.lang.String pRegionNameString,
                             int pStorageClass)
インタフェース Sym の記述:
regionType:
  Make an instance of RegionType
     
  in symRoot.symTableRoot.
  Region is a global area shared between subprograms
  and between compile units. A region may have several
  symbol tables containing declarations of variables to be
  allocated in it.
  After all elements has been added to a region in a subprogram,
  finishCurrentRegion of RegionType should be called for the region
  to close the declaration of the region.
  For unnamed region (blank region), regionType is already called in
  SymRoot and can be accessed by symRoot.typeRegion,
  but it is necessary to add elements and call finishCurrentRegion
  when there is unnamed region in given program.
  Processing sequence for defining a region is as follows
    RegionType lRegionType;   // Region type to be defined.
    SymTable lRegionSymTable; // Symbol table to record the
                       // elements declared for the region.
                       // It may be the symbol table local to
                       // the current subprogram.
    Subp lCurrentSubp; // Subprogram that includes the
                       // declaration of the region.
    Var  lRegionVar;   // Aggregate variable that represents
                       // the whole elements declared
                       // in the region.
    Elem lEmem;        // Element declared in the region.
    lRegionType = symRoot.sym.regionType(regionName.intern());
    lRegionSymTable = symRoot.symTableCurrentSubp;
    lRegionType.addSubp(symRoot.subpCurrent, lRegionSymTable);
    // For each declaration of variable to be included in
    // the region do {
      lElem = symRoot.sym.defineElem(....);
      lRegionType.addElemToCurrentRegion(lElem);
    // }
    lRegionType.finishCurrentRegion();
  To use the variables included in the region,
  treat them in the similar way as structure elements:
    lRegionVar = lRegionType.getRegionVar();
    Exp lExp = hirRoot.hir.qualifiedExp(
       hirRoot.hir.varNode(lRegionVar),
       hirRoot.hir.elemNode(lElem));
    // See HIR.java for qualifiedExp.

定義:
インタフェース Sym 内の regionType
パラメータ:
pRegionNameString - Interned name of the region;
pStorageClass - give VAR_STATIC or VAR_AUTO of Var interface.
戻り値:
RegionType instance.

regionType

public RegionType regionType(java.lang.String pRegionNameString)

enumType

public EnumType enumType(IrList pElemList,
                         Sym pTag)
インタフェース Sym0 の記述:
enumType with element list and tag
  Make an instance of EnumType
     
  in symRoot.symTableCurrent and prepare for making its
  origin type
     
  where nameOfTag is the name string of pTag, enumName is
  enumeration name and enumValue is value.
  If pElemList is null, addElem of EnumType should be called for
  each element of the enum in the order of declaration.
  After all elements has been added, finishEnumType of EnumType
  should be called to close the declaration of the enum.
  If pElemList is null,  is an incomplete type
  until finishEnumType is called. If pElemList is not null,
  the origin type
     
  is also created as a complete type.

定義:
インタフェース Sym0 内の enumType
パラメータ:
pElemList - List of the pairs of enum name and value; It can be created by statement sequence IrList lElemList = symRoot.hirRoot.hir.irList(); IrList lEnumPair = symRoot.hirRoot.hir.irList(); lEnumPair.add(elem1); lEnumPair.add(symRoot.sym.intObject(value1); lElemList.add(lEnumPair); lEnumPair = symRoot.hirRoot.hir.irList(); lEnumPair.add(elem2); lEnumPair.add(symRoot.sym.intObject(value2); lElemList.add(lEnumPair); ....
pTag - Tag name of the enum; If it is not given in source program, give it by generating it by generateTag() of SymTable.
戻り値:
EnumType instance.

enumType

public EnumType enumType(java.lang.String pInternedName,
                         IrList pEnumList,
                         Sym pTag)

definedType

public DefinedType definedType(java.lang.String pInternedName,
                               Type pOriginalType)
インタフェース Sym0 の記述:
definedType with simple parameter Make a defined type having pOrigin as its origin type. The defined type will be made in symRoot.symTableCurrent.

定義:
インタフェース Sym0 内の definedType
パラメータ:
pInternedName - name string composing the defined name; It may be a tag name. It should be given.
pOriginalType - origin type of the defined type; It should be given.
戻り値:
the defined type .

definedType

public DefinedType definedType(java.lang.String pInternedName,
                               Type pOriginalType,
                               Sym pDefinedIn)

subpType

public SubpType subpType(Type pReturnType,
                         IrList pParamList,
                         boolean pOptionalParam,
                         Sym pDefinedIn)

subpType

public SubpType subpType(Type pReturnType,
                         IrList pParamList,
                         boolean pOptionalParam,
                         boolean pNoParamSpec,
                         Sym pDefinedIn)
インタフェース Sym0 の記述:
subpType (with pPermitAnyParam) Make subprogram type (SubpType) from parameter list, etc. This method is not recommended to be used directly. SubpType of a subprogram can be made by closeSubpHeader() or closeSubpPrototype() of Subp without calling subpType directly. (See defineSubp(....)).

定義:
インタフェース Sym0 内の subpType
パラメータ:
pReturnType - return value type; If no return value, then give symRoot.typeVoid.
pParamList - Formal parameter list or IrList of parameter types.
pOptionalParam - true if optional param ("..." in C) is present, false if no optional parameter.
pNoParamSpec - true if any number of parameters of any type are permitted in such case as extern sub(); sub(a); sub(a, b); in old C language style.
pDefinedIn - null for source languages where nested subprogram definition is not allowed (such as C, Fortran), or parent subprogram which include the subprogram definition for source languages where nested subprogram definition is allowed (such as Pascal).
戻り値:
the HIR type of the subprogram specified by above parameters.

symbol

public Sym symbol(java.lang.String pInternedName,
                  Type pType,
                  Sym pDefinedIn)
インタフェース Sym の記述:
symbol Create a Sym object of pType. This method is used for creating symbol which can not be created by other factory methods defined in Sym interface. Symbols such as variable, constant, subprogram, label, etc. should not be created by this method but create by other method (corresponding to the class of the symbol) definid in Sym interface.

定義:
インタフェース Sym 内の symbol
パラメータ:
pInternedName - name of the symbol to be created.
pType - type of the symbol to be created.
pDefinedIn - owner symbol.
戻り値:
the created symbol object.

derivedSym

public Sym derivedSym()
インタフェース Sym の記述:
derivedSym Generate a symbol having the same type and kind as that of this symbol in symTableCurrentSubp, or symTableCurrent if symTableCurrentSubp is null. The name of the generated symbol begins with the name of pSym and ending with one of suffixes _1, _2, _3, ... . The suffix is selected so that the same name does not appear in the symbol table. "this" may be any symbol.

定義:
インタフェース Sym 内の derivedSym
戻り値:
the generated symbol.

makeVectorTypeName

public java.lang.String makeVectorTypeName(Type pElemType,
                                           long pElemCount)
インタフェース Sym の記述:
makeVectorTypeName with default lower bound Make a vector type name of the form . where, elemCount is integer number represented by pElemCountExp, elemType is the name of type represented by pElemType. The lower bound is assumed to be 0.

定義:
インタフェース Sym 内の makeVectorTypeName
パラメータ:
pElemType - Type of the vector element.
pElemCount - Number of elements in the vector.
戻り値:
the type name interned.

makeVectorTypeName

public java.lang.String makeVectorTypeName(Type pElemType,
                                           long pElemCount,
                                           long pLowerBound)
インタフェース Sym の記述:
makeVectorTypeName Make a vector type name of the form . where, elemCount is integer number represented by pElemCount, lowerBound is integer number represented by pLowerBound, elemType is the name of type represented by pElemType.

定義:
インタフェース Sym 内の makeVectorTypeName
パラメータ:
pElemType - Type of the vector element.
pElemCount - Number of elements in the vector.
pLowerBound - Lower bound of the subscript of the vector.
戻り値:
the type name interned.

makeVectorTypeName

public java.lang.String makeVectorTypeName(Type pElemType,
                                           Exp pElemCountExp,
                                           long pElemCount,
                                           Exp pLowerBoundExp,
                                           long pLowerBound)
インタフェース Sym の記述:
makeVectorTypeName Make a vector type name of the form . If pElemCountExp is ConstNode, then elemCount is a constant value else elemCount is the expression string for pElemCountExp, If pLowerBoundExp is ConstNode, then lowerBound is a constant value else lowerBound is expression string for pLowerBoundExp, elemType is the name of type represented by pElemType. pElemCountExp and pLowerBoundExp may be either VarNode, ConstNode, or (contents VarNode) representing a formal parameter value. // If pElemCountExp/pLowerBoundExp is either VarNode or (contents Varnode) // then elemCountExp/lowerBoundExp take the form of varName_hashCode // where varName is the name string of Var represented by the VarNode, and // hashCode is System.identifyHashCode of the Var.

定義:
インタフェース Sym 内の makeVectorTypeName
パラメータ:
pElemType - Type of the vector element.
pElemCountExp - Expression representing the number of elements in the vector, or null.
pElemCount - If pElemCountExp is null, give the number of elements in the vector, else 0 (which is not used).
pLowerBoundExp - Expression representing the lower bound of the subscript of the vector, or null.
pLowerBound - If pLowerBoundExp is null, give the lower bound of the subscript of the vector, else 0 (which is not used).
戻り値:
the type name interned.

makeExpString

public java.lang.String makeExpString(Exp pExp)

makeStructUnionTypeName

public java.lang.String makeStructUnionTypeName(boolean pStruct,
                                                IrList pElemList)
インタフェース Sym の記述:
Make a string of or where, Type1, Type2, ... are type name of struct/union element 1, element 2, ... .

定義:
インタフェース Sym 内の makeStructUnionTypeName
パラメータ:
pStruct - true for generating , false for generating
pElemList - list of struct/union elements.
戻り値:
the generated name interned.

makeEnumTypeName

public java.lang.String makeEnumTypeName(IrList pElemList)
インタフェース Sym の記述:
Make a string where, name1, name2, ... are the name of enum element 1, element 2, ... , and value1, value2, ... are the value of enum element 1, element 2, ... .

定義:
インタフェース Sym 内の makeEnumTypeName
パラメータ:
pElemList - list of enum elements.
戻り値:
the generated string interned.

makeSubpTypeName

public java.lang.String makeSubpTypeName(Type pReturnType,
                                         IrList pParamList,
                                         boolean pOptionalParam)

makeSubpTypeName

public java.lang.String makeSubpTypeName(Type pReturnType,
                                         IrList pParamList,
                                         boolean pOptionalParam,
                                         boolean pNoParamSpec)
インタフェース Sym の記述:
Make a string optionalParam returnType > where, paramType1, paramType2, ... are the type name of parameter 1, parameter 2, ... , and optionalParam is true or false, and returnType is the type name of return value type.

定義:
インタフェース Sym 内の makeSubpTypeName
パラメータ:
pReturnType - type of return value.
pParamList - list of parameters.
pOptionalParam - true if optional param is specified, false otherwise.
pNoParamSpec - is true if any number of parameters of any type are permitted in such case as extern sub(); sub(a); sub(a, b); in old C language style.
戻り値:
the generated string.

getSymKindName

public java.lang.String getSymKindName()
getSymKindName Get the symbol kind name from GlobalConstants. See GlobalConstants

定義:
インタフェース Sym 内の getSymKindName
戻り値:
String Symbol kind name.

linkSym

public void linkSym(Sym pNextSym)
linkSym Link pNextSym as the next to this symbol.

パラメータ:
pNextSym - Symbol to be inserted as the one next to this symbol.

getName

public java.lang.String getName()
getName Get the name of this symbol.( The same name as in the source file. )

定義:
インタフェース Sym0 内の getName
戻り値:
String symbol name

getPureName

public java.lang.String getPureName()
インタフェース Sym の記述:
getPureName Get the name of this symbol. If this is a reserved name with preceeding dot ('.'), the dot is also included in the resultant string.

定義:
インタフェース Sym 内の getPureName
戻り値:
String symbol name.

getNameOrNull

public java.lang.String getNameOrNull(Sym pSym)
インタフェース Sym の記述:
getNameOrNull If pSym is not null, return its name, else return null.

定義:
インタフェース Sym 内の getNameOrNull
パラメータ:
pSym - any symbol or null.
戻り値:
the name of the symbol or "null".intern().

getNextSym

public Sym getNextSym()
getNextSym Get the next symbol

定義:
インタフェース Sym0 内の getNextSym
戻り値:
Sym the next symbol

getUniqueName

public java.lang.String getUniqueName()
getUniqueName Get the UniqueName of this symbol.

定義:
インタフェース Sym0 内の getUniqueName
戻り値:
String symbol unique name.

setUniqueNameSym

public void setUniqueNameSym(Sym pUniqueNameSym)
setUniqueNameSym Set the UniqueName of this symbol.

定義:
インタフェース Sym 内の setUniqueNameSym

getOriginalSym

public Sym getOriginalSym()
インタフェース Sym の記述:
Get original symbol corresponding to uniqueNameSym if this is a unique name symbol generated by setUniqueNameToAllSym(). If this is not a symbol insymTableUnique, return the symbol itself.

定義:
インタフェース Sym 内の getOriginalSym
戻り値:
the original symbol.

setOriginalSym

public void setOriginalSym(Sym pOriginalSym)

getOriginalSym

public Sym getOriginalSym(java.lang.String pName)
インタフェース Sym の記述:
Get original symbol corresponding to the symbol named pName. pName should be a unique name registered in symTableUnique, if not, then return this.getOriginalSym().

定義:
インタフェース Sym 内の getOriginalSym
パラメータ:
pName - the name of the symbol (in symTableUnique).
戻り値:
the original symbol.

getDefinedIn

public Sym getDefinedIn()
getDefinedIn Get the name of the construct containing the definition of this symbol (see defineUnique, Define, etc.). "this" may be any symbol.

定義:
インタフェース Sym0 内の getDefinedIn
戻り値:
the name of the construct containing the definition of this symbol, e.g. subprogram name for its local variables and formal parameters, structure name or union name for their elements (anonymous structure or union should have name generated by compiler), class name for its fields, etc. Return null for symbols that has no surrounding constructs, e.g. global variables in C, predefined symbols inherent in the source language, etc.

setDefinedIn

public void setDefinedIn(Sym pDefiningSym)
setDefinedIn Set "definedIn" symbol of this symbol if it is not set by defineUnique, Define, and redefine. "this" may be any symbol.

定義:
インタフェース Sym 内の setDefinedIn
パラメータ:
pDefiningSym - name of the construct that include the definition of this symbol. Anonymous structure or union shuold be named by GenerateVar so as pDefiningSym (and pDefinedIn) can be specified.

getDefinedInName

public java.lang.String getDefinedInName()
インタフェース Sym の記述:
getDefinedInName Get the name of getDefinedIn(). If getDefinedIn() is null, return "";

定義:
インタフェース Sym 内の getDefinedInName

getRecordedIn

public SymTable getRecordedIn()
getRecordedIn Get the symbol table that recorded this symbol.

定義:
インタフェース Sym0 内の getRecordedIn

setRecordedIn

public void setRecordedIn(SymTable pSymTable)
setRecordedIn Link to the symbol table that recorded this symbol. See linkSym of SymTableImpl.

定義:
インタフェース Sym 内の setRecordedIn
パラメータ:
pSymTable - Symbol table that recorded this symbol.

getSymKind

public int getSymKind()
getSymKind Get the symbol kind of this symbol (KIND_VAR, KIND_SUBP, etc.).

定義:
インタフェース Sym0 内の getSymKind
戻り値:
the symbol kind that is set when this symbol is created.

setSymKind

public void setSymKind(int pSymKind)
setSymKind Set the symbol kind of this symbol (KIND_VAR, KIND_SUBP, etc.). "this" may be any symbol.

定義:
インタフェース Sym 内の setSymKind
パラメータ:
pSymKind - kind number to be set. (KIND_TAG, etc.)

getSymType

public Type getSymType()
getSymType Get the type of this symbol. "this" is any symbol.

定義:
インタフェース Sym0 内の getSymType
戻り値:
type symbol representing the type of this symbol. If this is a symbol that has no type (label, key words, etc.), return typeVoid.

setSymType

public void setSymType(Type pSymType)
setSymType Set the type of this symbol. "this" is any symbol.

定義:
インタフェース Sym 内の setSymType
パラメータ:
pSymType - type symbol representing the type of this symbol.

getFlag

public boolean getFlag(int pFlagNumber)
getFlag getFlag returns the value (true/false) of the flag indicated by pFlagNumber. "this" may be any symbol that may have flags.

定義:
インタフェース Sym0 内の getFlag
パラメータ:
pFlagNumber - flag identification number.
戻り値:
boolean which indicates pFlagNumber's flag.

setFlag

public void setFlag(int pFlagNumber,
                    boolean pYesNo)
setFlag setFlag sets the flag of specified number. "this" may be any symbol that may have flags.

定義:
インタフェース Sym0 内の setFlag
パラメータ:
pFlagNumber - flag identification number.
pYesNo - true or false to be set to the flag.

isGlobal

public boolean isGlobal()
インタフェース Sym0 の記述:
isGlobal

定義:
インタフェース Sym0 内の isGlobal
戻り値:
true if global symbol, //## REFINE false otherwise.

remove

public void remove()
インタフェース Sym の記述:
remove Remove this symbol. (The symbol instance remains to exist but can not be accessed after removed.)

定義:
インタフェース Sym 内の remove

isRemoved

public boolean isRemoved()
インタフェース Sym の記述:
isRemoved

定義:
インタフェース Sym 内の isRemoved
戻り値:
true if this is a remoded symbol, false otherwise.

getInf

public SymInf getInf()
getInf Get additional information (for optimization, parallelization, etc.) of this symbol. return@ information attached to this symbol, return null if no information is attached.

定義:
インタフェース Sym 内の getInf
戻り値:
information attached to this symbol, return null if no information is attached.

getOrAddInf

public SymInf getOrAddInf()
インタフェース Sym の記述:
getOrAddInf get attached information. If SymInf is not yet attached, blank SymInf is attached and it is returned.

定義:
インタフェース Sym 内の getOrAddInf

getSourceInf

public SourceInf getSourceInf()

setSourceInf

public void setSourceInf(SourceInf pInf)

getDefinedFile

public java.lang.String getDefinedFile()
getDefinedFile Get the symbol table entry representing the name of the file that defined this symbol for the first time.

定義:
インタフェース Sym0 内の getDefinedFile
戻り値:
Sym the name entry of the file that defined this symbol. If this is not declared in any source file, then return null.

setDefinedFile

public void setDefinedFile(java.lang.String pDefinedFile)
インタフェース Sym の記述:
setDefinedFile Set the name of the file defining this symbol. It is not recommended to use this method except in parser.

定義:
インタフェース Sym 内の setDefinedFile

getDefinedLine

public int getDefinedLine()
getDefinedLine Get the line number of the first declaration for this symbol. The line number is relative within a file defining this symbol.

定義:
インタフェース Sym 内の getDefinedLine
戻り値:
int the name entry of the file that defined this symbol. If this is not declared in any source file, then return 0.

setDefinedLine

public void setDefinedLine(int pDefinedLine)
インタフェース Sym の記述:
setDefinedLine Set the line number of declaration defining this symbol. The line number is counted within the file get by getDefinedFile(). It is not recommended to use this method except in parser.

定義:
インタフェース Sym 内の setDefinedLine
パラメータ:
pDefinedLine - line number of declaration defining this symbol.

getDefinedColumn

public int getDefinedColumn()
getDefinedColumn Get the column number of the first declaration for this symbol. The column number indicates the column position of this symbol in the line declaring this symbol.

定義:
インタフェース Sym 内の getDefinedColumn
戻り値:
int the name entry of the file that defined this symbol.
If this is not declared in any source file, then return 0.

getWork

public java.lang.Object getWork()
インタフェース Sym の記述:
Get phase-wise work used for arbitrary purpose in each phase. The work may be destroyed by other phases (aliased with others). + @return the object set by setWork.

定義:
インタフェース Sym 内の getWork

setWork

public void setWork(java.lang.Object pWork)
インタフェース Sym の記述:
Set phase-wise work used for arbitrary purpose in each phase. The work may be destroyed by other phases (aliased with others). As for Subp, see getFlowInf(), getOptInf(), getParallelInf(), getRegAllocInf(), getCodeGenInf(), etc. which can hold information that will not be destroyed by other phase.

定義:
インタフェース Sym 内の setWork
パラメータ:
pWork - an object to be attached to this symbol; It may contain any information such as Sym, HIR, etc.

isSym

public boolean isSym()
インタフェース HasStringObject の記述:
Test if this is a Sym object.

定義:
インタフェース HasStringObject 内の isSym
戻り値:
true if this is a Sym object, false otherwise.

isHIR

public boolean isHIR()
インタフェース HasStringObject の記述:
Test if this is an HIR object.

定義:
インタフェース HasStringObject 内の isHIR
戻り値:
true if this is an HIR object, false otherwise.

toString

public java.lang.String toString()
インタフェース HasStringObject の記述:
Get the string image of object.

定義:
インタフェース HasStringObject 内の toString
オーバーライド:
クラス java.lang.Object 内の toString

toStringShort

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

定義:
インタフェース Sym 内の toStringShort

toStringDetail

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

定義:
インタフェース Sym 内の toStringDetail

print

public void print(int pIndent)
インタフェース HasStringObject の記述:
Print the object.

定義:
インタフェース HasStringObject 内の print

print

public void print(int pIndent,
                  boolean pDetail)
インタフェース HasStringObject の記述:
Print the object.

定義:
インタフェース HasStringObject 内の print