Package org.codehaus.groovy.ast
Class VariableScope
java.lang.Object
org.codehaus.groovy.ast.VariableScope
Records declared and referenced variables for a given scope.  Helps determine
 variable sharing across closure and method boundaries.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncopy()Non-null iff this scope corresponds to a class; as opposed to a method, "if" statement, block statement, etc.getDeclaredVariable(String name) Gets a map containing the variables declared in this scope.Gets an iterator for the declared class variables.Gets a map containing the class variables referenced by this scope.Gets an iterator for the referenced class variables.intGets an iterator for the referenced local variables.booleanReturns true iff this scope corresponds to a class; as opposed to a method, "if" statement, block statement, etc.booleanbooleanbooleanbooleanisRoot()voidvoidvoidvoidsetClassScope(ClassNode classScope) voidsetInStaticContext(boolean inStaticContext) 
- 
Constructor Details- 
VariableScopepublic VariableScope()
- 
VariableScope
 
- 
- 
Method Details- 
getParent
- 
isRootpublic boolean isRoot()
- 
getClassScopeNon-null iff this scope corresponds to a class; as opposed to a method, "if" statement, block statement, etc.
- 
isClassScopepublic boolean isClassScope()Returns true iff this scope corresponds to a class; as opposed to a method, "if" statement, block statement, etc.
- 
setClassScope
- 
isInStaticContextpublic boolean isInStaticContext()
- 
setInStaticContextpublic void setInStaticContext(boolean inStaticContext) 
- 
getDeclaredVariable
- 
getReferencedLocalVariable
- 
getReferencedClassVariable
- 
isReferencedLocalVariable
- 
isReferencedClassVariable
- 
getDeclaredVariablesGets a map containing the variables declared in this scope. This map cannot be modified.- Returns:
- a map containing the declared variable references
 
- 
getReferencedClassVariablesGets a map containing the class variables referenced by this scope. This not can not be modified.- Returns:
- a map containing the class variable references
 
- 
getReferencedLocalVariablesCountpublic int getReferencedLocalVariablesCount()
- 
getDeclaredVariablesIteratorGets an iterator for the declared class variables. The remove operation is not supported.- Returns:
- an iterator for the declared variables
 
- 
getReferencedLocalVariablesIteratorGets an iterator for the referenced local variables. The remove operation *is* supported.- Returns:
- an iterator for the referenced local variables
 
- 
getReferencedClassVariablesIteratorGets an iterator for the referenced class variables. The remove operation is not supported.- Returns:
- an iterator for the referenced class variables
 
- 
putDeclaredVariable
- 
putReferencedLocalVariable
- 
putReferencedClassVariable
- 
removeReferencedClassVariable
- 
copy
 
-