..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................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, 54). 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: n56 means n is defined in rule 56; n2=n (the subscript is only for the desugaring). CLRMSafeGram.press Cedar Safe Language Syntax3.3 1 module ::=DIRECTORY (nd ?(: TYPE nt) ?(USING [nu, ...]) ), ... ; ( interface | implementation ) 2 interface ::= nm, !.. : CEDAR DEFINITIONS ?locks?(IMPORTS ( (niv : | ) nit ), ...) ~ { ?open7 (d | b); !.. } . 3 implementation ::= nm : CEDAR ( PROGRAM ?drType42 | MONITOR ?drType42 ?locks )?(IMPORTS ( (niv : | ) nit ), ...) ?(EXPORTS ne, ...) ~ block .5locks ::= 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. 8 enable ::= ENABLE { enChoice; ... }; 9 enChoice ::=( e, !.. | ANY ) => s --In 7, 27.1. 10 body ::= (d | b); !.. ; s; ... | s; !.. --In 5, 17. 3.511 declaration ::= n, !.. : ?(PUBLIC | PRIVATE) varTC40 --In 2, 10, 43. 13 binding ::= n, !.. : ?(PUBLIC | PRIVATE) t ~ ( --In 2, 10.e | t2 -- t=TYPE-- | CODE | ?INLINE ?(ENTRY|INTERNAL) block6 )3.614 statement ::= e1_e2 | e | block6 | escape | loop | NULL16 escape ::=GOTO n | EXIT | CONTINUE | (RETURN|RESUME) ?e17 loop ::= ?iterator ?(WHILE e | UNTIL e) DO ?body10 ?(REPEAT FINISHED=>s) ENDLOOP18 iterator ::= THROUGH e | FOR n : t ( ?DECREASING IN e | _ e1 , e2)e is a subrange. 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) | ERROR | [ argBinding27 ] | builtIn [ e, ... ?applEn27.1] | funnyAppl e ?( [?argBinding27 ?applEn27.1] ) |s | subrange25 | if28 | select29 | safeSelect32 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.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 ERROR25 subrange ::= ?typeName37 ( [ | ( ) e1 .. e2 ( ] | ) ) --In 19, 39.26 application ::= e [ ?argBinding ?applEn ]27 argBinding ::= (n ~ ?e ), !.. | (?e), !.. --In 19, 26. 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.30 choice ::= (?relOp22 e1 ), !..=> e231 endChoice ::= ENDCASE ?(=> e3) --In 29, 32, 34.32 safeSelect ::=WITH e SELECT FROM safeChoice; ... endChoice3133 safeChoice ::= n : t => e23.256 name ::= letter (letter | digit)...57 literal ::= num ?( D | B ) | digit (digit |A|B|C|D|E|F) ... H | ?num . num ?exponent | num exponent | ' extendedChar | " extendedChar ... " | $ n58 exponent ::= E ?(+ | ) num59 num ::= digit !..60 extendedChar ::= space | \ extension | anyCharNot'"Or\ 61 extension ::= digit1 digit2 digit3 | N | R | T | B | F | L | ' | " | \436 type ::= typeName | builtInType | typeCons37 typeName ::= n | typeName . n | typeName[e] --In 19,25,36,40.14.238 builtInType ::= INT | REAL | TYPE | ATOM | CONDITION | MONITORLOCKSee Table 42. TYPE only in a b or an interface's d. 39 typeCons ::= subrange25 | paintedTC40.1 | transferTC41 | arrayTC44 | seqTC45 | refTC46 | listTC47 | recordTC50 | unionTC52 | enumTC54 | defaultTC554.340 varTC ::= ( | READONLY | VAR) t | ANYIn 11, 46, 47. ANY only in refTC. VAR only in interface decl.40.1paintedTC ::= typeName37 PAINTED t4.441 transferTC ::=?(SAFE | UNSAFE) xfer ?drType 41.1xfer ::=PROC | PORT | PROCESS | SIGNAL | ERROR | PROGRAM42 drType ::= ?fields1 RETURNS fields2 | fields1 --In 3, 41.43 fields ::= [ d11, ... ] | [t, ... ] | ANY --In 42, 50, 52. ANY only in drType.44 arrayTC ::= ARRAY t1 OF t245 seqTC ::= SEQUENCE n : t1 OF t2 -- Only as last type in 50 or 52.4.546 refTC ::= REF ?varTC4047 listTC ::= LIST OF varTC404.650 recordTC ::= ?MONITORED RECORD fields4352 unionTC ::= SELECT n : (t | *) FROM (n => fields43), ... ?, ENDCASE -- Only as last type in fields of 50 or 52.4.754 enumTC ::= {n, ...} | MACHINE DEPENDENT {(?n (e) | n), ...}4.1155 defaultTC ::= t _ | t _ e Only as t in a decl in body9 or field43 (n: t _ e),in a TYPE binding13or in NEW.lp\Rqr>srsr"t5r> $(Rsr18srsr"srsrsr!srsr"srqrqsrdprsr dprsr dprsrdprsr dprsrdprO2qr'pr!pr.Iuhujfvr>wxXwyxwxfVqfxwxyxfVqfwxwyxfVqfxwxwxwxwxWdwx wxwcpr>wXxc*qcMtcpxwxyxy xwxWawyxwxwxaq>axXwxwxaqaxwxwxwxbraxwxwxwxwx` r>w Xx_q` xyxW^xwxyxwx^r^xxwxyxwx^r^xxwxwW\yxwxwx\q\xwxwx\q\xwxwxwyx\q\xwx [Lrwxwxyxwyx[q[LxwZ@%Xvr>wxXwxwyxwxyxwxywxWWMwxwxwxwxyxwxwxwxwxwxzG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x# $ Jwxwxwx>%*+dv,fr>wzxXwx wx wx,er>wXxwx wx zG)GcNw,r>w Xxyxwxyxwxyxwxyxwx-zayxwxy -z`zG tz",_r>wXx_Nr_xwx _Nr_xwx _Nr_xwx-z]]r]xwx]r]xwx]r]xwx]r]xwx-z\\Fr\xwx\Fr\xwx\Fr\xwx \Fr)GZYw,r>wXxwxwxyxwxywxwxy-zYzG tyztz,WrwXxWrWxyx)GUw,r>w Xyxwxywxwx,TlrwyxwxyxwxyxwyGxXwxyxwxy,Rr>wXxwxRrRxyxRrRxwxRrRzG ,Q@r>wXxQrQ@xwxwxwxwxyzGxXzG tz,Or>wXxyxOvrOxyxOvr,N>wXxyxMrNxyxMrNzG#)GLIw,r>wXxyxwxLr,J>wXxyGxK r)GIw,r>wXxwyxyxIdr,G>wXxyxwxwxwxyxwx GrGwxwxwx-zFywxzG))GDow,r>wxXwxwxwxyxyxwxJD7yKDoKD7yL0Dowxwxwx(Bw,r>wXxwx-zAzGArAz ArAztzArAztzTVk( Y TimesRoman TimesRoman TimesRoman TimesRoman TimesRoman TimesRoman  TimesRoman  TimesRoman  TimesRoman   TimesRoman  TimesRoman  TimesRoman  TimesRoman j/0CLRMSafeGram.bxLampsonFebruary 16, 1983 10:38 AM