All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class openjava.main.KeywordTable

java.lang.Object
   |
   +----java.util.Dictionary
           |
           +----java.util.Hashtable
                   |
                   +----openjava.main.KeywordTable

public class KeywordTable
extends Hashtable
The KeywordTable class presents for node of parse tree.

See Also:
Hashtable

Variable Index

 o parent

Constructor Index

 o KeywordTable()
constructs empty table
 o KeywordTable(KeywordTable)
constructs empty table with its parent set.

Method Index

 o isRegistered(Leaf)
tests if the specified token is a keyword in this hashtable.
 o isRegistered(String)
tests if the specified token is a keyword in this hashtable.
 o isRegisteredLocal(Leaf)
tests if the specified token is a keyword in this hashtable.
 o isRegisteredLocal(String)
tests if the specified token is a keyword in this hashtable.
 o popScope()
pop out of the scope
 o pushScope()
push into a scope
 o put(Leaf)
registers new keyword
 o put(Leaf, int)
registers new keyword
 o put(String)
registers new keyword
 o put(String, int)
registers new keyword
 o resetToDefault()

Variables

 o parent
 protected KeywordTable parent

Constructors

 o KeywordTable
 public KeywordTable()
constructs empty table

 o KeywordTable
 public KeywordTable(KeywordTable parent)
constructs empty table with its parent set.

Parameters:
parent - Parent table. If this is null, parent table will be default keywords.

Methods

 o isRegistered
 public boolean isRegistered(String str)
tests if the specified token is a keyword in this hashtable.

Returns:
true if specified string was registered yet
 o isRegistered
 public boolean isRegistered(Leaf token)
tests if the specified token is a keyword in this hashtable.

Returns:
true if specified token was registered yet
 o isRegisteredLocal
 public boolean isRegisteredLocal(String str)
tests if the specified token is a keyword in this hashtable.

Returns:
true if specified string was registered yet
 o isRegisteredLocal
 public boolean isRegisteredLocal(Leaf token)
tests if the specified token is a keyword in this hashtable.

Returns:
true if specified token was registered yet
 o put
 public void put(String str,
                 int id)
registers new keyword

Parameters:
str - String to be registered
id - Number presenting for the kind of token
 o put
 public void put(Leaf token,
                 int id)
registers new keyword

Parameters:
str - Leaf to be registered
See Also:
Leaf
 o put
 public void put(String str)
registers new keyword

Parameters:
str - String to be registered
 o put
 public void put(Leaf token)
registers new keyword

Parameters:
str - String to be registered
 o pushScope
 public KeywordTable pushScope()
push into a scope

 o popScope
 public KeywordTable popScope()
pop out of the scope

 o resetToDefault
 protected void resetToDefault()

All Packages  Class Hierarchy  This Package  Previous  Next  Index