KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > persistence > antlr > TokenManager


1 package persistence.antlr;
2
3 /* ANTLR Translator Generator
4  * Project led by Terence Parr at http://www.jGuru.com
5  * Software rights: http://www.antlr.org/license.html
6  *
7  */

8
9 import java.util.Hashtable JavaDoc;
10 import java.util.Enumeration JavaDoc;
11
12 import persistence.antlr.collections.impl.Vector;
13
14 /** Interface that describes the set of defined tokens */
15 interface TokenManager {
16     public Object JavaDoc 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 JavaDoc getName();
23
24     /** Get a token string by index */
25     public String JavaDoc getTokenStringAt(int idx);
26
27     /** Get the TokenSymbol for a string */
28     public TokenSymbol getTokenSymbol(String JavaDoc sym);
29
30     public TokenSymbol getTokenSymbolAt(int idx);
31
32     /** Get an enumerator over the symbol table */
33     public Enumeration JavaDoc getTokenSymbolElements();
34
35     public Enumeration JavaDoc 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 JavaDoc 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 JavaDoc n);
53
54     public void setReadOnly(boolean ro);
55
56     /** Is a token symbol defined? */
57     public boolean tokenDefined(String JavaDoc symbol);
58 }
59
Popular Tags