Search in sources :

Example 1 with LostHandler

use of priv.bajdcc.LALR1.grammar.error.LostHandler in project jMiniLang by bajdcc.

the class Grammar method declareErrorHandler.

/**
 * 声明错误处理器
 *
 * @throws SyntaxException 词法错误
 */
private void declareErrorHandler() throws SyntaxException {
    addErrorHandler("lost_exp", new LostHandler("表达式"));
    addErrorHandler("lost_func", new LostHandler("函数"));
    addErrorHandler("lost_token", new LostHandler("标识符"));
    addErrorHandler("lost_func_name", new LostHandler("函数名"));
    addErrorHandler("lost_func_body", new LostHandler("函数体"));
    addErrorHandler("lost_block", new LostHandler("块"));
    addErrorHandler("lost_stmt", new LostHandler("语句"));
    addErrorHandler("lost_string", new LostHandler("字符串"));
    addErrorHandler("lost_assign", new LostHandler("等号'='"));
    addErrorHandler("lost_call", new LostHandler("调用主体"));
    addErrorHandler("lost_lpa", new LostHandler("左圆括号'('"));
    addErrorHandler("lost_rpa", new LostHandler("右圆括号')'"));
    addErrorHandler("lost_lsq", new LostHandler("左方括号'['"));
    addErrorHandler("lost_rsq", new LostHandler("右方括号']'"));
    addErrorHandler("lost_lbr", new LostHandler("左花括号'{'"));
    addErrorHandler("lost_rbr", new LostHandler("右花括号'}'"));
    addErrorHandler("lost_colon", new LostHandler("冒号':'"));
    addErrorHandler("lost_semi", new LostHandler("分号';'"));
    addErrorHandler("lost_doc", new LostHandler("文档"));
    addErrorHandler("lost_var", new LostHandler("赋值"));
    addErrorHandler("lost_array", new LostHandler("数组'[]'"));
    addErrorHandler("lost_map", new LostHandler("字典'{}'"));
    addErrorHandler("lost_dot", new LostHandler("点号'.'"));
    addErrorHandler("lost_property", new LostHandler("属性连接符'::'"));
    addErrorHandler("lost_try", new LostHandler("属性连接符'::'"));
    addErrorHandler("lost_catch", new LostHandler("'catch'"));
}
Also used : LostHandler(priv.bajdcc.LALR1.grammar.error.LostHandler)

Aggregations

LostHandler (priv.bajdcc.LALR1.grammar.error.LostHandler)1