|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--coins.SymRoot
SymRoot class is used to access Sym (symbol) information and information prepared by other classes such as IoRoot, HIR, etc. All Sym objects contain a reference to the SymRoot object from which symbol information and methods can be quickly accessed. The SymRoot object contains a reference to IoRoot. Thus, every Sym objects can access input/output methods, too. Symbol tables: public SymTable symTable = null, // Instance to call SymTable methods. symTableRoot = null, // Root of SymTable. symTableConst = null, // Constant table. symTableUnique = null, // SymTable that contains // generated unique name. symTableCurrent = null, // Referes to the symbol table for // subprogram, etc. under construction or under processing. // At parsing phase, Sym methods pushSymTable and popSymTable // set symTableCurrent automatically. In parsing, at the point // of scope change, such as structure definition, symTableCurrent // should be properly set (by pushSymTable, popSymTable, or // by explicitly setting statements.) // In phases that modify HIR (optimization phase, etc.), // symTableCurrent should be set to the symbol table local // to the subprogram under processing. symTableCurrentSubp = null; // Symbol table of current subprogram. // Some kind of symbols (type, etc.) are // registered not in symTableCurrent // but in symTableCurrentSubp. Type symbols representing basic types: They are recorded in SymTableRoot as symbols whose name is preceeded by " " so that they do not conflict with identifiers used in input program. The names are shown in the tail of following lines. public Type typeBool, // bool " bool" typeChar, // character " char" typeShort, // short integer " short" typeInt, // integer " int" typeLong, // long integer " long" typeLongLong, // long long integer " long_long" typeU_Char, // unsigned character " u_char" typeU_Short, // unsigned short integer " u_short" typeU_Int, // unsigned integer " u_int" typeU_Long, // unsigned long integer " u_long" typeU_LongLong, // unsigned long long integer " u_long_long" typeFloat, // float " float" typeDouble, // double float " double" typeLongDouble, // long double " long_double" typeVoid, // void " void" typeOffset, // offset of address " offset" typeAddress; // address " address" public Type typeStringAny; // String type whose length is not fixed // (VECT 0 typeU_Char). Other public symbols public Subp subpCurrent; // Current subprogram under processing. // In flow analysis, alias analysis, // optimization, parallelization, it is // recommended to set this field to reflect // the subprogram under processing. public BoolConst boolConstTrue, // Bool constant representing true " true" boolConstFalse; // Bool constant representing false " false" public IntConst intConst0, // constant 0 intConst1, // constant 1 longConst0; // long int const 0 public FloatConst floatConst0, // float const 0.0 doubleConst0; // double const 0.0 Coding rules in SymRoot Methods begin with lower case letter. Constants (final static int, etc.) are spelled in upper case letters. Indentation is 2 characters. Formal parameters begin with p. Local variables begin with l. Methods and variables are named so that meaning is easily guessed. Short names less than 3 characters are not used except for very local purpose. Protected or private fields starts with character f. Public fields of xxxRoot class might not start with character f.
フィールドの概要 | |
BoolConst |
boolConstFalse
|
BoolConst |
boolConstTrue
|
java.util.Set |
conflictingSpecialSyms
conflictingSpecialSyms: Record symbols with '_' as heading character in order to avoid conflicts in generating symbols by generateLabel, generateVar, etc. |
FloatConst |
doubleConst0
|
protected int |
fARegCount
|
protected int |
fElemCount
|
protected int |
fGenSymCount
|
protected int |
fLabelCount
|
FloatConst |
floatConst0
|
protected int |
fMRegCount
|
protected int |
fParamCount
|
protected int |
fVarCount
|
IntConst |
intConst0
|
IntConst |
intConst1
|
IoRoot |
ioRoot
ioRoot records the reference to the IoRoot object passed as a parameter of SymRoot constructor. |
IntConst |
longConst0
|
MachineParam |
machineParam
Reference to MachineParam copied from ioRoot |
java.util.Set |
safeArray
Set of arrays which are declared as safe, that is, their subscript values does not exceed their limit and accessed locations are always within the storage area allocated to the array variable. |
SourceLanguage |
sourceLanguage
sourceLanguage is an instance of SourceLanguage class used to access source language dependent information and methods in such way as symRoot.sourceLanguage.makeCstringWithTrailing0(pureString). |
Subp |
subpCurrent
|
Sym |
sym
sym is an instance of Sym class used to access Sym methods such as creation of Sym instance, etc. |
SymRoot |
symRoot
symRoot referes SymRoot object that is used to access SymRoot information. |
SymTable |
symTable
|
SymTable |
symTableConst
|
SymTable |
symTableCurrent
|
SymTable |
symTableCurrentSubp
|
SymTable |
symTableFlow
|
SymTable |
symTableRoot
|
SymTable |
symTableUnique
|
Type |
typeAddress
Type symbols representing basic types |
Type |
typeBool
Type symbols representing basic types |
Type |
typeChar
Type symbols representing basic types |
Type |
typeDouble
Type symbols representing basic types |
Type |
typeFloat
Type symbols representing basic types |
Type |
typeInt
Type symbols representing basic types |
Type |
typeLong
Type symbols representing basic types |
Type |
typeLongDouble
Type symbols representing basic types |
Type |
typeLongLong
Type symbols representing basic types |
Type |
typeOffset
Type symbols representing basic types |
Type |
typeRegion
|
Type |
typeShort
Type symbols representing basic types |
Type |
typeStringAny
|
Type |
typeU_Char
Type symbols representing basic types |
Type |
typeU_Int
Type symbols representing basic types |
Type |
typeU_Long
Type symbols representing basic types |
Type |
typeU_LongLong
Type symbols representing basic types |
Type |
typeU_Short
Type symbols representing basic types |
Type |
typeVoid
Type symbols representing basic types |
コンストラクタの概要 | |
SymRoot(IoRoot pIoRoot)
|
メソッドの概要 | |
void |
attachFlowRoot(FlowRoot pFlowRoot)
attachFlowRoot: Attach FLowRoot information when it become available. |
void |
attachHirRoot(HirRoot pHirRoot)
attachHirRoot: Attach HirRoot information when it become available after the creation of SymRoot object. |
int |
getARegCount()
getARegCount: Get the generated abstract-register counter. |
Type |
getCharType()
getCharType: //##27 |
int |
getElemCount()
getElemCount: Get the generated element counter. |
FlowRoot |
getFlowRoot()
getFlowRoot: Get FlowRoot from symbol information. |
java.util.Set |
getFunctionsWithoutSideEffect()
Get the set of functions without side effect. |
HirRoot |
getHirRoot()
getHirRoot: Get the reference to the HirRoot object. |
Type |
getIntTypeOfAddress()
getIntTypeOfAddress: //##10 Get integer type corresponding to the address type. |
Type |
getIntTypeOfChar()
getIntTypeOfChar: //##10 Get integer type corresponding to the char type. |
int |
getLabelCount()
getLabelCount: Get the generated label counter. |
int |
getMRegCount()
getMRegCount: Get the generated machine-register counter. |
int |
getParamCount()
getParamCount: Get the generated parameter counter. |
int |
getSymCount()
getSymCount: Get the generated symbol counter. |
int |
getVarCount()
getVarCount: Get the generated variable counter. |
int |
incrementARegCount()
incrementARegCount: Increment the generated abstract register counter and return updated value. |
int |
incrementElemCount()
incrementElemCount: Increment the generated element counter and return updated value. |
int |
incrementLabelCount()
incrementLabelCount: Increment the generated label counter and return updated value. |
int |
incrementMRegCount()
incrementMRegCount: Increment the generated machine register counter and return updated value. |
int |
incrementParamCount()
incrementParamCount: Increment the generated parameter counter and return updated value. |
int |
incrementSymCount()
incrementSymCount: Increment the generated symbol counter and return updated value. |
int |
incrementVarCount()
incrementVarCount: Increment the generated variable counter and return updated value. |
void |
initiate()
initiate() does the initiation procedure of SymRoot such as symbol table initiation, etc. |
IrList |
irList(java.util.LinkedList pList)
irList creates an instance of IrList from LinkedList. |
void |
resetCounters()
resetCounters: reset the counters for generated symbols. |
void |
useSymTableOfSubpDefinition(SubpDefinition pSubpDef)
useSymTableOfSubpDefinition: //##16 Set the subpCurrent to the one corresponding to the subprogram definition pSubpDef, and set symTableCurrent, symTableCurrentSubp to the one corresponding to pSubpDef. |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
public final IoRoot ioRoot
public final SymRoot symRoot
public final Sym sym
public final SourceLanguage sourceLanguage
public final MachineParam machineParam
public SymTable symTable
public SymTable symTableRoot
public SymTable symTableConst
public SymTable symTableUnique
public SymTable symTableCurrent
public SymTable symTableCurrentSubp
public SymTable symTableFlow
public Type typeBool
public Type typeChar
public Type typeShort
public Type typeInt
public Type typeLong
public Type typeLongLong
public Type typeU_Char
public Type typeU_Short
public Type typeU_Int
public Type typeU_Long
public Type typeU_LongLong
public Type typeFloat
public Type typeDouble
public Type typeLongDouble
public Type typeVoid
public Type typeOffset
public Type typeAddress
public Type typeStringAny
public Type typeRegion
public Subp subpCurrent
public BoolConst boolConstTrue
public BoolConst boolConstFalse
public IntConst intConst0
public IntConst intConst1
public IntConst longConst0
public FloatConst floatConst0
public FloatConst doubleConst0
public java.util.Set conflictingSpecialSyms
public java.util.Set safeArray
protected int fVarCount
protected int fParamCount
protected int fElemCount
protected int fLabelCount
protected int fGenSymCount
protected int fARegCount
protected int fMRegCount
コンストラクタの詳細 |
public SymRoot(IoRoot pIoRoot)
メソッドの詳細 |
public IrList irList(java.util.LinkedList pList)
public void initiate()
public HirRoot getHirRoot()
public FlowRoot getFlowRoot()
public void attachHirRoot(HirRoot pHirRoot)
public void attachFlowRoot(FlowRoot pFlowRoot)
public void useSymTableOfSubpDefinition(SubpDefinition pSubpDef)
public Type getIntTypeOfAddress()
public Type getIntTypeOfChar()
public Type getCharType()
public java.util.Set getFunctionsWithoutSideEffect()
public int getVarCount()
public int incrementVarCount()
public int getParamCount()
public int incrementParamCount()
public int getElemCount()
public int incrementElemCount()
public int getLabelCount()
public int incrementLabelCount()
public int getSymCount()
public int incrementSymCount()
public int getARegCount()
public int incrementARegCount()
public int getMRegCount()
public int incrementMRegCount()
public void resetCounters()
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |