|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object
|
+--coins.sym.SymImpl
|
+--coins.sym.SubpImpl
Subp Class Subp (subprogram) class. Subprogram means such program construct as procedure, function, method, constructor, destructor, statement function, library function, etc. Each subprogram has its local symbol table which is maintained by pushSymbolTable, popSymbolTable, reopenSymbolTable in SymbolTableInterface. Enhancement is required to implement object oriented languages.
| フィールドの概要 | |
protected java.util.Set |
fAccessedSyms
Set of FlowAnalSym symbols accessed in this subprogram |
protected IrList |
fCallList
List of subprograms called from this subprogram |
protected Label |
fEndLabel
|
protected int |
fErrorCount
|
protected java.lang.Object |
fFlowInf
Information locally used for flow analysis, optimization, parallelyzation, etc. of this subprogram. |
protected Stmt |
fHirBody
The HIR body statement of this subprogram |
protected BlockStmt |
fInitiationProcess
initiation procedure of this subprogram |
protected IrList |
fLabelDefList
Defineded labels in this subprogram |
protected SymTable |
fLocalSymTable
|
protected Subp |
fNextSubp
Link to the next subproguram |
protected boolean |
fNoParamSpec
fIsAnyParamPermitted is true if any number of parameters of any kind are permitted. |
protected java.lang.Object |
fOptInf
|
protected Param |
fOptParam
Optional parameter generated for this subprogram if this subprogram has optional parameters. |
protected java.lang.Object |
fParallelInf
|
protected IrList |
fParamList
Parameter IrList of this subprogram. |
protected boolean |
fParamListIsSet
fParamListIsSet is changed to true if fParamList is set (so as not to change it any more). |
protected IrList |
fParamListTemp
Parameter type list of this subprogram. |
protected IrList |
fParamTypeListTemp
Parameter type list temporally used in addParamType. |
protected Type |
fReturnValueType
|
boolean |
fSafeArrayAll
fSafeArrayAll is set to true if #pragama safeArrayAll is given. |
protected Label |
fStartLabel
|
protected SubpDefinition |
fSubpDefinition
The IR SubpDefinition node of this subprogram |
protected int |
fSubpKind
Kind of this subprogram |
protected int |
fTempCount
|
protected int |
fTempDCount
|
protected IrList |
fTempDVarList
List of temporal double variables ganerated by compiler |
protected IrList |
fTempVarList
List of temporal long variables ganerated by compiler |
| クラス coins.sym.SymImpl から継承したフィールド |
fDbgLevel, fDefinedIn, fFlagBox, fKind, fName, fNextSym, fRecordedIn, fSourceInf, fSymInf, fType, fUniqueNameSym, fWork, machineParam, sourceLanguage, symRoot |
| インタフェース coins.sym.Sym から継承したフィールド |
KIND_NAME, VISIBILITY |
| コンストラクタの概要 | |
SubpImpl(SymRoot pSymRoot)
|
|
SubpImpl(SymRoot pSymRoot,
java.lang.String pName,
Type pReturnValueType,
Sym pDefinedIn)
|
|
| メソッドの概要 | |
void |
addInitiationStmt(Stmt pInitiation)
addInitiationStmt Add pInitiation as the HIR statement in initiation procedure. |
void |
addParam(Param pParam)
addParam Add parameter to the parameter list of this subprogram. |
void |
addParamType(Type pParamType)
addParamType Add parameter type to a temporal parameter type list. |
void |
addToCallList(Subp pCallee)
addToCallList Add pCallee as a subprogram in the call list of this subprogram. |
void |
addToErrorCount(int pCount)
addToErrorCount Add pCount to the number of syntax/semantic error counter of this subprogram. |
void |
addToLabelDefList(Label pLabel)
|
void |
buildLabelRefList()
Build the list of labels defined in the subprogram so as getLabelDefList() returns proper list, and build the list of LabelNode for every labels to show the label node refering them. |
void |
closeSubpHeader()
closeSubpHeader Finalize the header part of subprogram. |
void |
closeSubpPrototype()
closeSubpPrototype Finalize a prototype declaration of subprogram. |
java.util.Set |
getAccessedSyms()
|
IrList |
getCallList()
getCallList Get the list of subprograms called in this subprogram. |
Label |
getEndLabel()
getEndLabel setEndLabel Get/set a label attached to the exit point of this subprogram. |
int |
getErrorCount()
getErrorCount Get the number of syntax/semantic errors of this subprogram. |
java.lang.Object |
getFlowInf()
getEntryBBlock |
Stmt |
getHirBody()
getHirBody Get the procedural body of this subprogram represented in high level intermediate representation (HIR). |
IrList |
getLabelDefList()
getLabelDefList Get the list of labels defined in this subprogram. |
Subp |
getNextSubp()
getNextSubp Get the subprogram next to this one having the same scope as this. |
java.lang.Object |
getOptInf()
|
Param |
getOptionalParam()
getOptionalParam -- TO BE DELETED Get the formal parameter generated by setOptionalParam for this subprogram. |
java.lang.Object |
getParallelInf()
|
IrList |
getParamList()
getParamList Get the parameter list of this subprogram. |
IrList |
getParamTypeList()
getParamTypeList Get the parameter type list of this subprogram. |
Type |
getReturnValueType()
getReturnValueType Get the return value type of this subprogram. |
Label |
getStartLabel()
getStartLabel setStartLabel Get/set a label attached to the entry point of this subprogram. |
Stmt |
getStmtWithLabel(Label pLabel)
getStmtWithLabel Get the HIR Stmt attached with pLabel. |
SubpDefinition |
getSubpDefinition()
getFirstLocalVar //## Deleted. |
int |
getSubpKind()
getSubpKind Get subprogram kind (subpOrdinary/subpMember/subpConstructor/subpDestructor). |
SymTable |
getSymTable()
getSymTable Get the symbol table local to this subprogram. |
int |
getVisibility()
getVisibility setVisibility Get/set the visibility attribute of the subprogram. |
boolean |
hasNoParamSpec()
|
boolean |
hasOptionalParam()
hasOptionalParam |
BlockStmt |
initiationProcedure()
initiationProcedure Get HIR initiation procedure of this subprogram, where the initiation procedure is executed at the first invocation of this subprogram or at the beginning of execution and skipped in later invocations. |
boolean |
isSafeArrayAll()
|
void |
printLabelRefList()
Print the label reference list built by buildLabelRefList(). |
void |
removeLabelDef(Label pLabel)
|
void |
resetLabelLink()
resetLabelLink Reset label reference list of labels in this subprogram. |
void |
setAccessedSyms(java.util.Set pAccessedSyms)
|
void |
setEndLabel(Label pLabel)
|
void |
setFlowInf(java.lang.Object pInf)
|
void |
setHirBody(Stmt pHirBody,
Label pStartLabel,
Label pEndLabel)
setHirBody Set the procedural body of this subprogram represented in high level intermediate representation (HIR). |
void |
setNextSubp(Subp pNext)
setNextSubp Set pNext as the subprogram next to this one and make the original next subprogram as the next one of pNext. |
void |
setNoParamSpec()
Permit any number of parameters of any type for this subprogram. |
void |
setOptInf(java.lang.Object pInf)
|
Param |
setOptionalParam()
setOptionalParam -- TO BE DELETED Generate a formal parameter corresponding to "..." in parameter specification and make getOptionalParam() to be true for this subprogram. |
void |
setParallelInf(java.lang.Object pInf)
|
void |
setReturnValueType(Type pType)
setReturnValueType Set the return value type of this subprogram. |
void |
setStartLabel(Label pLabel)
|
void |
setSubpDefinition(SubpDefinition pSubpDefinition)
setSubpDefinition Set the SubpDefinition node defining the IR body of this subprogram. |
void |
setSubpKind(int pSubpKind)
setSubpKind Set subprogram kind (subpOrdinary/subpMember/subpConstructor/subpDestructor). |
void |
setSymTable(SymTable pSymTable)
setSymTable Set the symbol table local to this subprogram. |
void |
setVisibility(int pVisibility)
SetVisibility Sset the visibility attribute of the subprogram. |
java.lang.String |
toStringDetail()
toStringDetail Get detailed attributes of this symbol in text which is not interned. |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| インタフェース 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 |
| フィールドの詳細 |
protected Subp fNextSubp
protected int fSubpKind
protected Type fReturnValueType
protected SymTable fLocalSymTable
protected IrList fParamList
protected boolean fParamListIsSet
protected IrList fParamListTemp
protected IrList fParamTypeListTemp
protected Param fOptParam
protected boolean fNoParamSpec
protected IrList fTempVarList
protected int fTempCount
protected IrList fTempDVarList
protected int fTempDCount
protected SubpDefinition fSubpDefinition
protected Stmt fHirBody
protected BlockStmt fInitiationProcess
protected IrList fLabelDefList
protected Label fStartLabel
protected Label fEndLabel
protected IrList fCallList
protected java.util.Set fAccessedSyms
public boolean fSafeArrayAll
protected java.lang.Object fFlowInf
protected java.lang.Object fOptInf
protected java.lang.Object fParallelInf
protected int fErrorCount
| コンストラクタの詳細 |
public SubpImpl(SymRoot pSymRoot)
public SubpImpl(SymRoot pSymRoot,
java.lang.String pName,
Type pReturnValueType,
Sym pDefinedIn)
| メソッドの詳細 |
public Subp getNextSubp()
Subp 内の getNextSubppublic void setNextSubp(Subp pNext)
Subp 内の setNextSubppNext - subprogram defined in the same scope as this
subprogram.public int getSubpKind()
Subp 内の getSubpKindpublic void setSubpKind(int pSubpKind)
Subp 内の setSubpKindpSubpKind - subprogram kind to be set to this subprogram.
setSubpKind set the subprogram kind of this subprogram as pSubpKind.public int getVisibility()
Subp 内の getVisibilitypublic void setVisibility(int pVisibility)
Subp の記述:
Subp 内の setVisibilitypVisibility - visibility attribute to be set by setVisibility.
(SYM_EXTERN, SYM_PUBLIC, SYM_PROTECTED, SYM_PRIVATE,
SYM_COMPILE_UNIT)public SymTable getSymTable()
Subp の記述:
Subp 内の getSymTablepublic void setSymTable(SymTable pSymTable)
Subp の記述:
Subp 内の setSymTablepublic Type getReturnValueType()
Subp の記述:
Subp 内の getReturnValueTypepublic void setReturnValueType(Type pType)
Subp の記述:
Subp 内の setReturnValueTypepType - the return value type.public IrList getParamList()
Subp の記述:
Subp 内の getParamListpublic IrList getParamTypeList()
Subp の記述:
Subp 内の getParamTypeListpublic void addParam(Param pParam)
Subp の記述: Add parameter to the parameter list of this subprogram. If closeSubpPrototype has been called by processing prototype declaration, getParamTypeList will return the list of parameter types. It is recommended to check the consistency between prototype declaration and subprogram definition before calling addParam for each parameter. If null is returned by getParamTypeList, then prototype declaration is not yet given (closeSubpPrototype is not yet called.) See closeSubpHeader.
Subp 内の addParampublic void addParamType(Type pParamType)
Subp の記述:
Subp 内の addParamTypepublic Param getOptionalParam()
public Param setOptionalParam()
public boolean hasOptionalParam()
Subp の記述:
Subp 内の hasOptionalParampublic void setNoParamSpec()
Subp の記述:
Subp 内の setNoParamSpecpublic boolean hasNoParamSpec()
Subp の記述: Subp 内の hasNoParamSpecpublic void closeSubpHeader()
Subp の記述: Finalize the header part of subprogram. This method will set subprogram type for this subprogram and set other inevitable information for this subprogram. Before calling this method, addParam, setOptionalParam, setVisibility should be called if required and return value type should be given if required as it is written in defineSubp of Sym interface. It is the responsibility of language dependent front end to check the consistency between prototype declaration and subprogram definition. If closeSubpPrototype has been called by processing prototype declaration, getParamTypeList will return the list of parameter types. It is recommended to check the consistency between prototype declaration and subprogram definition before calling addParam for each parameter. The closeSubpHeader will adjust the parameter type list according to the list get by getParamList and so the consistency check will not be effective after the call.
Subp 内の closeSubpHeaderpublic void closeSubpPrototype()
Subp の記述:
Finalize a prototype declaration of subprogram.
This method will set subprogram type for this subprogram.
Before calling this method, addParamType, setOptionalParam,
setVisibility should be called if required and return value type
should also be given if required.
It is the responsibility of language dependent front end
to check the consistency between prototype declaration and
subprogram definition.
Typical sequence of processing prototype declaration is:
Subp lSubp = symRoot.sym.defineSubp("name".intern(), returnType);
lSubp.resetParamTypeList(); // If multiple declaration is allowed.
lSubp.addParamType(paramType1);
lSubp.addParamType(paramType2);
....
lSubp.setOptionalparam(); // only when optional parameter is given.
lSubp.setVisibility(Sym.SYM_PUBLIC); // only if public.
lSubp.closeSubpPrototype();
Subp 内の closeSubpPrototypepublic SubpDefinition getSubpDefinition()
Subp 内の getSubpDefinitionpublic void setSubpDefinition(SubpDefinition pSubpDefinition)
Subp の記述:
Subp 内の setSubpDefinitionpSubpDefinition - the SubpDefinition node of this subprogram.public Stmt getHirBody()
Subp 内の getHirBody
public void setHirBody(Stmt pHirBody,
Label pStartLabel,
Label pEndLabel)
Subp 内の setHirBodypHirBody - procedural body represented in HIR specifying
operations to be performed when this subprogram is called.
setHirBody set pHirBody as the HIR procedural body of this subprogram.pStartLabel - Label to be attached at entry point.pEndLabel - Label to be attached at exit point.public BlockStmt initiationProcedure()
public void addInitiationStmt(Stmt pInitiation)
pInitiation - statement to be put in the ititiation block.public IrList getLabelDefList()
public void resetLabelLink()
Subp の記述:
Subp 内の resetLabelLinkpublic void addToLabelDefList(Label pLabel)
public void removeLabelDef(Label pLabel)
public Stmt getStmtWithLabel(Label pLabel)
Subp の記述:
Subp 内の getStmtWithLabelpLabel - Label with which Stmt is to be searched.
public Label getStartLabel()
Subp の記述:
Subp 内の getStartLabelpublic void setStartLabel(Label pLabel)
Subp 内の setStartLabelpublic Label getEndLabel()
Subp の記述:
Subp 内の getEndLabelpublic void setEndLabel(Label pLabel)
Subp 内の setEndLabelpublic IrList getCallList()
Subp 内の getCallListpublic void addToCallList(Subp pCallee)
Subp 内の addToCallListpCallee - a subprogram called in this subprogram.public java.util.Set getAccessedSyms()
public void setAccessedSyms(java.util.Set pAccessedSyms)
public java.lang.Object getFlowInf()
Subp 内の getFlowInfpublic void setFlowInf(java.lang.Object pInf)
Subp 内の setFlowInfpublic java.lang.Object getOptInf()
Subp 内の getOptInfpublic void setOptInf(java.lang.Object pInf)
Subp 内の setOptInfpublic java.lang.Object getParallelInf()
Subp 内の getParallelInfpublic void setParallelInf(java.lang.Object pInf)
Subp 内の setParallelInfpublic boolean isSafeArrayAll()
Subp 内の isSafeArrayAllpublic void addToErrorCount(int pCount)
Subp の記述:
Subp 内の addToErrorCountpublic int getErrorCount()
Subp の記述:
Subp 内の getErrorCountpublic void buildLabelRefList()
Subp の記述:
Subp 内の buildLabelRefListpublic void printLabelRefList()
Subp の記述:
Subp 内の printLabelRefListpublic java.lang.String toStringDetail()
Sym の記述:
Sym 内の toStringDetailSymImpl 内の toStringDetail
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||