|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectDefinitionTable
public class DefinitionTable
A simple table of definitions for a Context Free Grammar. This particular implementation is very expensive, and we'll see improved implementations in the latter part of the semester.
| Constructor Summary | |
|---|---|
DefinitionTable()
Constructs an empty symbol table. |
|
| Method Summary | |
|---|---|
void |
add(String nonTerminal,
Definition value)
Adds a string-value association to the table. |
boolean |
contains(String nonTerminal)
Checks for an entry associated with a particular string. |
Definition |
get(String nonTerminal)
Gets a value associated with a string, from the table. |
static void |
main(String[] args)
An example method that makes use of a definition table. |
String |
toString()
Returns a string representation of the table. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefinitionTable()
| Method Detail |
|---|
public boolean contains(String nonTerminal)
nonTerminal - a string potentially associated with a value.
public void add(String nonTerminal,
Definition value)
nonTerminal - a non-null stringvalue - a Definition associated with a string.public Definition get(String nonTerminal)
nonTerminal - the string whose value is sought
public String toString()
toString in class Objectpublic static void main(String[] args)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||