|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--torero.model.SymbolMap
The SymbolMap is a collection used for creation and lookup of Symbols for a specific grammar. It ensures the uniqueness of the Symbols defined in it.
| Constructor Summary | |
SymbolMap()
|
|
| Method Summary | |
boolean |
contains(String symname)
Returns true if a Symbol with that name exists. |
Epsilon |
getEpsilon()
Returns the Epsilon Symbol of this SymbolMap. |
Iterator |
getSymbolIterator()
Returns all Symbols in this SymbolMap as Iterator. |
Collection |
getSymbols()
Returns all Symbols in this SymbolMap as Collection. |
int |
getSymbolSize()
Returns the number of Symbols in this SymbolMap. |
Nonterm |
obtainNonterm(String name)
If a Nonterm with the given name already exists it's given back - otherwhise a new one is created and given back. |
Symbol |
obtainSymbol(String name)
If a Nonterm with the given name already exists it's given back - otherwhise a new one is created and given back. |
Token |
obtainToken(String name,
String word)
If a token with the given name already exists its given back - otherwhise a new one is created and given back. |
String |
toString()
Returns String representation for this Symbol. |
protected void |
updateEntry(Symbol symbol,
String oldname)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SymbolMap()
| Method Detail |
public Epsilon getEpsilon()
public Token obtainToken(String name,
String word)
name - takes the Name of the token that should be obtained.word - takes the word expression the (new) token should have.public boolean contains(String symname)
public Nonterm obtainNonterm(String name)
name - takes the Name of the Nonterm that should be obtained.public Symbol obtainSymbol(String name)
name - takes the Name of the Symbol that should be obtained.public String toString()
toString in class Objectpublic Iterator getSymbolIterator()
public int getSymbolSize()
public Collection getSymbols()
protected void updateEntry(Symbol symbol,
String oldname)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||