Building Parsers with Java

sjm.examples.sling
Class Scope

java.lang.Object
  |
  +--sjm.examples.sling.Scope

public class Scope
extends java.lang.Object

This class holds a collection of variables.


Field Summary
protected  java.util.Hashtable dictionary
           
 
Constructor Summary
Scope()
           
 
Method Summary
 boolean isDefined(java.lang.String name)
          Returns true if a variable of the given name appears in this scope.
 Variable lookup(java.lang.String name)
          Returns a variable of the given name from this scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dictionary

protected java.util.Hashtable dictionary
Constructor Detail

Scope

public Scope()
Method Detail

isDefined

public boolean isDefined(java.lang.String name)
Returns true if a variable of the given name appears in this scope.
Parameters:
String - the variable name
Returns:
true, if a variable of the given name appears in this scope.

lookup

public Variable lookup(java.lang.String name)
Returns a variable of the given name from this scope. If the so-named variable is not already in this scope, the scope will create it and add the variable to itself.
Parameters:
String - the variable name
Returns:
a variable of the given name from this scope

by Steve Metsker