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.

A.1LexicalRules Webeginwiththerulesthatdenethelexicaltokensofthelanguage, distinguishthemfromnormalidentiers.Additionallogicisrequiredto includingidentier<strong>and</strong>varioustypesofliteral.Notethatkeywords<strong>and</strong> reservedwordsarelexicallyequivalenttoidentiers.Atableisusedto AppendixA.<strong>Hermes</strong>ConcreteSyntax135<br />

arelistedinTableA.1. determinewhenakeywordisactuallyusedasakeyword<strong>and</strong>whenitis acter.Tokensmayneverspanlines,includingnamedliterals<strong>and</strong>string appearbetweentokens. tiontokens.PunctuationsequencesarelistedinTableA.2. usedasanormalidentier,sincemostkeywordsarenotreserved.Keywords literals.Arbitraryamountsofwhitespace(spaces,tabs,linebreaks)may named{literal<strong>and</strong>string{literal,wheretheytreatedlikeanyotherchar-<br />

Certaincharacters<strong>and</strong>two-charactercombinationsconstitutepunctua-<br />

Spaces<strong>and</strong>tabsarenotallowedwithintokens,exceptinthecaseof Therearetwocommentingstyles: Commenttextmaybeembeddedwithinalinebydelimitingitwith Twoconsecutivehyphens(--)beginacommentthatextendstothe endoftheline.<br />

integer{literal extendstotheendoftheline.Acommentistreatedasaspace. identier::=alpha[alphanum]... Acommentbeginswithtwoconsecutivehyphencharacters(--)<strong>and</strong> thecharacterpairs\/*"atthebeginning<strong>and</strong>\*/"attheend.<br />

integer{part::=integer{literal real{literal::=[sign]initeger{part.[fraction{part][exponent] fraction{part::=integer{literal ::=[sign]digit[digit]...<br />

exponent::=exponent{letter[sign]integer{literal named{literal otherthanthespacecharacterareimplicitlyexcludedinallcases. string{literal::="[string{literal{character]..." Characterclassesusedintheaboveareasfollows.Nonprintingcharacters ::='named{literal{character[named{literal{character]...'

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

Saved successfully!

Ooh no, something went wrong!