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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

402.5.Front-endProcess paringavalueagainstasetofvalues.Itisequivalentto: Temp:=Line[ColonPosition+1]; Theselectstatementintheexampleistheusualabbreviationforcom-<br />

returnParms; where(Temp='F')... endblock; callParms.PutLine("!wfe:othersexception");<br />

<strong>Hermes</strong>'abilitytoplug<strong>and</strong>unplugmodulesindierentcongurations.(2) e.g.onebaseduponpointing,ordialog,ormenu-selection.Thisexploits vantages:(1)Itiseasytousethecomm<strong>and</strong>swithanalternativefront-end, thecodewhichobeysthecomm<strong>and</strong>s.Thisstyleofwritinghasseveralad-<br />

endselect; Noticethatwehaveseparatedthecodewhichparsesthecomm<strong>and</strong>from otherwise... where(Temp='C')... where(Temp='K')...<br />

frontendfromasimpledescriptionofthecomm<strong>and</strong>syntax. Therearetoolswhichautomaticallygenerateprogramssuchastheabove<br />

havetoissueacreateoperationbeforeeachprocedurecall. afteritreturns. procedureoftomakeiteasytoinvokeprocedures.Withoutit,youwould aprocesswhichiscreatedjustforasinglecall,<strong>and</strong>whichterminatesright token(stringofcontiguousnon-blankcharacters)fromastring.Procedures tverynicelyintotheprocessparadigmof<strong>Hermes</strong>.Aprocedureissimply Hereishowprocedureofworks:Youcodeprocedureofwithaprogramoper<strong>and</strong>,justlikecreateof.Theresultisanoutputportconnectetionportofthenewprocess.<br />

toaninitializationport.However,eachtimeyoumakeacallonthatoutput port,anewprocessisinstantiated,<strong>and</strong>yourcallisgiventotheinitializa-<br />

Sinceproceduresaresocommon,<strong>Hermes</strong>providesaspecialoperation, Thefront-endprocessusesaprocedurenamedTokenizertoextracta<br />

automatically. of,thesecondcallwillnotblockbecauseanewinstancewillbecreated mentedwithcreateof,thesecondcallwillblock;ifyouusedprocedure thereexistsonlyoneactivationatatime,thenitdoesn'tmatterwhether youcreatearegularprocesswithcreateora\process-generator"with beingprocessed,thenitdoesmakeadierence:ifyourprocedurewasimple-<br />

procedure.Butifyouevermakeasecondcallwhiletherstcallisstill Processescreatedautomaticallywithprocedureofarestilllike<strong>Hermes</strong> Ifyouarenotusingaprocedurere-entrantlyorrecursively|thatis,<br />

statement,unlessthereturnisthelaststatement.IfyouwanttheequivalentofAlgolprocedures,besuretouseprocedureof<strong>and</strong>begineach<br />

processesineveryotherway.Inparticular,theystillpersistafterareturn

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

Saved successfully!

Ooh no, something went wrong!