|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--coins.sym.SymTableImpl
SymTableImpl -- Symbol tabel class implementing SymTable.
フィールドの概要 | |
protected int |
fDbgLevel
|
protected Sym |
firstSym
Symbols in this symbol table |
java.lang.String |
fTableName
|
IoRoot |
ioRoot
|
protected Sym |
lastSym
|
protected Sym |
ownerSym
|
SymRoot |
symRoot
|
コンストラクタの概要 | |
SymTableImpl(SymRoot pSymRoot)
|
メソッドの概要 | |
Sym |
define(java.lang.String pInternedName,
int pSymKind,
Sym pDefinedIn)
define Define a new symbol specified by the parameter pUniqueName in the current symbol table. |
Sym |
defineUnique(java.lang.String pInternedName,
int pSymKind,
Sym pDefinedIn)
defineUnique Define a new symbol specified by the parameter pUniqueName in the current symbol table without traversing ancestor symbol tables. |
java.lang.String |
generateConstName(Sym pOldSym,
int index)
|
Sym |
generateDerivedSym(Sym pBaseSym)
generateDerivedSym Generate a symbol having the same type and kind as that of pSym in this symbol table. |
Elem |
generateElem(Type pType,
Sym pDefinedIn)
generateElem Generate an element of type pType in this symbol table. |
Label |
generateLabel()
generateLabel Generate an internal label in subpSymTable(). |
Param |
generateParam(Type pType,
Sym pDefinedIn)
generateParam Generate a parameter of type pType in subpSymTable(). |
Sym |
generateSym(Type pType,
int pSymKind,
java.lang.String pPrefix,
Sym pDefinedIn)
generateSym Generate a symbol of type pType in this symbol table (to be used as block name, etc.). |
java.lang.String |
generateSymName(java.lang.String pHeader)
Generate symbol name which is unique in this SymTable and its ancestors. |
Sym |
generateTag()
generateTag Generate a tag name in subpSymTable(). |
Sym |
generateTag(java.lang.String pTagName)
|
java.lang.String |
generateUniqueName(Sym pOldSym,
Subp pSubp)
Generate unique name for symbols in the form of subprogramName_originalName_n, where, subprogramName is the name of the subprogram defining the symbol ("" for global symbol), oroginalName is the name of the symbol, n is sequence number (1, 2, 3, ...) |
Var |
generateVar(Type pType)
generateVar Generate a variable of type pType in the symbol table of current subprogram symRoot.subpCurrent (to be used as temporal variable, etc.). |
Var |
generateVar(Type pType,
Sym pDefinedIn)
generateVar Generate a variable of type pType in this symbol table (to be used as temporal variable, etc.). |
SymTable |
getBrother()
getBrother |
SymTable |
getFirstChild()
getFirstChild |
Sym |
getFirstSym()
getFirstSym Get the first symbol recorded in this symbol table. |
Sym |
getOwner()
getOwner Get the owner node to which this symbol table is attached. |
java.lang.String |
getOwnerName()
getOwnerName Get the name of the owner of this symbol table. |
SymTable |
getParent()
getParent Get parent symbol table of this table. |
Subp |
getSubp()
getSubp Get the subprogram to which this symbol table is attached or in which the owner of this symbol table is contained. |
int |
getSymCount()
getSymCount Get the number of symbols recorded in the symbol table. |
SymIterator |
getSymIterator()
getSymIterator Get iterator to scan all symbols recorded in this symbol table. |
SymNestIterator |
getSymNestIterator()
getSymNestIterator (##6) Get iterator to scan all symbols recorded in this symbol table and its children. |
SymTableIterator |
getSymTableIterator()
getSymTableIterator (##10) Get iterator to scan all symbols tables starting from this symbol table and its children. |
boolean |
isInThisSymTable(Sym pSym)
isInThisSymTable |
void |
linkSym(Sym pNewSym)
linkSym Link pNewSym as the last symbol of this symbol table. |
java.lang.String |
makeNewName(java.lang.String pOldName,
java.lang.String lSubpName,
int index)
|
SymTable |
popSymTable()
popSymTable Close this (current) symbol table and make its ancestor symbol table as the current symbol table if this has the ancestor. |
void |
printSymTable()
printSymTable (##2) Print symbols in this symbol table using toString(). |
void |
printSymTableAll(SymTable pSymTable)
printSymTableAll (##2) Print symbols in pSymTable and all its descendent symbol tables using printSymTable. |
void |
printSymTableAllDetail()
printSymTableAllDetail with no param. |
void |
printSymTableAllDetail(SymTable pSymTable)
printSymTableAllDetail (##2) Print symbols in pSymTable and all its descendent symbol tables using printSymTableDetail. |
void |
printSymTableDetail()
printSymTableDetail Print this symbol table. |
SymTable |
pushSymTable(Sym pOwner)
pushSymTable Make this (current) symbol table as an ancestor symbol table and create a new symbol table making it as the current symbol table. |
Sym |
redefine(Sym pSym,
int pSymKind,
Sym pDefinedIn)
redefine Create a new symbol that has the name same as this symbol but having the symbol kind indicated by the parameter pSymKind in the current symbol table. |
SymTable |
reopenSymTable(SymTable pPreviousSymTable)
reopenSymTable Push this (current) symbol table as the ancestor symbol table and make the symbol table specified by the parameter as the new current symbol table. |
Sym |
search(java.lang.String pInternedName)
search Search the symbol specified by the parameter pInternedName in the current symbol table and its ancestors. |
Sym |
search(java.lang.String pName,
int symkind)
search Search a symbol named pName starting from this symbol table and upward (ancestors). |
Sym |
searchLocal(java.lang.String pName,
int symkind)
searchLocal Search a symbol named pName withis this symbol table without traversing other symbol table. |
Sym |
searchLocal(java.lang.String pInternedName,
int pSymKind,
boolean pSpecifiedKind)
searchLocal Search the symbol which is specified by parameter pInternedName. |
SymTableEntry |
searchLocalEntry(java.lang.String pInternedName,
int pSymKind,
boolean pSpecifiedKind)
|
Sym |
searchOrAdd(java.lang.String pInternedName,
int pSymKind,
Sym pDefinedIn,
boolean pWithinThisTable,
boolean pSpecifiedKind)
searchOrAdd Search the symbol which is specified by parameter pInternedName, pSymKind. |
SymTableEntry |
searchOrAddEntry(java.lang.String pInternedName,
int pSymKind,
Sym pDefinedIn,
boolean pWithinThisTable,
boolean pSpecifiedKind)
searchOrAddEntry Search a symbol table entry where a symbol is to be placed. |
Sym |
searchOrAddSym(Sym s)
searchOrAddSym Add symbol s to this symbol table. |
Sym |
searchSymOfThisKind(Sym pSym,
int pSymKind)
searchSymOfThisKind Search for the symbol having the same name as the parameter pSym and its kind is same to pSymKind in the same manner as Search. |
SymTable |
searchTableHaving(Sym s)
searchTableHaving Search a symbol symbol table containing the symbol named pName starting from this symbol table and upward (ancestors). |
void |
setUniqueNameToAllSym()
setUniqueNameToAllSym Set unique name to all symbols of the kind Var, Param, Subp, Label in the whole compile unit. |
SymTable |
subpSymTable()
subpSymTable Get the symbol table of current subprogram. |
java.lang.String |
toString()
|
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
フィールドの詳細 |
public final SymRoot symRoot
public final IoRoot ioRoot
public java.lang.String fTableName
protected Sym firstSym
protected Sym lastSym
protected Sym ownerSym
protected final int fDbgLevel
コンストラクタの詳細 |
public SymTableImpl(SymRoot pSymRoot)
メソッドの詳細 |
public SymTable pushSymTable(Sym pOwner)
SymTable
の記述:
SymTable
内の pushSymTable
pOwner
- Symbol owning the the new SymTable
(subprogram, etc.), null if no symbol corresponds.
public SymTable popSymTable()
SymTable
内の popSymTable
public SymTable reopenSymTable(SymTable pPreviousSymTable)
SymTable
内の reopenSymTable
pPreviousSymTable
- a symbol table that was once
a direct descendant symbol table of this symbol table.
public SymTable getParent()
SymTable
の記述:
SymTable
内の getParent
public SymTable getFirstChild()
SymTable
の記述:
SymTable
内の getFirstChild
public SymTable getBrother()
SymTable
の記述:
SymTable
内の getBrother
public Sym defineUnique(java.lang.String pInternedName, int pSymKind, Sym pDefinedIn)
SymTable
内の defineUnique
pSymKind
- kind of the symbol to be created (see GlobalConstants).pDefinedIn
- symbol representing language construct such as
subprogram name or structure name that encloses the definition of
the symbol to be defined. If there is no such construct, specify null.
(See definedIn().)pInternedName
- unique string representing the symbol to be defined.
public Sym define(java.lang.String pInternedName, int pSymKind, Sym pDefinedIn)
SymTable
内の define
pSymKind
- kind of the symbol to be created (see GlobalConstants).pDefinedIn
- language construct symbol that encloses the definition
of pUniqueName. If there is no such construct, specify null.pInternedName
- unique string representing the symbol to be defined.
public Sym search(java.lang.String pInternedName)
SymTable
内の search
pInternedName
- unique string representing the symbol to be searched.
public Sym searchLocal(java.lang.String pInternedName, int pSymKind, boolean pSpecifiedKind)
SymTable
内の searchLocal
pInternedName
- symbol name which is Interned.pSymKind
- symbol kind.pSpecifiedKind
- If ture, search by name and kind.
public SymTableEntry searchLocalEntry(java.lang.String pInternedName, int pSymKind, boolean pSpecifiedKind)
public Sym searchOrAdd(java.lang.String pInternedName, int pSymKind, Sym pDefinedIn, boolean pWithinThisTable, boolean pSpecifiedKind)
SymTable
内の searchOrAdd
pSpecifiedKind
- If ture, search the symbol which is same name as pInternedName and same kind as pSymKind.
public SymTableEntry searchOrAddEntry(java.lang.String pInternedName, int pSymKind, Sym pDefinedIn, boolean pWithinThisTable, boolean pSpecifiedKind)
SymTable
の記述:
SymTable
内の searchOrAddEntry
public void linkSym(Sym pNewSym)
SymTable
の記述:
SymTable
内の linkSym
public Sym searchSymOfThisKind(Sym pSym, int pSymKind)
SymTable
内の searchSymOfThisKind
pSym
- a symbol having the same name as the one to be searched.pSymKind
- kind of the symbol to be searched (see GlobalConstants).
public Sym redefine(Sym pSym, int pSymKind, Sym pDefinedIn)
SymTable
内の redefine
pSymKind
- symbol kind of the symbol to be created.pDefinedIn
- language construct symbol that encloses the definition
of pSym. If there is no such construct, specify null.
public SymTable subpSymTable()
SymTable
の記述:
SymTable
内の subpSymTable
public Var generateVar(Type pType)
SymTable
内の generateVar
pType
- type of the variable to be generated.
public Var generateVar(Type pType, Sym pDefinedIn)
SymTable
内の generateVar
pType
- type of the variable to be generated.pDefinedIn
- language construct symbol that encloses the
definition of the generated variable. If there is no such
construct, specify null.
public Param generateParam(Type pType, Sym pDefinedIn)
SymTable
の記述:
SymTable
内の generateParam
pType
- type of the parameter to be generated.pDefinedIn
- Subprogram defining the parameter.
public Elem generateElem(Type pType, Sym pDefinedIn)
SymTable
の記述:
SymTable
内の generateElem
pType
- type of the element to be generated.pDefinedIn
- language construct symbol that encloses the
definition
of the element (structure or union name).
public Label generateLabel()
SymTable
の記述:
SymTable
内の generateLabel
public Sym generateTag()
SymTable
の記述:
SymTable
内の generateTag
public Sym generateTag(java.lang.String pTagName)
SymTable
内の generateTag
public Sym generateSym(Type pType, int pSymKind, java.lang.String pPrefix, Sym pDefinedIn)
SymTable
内の generateSym
pType
- type of the symbol to be generated.pSymKind
- symbol kind number of the symbol to be generated.pPrefix
- prefix to be attached to the symbol name.pDefinedIn
- language construct symbol that encloses the
definition of the generated variable. If there is no such
construct, specify null.
public Sym generateDerivedSym(Sym pBaseSym)
SymTable
の記述:
SymTable
内の generateDerivedSym
public java.lang.String generateSymName(java.lang.String pHeader)
SymTable
内の generateSymName
pHeader
- is a string to be used as header of the generated name.
public SymIterator getSymIterator()
SymTable
の記述:
SymTable
内の getSymIterator
public SymNestIterator getSymNestIterator()
SymTable
の記述:
SymTable
内の getSymNestIterator
public SymTableIterator getSymTableIterator()
SymTable
の記述:
SymTable
内の getSymTableIterator
public Sym getFirstSym()
SymTable
の記述:
SymTable
内の getFirstSym
public boolean isInThisSymTable(Sym pSym)
SymTable
の記述:
SymTable
内の isInThisSymTable
pSym
- Any symbol.
public java.lang.String toString()
java.lang.Object
内の toString
public void printSymTableAll(SymTable pSymTable)
SymTable
の記述:
SymTable
内の printSymTableAll
pSymTable
- any symbol table.public void printSymTableAllDetail()
SymTable
の記述:
SymTable
内の printSymTableAllDetail
public void printSymTableAllDetail(SymTable pSymTable)
SymTable
の記述:
SymTable
内の printSymTableAllDetail
pSymTable
- any symbol table.public void printSymTable()
SymTable
の記述:
SymTable
内の printSymTable
public void printSymTableDetail()
SymTable
内の printSymTableDetail
public Sym getOwner()
SymTable
の記述:
SymTable
内の getOwner
public java.lang.String getOwnerName()
SymTable
の記述:
SymTable
内の getOwnerName
public Subp getSubp()
SymTable
の記述:
SymTable
内の getSubp
public int getSymCount()
SymTable
の記述:
SymTable
内の getSymCount
public Sym searchOrAddSym(Sym s)
SymTable
内の searchOrAddSym
s
- Symbol to be searched or added.
public Sym search(java.lang.String pName, int symkind)
SymTable
内の search
pName
- name of the symbol to be serached.symkind
- symbol kind (Sym.KIND_VAR, etc.).
public Sym searchLocal(java.lang.String pName, int symkind)
SymTable
内の searchLocal
pName
- name of the symbol to be serached.symkind
- symbol kind (Sym.KIND_VAR, etc.).
public SymTable searchTableHaving(Sym s)
SymTable
内の searchTableHaving
s
- Symbol to be searched if it is contained in some
symbol table.
public java.lang.String makeNewName(java.lang.String pOldName, java.lang.String lSubpName, int index)
public java.lang.String generateUniqueName(Sym pOldSym, Subp pSubp)
SymTable
の記述:
SymTable
内の generateUniqueName
pOldSym
- pSubp
-
public java.lang.String generateConstName(Sym pOldSym, int index)
public void setUniqueNameToAllSym()
SymTable
の記述:
SymTable
内の setUniqueNameToAllSym
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |