|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.ast.VariableScope
public class VariableScope
Represents a variable scope. This is primarily used to determine variable sharing across method and closure boundaries.
Field Summary | |
---|---|
private ClassNode |
clazzScope
|
private java.util.Map |
declaredVariables
|
private boolean |
inStaticContext
|
private VariableScope |
parent
|
private java.util.Map |
referencedClassVariables
|
private java.util.Map |
referencedLocalVariables
|
private boolean |
resolvesDynamic
|
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(java.lang.String name)
|
VariableScope |
getParent()
|
Variable |
getReferencedClassVariable(java.lang.String name)
|
java.util.Map |
getReferencedClassVariables()
Gets a map containing the class variables referenced by this scope. |
java.util.Iterator |
getReferencedClassVariablesIterator()
Gets an iterator for the referenced class variables. |
Variable |
getReferencedLocalVariable(java.lang.String name)
|
int |
getReferencedLocalVariablesCount()
|
java.util.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(java.lang.String name)
|
boolean |
isReferencedLocalVariable(java.lang.String name)
|
boolean |
isResolvingDynamic()
|
boolean |
isRoot()
|
void |
putDeclaredVariable(Variable var)
|
void |
putReferencedClassVariable(Variable var)
|
void |
putReferencedLocalVariable(Variable var)
|
java.lang.Object |
removeReferencedClassVariable(java.lang.String name)
|
void |
setClassScope(ClassNode node)
|
void |
setDynamicResolving(boolean resolvesDynamic)
|
void |
setInStaticContext(boolean inStaticContext)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Map declaredVariables
private java.util.Map referencedLocalVariables
private java.util.Map referencedClassVariables
private boolean inStaticContext
private boolean resolvesDynamic
private ClassNode clazzScope
private VariableScope parent
Constructor Detail |
---|
public VariableScope()
public VariableScope(VariableScope parent)
Method Detail |
---|
public Variable getDeclaredVariable(java.lang.String name)
public boolean isReferencedLocalVariable(java.lang.String name)
public boolean isReferencedClassVariable(java.lang.String name)
public VariableScope getParent()
public boolean isInStaticContext()
public void setInStaticContext(boolean inStaticContext)
public boolean isResolvingDynamic()
public void setDynamicResolving(boolean resolvesDynamic)
public void setClassScope(ClassNode node)
public ClassNode getClassScope()
public boolean isClassScope()
public boolean isRoot()
public VariableScope copy()
public void putDeclaredVariable(Variable var)
public java.util.Iterator getReferencedLocalVariablesIterator()
public int getReferencedLocalVariablesCount()
public Variable getReferencedLocalVariable(java.lang.String name)
public void putReferencedLocalVariable(Variable var)
public void putReferencedClassVariable(Variable var)
public Variable getReferencedClassVariable(java.lang.String name)
public java.lang.Object removeReferencedClassVariable(java.lang.String name)
public java.util.Map getReferencedClassVariables()
public java.util.Iterator getReferencedClassVariablesIterator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |