01: package persistence.antlr;
02:
03: /* ANTLR Translator Generator
04: * Project led by Terence Parr at http://www.jGuru.com
05: * Software rights: http://www.antlr.org/license.html
06: *
07: */
08:
09: import java.util.Hashtable;
10: import java.util.Enumeration;
11:
12: import persistence.antlr.collections.impl.Vector;
13:
14: /** Interface that describes the set of defined tokens */
15: interface TokenManager {
16: public Object clone();
17:
18: /** define a token symbol */
19: public void define(TokenSymbol ts);
20:
21: /** Get the name of the token manager */
22: public String getName();
23:
24: /** Get a token string by index */
25: public String getTokenStringAt(int idx);
26:
27: /** Get the TokenSymbol for a string */
28: public TokenSymbol getTokenSymbol(String sym);
29:
30: public TokenSymbol getTokenSymbolAt(int idx);
31:
32: /** Get an enumerator over the symbol table */
33: public Enumeration getTokenSymbolElements();
34:
35: public Enumeration getTokenSymbolKeys();
36:
37: /** Get the token vocabulary (read-only).
38: * @return A Vector of Strings indexed by token type */
39: public Vector getVocabulary();
40:
41: /** Is this token manager read-only? */
42: public boolean isReadOnly();
43:
44: public void mapToTokenSymbol(String name, TokenSymbol sym);
45:
46: /** Get the highest token type in use */
47: public int maxTokenType();
48:
49: /** Get the next unused token type */
50: public int nextTokenType();
51:
52: public void setName(String n);
53:
54: public void setReadOnly(boolean ro);
55:
56: /** Is a token symbol defined? */
57: public boolean tokenDefined(String symbol);
58: }
|