Package org.ek9lang.compiler.symbols
Class CaptureScopedSymbol
java.lang.Object
org.ek9lang.compiler.symbols.Symbol
org.ek9lang.compiler.symbols.ScopedSymbol
org.ek9lang.compiler.symbols.CaptureScopedSymbol
- All Implemented Interfaces:
Serializable
,ICanCaptureVariables
,IScope
,IScopedSymbol
,ISymbol
,ITokenReference
- Direct Known Subclasses:
PossibleGenericSymbol
Just focuses on the ability to possible capture variables from an enclosing scope.
This is primarily used for dynamic functions and classes.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ek9lang.compiler.symbols.IScope
IScope.ScopeType
Nested classes/interfaces inherited from interface org.ek9lang.compiler.symbols.ISymbol
ISymbol.SymbolCategory, ISymbol.SymbolGenus
-
Field Summary
Fields inherited from interface org.ek9lang.compiler.symbols.ISymbol
NOT_ASSIGNABLE
-
Constructor Summary
ConstructorDescriptionCaptureScopedSymbol
(String name, Optional<ISymbol> type, IScope enclosingScope) CaptureScopedSymbol
(String name, IScope enclosingScope) -
Method Summary
Modifier and TypeMethodDescriptionClone the symbol and re-parent if this symbol like a method should have a parent.protected CaptureScopedSymbol
boolean
Make the scope that holds the captured variables (if any accessible).protected String
int
hashCode()
boolean
Try and resolve a symbol but exclude looking in captured variables.resolveInThisScopeOnly
(SymbolSearch search) Just look in own scope.void
setCapturedVariables
(Optional<CaptureScope> capturedVariables) void
setCapturedVariables
(CaptureScope capturedVariables) It is possible to capture variables in the current scope and pull them into the function, so they can be used.void
setCapturedVariablesVisibility
(boolean isPublic) The variables that have been captured can be given public access if needed.void
setMarkedAbstract
(boolean markedAbstract) void
setModuleScope
(IScope moduleScope) Methods inherited from class org.ek9lang.compiler.symbols.ScopedSymbol
cloneIntoScopeSymbol, copyScopedSymbolProperties, define, findNearestDynamicBlockScopeInEnclosingScopes, findNearestNonBlockScopeInEnclosingScopes, getActualScope, getAllSymbolsMatchingName, getAnySuperTypeOrFunction, getEnclosingScope, getEncounteredExceptionToken, getFriendlyScopeName, getOuterMostTypeOrFunction, getScopeName, getScopeType, getSymbolsForThisScope, isMarkedPure, isMutable, isNotMarkedPure, isScopeAMatchForEnclosingScope, isTerminatedNormally, resolve, resolveMatchingMethods, resolveMatchingMethodsInThisScopeOnly, resolveMember, resolveWithParentScope, setEncounteredExceptionToken, setMarkedPure, setOuterMostTypeOrFunction, setScopeType
Methods inherited from class org.ek9lang.compiler.symbols.Symbol
clearInitialisedBy, cloneIntoSymbol, copySymbolProperties, getAssignableWeightTo, getAssignableWeightTo, getCategory, getFriendlyName, getFullyQualifiedName, getGenus, getInitialisedBy, getName, getParsedModule, getProduceFullyQualifiedName, getSourceToken, getSquirrelledData, getSymbolTypeAsString, getType, getUnCoercedAssignableWeightTo, isAssignableTo, isAssignableTo, isDevSource, isEk9Core, isExactSameType, isInjectionExpected, isLibSource, isNullAllowed, isPromotionSupported, isReferenced, putSquirrelledData, setCategory, setEk9Core, setGenus, setInitialisedBy, setInjectionExpected, setName, setNotMutable, setNullAllowed, setParsedModule, setProduceFullyQualifiedName, setReferenced, setSourceToken, setType, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ek9lang.compiler.symbols.ISymbol
clearInitialisedBy, getAssignableWeightTo, getAssignableWeightTo, getCategory, getFriendlyName, getFullyQualifiedName, getGenus, getInitialisedBy, getName, getParsedModule, getSourceToken, getSquirrelledData, getType, getUnCoercedAssignableWeightTo, isApplication, isAssignableTo, isAssignableTo, isConceptualTypeParameter, isConstant, isControl, isDeclaredAsConstant, isDevSource, isEk9Core, isExactSameType, isExtensionOfInjectable, isFromLiteral, isFunction, isGenericInNature, isIncomingParameter, isInitialised, isInjectable, isInjectionExpected, isLibSource, isLoopVariable, isMethod, isNullAllowed, isParameterisedType, isPrimitiveType, isPrivate, isPromotionSupported, isPropertyField, isProtected, isPublic, isReferenced, isReturningParameter, isTemplateFunction, isTemplateType, isType, isVariable, putSquirrelledData, setGenus, setInitialisedBy, setInjectionExpected, setName, setNotMutable, setNullAllowed, setParsedModule, setReferenced, setType, setType
Methods inherited from interface org.ek9lang.compiler.symbols.ITokenReference
setSourceToken
-
Constructor Details
-
CaptureScopedSymbol
-
CaptureScopedSymbol
-
-
Method Details
-
clone
Description copied from interface:ISymbol
Clone the symbol and re-parent if this symbol like a method should have a parent. Other symbols like VariableSymbols are un-parented- Specified by:
clone
in interfaceIScope
- Specified by:
clone
in interfaceIScopedSymbol
- Specified by:
clone
in interfaceISymbol
- Overrides:
clone
in classScopedSymbol
-
cloneIntoCaptureScopedSymbol
-
getModuleScope
-
setModuleScope
-
isMarkedAbstract
public boolean isMarkedAbstract()- Specified by:
isMarkedAbstract
in interfaceISymbol
-
setMarkedAbstract
public void setMarkedAbstract(boolean markedAbstract) -
getCapturedVariables
Description copied from interface:ICanCaptureVariables
Make the scope that holds the captured variables (if any accessible).- Specified by:
getCapturedVariables
in interfaceICanCaptureVariables
- Returns:
- The scope holding the captured variables.
-
setCapturedVariables
It is possible to capture variables in the current scope and pull them into the function, so they can be used.- Specified by:
setCapturedVariables
in interfaceICanCaptureVariables
- Parameters:
capturedVariables
- The variables to capture.
-
setCapturedVariables
-
setCapturedVariablesVisibility
public void setCapturedVariablesVisibility(boolean isPublic) The variables that have been captured can be given public access if needed. -
getPrivateVariablesForDisplay
-
resolveExcludingCapturedVariables
Description copied from interface:ICanCaptureVariables
Try and resolve a symbol but exclude looking in captured variables.- Specified by:
resolveExcludingCapturedVariables
in interfaceICanCaptureVariables
-
resolveInThisScopeOnly
Description copied from interface:IScope
Just look in own scope.- Specified by:
resolveInThisScopeOnly
in interfaceIScope
- Overrides:
resolveInThisScopeOnly
in classScopedSymbol
-
equals
- Overrides:
equals
in classScopedSymbol
-
hashCode
public int hashCode()- Overrides:
hashCode
in classScopedSymbol
-