public class StandardSymbolTable extends Object implements ISymbolTable
| Modifier and Type | Field and Description |
|---|---|
static Method |
PRINT |
START_POS, SUPER_POS, THIS_POS| Constructor and Description |
|---|
StandardSymbolTable() |
StandardSymbolTable(boolean bDefineCommonSymbols) |
| Modifier and Type | Method and Description |
|---|---|
ISymbolTable |
copy()
Perform a semi-deep copy of this symbol table.
|
void |
defineCommonSymbols()
Define symbols that are considered ubiquitous.
|
int |
getNextStackIndex()
For compile-time assignment of stack indexes.
|
int |
getNextStackIndexForScope(IScope scope)
For compile-time assignment of stack indexes.
|
int |
getPrivateGlobalScopeCount() |
int |
getScopeCount() |
ISymbol |
getSymbol(CharSequence name) |
Map |
getSymbols() |
Map |
getSymbols(int iStartIndex,
int iPrivateGlobalIndex) |
ISymbol |
getThisSymbolFromStackOrMap()
Get the 'this' symbol from either the stack or the table.
|
int |
getTotalSymbolCount() |
boolean |
hasIsolatedScope()
For compile-time use.
|
boolean |
isSymbolWithinScope(ISymbol symToFind,
IScope containingScope) |
IScope |
peekIsolatedScope() |
IScope |
peekScope() |
IScope |
peekScope(int iPos) |
void |
popGlobalScope(IScope scope)
Pops a global scope previously pushed via
pushGlobalScope( IScope )
or pushPrivateGlobalScope( IScope ). |
IScope |
popScope()
Pop a local scope context from the symbol table.
|
IScope |
popScope(IScope scope) |
IScope |
pushIsolatedScope(IActivationContext activationCtx)
Push a scope that demarcates an activation record.
|
void |
pushPrivateGlobalScope(IScope scope)
Push a global scope you specify onto the private global scope space.
|
IScope |
pushScope()
Push a local scope context onto the symbol table.
|
IScope |
pushScope(IScope scope)
Push a local scope context onto the symbol table.
|
void |
putSymbol(ISymbol symbol)
Maps a name to a symbol in the table.
|
ISymbol |
removeSymbol(CharSequence name)
Removes a previously mapped symbol.
|
String |
toString() |
public static final Method PRINT
public StandardSymbolTable()
public StandardSymbolTable(boolean bDefineCommonSymbols)
bDefineCommonSymbols - public ISymbol getSymbol(CharSequence name)
getSymbol in interface ISymbolTablepublic void putSymbol(ISymbol symbol)
ISymbolTableputSymbol in interface ISymbolTablepublic ISymbol removeSymbol(CharSequence name)
ISymbolTableremoveSymbol in interface ISymbolTablename - The name mapped to the symbol to remove.public int getTotalSymbolCount()
getTotalSymbolCount in interface ISymbolTablepublic Map getSymbols()
getSymbols in interface ISymbolTablepublic Map getSymbols(int iStartIndex, int iPrivateGlobalIndex)
getSymbols in interface ISymbolTableiStartIndex - Scopes positioned on the stack at an index greater than
this number are not included. Very useful for examining a specific scope
e.g., for a debugger. Note an index < 0 indicates that all scopes are
included.public int getScopeCount()
getScopeCount in interface ISymbolTableISymbolTable.getSymbols(int,int)public int getPrivateGlobalScopeCount()
getPrivateGlobalScopeCount in interface ISymbolTableISymbolTable.getSymbols(int,int)public IScope pushScope()
ISymbolTablepushScope in interface ISymbolTablepublic IScope pushScope(IScope scope)
ISymbolTablepushScope in interface ISymbolTablescope - the scope to pushpublic void pushPrivateGlobalScope(IScope scope)
ISymbolTablepushIsolatedScope() instead.pushPrivateGlobalScope in interface ISymbolTableISymbolTable.pushScope(),
ISymbolTable.pushIsolatedScope(IActivationContext)public void popGlobalScope(IScope scope)
ISymbolTablepushGlobalScope( IScope )
or pushPrivateGlobalScope( IScope ).
You probably shouldn't call this method.popGlobalScope in interface ISymbolTableISymbolTable.pushPrivateGlobalScope(IScope),
ISymbolTable.popScope()public IScope pushIsolatedScope(IActivationContext activationCtx)
ISymbolTablepushIsolatedScope in interface ISymbolTableactivationCtx - The context for the activation record.public IScope popScope()
ISymbolTablepopScope in interface ISymbolTablepublic IScope popScope(IScope scope)
popScope in interface ISymbolTablepublic ISymbolTable copy()
ISymbolTablecopy in interface ISymbolTablepublic ISymbol getThisSymbolFromStackOrMap()
ISymbolTablegetThisSymbolFromStackOrMap in interface ISymbolTablepublic void defineCommonSymbols()
ISymbolTabledefineCommonSymbols in interface ISymbolTablepublic boolean isSymbolWithinScope(ISymbol symToFind, IScope containingScope)
isSymbolWithinScope in interface ISymbolTablepublic IScope peekIsolatedScope()
peekIsolatedScope in interface ISymbolTablepublic int getNextStackIndex()
getNextStackIndex in interface IStackProviderpublic int getNextStackIndexForScope(IScope scope)
getNextStackIndexForScope in interface IStackProviderpublic boolean hasIsolatedScope()
IStackProviderhasIsolatedScope in interface IStackProviderpublic IScope peekScope()
peekScope in interface ISymbolTablepublic IScope peekScope(int iPos)
peekScope in interface ISymbolTableCopyright © 2018. All rights reserved.