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, ISymbolNature, 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 IScope
IScope.ScopeType -
Constructor Summary
ConstructorsConstructorDescriptionCaptureScopedSymbol(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 CaptureScopedSymbolbooleanMake the scope that holds the captured variables (if any accessible).protected StringinthashCode()booleanTry and resolve a symbol but exclude looking in captured variables.resolveInThisScopeOnly(SymbolSearch search) Just look in own scope.voidsetCapturedVariables(Optional<CaptureScope> capturedVariables) voidsetCapturedVariables(CaptureScope capturedVariables) It is possible to capture variables in the current scope and pull them into the function, so they can be used.voidsetCapturedVariablesVisibility(boolean isPublic) The variables that have been captured can be given public access if needed.voidsetMarkedAbstract(boolean markedAbstract) voidsetModuleScope(IScope moduleScope) Methods inherited from class 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, setScopeTypeMethods inherited from class Symbol
clearInitialisedBy, cloneIntoSymbol, copySymbolProperties, getAssignableCostTo, getAssignableCostTo, getCategory, getFriendlyName, getFullyQualifiedName, getGenus, getInitialisedBy, getName, getParsedModule, getProduceFullyQualifiedName, getSourceToken, getSquirrelledData, getSymbolTypeAsString, getType, getUnCoercedAssignableCostTo, isAssignableTo, isAssignableTo, isDevSource, isEk9Core, isExactSameType, isInjectionExpected, isLibSource, isNullAllowed, isPromotionSupported, isReferenced, putSquirrelledData, setCategory, setEk9Core, setGenus, setInitialisedBy, setInjectionExpected, setName, setNotMutable, setNullAllowed, setParsedModule, setProduceFullyQualifiedName, setReferenced, setSourceToken, setType, toStringMethods inherited from interface ISymbol
clearInitialisedBy, getAssignableCostTo, getAssignableCostTo, getFriendlyName, getFullyQualifiedName, getInitialisedBy, getName, getParsedModule, getSourceToken, getSquirrelledData, getType, getUnCoercedAssignableCostTo, isAssignableTo, isAssignableTo, isDeclaredAsConstant, isDevSource, isExactSameType, isExtensionOfInjectable, isFromLiteral, isIncomingParameter, isInitialised, isInjectable, isInjectionExpected, isLibSource, isLoopVariable, isNullAllowed, isPrivate, isPromotionSupported, isPropertyField, isProtected, isPublic, isReferenced, isReturningParameter, putSquirrelledData, setInitialisedBy, setInjectionExpected, setName, setNotMutable, setNullAllowed, setParsedModule, setReferenced, setType, setTypeMethods inherited from interface ISymbolNature
getCategory, getGenus, isApplication, isConceptualTypeParameter, isConstant, isControl, isEk9Core, isFunction, isGenericInNature, isMethod, isParameterisedType, isPrimitiveType, isTemplateFunction, isTemplateType, isType, isVariable, setGenusMethods inherited from interface ITokenReference
setSourceToken
-
Constructor Details
-
CaptureScopedSymbol
-
CaptureScopedSymbol
-
-
Method Details
-
clone
Description copied from interface:ISymbolClone the symbol and re-parent if this symbol like a method should have a parent. Other symbols like VariableSymbols are un-parented- Specified by:
clonein interfaceIScope- Specified by:
clonein interfaceIScopedSymbol- Specified by:
clonein interfaceISymbol- Overrides:
clonein classScopedSymbol
-
cloneIntoCaptureScopedSymbol
-
getModuleScope
-
setModuleScope
-
isMarkedAbstract
public boolean isMarkedAbstract()- Specified by:
isMarkedAbstractin interfaceISymbol
-
setMarkedAbstract
public void setMarkedAbstract(boolean markedAbstract) -
getCapturedVariables
Description copied from interface:ICanCaptureVariablesMake the scope that holds the captured variables (if any accessible).- Specified by:
getCapturedVariablesin 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:
setCapturedVariablesin 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:ICanCaptureVariablesTry and resolve a symbol but exclude looking in captured variables.- Specified by:
resolveExcludingCapturedVariablesin interfaceICanCaptureVariables
-
resolveInThisScopeOnly
Description copied from interface:IScopeJust look in own scope.- Specified by:
resolveInThisScopeOnlyin interfaceIScope- Overrides:
resolveInThisScopeOnlyin classScopedSymbol
-
equals
- Overrides:
equalsin classScopedSymbol
-
hashCode
public int hashCode()- Overrides:
hashCodein classScopedSymbol
-