## org.codehaus.groovy.ast
Class VariableScope

Represents a variable scope. This is primarily used to determine variable sharing across method and closure boundaries.

author:
  James Strachan

author:
  Jochen Theodorou

version:
  $Revision: 9929 $

Field Summary
`ClassNode` | `clazzScope`
`Map` | `declaredVariables`
`boolean` | `inStaticContext`
`VariableScope` | `parent`
`Map` | `referencedClassVariables`
`Map` | `referencedLocalVariables`
`boolean` | `resolvesDynamic`

Constructor Summary
`VariableScope()`
`VariableScope(VariableScope parent)`

Method Summary
`VariableScope` | `copy()`
`ClassNode` | `getClassScope()`
`Variable` | `getDeclaredVariable(String name)`
`VariableScope` | `getParent()`
`Variable` | `getReferencedClassVariable(String name)`
`Map` | `getReferencedClassVariables()` Gets a map containing the class variables referenced by this scope.
`Iterator` | `getReferencedClassVariablesIterator()` Gets an iterator for the referenced class variables.
`Variable` | `getReferencedLocalVariable(String name)`
`int` | `getReferencedLocalVariablesCount()`
`Iterator` | `getReferencedLocalVariablesIterator()`
`boolean` | `isClassScope()`
`boolean` | `isInStaticContext()`
`boolean` | `isReferencedClassVariable(String name)`
`boolean` | `isReferencedLocalVariable(String name)`
`boolean` | `isResolvingDynamic()`
`boolean` | `isRoot()`
`void` | `putDeclaredVariable(Variable var)`
`void` | `putReferencedClassVariable(Variable var)`
`void` | `putReferencedLocalVariable(Variable var)`
`Object` | `removeReferencedClassVariable(String name)`
`void` | `setClassScope(ClassNode node)`
`void` | `setDynamicResolving(boolean resolvesDynamic)`
`void` | `setInStaticContext(boolean inStaticContext)`

Constructor Detail

### VariableScope

    public VariableScope()

### VariableScope

    public VariableScope(VariableScope parent)

Method Detail

### copy

    public VariableScope copy()

### getClassScope

    public ClassNode getClassScope()

### getDeclaredVariable

    public Variable getDeclaredVariable(String name)

### getParent

    public VariableScope getParent()

### getReferencedClassVariable

    public Variable getReferencedClassVariable(String name)

### getReferencedClassVariables

    public Map getReferencedClassVariables()

  Gets a map containing the class variables referenced by this scope. This not can not be modified.
  return:
    a map containing the class variable references

### getReferencedClassVariablesIterator

    public Iterator getReferencedClassVariablesIterator()

  Gets an iterator for the referenced class variables. The remove operation is not supported.
  return:
    an iterator for the referenced class variables

### getReferencedLocalVariable

    public Variable getReferencedLocalVariable(String name)

### getReferencedLocalVariablesCount

    public int getReferencedLocalVariablesCount()

### getReferencedLocalVariablesIterator

    public Iterator getReferencedLocalVariablesIterator()

### isClassScope

    public boolean isClassScope()

### isInStaticContext

    public boolean isInStaticContext()

### isReferencedClassVariable

    public boolean isReferencedClassVariable(String name)

### isReferencedLocalVariable

    public boolean isReferencedLocalVariable(String name)

### isResolvingDynamic

    public boolean isResolvingDynamic()

### isRoot

    public boolean isRoot()

### putDeclaredVariable

    public void putDeclaredVariable(Variable var)

### putReferencedClassVariable

    public void putReferencedClassVariable(Variable var)

### putReferencedLocalVariable

    public void putReferencedLocalVariable(Variable var)

### removeReferencedClassVariable

    public Object removeReferencedClassVariable(String name)

### setClassScope

    public void setClassScope(ClassNode node)

### setDynamicResolving

    public void setDynamicResolving(boolean resolvesDynamic)

### setInStaticContext

    public void setInStaticContext(boolean inStaticContext)