SyntaxMeaning..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................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 "," ";" IN ELSE OR.Abbreviated non-terminals: b=binding13; d=declaration11; e=expression19; n=name56; s=statement14; t=type36.4 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). CLRMSumm.pressExamplesNotes 1 module ::= DIRECTORY (nd (: TYPE (nt | ) | ) l [ (nd : ( (TYPE nt | TYPE nd) | TYPE nd), ... ] IN ?(USING [ nu, ... ] ) ), ... ; LET (nd~RESTRICT[nd, [$nu, ... ] ] ), ... ( interface | implementation )IN ( interface | implementation ) 2 interface ::= nm, !.. : ?CEDAR DEFINITIONS l [((niv | nit):MKINSTANCETYPE[nit]), ...]=>?locks ?(IMPORTS ( (niv : | ) nit ), ...) [nm: TYPE nm] IN?(SHARES ns, ...) -- Access to PRIVATE names in ns is allowed.~ ?access12 { ?open7 (d | b); !.. } .LET REC nm~open [ ?(lock(~locks, ) (d | b), ... ] IN nmDIRECTORY Rope: TYPE USING [ROPE, Compare], -- There should always be a USING clause CIFS: TYPE USING [OpenFile,Error,Open,read],-- unless most of the interface is usedIO: TYPE IOStream,Buffer: TYPE;-- or it is exported. 3 implementation ::= nm : ?CEDAR l [( ( niv | nit ):MKINSTANCETYPE[nit]), ...]=>?safety ( PROGRAM ?drType42 | [(ne: ne) , ... , nm: TYPE nm , CONTROL: PROGRAM] ] IN MONITOR ?drType42 ( | locks) )( | ( LET LOCK:MONITORLOCK IN LET l(~(l IN LOCK) IN | ))?(IMPORTS ( (niv : | ) nit ), ...) LET b(~NEWPROGINSTANCE[block].UNCONS IN?(EXPORTS ne, ...) [ (ne~BINDDFROM[ne, b(] ), ... , nm~b(, CONTROL~b(.nm ]?(SHARES ns, ...)where the body of the block is desugared thus:~ ?access12 block . [( | ( | l(~locks,)) (d | b), ... , nm: PROGRAM drType~{s;...}]4 safety ::= SAFE | UNSAFE --In 3, 41.5 locks ::= LOCKS e ?( USING nu: t)l ?( [nu : t] ) IN eBufferImpl: MONITOR [f: CIFS.OpenFile] -- Implementations can have arguments.LOCKS Buffer.GetLock[h]^ -- LOCKS only in MONITOR, to specifyUSING h: Buffer.Handle-- a non-standard lock.IMPORTS Files: CIFS, IO, Rope-- Note the absence of semicolons.EXPORTS Buffer-- EXPORTS in PROGRAM or MONITOR.~ { -- module body -- } . -- Note the final dot. 6 block ::= ?(CHECKED | UNCHECKED | TRUSTED) { ?open ?enable ?body open LET n((, ... : EXCEPTION~NEWLABEL[] , ... ?(EXITS (n, !..=>s); ...) } IN ( body enable ) BUT { (n((, ... => s ); ... } --In 3, 13, 15.-- But n(( is not visible in s. 7 open ::= OPEN ( n ~~ e | e ), !.. ;( LET n~lopen IN e.DEREF | --The IN before !.. is a separator.In 2, 5, 17. The ~~ may be written as :. LET BINDP[D(e.DEREF).P, OPENPROCS[D(e.DEREF).P, l IN e.DEREF] ] ) IN !.. IN 8 enable::=ENABLE(enChoice|BUT ( { enChoice } | {enChoice; ...});{ enChoice; ... } )In 5, 17. 9 enChoice ::=( e, !.. | ANY ) => s( e | ANY ), ... => { s; REJECT; EXITSIn 7, 27.1. Retry(=>GOTO Retry((14; Cont(=>GOTO Cont((14 } 10 body ::= (d | b); !.. ; s; ... | s; !..LET NEWFRAME[ REC [(d | b), ...] ].UNCONS IN { s; ...} In 5, 17. CHECKED { -- Unnamed OPEN OK for exportedOPEN Buffer, Rope; -- interface or one with a USING clause.ENABLE Buffer.Overflow=>GOTO HandleOvfl;-- A single choice needn't be in {}.stream: IO.Stream~IO.CreateFileStream["X"];-- Use a binding if a name's value is fixed.x: INT_7; -- Better to initialize declared names.{OPEN b~~GetBuffer[stream];-- A statement may be a nested block. ENABLE {-- Multiple enable choices must be in {}.Files.Error--[error, file]--=>{-- ERRORs can have parameters.stream.Put[IO.rope[error]]; ERROR Buffer.Error["Help"] };-- Choices are separated by semicolons.ANY=>{ x_12; GOTO AfterQuit } };-- ANY must be last. ENABLE ends with ;.y: INT_9; ... };-- Other bindings, decls and statements.x_stream.GetInt; ...-- Other statements in the outer block.EXITS-- Multiple EXIT choices are not in {}.AfterQuit=>{...};-- AfterQuit, HandleOvfl declared here, HandleOvfl=>{...} };-- legal only in a GOTO in the block.11 declaration ::= n, !.. : ?access12 varTC40( n: varTC ), ...In 2, 10, 43. VAR, READONLY only for interface var.12 access ::= PUBLIC | PRIVATEIn 2, 3, 11, 13, 50, 51, 53.13 binding ::= n, !.. : ?access12 t ~ (LET x( : t ~ ( -- The desugaring for n is at the end.e | e |t2 -- if t=TYPE | t2 -- Same as e except for conflicting syntax. |CODE | NEWEXCEPTIONCODE[] --tgSIGNAL or ERROR |?INLINE ?(ENTRY | INTERNAL) block6 | l [d(: t.DOMAIN] IN LET r(~NEWFRAME[t.RANGE].UNCONS IN (LET r( IN {t.DOMAIN~d(; block; RETURN} BUT {Return(((=>r(}) | ?TRUSTED MACHINE CODE {(e, ...); ...} MACHINECODE[(BYTESTOINSTRUCTION[e, ...]), ...])) IN n, ... ~ x( -- e is evaluated only once.In 2, 10. The ~ may be written as =. Block or MACHINE CODE only for proc types. ENTRY and INTERNAL can also be before t.HistValue: TYPE[ANY];-- Interface: An exported type.Histogram: TYPE~REF HistValue;-- A type binding.baseHist: READONLY Histogram;-- An exported variable .AddHists: PROC[x, y: Histogram] -- An exported proc.RETURNS [Histogram];LabelValue: PRIVATE TYPE~RECORD[-- PRIVATE only for secret first,last:INT,s:ROPE,x:REAL,f,g:INT,r:REF ANY];-- stuff in an interface.Label: TYPE~REF LabelValue;Next: PROC[l: Label] RETURNS[Label]~-- An inline proc binding.INLINE { RETURN [NARROW[l.r]] };H: TYPE~Histogram11; Size: INT~10;-- Implementation: Binds a TYPE and INT.HistValue: PUBLIC TYPE~HV40.1;-- PUBLIC for exports.baseHist: PUBLIC H_NEW[HistValue_ALL[17]];-- An exported variable x, y: HistValue_[ 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0];-- with initialization.FatalError: ERROR[reason: ROPE]~CODE;-- Binds an error.Setup: PROC [bh: Handle3, a: INT]~ENTRY {...};-- Binds an entry proc.i,j,k: INT_0; p,q: BOOL; lb: Label; main: Handle;14 statement ::= sS{ SIMPLELOOP {sS; GOTO Cont((; EXITS Retry((=>NULL};In 6, 10, 17, 19. EXITS Cont((=>NULL } 15 sS ::=e1_e2 | e | block6 | escape | loop | NULL[e1_e2].TOVOID | e --must yield VOID-- | --all yield VOID--16 escape ::= GOTO n | GO TO n | EXORVAL[exception[code~ n((, args~NIL]] |EXIT | CONTINUE | LOOP | RETRY |GOTO ( Exit(17 | Cont(9 | Loop(17| Retry(9) |(RETURN | RESUME) ?e | { ?(r(13_e;) GOTO (Return(13 | Resume(13) } |REJECT | e _ STATETHISEXCEPTION[] | DUMPSTATE[e]x_AddHists[baseHist, baseHist]^;-- A statement can be an assignment,Setup[bh~main, a~3];-- or an application without results,{ENABLE FatalError=>RETURN[0]; []_f[3]; ...};-- or a block,IF i>3 THEN RETURN[25] ELSE GOTO NotPresent;-- or an IF or an escape statement,17 loop ::= (iterator | ) { ( iterator ; | done(~FALSE; Next(: PROC~{}; )(WHILE e | UNTIL e | ) { Test(~l IN (NOT e | e | FALSE);DO ?open7 ?enable8 ?body10 { open SIMPLELOOP { IF Test([] OR done( THEN GOTO FINISHED; { enable body EXITS Loop(=>NULL }; Next([] }?(REPEAT (n, !..=>s); ...) ENDLOOP EXITS Exit(gNULL; (n, !..gs); ...; FINISHEDgNULL}}}FOR t:INT DECREASING IN [0..5) UNTIL f[t]>3 DO -- or a loop. Try to declare t in the FOR u: INT_0; ... ; u_t+4; ...-- as shown. Avoid OPEN or ENABLE REPEAT Out=>{...}; FINISHED=>{...} ENDLOOP;-- after DO (use a block). FINISHED -- must be last.18 iterator ::= THROUGH e | FOR x(: e IN e | FOR (n : t | n) ( n: t; | ) ( ( | DECREASING) IN e | ( Range(: TYPE~e; done(: BOOL_Range(.ISEMPTY; Next(: PROC~{ IF n ( >Range(.LAST | j), i*j, i_3, i NOT >j, p OR q, lb.r^];-- An application with sample expressions.lv19_[first~0, last~10, x~3.14, g~2, f~5];-- Short for lv_LabelValue13[...].[first~i, last~j]_lv19;-- Assignment to VAR binding -- (extractor).20 prefixOp ::= @ (8) | (7) | (~ | NOT) (3)VARTOPOINTER | UMINUS | NOT21 infixOp ::= * | / | MOD (6) | + | (5) | _ (0)TIMES | DIVIDE | REM | PLUS | MINUS | ASSIGN22 relOp ::= ?NOT ( ?~ (= | < | >) | # | ?NOT ( ?NOT x(.(EQUAL | LESS | GREATER)[y(] | x(~=y( | (<= | >=) | IN) x(=y( OR x( (< | >) y( | x(>=y(.FIRST AND ( x(<=y(.LAST --In 19, 30. BUT {BoundsFault=>FALSE} ) )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 | ) LET t(~(typeName | INT) , first(~( e1 | e1.SUCC ) IN ( [ | ( ) e1 .. e2 ( ] | ) ) t(.MKSUBRANGE[first(, (e2 | e2.PRED )] BUT --In 19, 39, 48. {BoundsFault=>t(.MKEMPTYSUBRANGE[e1]}b: BOOL_i IN [1..10]; FOR x: INT IN (0..11) DO ...;-- Subrange only in types or with IN.b_( c IN Color54(red..green] OR x IN INT[0..10) );-- The INT is redundant.hplq\Rrs>tsts"u5s> $(RtsE8tsts"tststs!tsts#tsusususrsrtsdqsts dqsts dqstsdqsts dqstsdqsOrsA'qs!qs.J5hpJGgq#t>sustsgvgstsustsgvgststststBswstgvgststustgvgstsustgvgtstsustgvgtstsxu5s>f!tusfvfststststsBxstfvfsxstfvfstfvfstststsets tstBxstststst stGdq#t>sdvudststusu sBwstdvdststdvdtsx stdvdststsctstuststscqvcststscqvcststs tcqvcsustcqvcsx5bztstus>bWvbzstsB us tbWvbzs a`tsaqa`stsaqa`ststststsBx5s>ta=va`ststsyststststststsv5xs>ta=v-gu5.qfs>u5s>us Cus.qeususC).qdus .qcu5Cs>G_q#t >s_v_stusu5Bws>tstst_v_stst_v_stsx st_v_ststs^tstsusts_+q^stBst^v^st^v^tstst^v^sust^v^sususx]u5s>ts^q]stststBtststsxsusu x5s>xsys%u]U%]wsxsus*]U*r]xstst\uststs\v\ststs\v\ststsBxsysxst V\:"\sxsx[tus[v[stBst[v[sxst[v[syststst[v[sysusyst[v[sZtstusZ}vZstBs.YtsYqYsBtstststsystststststYcvYsuststsXltsGWuq#t>sustsusv5GV~q#t>sustsusV[vV~stBwststV[vV~ststsxst-_s usC&.q_usCu5s>us /!^usC.q]usC".q\#usCususus-[,CGUSGTq#ts>tsStustsustsutsRtststsBtBRj7RsxstystsxsxstQuststststsBxsQsU%QtcQsPQstQs4QsrQsUQxstyststststsPv5 BPyPvGOq#t>uststststsBtsxstswOvvOsxu5tsxs>tsv5xvN)Bxs>xsxsysNGU\NtsxsNGU&Nxsu5BMs>u5s>xsytsxtsxswsxstsxstsxu5tuxGLq#tutstBxs>tst|LYPLstsK tstsBtKbKststJv5GIq#t>ststsustsBtststsustststsusuHv5BusysusyIqHs>ysu5syIqHs>GGq#t>ststststststv5s>tBxsxsxststststsxsxststsG v5-Tus>C us.qSusCus.qRusus C$.qQ+C,.qPusC'/!OusC%/!NusC)/MCus0L0KusC'/Jus usCusus /!IustsC(.qHtCs'.qHuCs us rs/!G tsCrsr s/!F tsCus GERSGDLq#tv s>tststsDqDLsDqBDLtststststCxv5 uvuvGBq#t>sustsuAv5G@q#tvt>ststs@q@stBxsyststsv5$?s>tBstst>s>q>sv5us>tsBt>U>q>sv5)s>t=u5ts>Bxsvyuv5uvt<us>tustsutu5zGstBswsystsxsxsxsysxstsxsxsB;u5xusT;eU;xs>ysxsxsystsusB:xu5sysys:nU:>t9stusu5s>tststsBx stxststststs8tBtsxststsysv57&6u s>v55suvuv-DLs >ususC IP-CU usus CIP-B^ us CIP-Ag usCIP.q@pus -?y u5susC>IPus-> ususususu5sC>IPs-=usus -<us usCIP.q;ususus-:<us :q:IP-4rususG3SG2q#tvt>sBx stsu5sys>u5s>ysus1v5Bs>usysusG0q#t>s0q0s0q0ststs0q0stststsuBst0q0st0q0sxststsv5xvs>tsv5usG/q#t>sustsu5s>tsBxstysust.ustsustsustsustBu5ts>y.q.stsy.q.stsy.q.tsy.q.tst-ustsutststsBtsy-q-ststsustsy-q-stsy-q-tst,sustsuBx stsxsts-2C$-1C%-0us ustsC -/ususususus CusG+|q#t>stststsBtst+D+|stsysusysust*ustsuststsByswsxstuststststsuts)usts)q)sts)q)sts)q)sBt1)V&)sx sB( usysusysusususB'tstsusysusys&tuststststsuBsusyuststytstsuyus-+|ususu susususC usu5rs>us.q*usts tCsusus-)u5s>ustsu stsusC ususC(G%kq#t>sustsBusB%3%kystsust%3%kst$tu5s>tststsBtstststst#}stststsu tsustsBtsysustsysusysxsB"ysusu5ts>tsysysustsysysustsB!usysusu5tststus>tsutsB tsystustsutsts"~qs~qtBsysususysustst~qstst~qstsv5uvQ-%kus>ususC rs-$tusu5s>usus C%-#}ususususCrsGSGq#tvt>sts%qsts U  uU ts %qstststs.qtsu5{us>ts tsqs q#s>tsBtstoststqstC"estqstsqsu5{us>q#s>tBsBUwsysysqsysysqsxstcwsU qsqstsqsu5{us>q#s>tsqsu5{us>q#s>tsBustqsustqsusustsu5tqs>ususu5tqs>tsu5{us>tsustsustBtsu5x s>tsxstsu5x s>ts qstsqststsqstsBtqstststqstststs tsts qstsqststBtststst stststs qstsB=tstsqstsqstsqsts qsts qsv 5{vQFuvuv sqvq#v-s> %qs!C".q usC-ususususC$-us us C$-us IqsC- ususus C*-[qs&C rsr [qsts-dqsCus-'CGq#t>su{ustsu{ustststsutsu{uBx stsxstsxGq#t>ststsusu{uststsu{ustsu{uBxstsxstsxstsxstsxstsxGq#t>stuststststststststsBtuststusystxstsxstsxtsystsyusysts u5"ts>tststsutsBysysusystststsystsysysusus%J ~U% ysysus v5Bs>*xsus+ U+d tG q#t>s&G q#t>sustsustsustsustsustsustsustsu5 s>t sustsustsustsu5s>tsu5Gq#t>stsqststsu5Bxs>yststsutsyststyqu5tutyqsus>tu5xus>tsts JU `ts_qs_qststsoJUtBsysx syst_qstst_qsustsxshv5 Bs>ysxstEqhs-usus ususususC"us-usqs ususus Cus ,<TVk(SyntaxMeaning..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................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 "," ";" IN ELSE OR.Abbreviated non-terminals: b=binding13; d=declaration11; e=expression19; n=name56; s=statement14; t=type36.4 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). CLRMSumm.pressExamplesNotes26 application ::= e [?argBinding ?applEn]LET m(~e, a(~[argBinding] IN ( (m(. APPLY Za( ) ?applEn )27 argBinding ::= (n ~ (e | | TRASH )), !.. |(n ~ (e | OMITTED | TRASH) ), !.. | (e | | TRASH ), ...(e | OMITTED | TRASH ), ...In 19, 26. TRASH may be written as NULL, ~ as :.27.1applEn ::= ! enChoice9; ...-- In 19, 26.BUT { enChoice; ... }fh_Files.Open[name~lb.s, mode~Files.read-- Keywords are best for multiple args.! AccessDenied=>{...}; FatalError=>{...}];-- Semicolons separate choices.(GetProcs[j].ReadProc)[k];-- The proc can be computed.file.Read[buffer~b, count~k];-- WFile.Read[file, b, k] (object notation).f[i~3, j~ , k~TRASH]; f[i~3, k~TRASH];-- j and k may be trash (see defaultTC55).f[3, , TRASH];-- Likewise, if i, j, and k are in that order.28 if ::= IF e1 THEN e2 (ELSE e3 | )IF e1 THEN e2 ELSE (e3 | NULL)29 select ::= SELECT e FROM LET selector(~e IN choice; ... endChoice choice ELSE ... endChoice The ";" is "," in an expression; also in 32 and 34.-- ELSE is a separator for repetitions of the choice.30 choice ::= ( ( | relOp22 ) e1 ), !..=>e2IF ( (selector( (= | relOp ) e1) OR ... ) THEN e231 endChoice ::= ENDCASE ( | => e3)ELSE (NULL | e3)In 29, 32, 34.i_(IF j<3 THEN 6 ELSE 8);-- An IF with results must have an ELSE.IF k NOT IN Range THEN RETURN[7];SELECT f[j] FROM-- SELECT expressions are also possible.<7=>{...};-- Wt:INT~f[j]; IF t<7 THEN {...} ELSE ... IN [7..8]=>{...};-- 7, 8=> or =7, =8=>{...} is the same. NOT <=8=>{...};-- ENDCASE=>{...} is the same here.ENDCASE=>ERROR;-- Redundant: choices are exhaustive.32 safeSelect ::= WITH e SELECT FROMLET v(~e IN safeChoice; ... endChoice31 safeChoice ELSE ... endChoice33 safeChoice ::= n : t => e2IF ISTYPENOTNIL[v(, t] THEN LET n : t_NARROW[v(, t] IN e234 withSelect ::= WITH (n1 ~~ e1 | e1 )OPEN v(~~e1 IN LET n(~($n1 | NIL), type(~v(,SELECT ( | e11) FROM selector(~(e1.TAG | e11) IN withChoice ELSE ... endChoice withChoice; ... endChoice31-- e11 must be defaulted except for a COMPUTED variant.The ~~ may be written as :.35 withChoice ::= n2 => e2 |IF selector(=n2 THEN OPEN n2, n2, !.. => e2 (BINDP[n(, LOOPHOLE[v(,type([n2]] ] | BINDP[n(, v(] ) IN e2WITH r SELECT FROM-- Assume r: REF ANY in this example.rInt: REF INT=>RETURN[Gcd[rInt^, 17]];-- rInt is declared in this choice only.rReal: REF REAL=>RETURN[Floor[Sin[rReal^]]];ENDCASE=>RETURN[IF r=NIL THEN 0 ELSE 1]-- Only the REF ANY r is known here.nr: REF Node52~...; WITH dn~~nr SELECT FROM-- See rule 52 for the variant record Node.binary=>{nr_dn.b};-- dn is a Node.binary in this choice only.unary=>{nr_dn.a};-- dn is a Node.unary in this choice only.ENDCASE=>{nr_NIL};-- dn is just a Node here.36 type ::= typeName | builtInType | typeCons37 typeName ::= n1 | typeName . n2 | typeName [e] | n2 typeName typeName.SPECIALIZE[e] | typeName . n2 In 19, 25, 36, 40.1, 49.--n2 names a variant.P: PROC[ b: Buffer1.Handle, -- A type from an interface. i: INT_TEXT[20].SIZE ];-- A bound sequence; only in SIZE, NEW.38 builtInType ::= INT | REAL | TYPE | ATOM | MONITORLOCK | CONDITION | ?UNCOUNTED ZONE | MDSZone | LONG CARDINAL | ?LONG UNSPECIFIED -- See Table 42. TYPE only as t in a b or an interface's d. INTEGER, CARDINAL, NAT, TEXT, STRING, BOOL, CHAR are predefined.39 typeCons ::= subrange25 | paintedTC40.1 | transferTC41 | arrayTC44 | seqTC45 | descriptorTC45.1 | refTC46 | listTC47 | pointerTC48 | relativeTC49 | recordTC50 | unionTC52 | enumTC54 | defaultTC55TypeIndex: TYPE~[0..256);-- A subrange type.BinaryNode: TYPE~Node52.binary;-- A bound variant type.40 varTC ::= ( | READONLY | VAR ) t | ANY( VAR | READONLY | VAR ) t | ANYIn 11, 4548. ANY only in refTC. VAR only in interface decl.40.1paintedTC ::= typeName PAINTED tREPLACEPAINT[in: t, from: typeName]typeName must be an opaque type, t recordTC or enumTC.HV: TYPE~Interface.HistValue PAINTED -- See 13 for use.RECORD[...]41 transferTC ::=?safety4 xfer ?drTypeMKXFERTYPE[drType, flavor~xfer]41.1xfer ::= PROCEDURE | PROC | PORT |PROCESS | SIGNAL | ERROR | PROGRAM42 drType ::= ?fields1 RETURNS fields2 | fields1 domain~fields1, range~fields2No domain for PROCESS. In 3, 41.43 fields ::= [d11, ... ] | [t, ... ] | ANYANY only in drType. In 42, 50, 52.Enumerate: PROC[l: RL, p: PROC[x: REF ANY] RETURNS [stop: BOOL]] RETURNS [stopped: BOOL];p2:PROCESS RETURNS[i:INT]_FORK stream.Get;failed: ERROR [reason: ROPE]~CODE;44 arrayTC ::= ?PACKED ARRAY ?t1 OF t2MKARRAY[domain~t1, range~t2]45 seqTC ::=?PACKED SEQUENCE tag53 OF tMKSEQUENCE[domain~tag, range~t]Legal only as last type in a recordTC or unionTC.45.1descriptorTC ::= ?LONG DESCRIPTOR FOR varTC40MKARRAYDESCR[arrayType~varTC]varTC must be an array type.Vec: TYPE=ARRAY [0..maxVecLen) OF REF TEXT;Chars: TYPE~RECORD [text: PACKED SEQUENCE-- A record with just a sequence in it. len: [0..LAST[INTEGER]] OF CHAR]; ch: Chars;-- ch.text[i] or ch[i] refers to an element.v: Vec~ALL[NIL];dV: DESCRIPTOR FOR ARRAY OF REF TEXT~DESCRIPTOR[v];46 refTC ::= REF ( varTC40 | )MKREF[target~( varTC | ANY )]47 listTC ::= LIST OF varTC40MKLIST[range~varTC]ROText: TYPE~REF READONLY TEXT;-- NARROW[rl.first, ROText]^ is aRL: TYPE~LIST OF REF READONLY ANY; rl:RL;-- READONLY TEXT (or error).48 pointerTC::=?LONG ?ORDERED ?BASE MKPOINTER[target~varTC] | POINTER ?subrange25 ?(TO varTC40) |POINTER TO FRAME [ n ]MKINSTANCETYPE[n]Subrange only in a relativeTC; no typeName37 on it.49 relativeTC ::= typeName37 RELATIVE tMKRELATIVE[range~t, baseType~typeName]t must be a pointer or descriptor type, typeName a base pointer type.UnsafeHandle: TYPE~LONG POINTER TO Vec44;50 recordTC ::=?access12 (?MONITORED RECORD fields43 |MKRECORD[ fields] | MACHINE DEPENDENT RECORD (mdFields | fields43) )MKMDRECORD[mdFields | fields] 51 mdFields ::= [( (n pos), ... : --In 50, 52. MKMDFIELDS[LIST[ ( LIST[ ([$n, pos] ), ... ] , t ), ... ] ] ?access12 t), ...] 51.1pos ::= ( e1 ?(: e2 .. e3) ) -- In 51, 53.MKPOSITION[firstWord~e1, firstBit~e2, lastBit~e3]Cell: TYPE~RECORD[next: REF Cell, val: ATOM];Status: TYPE~MACHINE DEPENDENT RECORD [-- Don't omit the field positions.channel (0: 8..10): [0..nChannels),-- nChannels < 8.device (0: 0..3): DeviceNumber,-- DeviceNumber held in < 4 bits.stopCode (0: 11..15): Color, fill (0: 4..7): BOOL,-- No gaps allowed, but any ordering OK.command (1: 0..31): ChannelCommand ];-- Bit numbers >16 OK; fields can cross-- word boundaries only if word-aligned.52 unionTC ::= SELECT tag FROM MKUNION[selector~tag, variants~LIST[ (n, ...=>(fields43 | mdFields51 | NULL) ), ... ( [ labels~LIST[ $n, ...], value~fields ] ), ...] ]?, ENDCASE Legal only as last type in a recordTC or unionTC.53 tag ::= (n (pos51.1 | ) : ?access12 | [ ( [ $n, (pos | NIL) ] | $COMPUTED( | $OVERLAID( ) , COMPUTED | OVERLAID ) (t | *) ( t | TYPEFROMLABELS ) ]In 44, 52. * only in unionTC52.Node: TYPE~MACHINE DEPENDENT RECORD [-- rands is a union or variant part.type (0: 0..15): TypeIndex, rator (1: 0..13): Op54,-- This is the common part.rands (1: 14..79): SELECT n (1: 14..15): * FROM-- Both union and tag have pos.nonary=>[],-- Type of n is {nonary, unary, binary}.unary=>[a (1: 16..47): REF Node],-- Can use same name in several variants.binary=>[a (1:16..47), b(1:48..79): REF Node] -- At least one variant must fill 1: 14..79.ENDCASE ];54 enumTC ::= { n, ... } |MKENUMERATION[ LIST[$n, ...] ] |MACHINE DEPENDENT {( (n | ) (e) | n), !.. }MKMDENUMERATION[LIST[( [($n | NIL), e] | [$n, 1] ), ... ]]Op: TYPE~{plus, minus, times, divide };Color: TYPE~MACHINE DEPENDENT {-- A Color value takes 4 bits; greenW1.red(0), green, blue(4), (15)}; c: Color;55 defaultTC ::=CHANGEDEFAULT[type~t, (t _ |proc~NIL, trashOK~FALSE] |t _ e |proc~INLINE l IN e, trashOK~FALSE] |t _ e | TRASH |proc~INLINE l IN e, trashOK~TRUE] |t _ TRASHproc~t.Trash, trashOK~TRUE] )defaultTC legal only as the type in a decl in a body9 or field43 (n: t _ e), in a TYPE binding13, or in NEW. Note the terminal |.TRASH may be written as NULL.-- Except as noted, a constructor or application must mention each name and give it a value. Q: TYPE~RECORD[-- Otherwise there's a compile-time error.i: INT,-- Q[], Q[i~ ] trash i (not in argBinding27).j: INT_,-- No defaulting or trash for j.k: INT_3,-- Q[], Q[k~ ] leave k=3.l: INT_3 | TRASH,-- As k, but Q[l~TRASH] trashes l.m: INT_TRASH ];-- Q[], Q[m~ ] trash m.56 name ::= letter (letter | digit)...-- But not one of the reserved words in Table 31.57 literal ::= num ?( ( D|d | B|b ) ?num ) |-- INT literal, decimal if radix omitted or D, octal if B. |digit (digit |A|B|C|D|E|F) ... ( H|h ) ?num |-- INT literal in hex; must start with digit. |?num . num ?exponent | -- REAL as a scaled decimal fraction; note no trailing dot. |num exponent |-- With an exponent, the decimal point may be omitted. |' extendedChar | digit !.. C |-- CHAR literal; the C form specifies the code in octal. |" extendedChar ... " ?L |[ ('extendedChar), ...] -- Rope.ROPE, TEXT, or STRING. |$ n-- ATOM literal.58 exponent ::= (E|e) ?(+ | ) num-- Optionally signed decimal exponent.59 num ::= digit !..60 extendedChar ::= space | \ extension | anyCharNot'"Or\ 61 extension ::= digit1 digit2 digit3 |-- The character with code digit1 digit2 digit3 B. | (n|N | r|R) | (t|T) | (b|B) | -- CR, '\015 | TAB, '\011 | BACKSPACE, '\010 | (f|F) | (l|L) | ' | " | \-- FORMFEED, '\014 | LINEFEED, '\012 | ' | " | \m, x1, x59y, longNameWithSeveralWords: INT;n: INT~1+12D+2B3+2000B-- = 1+12+1024+1024 +1H+0FFH;-- +1+255r1: REAL~0.1+.1+1.0E1-- = 0.1+0.1+0.1 +1E1;-- +0.1a1: ARRAY [0..3] OF CHAR~['x, '\N, '\', '\141];r2: ROPE~"Hello.\N...\NGoodbye\F";a2: ATOM~$NameInAnAtomLiteral;hplq\Rrs>tsts"u5s> $(RtsE8tsts"tststs!tsts#tsusususrsrtsdqsts dqsts dqstsdqsts dqstsdqsOrsA'qs!qs.J5hpJGgq#t >sts tsBxsystsyst cggsxs {gU g!gU!cgysu5xs>ysys'.gU'gt(-g+gs+FgUGfq#t >ststststsustststBtststsxstsutu5ts>tstestststsuststBtstsxstsu5ts>tev5 uvuvGd qt>s dfqd stv5 Bxs>tcd sts-g(C'.qftsC-eC-dCyrsrsrsrsrs-c us usCrsrsdCqcs-cusCrsrsrsGbASGa;q#t>susaqa;susaqa;stusaqa;ststBustaqa;sustaqa;sustaqa;stsutG`!q#t>sususBxsystsx_*s ts Bt^]_*sustst^O 8_*s^Vv51Buv.G]_q#t>stststs]q]_sts]tstststst]suststs\"q\EtBustustst\"q\Et[Nv5 -a;sus>ususCusus-`Dusu5s>usus-_MusuCsus.q^V Cyrsusrsrsusrsustsusts.q]_usCts.q\hus Custs.q[qususC%GZq#t >susu5Bxs>ystsxYsts Y_qBYst xX}YsuststXOGX"q#t >s WqBX"usx systsu5s>xststsusystsustWqGW#st >sustsVqWsVqWstsVqWstBxsystVqWsxu5xs>yststVqWstsutsysyuUststsUqUtsusBu5systUqUsxs>tstUqUtsxst `U#Usustst'UOTsts UqBTv5TqTvuvSGRq#st >sRqRsRqRstBusystRqRu5s>xu5QsQqQs>QqQstsQqQsBu5txsys>usysystQqQstu5xsys>ysu5ts>xstQq-Zusu5Cs>rsu5s>.qYu5sus >Crs!.qX"u5sus.qW+ususus>usususC u5s>rs-UusVqUsusu5Cs>$r.qTsCrsrsrs.qSCrsrsrs.qRususCrs rsGPSGOq#tvs>ts ts tsGNq#t>sNq#Nts> NqNstsBM tsMqMs Btsx ststststMqMsLv5BLqLv-Ous> P$qOsC.qNusususCususGKq#t >sustsustsustsustsu stsustsJtu 5s>ts tsusuststu5 s>v5Iuv'uvuvuvuvuvGHq#t>sHqHsts HqHsts HqHstsHqHstsHqHsts HqHstsGHqGstsHqGsts HqGsts HqGstsHqGstsHqGstsHqGsts Hq-Hs us C-G usHqGsCGFq#t>ststsustsuststsuBtsustsustsustststsuEv5 uvuvGDqt>s usBx ststsD&v5.-Ds>usu5Cs>.qDusGBqstsC qBstsBx st%B BstsGAqtustsustsust@ustu5s>tsustsuG?q#t>sts?q?sus?q?sts?q?sBt?q?st?q>v5 uv G=q#t>s>8q=ststststsu=v5-Bs >us/!A/!@usu5s>usus.q?us us->usususus -=us ususG;q#t>stsususts;q;sus;qB;xst;q;st;q;sG:q#t>susus; q:susBx stststs9v5,G8qst >s8tusu 5s>8JqB8x s ts70v5-;s>usususu5s-:>ususu5Cs>%.q9 ususu5s> Crsrsrsrsrs-8usus-8u 5s.q7 u sG5q#t>susts6q5ststBxstststsustsG4q#t>su5s5qB4xsts-5>usu5Cs>usrsru5rs>-4usu5s>u5 s>Cu5s>ts G3q#st u5tus>tsusBxstst2su5ts2q2utus>2q2tst1su5s>Bx sts0v5"1q0vG/q#st >s0'q/susBx sts ts/ v5D-3s >usu5 s3q3sG-q#t>s.q-st,tusus-q,stBxstst+su5 s>u*stststs+0q*tstBx ststststG)q#st>ststststsv5s>Bx sustsuststststststststs(ts)Bq(ststsv5G(qst>s+'U('q(sts'q(s'q(ts 'U a(v5Bx s t'q(s> t'q(s t'q(s--ususus us-,usu5s>C".q+#Crsys.q*Cr sys.q)-usC(.q(%CysC(*G&q#t>sususBxs ts us%tststs%q%sts%q%stsutu5ts>tsBts ustststsu5ts>ts$tsut#sv5,G"q#t>ststs#q"stststs#q"stsBtstststsutstsxystsxysts!ustsuststststBstststsx sts v5uv!Cq v-&s>usu5s>Crs.q%0%q%sC.q$usuCs/!# C rsrsrsrs/!"usC)/!!u5s >usC,/! usGq#ts>tststBx sustststusuststststsmUNmUtststsBxsuststststsutstststststs-us-usu5 s>Crsrys.q(Gq#t>Bx stststsus uststsu5ws>xsts ustsPustsu5ws>xsts ustsustsustv5+Mqv MqvuvMqvuvu3vuvuv-s>[-u5susC>(.qusCrsrsrs rsqs.qusCrs.qusCrsrsrs rs.qususCrsrsrsus rs.qususCrsrsrs rsG(SG"q#tvt>stststBs2G+q#t>sts m 6+ts t +ts  [+ts  $+tstststBsus5t4ststst-4tsk 4tsK4ts ; 4ts B 4ts " 4tststs 4tsw4tststBsus(t=s tstsBus5tFs tBs7tOststs  AOtBsus2tXststs   XtBststsrsususustasBusG jq#t>sts! 2 jts 2tu jtstststsB&G sq#t>stG |q#t >sts tsG q#t>s bq s bq s bq stBst bq st bq st bq st kstsR 3 kts 3 kts 3] kts ; 3 ktststs Z 3N kts 3 ktststs 3y kts 3Y ktstsBustu5s>tsusts tsRU ts tststs E 2 ts p  tstststsBust|Xus>tststs-"'us-+usC.q4C -=us C.qFC-Ousu5s>-Xus ts -aus+:TVk(C TimesRoman  TimesRoman TimesRoman TimesRoman TimesRoman TimesRoman TimesRomanHippo Helvetica Math  TimesRoman  TimesRoman  TimesRoman (n(&Nj/QO0 CLRMSumm.bxLampsonFebruary 16, 1983 10:34 AM