use of priv.bajdcc.LALR1.syntax.exp.TokenExp in project jMiniLang by bajdcc.
the class Syntax method addTerminal.
/**
* 添加终结符
*
* @param name
* 终结符名称
* @param type
* 单词类型
* @param obj
* 单词信息
* @throws SyntaxException 词法错误
*/
public void addTerminal(String name, priv.bajdcc.util.lexer.token.TokenType type, Object obj) throws SyntaxException {
TokenExp exp = new TokenExp(arrTerminals.size(), name, type, obj);
if (!mapTerminals.containsKey(name)) {
mapTerminals.put(name, exp);
arrTerminals.add(exp);
} else {
err(SyntaxError.REDECLARATION, name);
}
}
Aggregations