Groovy 2.2.0

org.codehaus.groovy.ast
[Java] Class VariableScope

java.lang.Object
  org.codehaus.groovy.ast.VariableScope

public class VariableScope
extends Object

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

Authors:
James Strachan
Jochen Theodorou
Version:
\$Revision\$


Constructor Summary
VariableScope()

VariableScope(VariableScope parent)

 
Method Summary
VariableScope copy()

ClassNode getClassScope()

Non-null iff this scope corresponds to a class; as opposed to a method, "if" statement, block statement, etc.

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

Returns true iff this scope corresponds to a class; as opposed to a method, "if" statement, block statement, etc.

boolean isInStaticContext()

boolean isReferencedClassVariable(String name)

boolean isReferencedLocalVariable(String name)

boolean isRoot()

void putDeclaredVariable(Variable var)

void putReferencedClassVariable(Variable var)

void putReferencedLocalVariable(Variable var)

Object removeReferencedClassVariable(String name)

void setClassScope(ClassNode node)

void setInStaticContext(boolean inStaticContext)

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Constructor Detail

VariableScope

public VariableScope()


VariableScope

public VariableScope(VariableScope parent)


 
Method Detail

copy

public VariableScope copy()


getClassScope

public ClassNode getClassScope()
Non-null iff this scope corresponds to a class; as opposed to a method, "if" statement, block statement, etc.


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.
Returns:
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.
Returns:
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()
Returns true iff this scope corresponds to a class; as opposed to a method, "if" statement, block statement, etc.


isInStaticContext

public boolean isInStaticContext()


isReferencedClassVariable

public boolean isReferencedClassVariable(String name)


isReferencedLocalVariable

public boolean isReferencedLocalVariable(String name)


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)


setInStaticContext

public void setInStaticContext(boolean inStaticContext)


 

Copyright © 2003-2013 The Codehaus. All rights reserved.