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.

Ifnoneoftheclausescanexitsnormally,theblockstatementcannotexit thetypestatesonnormalexitfromalltheclauseswhichcanexitnormally. normally.Theonlywayaclausecannotexitnormallyisifitendswith therewillalwaysexistatargetforexceptionsraisedwithinh<strong>and</strong>lersofthe processstatement. Thetypestateonnormalterminationofablockstatementisthemeetof 11.<strong>Hermes</strong>Operations97<br />

cannotexitnormally. Ifcompound{statement anexitstatementorifitendswithacompoundstatementwhichitself<br />

thethenclauseisthenexecuted;ifthevalueis'false',theelseclause Theifstatementcontainsanexpression|thetest|<strong>and</strong>twoclauses|the pressionisevaluatedtoaninitializedbooleanvalue.Ifthevalueis'true', then<strong>and</strong>elseclauses. ::=iftest{expression<br />

isexecuted.Anomittedelseclauseistreatedasanemptyelseclause. Itbehavesliketheifstatementofconventionallanguages:Thetestex-<br />

endif [else[statement;]...] then[statement;]...<br />

While statementcannotexitnormally. clausewhichcanexitnormally;ifnoclausecanexitnormally,thentheif onnormalexitoftheifstatementisthemeetofthetypestatesforeach sameasthetypestateafterexecutionofthetestexpression.Thetypestate musthavetypestateinit.Thetypestateonentrytoeitherclauseisthe isinferredtohavetypepredefined!boolean.Thetestexpressionresult Thetype<strong>and</strong>typestaterulesareasfollows:Thetestexpressionresult<br />

Thewhilestatementcontainsanexpression|thetest|<strong>and</strong>aclause|the repeatclause. compound{statement<br />

statementisre-executed.Ifitis'false',thewhilestatementterminates. expressionisrepeatedlyevaluatedtoaninitializedbooleanvalue.Ifthe valueis'true',thentherepeatclauseisexecuted,<strong>and</strong>thenthewhile Itbehaveslikethewhilestatementofconventionallanguages:Thetest ::=whiletest{expressionrepeat<br />

Thetype<strong>and</strong>typestaterulesareasfollows:Thetestexpressionresultis endwhile [statement;]...<br />

checkedtohavetypestateinit.Thetypestateonentrytothetestexpres- inferredtohavetypepredefined!boolean.Thetestexpressionresultis

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

Saved successfully!

Ooh no, something went wrong!