当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

《面向对象语言》课程教学资源(讲稿)class predicates

资源类别:文库,文档格式:DOC,文档页数:1,文件大小:23.5KB,团购合买
class predicates handleFileReadError:( exception: traceID ErrorCode) failure handle FileRead Error(ErrorCode) Descriptor exception: try GetDescriptor(ErrorCode, fileSystem_api: cannotcreate) i, file cannot be loaded
点击下载完整版文档(DOC)

class predicates handle File Error:( exception: traceID ErrorCode )failure clauses handle File Read Error(ErrorCode) Descriptor exception: try GetDescriptor(ErrorCode, file System_api: cannotcreate ) i file cannot be loaded exception: descriptor(ErrorCode, %_ErrorCode is Errorcode %just not necessary to insert extra check here ClassInfo, class information of the class, which raised the exception Exception, actually it is file System_api: cannotcreate, Yo but the parameter should not be compared by %o See exception State: equals Kind, exception can be raised or continued ExtraInfo CursorPosition %o currently we know the position but sending dumps to developers requires positions GMTTime, %o the time of exception creation ExceptionDescription )= Descriptor, File Name core: mapLookUp(ExtraInfo file System_ api: file Name_parameter, string ()) common_exception: errorDescription_parameter, string(")). stdIo: write("Cannot load file due to: " Exception Des cription, AnFile Name: File Name n:,Reason) exception: clear(ErrorCode) %o it is necessary to clean exceptions when they are handled handle File Read Error(ErrorCode): Debug Mode true , exception Dump: dump ToStdOutput(ErrorCode), %o dump to console for developer needs exception: clearAllO, Yo clear all exce ptions, as they are shown in the dump already fail handle File Read Error(ErrorCode): exception: clear(Errorcode), %o program cannot handle the exce ption and it does not report about it fail

class predicates handleFileReadError : ( exception::traceID ErrorCode ) failure. clauses handleFileReadError(ErrorCode):- Descriptor = exception::tryGetDescriptor(ErrorCode, fileSystem_api::cannotcreate), !, % file cannot be loaded exception::descriptor(_ErrorCode, % _ErrorCode is ErrorCode , %just not necessary to insert extra check here _ClassInfo, % class information of the class, which raised the exception . _Exception, % actually it is fileSystem_api::cannotcreate, % but the parameter should not be compared by ' = ' . % See exceptionState::equals _Kind, % exception can be raised or continued ExtraInfo, _CursorPosition, % currently we know the position, % but sending dumps to developers requires positions _GMTTime, % the time of exception creation . ExceptionDescription) = Descriptor, FileName = core::mapLookUp(ExtraInfo, fileSystem_api::fileName_parameter, string("")), Reason = core::mapLookUp(ExtraInfo, common_exception::errorDescription_parameter, string("")), stdIO::write("Cannot load file due to: ",ExceptionDescription, "\nFileName: ", FileName, "\nReason: ", Reason ), exception::clear(ErrorCode), % it is necessary to clean exceptions when they are handled fail. handleFileReadError(ErrorCode):- isDebugMode = true, !, exceptionDump::dumpToStdOutput(ErrorCode), % dump to console for developer needs exception::clearAll(), % clear all exceptions, as they are shown in the dump already . fail. handleFileReadError(ErrorCode):- exception::clear(ErrorCode), % program cannot handle the exception and it does not report about it . fail

点击下载完整版文档(DOC)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
已到末页,全文结束
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有