|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--prolog.implementation.SymbolTable
The symboltable is created by the scanner and parser during parsing. All identifiers and strings of the sourceprogram are replaced by a number. In the symboltable, the relation between the number and the original string is stored
| Field Summary | |
(package private) static int |
instanceCount
a instance counter for hacked debug purpose |
protected java.util.Map |
wordMap
a map storing all words found in program the key is the word, the index in the word list the value |
protected java.util.List |
words
a list storing all words with their index found in program |
| Constructor Summary | |
SymbolTable()
create a symboltable |
|
| Method Summary | |
void |
clear()
clears the symboltyble |
java.lang.String |
decode(IAtom index)
decodes the given word |
java.lang.String |
decode(int index)
decodes the given word |
java.lang.String |
decode(java.lang.Object obj)
decodes the given word |
int |
encode(java.lang.String word)
encodes the given word |
void |
genXml(java.io.Writer out)
generates a xml representation of this symboltable |
private int |
getIndex(java.lang.String word)
returns the index of the given word in the symboltable |
java.lang.String |
toString()
returns a string representation of this symboltable |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
static int instanceCount
protected java.util.List words
protected java.util.Map wordMap
| Constructor Detail |
public SymbolTable()
| Method Detail |
public void clear()
clear in interface ISymbolTablepublic int encode(java.lang.String word)
encode in interface ISymbolTableword - public java.lang.String decode(IAtom index)
decode in interface ISymbolTableprolog.model.ISymbolTableindex - public java.lang.String decode(int index)
decode in interface ISymbolTableprolog.model.ISymbolTableindex - public java.lang.String decode(java.lang.Object obj)
private int getIndex(java.lang.String word)
public void genXml(java.io.Writer out)
throws java.io.IOException
genXml in interface ISymbolTablejava.io.IOException - public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||