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.

createstheclient,createsthelter,<strong>and</strong>connectsthetwotogether.The clientmaybeanyprogramwithourst<strong>and</strong>ard3-pluginterface,suchas HelloWorld,Echo,orevenCompounditself.We'llassumethattheinput clientprogram,<strong>and</strong>itsarguments,separatedbythedelimiter`/'. stringParms.ParmStringreceivedbyCompoundcontainsthenameofthe receiveParmsfromInit; 1.Introductionto<strong>Hermes</strong>15<br />

ofCMark); blockbegin ClientName:="filter"; Arguments:=everyofCinParms.ParmStringwhere(position ClientName:=everyofCinParms.ParmStringwhere(position Filter:=createofParms.GetProgram(ClientName);<br />

on(NotFound) Client:=createofParms.GetProgram(ClientName); callFilter(Parms.PutLine,"TheFilter",CliToFil); callClient(Parms.GetLine,CliToFil,Parms.GetProgram,Arguments); Mark:=positionofCinParms.ParmStringwhere(C='/');<br />

on(InterfaceMismatch) on(GetProgramInterface.NotFound)<br />

callParms.PutLine("compound:SyntaxError."); callParms.PutLine("compound:"|ClientName|"notfound.");<br />

assourcetext.Therearethreewaystoobtainvaluesoftypeprogram: statementsofaprocessmodulestoredasstructuredvaluesratherthan ofthepredened<strong>Hermes</strong>datatypeprogram|asetofdeclarations<strong>and</strong> TheresultreturnedbyGetProgramisaprogram.Aprogramisavalue characterstringnameofaprogramtobefetchedfromtheprogramlibrary. returnParms; TheprogrambeginsbycallingtheserviceGetProgram,passingitthe endblock; "interfacemismatch.");<br />

value\on-the-y".Inthiscase,weareusingtherstapproach.Wehave (2)bywritinga\programliteral",<strong>and</strong>(3)bydirectlybuildingaprogram (1)bypassingthesourcetextofa<strong>Hermes</strong>processthroughthecompiler, savingtheresultinaprogramlibrary,<strong>and</strong>retrievingitwithGetProgram, assumedthattheprogramnamed"filter"hasbeenpreviouslycompiled <strong>and</strong>thatthecompiledprogramhasbeenplacedinalibrarymanagedby theGetProgramservice. notsupporton-the-yprogramcreation.Someweaklytyped2languages <strong>and</strong>run-timecheckingfortypeviolations. (Note:Stronglytypedlanguages,likeAlgol,Ada,Pascal,C,etc.,do 2Thetermsstrongly-typed<strong>and</strong>weakly-typeddenoterespectivelycompile-time

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

Saved successfully!

Ooh no, something went wrong!