..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................Notation: item | item=choose one; ?item=zero or one item; terminals: SMALL CAPS, underlined or punctuation other than bold ()?| (parens are terminals only in rules 19, 25, 51.1, 54, | only in 55). item s ...=zero or more items, separated by s; item s !..=one or more items, separated by s; with s=";", a trailing ";" is optional; s is one of: empty "," ";" .Abbreviated non-terminals: b=binding13; d=declaration11; e=expression19; n=name56; s=statement14; t=type36.16 Feb 83Comments: =obsolete; =efficiency hack; =unsafe; =machine dependent; n56 means n is defined in rule 56; n2=n (the subscript is only for the desugaring). CLRMFullGram.press Cedar Full Language Syntax3.3 1 module ::= DIRECTORY (nd ?( : TYPE ?nt ) ?(USING [ nu, ... ] ) ), ... ; ( interface | implementation ) 2 interface ::= nm, !.. : ?CEDAR DEFINITIONS ?locks?(IMPORTS ( (niv : | ) nit ), ...)?(SHARES ns, ...) ~ ?access12 { ?open7 (d | b); !.. } . 3 implementation ::= nm : ?CEDAR ?safety( PROGRAM ?drType42 | MONITOR ?drType42 ?locks )?(IMPORTS ( (niv : | ) nit ), ...) ?(EXPORTS ne, ...)?(SHARES ns, ...) ~ ?access12 block .4 safety ::= SAFE | UNSAFE --In 3, 41.5 locks ::= LOCKS e ?(USING nu: t)3.4 6 block ::= ?(CHECKED | UNCHECKED | TRUSTED) { ?open ?enable ?body ?( EXITS (n, !..=>s); ... ) } --In 3,13,14. 7 open ::= OPEN ( n ~~ e | e ), !.. ;In 2, 5, 17. The ~~ may be written as :. 8 enable ::= ENABLE (enChoice | {enChoice; ...}); --In 5, 17. 9 enChoice ::=( e, !.. | ANY ) => s --In 7, 27.1. 10 body ::= (d | b); !.. ; s; ... | s; !.. --In 5, 17. 3.511 declaration ::= n, !.. : ?access varTC40In 2, 10, 43. VAR, READONLY only for interface var.12 access ::= PUBLIC | PRIVATE --In 2, 3, 11, 13, 50, 51, 53.13 binding ::= n, !.. : ?access t ~ ( e | t2 -- if t=TYPE-- | CODE | ?TRUSTED MACHINE CODE { (e, ...); ... } | ?INLINE ?(ENTRY | INTERNAL) block6 )In 2, 10. The ~ may be written as =. ENTRY or INTERNAL may be writtenbefore t. Block or MACHINE CODE only for proc types.3.614 statement ::= e1_e2 | e | block6 | escape | loop | NULL--In 6, 10, 17, 19. 16 escape ::= GOTO n | GO TO n | EXIT | CONTINUE | LOOP |RETRY | REJECT | (RETURN | RESUME) ?e | e _ STATE17 loop ::= ?iterator ?(WHILE e | UNTIL e) DO ?open7 ?enable8 ?body10 ?(REPEAT (n, !.. => s); ...) ENDLOOP18 iterator ::= THROUGH e | FOR (n : t | n) ( ?DECREASING IN e | _ e1 , e2)e is a subrange. In FOR n: t ..., n is readonly.3.719 expression ::= n | literal57 | (e) | application26 | (e | typeName37) . (9) n | prefixOp e | e1 infixOp e2 | e1 AND (2) e2 | e1 OR (1) e2 | e ^ (9) | STOP | ERROR | [ argBinding27 ] | builtIn [ e, ... ?applEn27.1] | funnyAppl e ?( [?argBinding27 ?applEn27.1] ) |s | subrange25 | if28 | select29 | safeSelect32 | withSelect34 Precedence is in bold in rules 19-21. All operators associate to the left except_, which associates to the right. Application has highest precedence. Subrangeonly after IN or THROUGH. s only in if28 and select choices30 33 35.20 prefixOp ::= @ (8) | (7) | (~ | NOT) (3)21 infixOp ::= * | / | MOD (6) | + | (5) | relOp (4) |_ (0)22 relOp ::= ?NOT (?~ (= | < | >) | <= | >= | # | IN) --In 21, 30.23 builtIn ::= -- These are enumerated in Table 45.24 funnyAppl ::= FORK | JOIN | WAIT | NOTIFY | BROADCAST |SIGNAL | ERROR | RETURN WITH ERROR | NEW | START |RESTART | TRANSFER WITH | RETURN WITH25 subrange ::= ?typeName37 ( [ e1 .. e2 ] | [ e1 .. e2 ) | ( e1 .. e2 ] | ( e1 .. e2 ) ) --In 19, 39, 48.26 application ::= e [ ?argBinding ?applEn ]27 argBinding ::= (n ~ (e | | TRASH )), !.. | (e | | TRASH), !..In 19, 26. The ~ may be written as :. NULL may be written for TRASH.27.1applEn ::= ! enChoice9; ... -- In 19, 26.3.828 if ::= IF e1 THEN e2 ?(ELSE e3)29 select ::= SELECT e FROM choice; ... endChoice The ";" is "," in an expression, here and in 32 and 34.30 choice ::= (?relOp22 e1 ), !..=> e231 endChoice ::= ENDCASE ?(=> e3) --In 29, 32, 34.32 safeSelect ::=WITH e SELECT FROM safeChoice; ... endChoice3133 safeChoice ::= n : t => e234 withSelect ::= WITH (n1 ~~ e1 | e1 ) SELECT ?e11 FROM withChoice; ... endChoice31 --The ~~ may be written as :.35 withChoice ::= n2 => e2 | n2, n2, !.. => e2 436 type ::= typeName | builtInType | typeCons37 typeName ::= n1 | typeName . n2 | typeName[e] | n2 typeName --In 19, 25, 36, 40.1, 49.4.238 builtInType ::= INT | REAL | TYPE | ATOM | CONDITION | MONITORLOCK | LONG CARDINAL | ?LONG UNSPECIFIED | MDSZone | ?UNCOUNTED ZONESee Table 42. TYPE only in a b or an interface's d. 39 typeCons ::= subrange25 | paintedTC40.1 | transferTC41 |arrayTC44 | seqTC45 | descriptorTC45.1 | refTC46 | listTC47 |pointerTC48 | relativeTC49 | recordTC50 | unionTC52 |enumTC54 | defaultTC554.340 varTC ::= ( | READONLY | VAR) t | ANY In 11, 4548. ANY only in refTC. VAR only in interface decl.40.1paintedTC ::= typeName37 PAINTED t4.441 transferTC ::=?safety4 xfer ?drType 41.1xfer ::= PROCEDURE | PROC | PORT | PROGRAM | PROCESS | SIGNAL | ERROR42 drType ::= ?fields1 RETURNS fields2 | fields1 --In 3, 41.43 fields ::= [d11, ... ] | [t, ... ] | ANY --In 42, 50, 52. ANY only in 42.44 arrayTC ::= ?PACKED ARRAY ?t1 OF t245 seqTC ::= ?PACKED SEQUENCE tag53 OF tLegal only as last type in the fields of a recordTC or unionTC.45.1descriptorTC ::= ?LONG DESCRIPTOR FOR varTC40varTC must be an array type.4.546 refTC ::= REF ?varTC40 47 listTC ::= LIST OF varTC4048 pointerTC ::= ?LONG ?ORDERED ?BASE POINTER ?subrange25 ?(TO varTC40) | POINTER TO FRAME [ n ]Subrange only in a relativeTC; no typeName37 on it.49relativeTC ::= typeName37 RELATIVE t4.650 recordTC ::= ?access12 ( ?MONITORED RECORD fields43 | MACHINE DEPENDENT RECORD (mdFields | fields43) )51 mdFields ::= [( (n pos), ... : ?access12 t ), ...] -- In 50, 52.51.1pos ::= ( e1 ?(: e2 .. e3) ) -- In 51, 53.52 unionTC ::= SELECT tag FROM( n, ... => ( fields43 | mdFields51 | NULL) ), ... ?, ENDCASE Legal only as last type in the fields of a recordTC or unionTC.53 tag ::= (n ?pos51.1 : ?access12 | (COMPUTED|OVERLAID) ) (t | *) --In 44, 52. * only in unionTC.4.754 enumTC ::= {n, ...} | MACHINE DEPENDENT {(?n (e) | n), ...}4.1155 defaultTC ::= t _ | t _ e | t _ e | TRASH | t _ TRASHdefaultTC legal only as the type in a decl in a body9 or field43 (n: t _ e), in aTYPE binding13, or in NEW. Note the terminal |. TRASH may be written NULL.3.256 name ::= letter (letter | digit)...57 literal ::= num ?( ( D|d | B|b ) ?num ) -- INT literal. |digit (digit |A|B|C|D|E|F) ... ( H|h ) ?num -- Hex INT literal. |?num . num ?exponent | num exponent -- REAL literal. |' extendedChar | digit !.. C | " extendedChar ... " ?L | $ n58 exponent ::= (E|e) ?(+ | ) num59 num ::= digit !..60 extendedChar ::= space | \ extension | anyCharNot'"Or\ 61 extension ::= digit1 digit2 digit3 | n|N | r|R | t|T | b|B | f|F | l|L | ' | " | \lp\Rqr>srsr"t5r> $(RsrE8srsr"srsrsr!srsr#srqrqsrdprsr dprsr dprsrdprsr dprsrdprO2qrA'pr!pr.Ihujfvr>wXxyxwxfVqfxwxyxwxfVqfxwWdx/wyxdqdxwxwxwxwxWcLwx wxwar>wXxaqataxwxwyxy xwxW` wyxwxwx_q>` xXwxwx_q` xwxwW^xxwyx^2q^xxwxwx^r^xxwx^r^xxwxwxwxwx\r>w Xx\q\xwyxwxW[(wxyxwx[nr[(xwxyxwx[nr[(xwxwWYyxwxwxY^qYxwxwxY^qY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-zzG+ rzx rzxzxz-ztzrztzyztztz,%)Dv,r>wzwXxwxwxw,r>wXxwx9:'wx:;FwxTwxwxwxzGtzxXw-z @ 4wxwxwxLpMW4wx, r>wXxwx6 x6 wx7U x7 wxwxwxwx, ,r>wXxw, r>w Xxwx wzGxX, $r>wXxr $xr $xr $xw-z|x5D6|wx6D#7|wx9D9|wx9D :|wx;Do<`|wx<D=|wx>D?n|wx?D@|wxADyB.|wxBDCm|wxDuDcD|wxE0DF|wxwxwxJTVk( 0 TimesRoman TimesRoman TimesRoman TimesRoman TimesRoman TimesRoman  TimesRoman  TimesRoman  TimesRoman   TimesRoman  TimesRoman  TimesRoman  TimesRoman j/!0CLRMFullGram.bxLampsonFebruary 16, 1983 10:36 AM