org.jruby.runtime
Class Scope

java.lang.Object
  extended byorg.jruby.runtime.Scope
All Implemented Interfaces:
StackElement

public class Scope
extends java.lang.Object
implements StackElement

A Scope in the Ruby Stack of scopes. This is used to maintain a stack of scopes through a linked list. Each scope holds a list of local values and a list of local names Each scope also hold a pointer to the previous scope, a new empty scope can be pushed on top of the stack using the push method, the top scope can be popped of the top of the stack using the pop method.

Version:
$Revision: 1.8 $
Author:
jpetersen

Constructor Summary
Scope(Ruby ruby)
           
 
Method Summary
 void addLocalVariables(java.util.List localNames)
           
 IRubyObject getBackref()
           
 IRubyObject getLastLine()
           
 java.util.List getLocalValues()
           
 StackElement getNext()
           
 IRubyObject getSuperObject()
          Getter for property superObject.
 IRubyObject getValue(int count)
           
 Visibility getVisibility()
          Gets the methodScope.
 boolean hasLocalVariables()
           
 void resetLocalVariables(java.util.List localNames)
          Sets the localNames.
 void setBackref(IRubyObject match)
           
 void setLastLine(IRubyObject value)
           
 void setNext(StackElement newNext)
           
 void setSuperObject(IRubyObject superObject)
          Setter for property superObject.
 void setValue(int count, IRubyObject value)
           
 void setVisibility(Visibility visibility)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scope

public Scope(Ruby ruby)
Method Detail

getNext

public StackElement getNext()
Specified by:
getNext in interface StackElement

setNext

public void setNext(StackElement newNext)
Specified by:
setNext in interface StackElement

getSuperObject

public IRubyObject getSuperObject()
Getter for property superObject.

Returns:
Value of property superObject.

setSuperObject

public void setSuperObject(IRubyObject superObject)
Setter for property superObject.

Parameters:
superObject - New value of property superObject.

resetLocalVariables

public void resetLocalVariables(java.util.List localNames)
Sets the localNames.

Parameters:
localNames - The localNames to set

addLocalVariables

public void addLocalVariables(java.util.List localNames)

getLocalValues

public java.util.List getLocalValues()

hasLocalVariables

public boolean hasLocalVariables()

getValue

public IRubyObject getValue(int count)

setValue

public void setValue(int count,
                     IRubyObject value)

getVisibility

public Visibility getVisibility()
Gets the methodScope.

Returns:
Returns a int

setVisibility

public void setVisibility(Visibility visibility)

getLastLine

public IRubyObject getLastLine()

setLastLine

public void setLastLine(IRubyObject value)

getBackref

public IRubyObject getBackref()

setBackref

public void setBackref(IRubyObject match)


Copyright © 2002 Jan Arne Petersen. All Rights Reserved.