rsl.syntax.bnf (811085), страница 2
Текст из файла (страница 2)
the microsyntax for RSL.Basically, RSL follows the rules now in current practice for most programming languages:text (i.e. an RSLspecification) is represented as a string of characters, which is interpreted left-to-right and broken into a string of tokens.The characters are drawn from a superset of the ASCIIcharacters called the full RSL character set. Tokens may beseparated by 'whitespace', which isstrings of one or more of the following characters: line-feed, carriage-return, space andtab. (Note that comments are part of the RSL syntax and thus cannot be used freely as whitespace. Also note that commentsmay not be nested.)There are two types of tokens in RSL: varying and fixed.Varying TokensThe microsyntax for varying tokens is defined by the syntax rules below, where the charactersused in forming tokens areshown in quotes, as in '$'.
Furthermore, LF, CR and TAB are used to denote the ASCII characters line-feed, carriage-returnand tab.id ::=letter opt-letter_or_digit_or_underline_or_prime-stringletter_or_digit_or_underline_or_prime ::=letter | digit | underline | primeletter ::=ascii_letter | greek_lettercomment ::=‘/’ ‘*’ comment_item-string ‘*’ ’/’comment_item ::=comment_charcomment_char ::=LF | CR | TAB | ascii_letter | digit | graphic | prime | quote | backslashint_literal ::=digit-stringreal_literal ::=digit-string ’.’ digit-stringtext_literal ::=‘’opt-text_character-string ‘’char_literal ::=‘’char_character ‘’text_character ::=character | primechar_character ::=character | quotecharacter ::=ascii_letter | digit | graphic | escapedigit ::=‘0’ |’1’ |’ 2’ |’ 3’ |’ 4’ |’ 5’ |’ 6’ |’ 7’ |’ 8’ |’ 9’ascii_letter ::=‘a’ | ’b’ | ’c’ | ’d’ | ’e’ | ’f’ | ’g‘ | ’h’ | ’i’ | ’j’ | ’k’ | ’l’ | ’m’ |’n’ | ’o’ | ’p’ | ’q’ | ’r’ | ’s’ | ’t’ | ’u’ | ’v’ | ’w’ | ’x’ | ’y’ |’z’ |‘A’ | ’B’ | ’C’ | ’D’ | ’E’ | ’F’ | ’G’ | ’H’ | ’I’ | ’J’ | ’K’ | ’L’ | ’M’ |’N’ | ’O’ | ’P’ | ’Q’ | ’R’ | ’S’ | ’T’ | ’U’ | ’V’ |’W’ | ’X’ | ’Y’ | ’Z’greek_letter ::=‘`alpha’|’`beta’|’`gamma’|’`delta’|’`epsilon’|’`zeta’|’`eta’|’`theta’|’`iota’|‘`kappa’|’`mu’|’`nu’|’`xi’|’`pi’|’`rho’|’`sigma’|’`tau’|’`upsilon’|’`phi’|’`chi’|’`psi’|’`omega’|’`Gamma’|’`Delta’|’`Theta’|’`Lambda’|’`Xi’|’`Pi’|’`Sigma’|’`Upsilon’|’`Phi’|’`Psi’|’`Omega’underline ::=‘_’prime ::=‘’quote ::=‘’backslash ::=‘\’graphic ::=‘ ’ | ‘!’ | ‘#’ | ‘$’ | ‘%’ | ‘&’ | ‘(’ | ‘)’ | ‘*’ | ‘+’ | ‘,’ | ‘-’ | ‘.’ | ‘/’ | ‘:’ | ‘;’ |‘<’ | ‘=’ | ‘>’ | ‘?’ | ‘@’ | ‘[’ | ‘]’ | ‘^’ | ‘_’ | ‘`’ |‘{’ | ‘|’ | ‘}’ | ‘~’escape ::=‘\’’r’|‘\’’n’|‘\’’t’|‘\’’a’|‘\’’b’|‘\’’f’|‘\’’v’|‘\’’?’|‘\’’\’|‘\’’ ’|‘\’’ ’| ‘\’ oct_constant | ‘\’ ‘x’ hex_constantoct_constant ::= oct_digit | oct_digit oct_digit | oct_digit oct_digit oct_digithex_constant ::=hex_digit-stringoct_digit ::=‘0’ |’1’ |’ 2’ |’ 3’ |’ 4’ |’ 5’ |’ 6’ |’ 7’hex_digit ::=digit | ‘a’ | ’b’ | ’c’ | ’d’ | ’e’ | ’f’ | ‘A’ | ’B’ | ’C’ | ’D’ | ’E’ | ’F’ASCII forms of Greek LettersGreek letters, which may be used in identifiers, have ASCII forms are follows :ASCII`alpha`beta`gamma`delta`epsilon`zeta`eta`theta`iota`kappaFullαβγδεζηθικ`mu`nu`xi`pi`rho`sigma`tau`upsilon`phi`chi`psi`omegaASCIIµνξπρστυφχϕωFull`Gamma`DeltaΓ∆`ThetaΘ`LambdaΛ`Xi`PiΞΠ`SigmaΣ`Upsilon`PhiΥΦ`Psi`Omega’ΨΩFixed TokensThe representation of individual fixed token is given directly in the syntax rules for RSL.
However, a representation usingonly ASCII characters is possible, as denied in the following table:ASCII><|||=|**Full×/\>=<=inter-m->-~->->#:-∧≥≤∩↑→°•ASCIIisin++|^|inflist\/existsunion<<<<=>>>>=<.Full∈⎡⎢∨∃∪⊂⊆⊃⊇〈ASCII~isin-\-list~=Full∉λ∗≠+>all!!always=>is<->.>⎟→∀†⇒≡↔〉The word equivalents of certain symbols: all, exists, union, inter, isin, always are reserved, and cannot beused as identifiers.RSL KeywordsThe RSL keywords are listed below.
They cannot be used as identifiers.BoolKeywords for RSLclassindsskipCharIntNatRealTextUnitabsanyasaxiomcardcasechannelchaosdodomelemselseelsifendextendfalseforforallhdhideifininitialiseintlenletlocalobjectofoutpostprereadrealrngschemestopswapthentltruetypeuntilusevaluevariablewhilewithwrite.