org.eclipse.xtext.xbase.scoping
Class LocalVariableScopeContext

java.lang.Object
  extended by 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)

Field Summary
protected  org.eclipse.emf.ecore.EObject context
           
protected  int idx
           
protected  boolean includeCurrentBlock
           
protected  org.eclipse.emf.ecore.EReference reference
           
protected  boolean referredFromClosure
           
 
Constructor Summary
protected LocalVariableScopeContext(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, boolean includeCurrentBlock, int idx, boolean referredFromClosure)
           
 
Method Summary
 boolean canSpawnForContainer()
          Used to decide whether the container hierarchy for the referenced context should be walked up or not.
 org.eclipse.emf.ecore.EObject getContext()
           
 int getIndex()
          Returns the index in the current block for the 'leaf context'.
 org.eclipse.emf.ecore.EReference getReference()
           
 boolean isIncludeCurrentBlock()
           
 boolean isReferredFromClosure()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

LocalVariableScopeContext

protected LocalVariableScopeContext(org.eclipse.emf.ecore.EObject context,
                                    org.eclipse.emf.ecore.EReference reference,
                                    boolean includeCurrentBlock,
                                    int idx,
                                    boolean referredFromClosure)
Method Detail

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()