org.eclipse.xtext.xbase.scoping
Class LocalVariableScopeContext
java.lang.Object
org.eclipse.xtext.xbase.scoping.LocalVariableScopeContext
public class LocalVariableScopeContext
- extends java.lang.Object
A wrapped parameter object that holds the necessary information for computing local variable scopes.
- Author:
- Sebastian Zarnekow - Initial contribution and API
- See Also:
XbaseScopeProvider.createLocalVarScope(org.eclipse.xtext.scoping.IScope, LocalVariableScopeContext)
,
XbaseScopeProvider.createLocalVariableScopeContext(EObject, EReference, boolean, int)
Constructor Summary |
protected |
LocalVariableScopeContext(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference,
boolean includeCurrentBlock,
int idx,
boolean referredFromClosure)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
context
protected final org.eclipse.emf.ecore.EObject context
reference
protected final org.eclipse.emf.ecore.EReference reference
includeCurrentBlock
protected final boolean includeCurrentBlock
idx
protected final int idx
referredFromClosure
protected final boolean referredFromClosure
LocalVariableScopeContext
protected LocalVariableScopeContext(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference,
boolean includeCurrentBlock,
int idx,
boolean referredFromClosure)
spawnForContainer
public LocalVariableScopeContext spawnForContainer()
- Create a copy of the context and adjust parameters, e.g. the information about the block scoping context
is set to default while the flag
referredFromClosure
is updated appropriately.
- Returns:
- the spawned context. Never
null
. - See Also:
canSpawnForContainer()
canSpawnForContainer
public boolean canSpawnForContainer()
- Used to decide whether the container hierarchy for the referenced
context
should be walked up or not.
getContext
public org.eclipse.emf.ecore.EObject getContext()
getReference
public org.eclipse.emf.ecore.EReference getReference()
getIndex
public int getIndex()
- Returns the index in the current block for the 'leaf context'.
- Returns:
- the index in the current block for the 'leaf context'.
isIncludeCurrentBlock
public boolean isIncludeCurrentBlock()
isReferredFromClosure
public boolean isReferredFromClosure()