public abstract class AbstractScope extends Object implements IScope
| Modifier and Type | Field and Description |
|---|---|
protected TParseTreeNode |
node
Associated AST node
|
protected IScope |
parent
Parent scope (never null - root has EmptyScope parent)
|
protected ScopeType |
scopeType
Scope type
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractScope(IScope parent,
TParseTreeNode node,
ScopeType scopeType) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(INamespace namespace,
String alias,
boolean nullable)
Default implementation: not supported (most scopes don't have children)
|
QualifiedName |
fullyQualify(String name)
Default implementation: delegate to parent
|
List<ScopeChild> |
getChildren()
Default implementation: empty list
|
TParseTreeNode |
getNode()
Get the associated AST node
|
IScope |
getParent()
Get the parent scope.
|
ScopeType |
getScopeType()
Get the scope type
|
List<INamespace> |
getVisibleNamespaces()
Default implementation: delegate to parent
|
boolean |
isWithin(IScope ancestorScope)
Default implementation: check ancestry
|
void |
resolve(List<String> names,
INameMatcher matcher,
boolean deep,
IResolved resolved)
Default implementation: delegate to parent
|
INamespace |
resolveTable(String tableName)
Default implementation: delegate to parent
|
String |
toString() |
protected final TParseTreeNode node
protected AbstractScope(IScope parent, TParseTreeNode node, ScopeType scopeType)
public IScope getParent()
IScopepublic TParseTreeNode getNode()
IScopepublic ScopeType getScopeType()
IScopegetScopeType in interface IScopepublic void resolve(List<String> names, INameMatcher matcher, boolean deep, IResolved resolved)
public INamespace resolveTable(String tableName)
resolveTable in interface IScopetableName - Table name or aliaspublic void addChild(INamespace namespace, String alias, boolean nullable)
public List<ScopeChild> getChildren()
getChildren in interface IScopepublic List<INamespace> getVisibleNamespaces()
getVisibleNamespaces in interface IScopepublic QualifiedName fullyQualify(String name)
fullyQualify in interface IScopename - Name to qualify