SyntaxError.java 文件源码

java
阅读 39 收藏 0 点赞 0 评论 0

项目:MARF-for-Android 作者:
/**
 * Serialization routine.
 * TODO: migrate to MARF dump/restore mechanism.
 *
 * @param piOperation  0 for load (not implemented), 1 for save as text
 * @param poFileWriter writer to write the error message to
 * @return <code>true</code> if the operation was successful
 */
public boolean serialize(int piOperation, FileWriter poFileWriter) {
    if (piOperation == 0) {
        // TODO load
        System.err.println("LexicalError::serialize(LOAD) - unimplemented");
        return false;
    } else {
        try {
            poFileWriter.write
                    (
                            "Syntax Error (line " + this.iLineNo + "): " + this.iCurrentErrorCode +
                                    " - " + this.strMessage + ", " +
                                    "faulting token: [" + this.oFaultingToken.getLexeme() + "]\n"
                    );

            return true;
        } catch (IOException e) {
            System.err.println("SyntaxError::serialize() - " + e.getMessage());
            e.printStackTrace(System.err);
            return false;
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号