Package org.ek9lang.compiler.symbols
Class CaptureScope
java.lang.Object
org.ek9lang.compiler.symbols.SymbolTable
org.ek9lang.compiler.symbols.LocalScope
org.ek9lang.compiler.symbols.CaptureScope
- All Implemented Interfaces:
Serializable
,IScope
Used to actually hold the captured symbols.
Note that the resolution out to the enclosing scope is switched on and off.
This switching is based on entering and exiting the 'capture' via the antlr listeners.
It is important because on entering the capture scope it must be possible to resolve varaiables
in the enclosing Blocks before, so that variables can be captured).
But on exiting the capture scope, the resolution must then only be within this scope and must not
look outside to the enclosing scope.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ek9lang.compiler.symbols.IScope
IScope.ScopeType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncloneIntoCaptureScope
(CaptureScope newCopy) Clones the content of this into the new copy.void
Define a Symbol in this scope.boolean
int
hashCode()
protected MethodSymbolSearchResult
There are no supers so this will not add any methods.This class is the root and so there is no enclosing scope.void
setOpenToEnclosingScope
(boolean openToEnclosingScope) Methods inherited from class org.ek9lang.compiler.symbols.LocalScope
cloneIntoLocalScope, findNearestDynamicBlockScopeInEnclosingScopes, findNearestNonBlockScopeInEnclosingScopes, getEnclosingScope, getScopeType, isScopeAMatchForEnclosingScope, setScopeType
Methods inherited from class org.ek9lang.compiler.symbols.SymbolTable
cloneIntoSymbolTable, getAllSymbolsMatchingName, getEncounteredExceptionToken, getFriendlyScopeName, getScopeName, getSymbolsForThisScope, getSymbolsForThisScopeOfCategory, isMarkedPure, isTerminatedNormally, resolve, resolveInThisScopeOnly, resolveMatchingMethods, resolveMatchingMethodsInThisScopeOnly, resolveMember, searchIsNotInThisScope, setEncounteredExceptionToken, setMarkedPure, toString
-
Constructor Details
-
CaptureScope
-
-
Method Details
-
equals
- Overrides:
equals
in classLocalScope
-
hashCode
public int hashCode()- Overrides:
hashCode
in classLocalScope
-
clone
- Specified by:
clone
in interfaceIScope
- Overrides:
clone
in classLocalScope
-
cloneIntoCaptureScope
Clones the content of this into the new copy. -
define
Description copied from interface:IScope
Define a Symbol in this scope.- Specified by:
define
in interfaceIScope
- Overrides:
define
in classSymbolTable
-
setOpenToEnclosingScope
public void setOpenToEnclosingScope(boolean openToEnclosingScope) -
resolveWithEnclosingScope
Description copied from class:SymbolTable
This class is the root and so there is no enclosing scope. subclasses will override to provide the scope that encloses them- Overrides:
resolveWithEnclosingScope
in classLocalScope
-
resolveMatchingMethodsInEnclosingScope
protected MethodSymbolSearchResult resolveMatchingMethodsInEnclosingScope(MethodSymbolSearch search, MethodSymbolSearchResult result) Description copied from class:SymbolTable
There are no supers so this will not add any methods.- Overrides:
resolveMatchingMethodsInEnclosingScope
in classLocalScope
-