org.jruby.parser
Class LocalNamesStack

java.lang.Object
  extended byorg.jruby.util.collections.AbstractStack
      extended byorg.jruby.parser.LocalNamesStack

public class LocalNamesStack
extends AbstractStack

Version:
$Revision: 1.6 $
Author:
jpetersen

Field Summary
 
Fields inherited from class org.jruby.util.collections.AbstractStack
top
 
Constructor Summary
LocalNamesStack()
           
 
Method Summary
 void changeBlockLevel(int change)
           
 void ensureLocalRegistered(java.lang.String name)
           
 int getLocalIndex(java.lang.String name)
          Returns the index of the local variable 'name' in the table of registered variable names.
 java.util.List getNames()
           
 boolean isInBlock()
           
 boolean isLocalRegistered(java.lang.String name)
          Returns true if there was already an assignment to a local variable named name, false otherwise.
 void push()
           
 int registerLocal(java.lang.String name)
           
 void setNames(java.util.List names)
           
 
Methods inherited from class org.jruby.util.collections.AbstractStack
getTop, isEmpty, pop, push
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalNamesStack

public LocalNamesStack()
Method Detail

isLocalRegistered

public boolean isLocalRegistered(java.lang.String name)
Returns true if there was already an assignment to a local variable named name, false otherwise. MRI: cf local_id

Parameters:
name - The name of the local variable.
Returns:
true if there was already an assignment to a local variable named id.

getLocalIndex

public int getLocalIndex(java.lang.String name)
Returns the index of the local variable 'name' in the table of registered variable names. If name is not registered yet, register the variable name. If name == null returns the count of registered variable names. MRI: cf local_cnt

Parameters:
name - The name of the local variable
Returns:
The index in the table of registered variable names.

registerLocal

public int registerLocal(java.lang.String name)

ensureLocalRegistered

public void ensureLocalRegistered(java.lang.String name)

getNames

public java.util.List getNames()

setNames

public void setNames(java.util.List names)

isInBlock

public boolean isInBlock()

changeBlockLevel

public void changeBlockLevel(int change)

push

public void push()


Copyright © 2002 Jan Arne Petersen. All Rights Reserved.