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.

12811.9.PolymorphOperations Thevalueincludesthetypestate,thedenitionsmoduledeningthetypestate,<strong>and</strong>alltheimporteddenitionsmodules.<br />

Thetypestateofoperationevaluatestothetypestateinformationstored inthepolymorphwrapper.Thisisaninitializedvalueoftypepredefined!typestateofvalue.<br />

intocheckedprogramvalues.Alternatively,youcancreateprogramvalues, linearsourceform<strong>and</strong>passthemtothe<strong>Hermes</strong>compilerforconversion 11.10ProgramOperations In<strong>Hermes</strong>,youcancreateprogramsintwoways:Youcanwritethemin Theoper<strong>and</strong>mustbeaninitializedpolymorph.<br />

either\fromscratch",orbycomposingormodifyingotherprogramvalues.<br />

pilingitintomachinecodeforthemachineormachinesonwhichthepro-<br />

statement ingacheckedprogramwillbemissingthepredefined!checkedattribute. Tocheckafullyinitializedinstanceofprogramvariablepgm,executethe tributepredefined!checked.Aprogrambuiltfromscratchorbymodify-<br />

assertchecked(pgm); Inmostimplementationsof<strong>Hermes</strong>,checkingaprogramalsoentailscom-<br />

Aprogramvalueobtainedfromthecompilerwillhavethetypestateat-<br />

instantiateaprogramwhichisnotchecked. predefined!program. ProgramLiteral gramwillbeinstantiated.Thisisanoptional<strong>and</strong>machine-dependentop-<br />

timization;theprogrammercannotdirectlymanipulatethemachinecode. Thechecking,however,isnotoptional.Itisatypestateerrortotryto Theoperationsinthissectionareusedtoconstructobjectsoftype Thepredefined!programdenitionisshownintheappendix. program{literal ::=process(declaration) begin [declaration{section] [pragma]<br />

Thecompilerwillchecktheprogramliteralatthesametimethatitchecks Aprogramliteraloperationiscodedasaself-deningvalue.Thevalueof theliteralisthevalueoftheprogramaftertranslationbythecompiler. ::=processlink{name endprocess [h<strong>and</strong>ler]... [statement;]...

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

Saved successfully!

Ooh no, something went wrong!