28.01.2015 Views

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

9611.2.TheDepletionException 11.3ControlFlowOperations Block compound{statement<br />

constant{section ::=block endblock [h<strong>and</strong>ler]... begin [declaration{section] [constant{section]<br />

declaration{section ::=constant([base{variable[,base{variable]...]) ::=declare[declaration;]... [statement;]...<br />

declarenewvariables,youcanspecifythatthevaluesofexistingvariables Ablockstatementintroducesanewscope.Withinthisscope,youcan h<strong>and</strong>ler::=on([exception{name[,exception{name]...]) ::=onexit([exit{name[,exit{name]...])<br />

bythenamesoftheexitsorexceptionsith<strong>and</strong>les.Theabbreviationothers Theotherclausesaretheh<strong>and</strong>lerclauses.Eachh<strong>and</strong>lerclauseispreceded mustremainconstant,<strong>and</strong>youcanprovideh<strong>and</strong>lersforexceptionsorexits withinthemainbodyoftheblock. Thestatementseriesafterthewordbeginisthemainclauseoftheblock. [statement;]...<br />

withinah<strong>and</strong>lerclausecannotcausecontroltotransfertoanotherh<strong>and</strong>ler clauseofthesameblock. totheh<strong>and</strong>leroftheinnermostblock.Rememberthatexceptionsraised Twoclausesofthesameblockcannoth<strong>and</strong>lethesameexitorexception. containingh<strong>and</strong>lersforthesameexceptionorexit,controlwilltransfer st<strong>and</strong>sforallexceptionswhicharenotexplicitlyh<strong>and</strong>led.Restriction:<br />

issuinganexitstatement,thentheclauseissaidtoexitnormally..Ifany Ifastatementiswithinthemainclausesoftwoormorenestedblocks controltotransfertotheclauseheadedbythatexceptionorexitname. Ifallstatementsofaclausecompletewithoutraisinganexceptionor Anexceptionorexitraisedwithinthemainclauseofablockcauses<br />

wordsblock<strong>and</strong>endblockdonotappear.Asecondblockwithanempty clauseofablockexitsnormally,thentheblockitselfexitsnormally. on(others)h<strong>and</strong>lerisimpliedaroundthisblock.Thisisnecessarysothat Thebodyofaprocessstatementisactuallyablock,althoughthe

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!