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)

Constructor Summary
LocalVariableScopeContext(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, boolean includeCurrentBlock, int idx, boolean referredFromClosure, ILogicalContainerProvider expressionContext)
           
 
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.EObject getLogicalOrRealContainer()
           
 org.eclipse.emf.ecore.EReference getReference()
           
 boolean isIncludeCurrentBlock()
           
 boolean isReferredFromClosure()
           
 LocalVariableScopeContext spawnForContainer()
          Create a copy of the context and adjust parameters, e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalVariableScopeContext

public LocalVariableScopeContext(org.eclipse.emf.ecore.EObject context,
                                 org.eclipse.emf.ecore.EReference reference,
                                 boolean includeCurrentBlock,
                                 int idx,
                                 boolean referredFromClosure,
                                 ILogicalContainerProvider expressionContext)
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()

getLogicalOrRealContainer

public org.eclipse.emf.ecore.EObject getLogicalOrRealContainer()

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