org.jruby.parser
Class LocalStaticScope

java.lang.Object
  extended by org.jruby.parser.StaticScope
      extended by org.jruby.parser.LocalStaticScope
All Implemented Interfaces:
java.io.Serializable

public class LocalStaticScope
extends StaticScope

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jruby.parser.StaticScope
enclosingScope
 
Constructor Summary
LocalStaticScope(StaticScope enclosingScope)
           
LocalStaticScope(StaticScope enclosingScope, java.lang.String[] names)
           
 
Method Summary
 AssignableNode assign(ISourcePosition position, java.lang.String name, Node value, StaticScope topScope, int depth)
           
 Node declare(ISourcePosition position, java.lang.String name, int depth)
           
 java.lang.String[] getAllNamesInScope()
          Get all visible variables that we can see from this scope that have been assigned (e.g.
 StaticScope getLocalScope()
          Gets the Local Scope relative to the current Scope.
 boolean isArgumentScope()
          Argument scopes represent scopes which contain arguments for zsuper.
 int isDefined(java.lang.String name, int depth)
           
 void makeArgumentScope()
           
 java.lang.String toString()
           
 
Methods inherited from class org.jruby.parser.StaticScope
addVariable, addVariableThisScope, assign, capture, declare, determineModule, exists, getArity, getConstant, getConstantWithConstMissing, getDummyScope, getEnclosingScope, getModule, getNumberOfVariables, getOptionalArgs, getPreviousCRefScope, getRequiredArgs, getRestArg, getVariables, isBackrefLastlineScope, isCaptured, isDefined, setArities, setBackrefLastlineScope, setModule, setPreviousCRefScope, setRequiredArgs, setRestArg, setVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalStaticScope

public LocalStaticScope(StaticScope enclosingScope)

LocalStaticScope

public LocalStaticScope(StaticScope enclosingScope,
                        java.lang.String[] names)
Method Detail

getLocalScope

public StaticScope getLocalScope()
Description copied from class: StaticScope
Gets the Local Scope relative to the current Scope. For LocalScopes this will be itself. Blocks will contain the LocalScope it contains.

Specified by:
getLocalScope in class StaticScope
Returns:
localScope

isDefined

public int isDefined(java.lang.String name,
                     int depth)
Specified by:
isDefined in class StaticScope

isArgumentScope

public boolean isArgumentScope()
Description copied from class: StaticScope
Argument scopes represent scopes which contain arguments for zsuper. All LocalStaticScopes are argument scopes and BlockStaticScopes can be when they are used by define_method.

Specified by:
isArgumentScope in class StaticScope

makeArgumentScope

public void makeArgumentScope()
Specified by:
makeArgumentScope in class StaticScope

getAllNamesInScope

public java.lang.String[] getAllNamesInScope()
Description copied from class: StaticScope
Get all visible variables that we can see from this scope that have been assigned (e.g. seen so far)

Specified by:
getAllNamesInScope in class StaticScope
Returns:
a list of all names (sans $~ and $_ which are special names)
See Also:
StaticScope.getAllNamesInScope()

assign

public AssignableNode assign(ISourcePosition position,
                             java.lang.String name,
                             Node value,
                             StaticScope topScope,
                             int depth)
Specified by:
assign in class StaticScope

declare

public Node declare(ISourcePosition position,
                    java.lang.String name,
                    int depth)
Specified by:
declare in class StaticScope

toString

public java.lang.String toString()
Overrides:
toString in class StaticScope


Copyright © 2002-2009 JRuby Team. All Rights Reserved.