org.codehaus.groovy.ast
Class VariableScope

java.lang.Object
  extended byorg.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.

Version:
$Revision: 1.2 $
Author:
James Strachan

Constructor Summary
VariableScope()
           
VariableScope(VariableScope parent)
           
 
Method Summary
protected  void append(VariableScope scope)
          Appends all of the references and declarations from the given scope to this one
protected  void appendRecursive(VariableScope scope)
          Appends all of the references and declarations from the given scope and all its children to this one
 VariableScope createCompositeChildScope()
          Creates a composite variable scope combining all the variable references and declarations from all the child scopes not including this scope
 VariableScope createRecursiveChildScope()
          Creates a scope including this scope and all nested scopes combined together
 VariableScope createRecursiveParentScope()
          Creates a scope including this scope and all parent scopes combined together
 List getChildren()
           
 Set getDeclaredVariables()
           
 Set getReferencedVariables()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableScope

public VariableScope()

VariableScope

public VariableScope(VariableScope parent)
Method Detail

getDeclaredVariables

public Set getDeclaredVariables()

getReferencedVariables

public Set getReferencedVariables()

getChildren

public List getChildren()
Returns:
all the child scopes

createCompositeChildScope

public VariableScope createCompositeChildScope()
Creates a composite variable scope combining all the variable references and declarations from all the child scopes not including this scope

Returns:

createRecursiveChildScope

public VariableScope createRecursiveChildScope()
Creates a scope including this scope and all nested scopes combined together

Returns:

createRecursiveParentScope

public VariableScope createRecursiveParentScope()
Creates a scope including this scope and all parent scopes combined together

Returns:

append

protected void append(VariableScope scope)
Appends all of the references and declarations from the given scope to this one

Parameters:
scope -

appendRecursive

protected void appendRecursive(VariableScope scope)
Appends all of the references and declarations from the given scope and all its children to this one

Parameters:
scope -


Copyright © 2003-2004 The Codehaus. All Rights Reserved.