You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.5 KiB
61 lines
1.5 KiB
5 years ago
|
package com.fr.third.antlr;
|
||
|
|
||
|
/* ANTLR Translator Generator
|
||
|
* Project led by Terence Parr at http://www.cs.usfca.edu
|
||
|
* Software rights: http://www.antlr.org/license.html
|
||
|
*
|
||
|
* $Id: //depot/code/org.antlr/release/antlr-2.7.7/antlr/TokenManager.java#2 $
|
||
|
*/
|
||
|
|
||
|
|
||
|
import java.util.Enumeration;
|
||
|
|
||
|
import com.fr.third.antlr.collections.impl.Vector;
|
||
|
|
||
|
|
||
|
/** Interface that describes the set of defined tokens */
|
||
|
interface TokenManager {
|
||
|
public Object clone();
|
||
|
|
||
|
/** define a token symbol */
|
||
|
public void define(TokenSymbol ts);
|
||
|
|
||
|
/** Get the name of the token manager */
|
||
|
public String getName();
|
||
|
|
||
|
/** Get a token string by index */
|
||
|
public String getTokenStringAt(int idx);
|
||
|
|
||
|
/** Get the TokenSymbol for a string */
|
||
|
public TokenSymbol getTokenSymbol(String sym);
|
||
|
|
||
|
public TokenSymbol getTokenSymbolAt(int idx);
|
||
|
|
||
|
/** Get an enumerator over the symbol table */
|
||
|
public Enumeration getTokenSymbolElements();
|
||
|
|
||
|
public Enumeration getTokenSymbolKeys();
|
||
|
|
||
|
/** Get the token vocabulary (read-only).
|
||
|
* @return A Vector of Strings indexed by token type */
|
||
|
public Vector getVocabulary();
|
||
|
|
||
|
/** Is this token manager read-only? */
|
||
|
public boolean isReadOnly();
|
||
|
|
||
|
public void mapToTokenSymbol(String name, TokenSymbol sym);
|
||
|
|
||
|
/** Get the highest token type in use */
|
||
|
public int maxTokenType();
|
||
|
|
||
|
/** Get the next unused token type */
|
||
|
public int nextTokenType();
|
||
|
|
||
|
public void setName(String n);
|
||
|
|
||
|
public void setReadOnly(boolean ro);
|
||
|
|
||
|
/** Is a token symbol defined? */
|
||
|
public boolean tokenDefined(String symbol);
|
||
|
}
|