-- grammar extracted from Pass1T.mesa by NPGS, June 21, 1989 12:40:23 pm PDT
-- Copyright Ó 1991 by Xerox Corporation. All rights reserved.

||CHAIN ||LISTS

||TABLE1
1 id
2 num
3 lnum
4 flnum
5 string
6 lstring
7 char
8 atom
9 ,
10 ;
11 :
12 ..
13 =>
14 ←
15 =
16 #
17 <
18 >
19 <=
20 >=
21 ~
22 ~~
23 +
24 -
25 *
26 **
27 /
28 ^
29 .
30 @
31 !
32 '|
33 RECORD
34 POINTER
35 REF
36 VAR
37 LIST
38 ARRAY
39 SEQUENCE
40 DESCRIPTOR
41 PROCEDURE
42 PROC
43 PORT
44 SIGNAL
45 ERROR
46 PROCESS
47 PROGRAM
48 MONITOR
49 DEFINITIONS
50 ZONE
51 RELATIVE
52 LONG
53 TYPE
54 FRAME
55 TO
56 ORDERED
57 UNCOUNTED
58 PAINTED
59 BASE
60 OF
61 RETURNS
62 SAFE
63 UNSAFE
64 PACKED
65 MSBIT
66 LSBIT
67 NATIVE
68 WORD8
69 WORD16
70 WORD32
71 WORD64
72 MONITORED
73 OVERLAID
74 COMPUTED
75 MACHINE
76 DEPENDENT
77 DIRECTORY
78 IMPORTS
79 EXPORTS
80 SHARES
81 LOCKS
82 USING
83 PUBLIC
84 PRIVATE
85 CEDAR
86 CHECKED
87 TRUSTED
88 UNCHECKED
89 ENTRY
90 INTERNAL
91 INLINE
92 READONLY
93 CODE
94 ABS
95 ALL
96 AND
97 APPLY
98 CONS
99 MAX
100 MIN
101 MOD
102 NOT
103 OR
104 ORD
105 PRED
106 LENGTH
107 NEW
108 START
109 SUCC
110 VAL
111 FORK
112 JOIN
113 LOOPHOLE
114 NARROW
115 ISTYPE
116 BITS
117 BYTES
118 SIZE
119 UNITS
120 WORDS
121 FIRST
122 LAST
123 NIL
124 TRASH
125 NULL
126 IF
127 THEN
128 ELSE
129 WITH
130 FROM
131 FOR
132 DECREASING
133 IN
134 THROUGH
135 UNTIL
136 WHILE
137 REPEAT
138 FINISHED
139 RETURN
140 EXIT
141 LOOP
142 GOTO
143 GO
144 FREE
145 WAIT
146 RESTART
147 NOTIFY
148 BROADCAST
149 STOP
150 RESUME
151 REJECT
152 CONTINUE
153 RETRY
154 OPEN
155 ENABLE
156 ANY
157 EXITS
158 )
159 ]
160 }
161 END
162 ENDLOOP
163 ENDCASE
164 (
165 [
166 {
167 BEGIN
168 DO
169 SELECT
170 eof

||TABLE2
171 goal
172 module
173 directory
174 identlist
175 cedar
176 proghead
177 trusted
178 checked
179 block
180 defhead
181 defbody
182 includeitem
183 using
184 resident
185 safe
186 class
187 arguments
188 locks
189 interface
190 bindop
191 public
192 definitions
193 imports
194 shares
195 open
196 declist
197 primary
198 lambda
199 ident
200 typeexp
201 moduleitem
202 declaration
203 entry
204 readonly
205 initialization
206 default
207 optsize
208 procaccess
209 idlist'
210 identlist'
211 position
212 exp
213 optbits
214 bounds
215 interval
216 range
217 typeid'
218 typeappl
219 typeid
220 length
221 typecons
222 dependent
223 elementlist
224 element
225 monitored
226 reclist
227 ordered
228 base
229 pointertype
230 variantpart
231 indextype
232 transfermode
233 arglist
234 returnlist
235 heap
236 pairlist
237 typelist
238 variantpair
239 vcasehead
240 variantlist
241 tagtype
242 pairitem
243 variantitem
244 idlist
245 defaultopt
246 pointerprefix
247 initvalue
248 inline
249 codelist
250 orderlist
251 statement
252 balstmt
253 casehead
254 casestmtlist
255 basicstmt
256 lhs
257 explist
258 forclause
259 dotest
260 scope
261 doexit
262 optargs
263 transfer
264 free
265 optcatch
266 exits
267 enables
268 statementlist
269 binditem
270 exitlist
271 casestmtitem
272 caselabel
273 caseexpitem
274 exititem
275 casetest
276 optrelation
277 controlid
278 direction
279 catchcase
280 catchany
281 catchlist
282 catchhead
283 lhslist
284 keyitem
285 optexp
286 trash
287 caseexplist
288 disjunct
289 conjunct
290 negation
291 relation
292 sum
293 addop
294 product
295 multop
296 factor
297 relationtail
298 relop
299 prefixop
300 new
301 cons
302 listcons
303 typeop
304 transferop
305 qualifier
306 desclist
307 opttype
308 exports
309 fieldlist
310 includelist
311 modulelist
312 elementlist'
313 bindlist
314 statementlist'
315 casestmtlist'
316 caselabel'
317 exitlist'
318 keylist
319 caseexplist'


||TABLE3
id tokenID
num tokenNUM
lnum tokenLNUM
flnum tokenFLNUM
string tokenSTR
lstring tokenLSTR
char tokenCHAR
atom tokenATOM
- tokenMINUS
. tokenDOT
.. tokenDOTS
** tokenPOWER
= tokenEQUAL
=> tokenARROW
< tokenLESS
<= tokenLE
> tokenGREATER
>= tokenGE
# tokenNE
~ tokenTILDE
~~ tokenBIND
. initialSymbol


||TABLE4

1 0 goal ::= . module .
2 0 | . module ..

3 1 module ::= directory identlist cedar proghead trusted checked block
4 1 | directory identlist cedar defhead defbody

5 2 includeitem ::= id : FROM string using
6 3 | id : TYPE using
7 3 | id using
8 3 | id : TYPE id using

9 4 cedar ::= CEDAR
10 4 |

11 5 proghead ::= resident safe class arguments locks interface bindop public

12 6 resident ::=

13 7 defhead ::= definitions locks imports shares bindop public

14 8 definitions ::= DEFINITIONS

15 9 defbody ::= BEGIN open declist END
16 9 | BEGIN open declist ; END
17 9 | { open declist }
18 9 | { open declist ; }

19 10 locks ::= LOCKS primary lambda
20 237 |

21 11 lambda ::= USING ident typeexp
22 237 |

23 12 moduleitem ::= id
24 12 | id : id

25 13 declaration ::= identlist public entry readonly typeexp initialization
26 14 | identlist public TYPE bindop public typeexp default
27 15 | identlist public TYPE optsize

28 16 public ::= PUBLIC
29 17 | PRIVATE
30 18 |

31 17 procaccess ::=

32 19 entry ::= ENTRY
33 20 | INTERNAL
34 21 |

35 22 idlist' ::= id
36 22 | id , idlist'

37 22 identlist' ::= id :
38 22 | id , identlist'
39 23 | id position :
40 24 | id position , identlist'

41 25 position ::= ( exp optbits )

42 26 optbits ::= : bounds
43 237 |

44 26 interval ::= [ bounds ]
45 27 | [ bounds )
46 28 | ( bounds ]
47 29 | ( bounds )

48 30 typeexp ::= id
49 237 | typeid
50 237 | typecons

51 30 range ::= id
52 36 | id interval
53 37 | typeid interval
54 237 | interval
55 237 | typeid

56 30 typeid' ::= id . id
57 31 | typeid' . id

58 31 typeappl ::= typeappl . id
59 34 | id length
60 35 | typeid length
61 35 | typeappl length

62 32 typeid ::= id id
63 33 | id typeid
64 237 | typeid'

65 36 typecons ::= interval
66 36 | id interval
67 37 | typeid interval
68 38 | dependent { elementlist }
69 41 | dependent monitored RECORD reclist
70 42 | ordered base pointertype
71 43 | VAR typeexp
72 44 | REF readonly typeexp
73 45 | REF readonly ANY
74 45 | REF
75 46 | LIST OF readonly typeexp
76 47 | PACKED typecons
77 48 | MSBIT typecons
78 49 | LSBIT typecons
79 50 | NATIVE typecons
80 51 | WORD8 typecons
81 52 | WORD16 typecons
82 53 | WORD8
83 54 | WORD16
84 55 | WORD32
85 56 | WORD64
86 57 | WORD32 typecons
87 58 | WORD64 typecons
88 59 | ARRAY indextype OF typeexp
89 60 | DESCRIPTOR FOR readonly typeexp
90 61 | safe transfermode arguments
91 64 | id RELATIVE typeexp
92 65 | typeid RELATIVE typeexp
93 66 | heap ZONE
94 67 | LONG typeexp
95 68 | FRAME [ id ]
96 69 | id PAINTED typeexp
97 70 | typeid PAINTED typeexp
98 237 | typeappl

99 39 ident ::= id position :
100 198 | id :

101 39 element ::= id ( exp )
102 40 | ( exp )
103 198 | id

104 47 variantpart ::= PACKED variantpart
105 76 | SELECT vcasehead FROM variantlist ENDCASE
106 76 | SELECT vcasehead FROM variantlist , ENDCASE
107 77 | SEQUENCE vcasehead OF typeexp

108 62 safe ::=
109 235 | UNSAFE
110 236 | SAFE

111 63 arglist ::= ANY
112 237 | fieldlist
113 237 |

114 63 returnlist ::= RETURNS ANY
115 237 | RETURNS fieldlist
116 237 |

117 71 monitored ::= MONITORED
118 236 |

119 72 dependent ::=
120 72 | MACHINE DEPENDENT

121 73 reclist ::= [ ]
122 73 | NULL
123 73 | [ pairlist ]
124 73 | [ typelist ]
125 74 | [ pairlist , variantpair ]
126 75 | [ variantpart default ]
127 236 | [ variantpair ]

128 78 variantpair ::= identlist public variantpart default

129 78 vcasehead ::= ident public tagtype
130 79 | COMPUTED tagtype
131 80 | OVERLAID tagtype

132 78 pairitem ::= identlist public typeexp default

133 81 tagtype ::= *
134 237 | typeexp

135 82 variantitem ::= idlist => reclist

136 83 typelist ::= id
137 83 | typecons default
138 83 | typeid default
139 83 | id ← defaultopt
140 84 | typecons default , typelist
141 84 | typeid default , typelist
142 85 | id , typelist
143 85 | id ← defaultopt , typelist

144 86 pointertype ::= pointerprefix
145 87 | pointerprefix TO readonly typeexp

146 88 transfermode ::= PROCEDURE
147 88 | PROC
148 89 | PORT
149 90 | SIGNAL
150 91 | ERROR
151 92 | PROCESS
152 93 | PROGRAM

153 94 initialization ::=
154 235 | ← initvalue
155 236 | bindop initvalue

156 95 initvalue ::= procaccess trusted checked inline entry block
157 96 | CODE
158 97 | procaccess trusted checked MACHINE CODE BEGIN codelist END
159 97 | procaccess trusted checked MACHINE CODE { codelist }
160 155 | trash
161 237 | exp

162 98 trusted ::=

163 99 codelist ::= orderlist
164 99 | codelist ; orderlist

165 100 statement ::= IF exp THEN statement
166 101 | IF exp THEN balstmt ELSE statement
167 102 | casehead casestmtlist ENDCASE => statement
168 237 | basicstmt

169 101 balstmt ::= IF exp THEN balstmt ELSE balstmt
170 102 | casehead casestmtlist ENDCASE => balstmt
171 237 | basicstmt

172 103 basicstmt ::= lhs
173 104 | lhs ← exp
174 105 | [ explist ] ← exp
175 106 | trusted checked block
176 107 | casehead casestmtlist ENDCASE
177 108 | forclause dotest DO scope doexit ENDLOOP
178 109 | EXIT
179 110 | LOOP
180 111 | GOTO id
181 111 | GO TO id
182 112 | RETURN optargs
183 113 | transfer lhs
184 114 | free [ exp optcatch ]
185 115 | WAIT lhs
186 116 | ERROR
187 117 | STOP
188 118 | NULL
189 119 | RESUME optargs
190 120 | REJECT
191 121 | CONTINUE
192 122 | RETRY

193 123 block ::= BEGIN scope exits END
194 123 | { scope exits }

195 124 scope ::= open enables statementlist
196 125 | open enables declist ; statementlist

197 126 binditem ::= exp
198 126 | id ~~ exp
199 126 | id : exp

200 127 exits ::= EXITS exitlist
201 236 |

202 128 casestmtitem ::= caselabel => statement

203 128 caseexpitem ::= caselabel => exp

204 128 exititem ::= idlist => statement

205 129 casetest ::= optrelation
206 129 | ~ optrelation
207 130 | exp

208 131 caselabel ::= ident typeexp
209 234 | caselabel'

210 131 controlid ::= ident typeexp
211 198 | id

212 132 forclause ::= FOR controlid ← exp , exp
213 133 | FOR controlid direction IN range
214 134 | THROUGH range
215 237 |

216 135 direction ::=
217 135 | DECREASING

218 136 dotest ::= UNTIL exp
219 237 | WHILE exp
220 237 |

221 137 doexit ::=
222 137 | REPEAT exitlist
223 138 | REPEAT exitlist FINISHED => statement
224 138 | REPEAT exitlist FINISHED => statement ;

225 139 enables ::= ENABLE catchcase ;
226 140 | ENABLE catchany ;
227 141 | ENABLE BEGIN catchlist END ;
228 141 | ENABLE { catchlist } ;
229 236 |

230 142 catchlist ::= catchhead catchcase
231 231 | catchhead
232 237 | catchhead catchany
233 237 | catchhead catchany ;

234 143 catchcase ::= lhslist => statement

235 144 optargs ::= [ explist ]
236 145 |
237 236 | lhs

238 146 transfer ::= SIGNAL
239 147 | ERROR
240 148 | RETURN WITH ERROR
241 149 | START
242 150 | RESTART
243 151 | JOIN
244 152 | NOTIFY
245 153 | BROADCAST

246 154 keyitem ::= id ~ optexp
247 154 | id : optexp

248 155 defaultopt ::= trash
249 155 | exp '| trash
250 232 |
251 237 | exp

252 155 optexp ::= trash
253 237 | exp
254 237 |

255 156 exp ::= IF exp THEN exp ELSE exp
256 157 | casehead caseexplist ENDCASE => exp
257 158 | lhs ← exp
258 159 | [ explist ] ← exp
259 160 | ERROR
260 188 | transferop lhs
261 237 | disjunct

262 161 disjunct ::= disjunct OR conjunct
263 C 237 | conjunct

264 162 conjunct ::= conjunct AND negation
265 C 237 | negation

266 163 negation ::= ~ relation
267 163 | NOT relation
268 C 237 | relation

269 164 relation ::= sum optrelation
270 237 | sum

271 164 sum ::= sum addop product
272 C 237 | product

273 164 product ::= product multop factor
274 C 237 | factor

275 165 optrelation ::= NOT relationtail
276 237 | relationtail

277 166 relationtail ::= IN range
278 237 | relop sum

279 167 relop ::= =
280 168 | #
281 169 | <
282 170 | <=
283 171 | >
284 172 | >=

285 173 addop ::= +
286 174 | -

287 175 multop ::= *
288 176 | /
289 177 | MOD

290 178 factor ::= primary ** factor
291 179 | addop primary
292 C 237 | primary

293 180 primary ::= [ explist ]
294 181 | prefixop [ orderlist ]
295 182 | VAL [ orderlist ]
296 183 | ALL [ orderlist ]
297 184 | new [ typeexp initialization optcatch ]
298 185 | cons [ explist optcatch ]
299 186 | listcons [ explist ]
300 187 | NIL
301 188 | typeop [ typeexp ]
302 190 | BITS [ typeexp ]
303 190 | BITS [ typeexp , exp ]
304 191 | BYTES [ typeexp ]
305 191 | BYTES [ typeexp , exp ]
306 192 | UNITS [ typeexp ]
307 192 | UNITS [ typeexp , exp ]
308 193 | SIZE [ typeexp ]
309 193 | SIZE [ typeexp , exp ]
310 194 | WORDS [ typeexp ]
311 194 | WORDS [ typeexp , exp ]
312 195 | ISTYPE [ exp , typeexp ]
313 196 | @ lhs
314 197 | DESCRIPTOR [ desclist ]
315 237 | lhs

316 189 qualifier ::= . prefixop
317 189 | . typeop
318 190 | . BITS
319 191 | . BYTES
320 192 | . UNITS
321 193 | . SIZE
322 194 | . WORDS
323 207 | [ explist optcatch ]
324 208 | . id
325 209 | ^

326 198 lhs ::= id
327 199 | num
328 199 | string
329 199 | lnum
330 200 | flnum
331 201 | char
332 202 | lstring
333 203 | atom
334 204 | NARROW [ exp opttype optcatch ]
335 205 | LOOPHOLE [ exp opttype ]
336 206 | APPLY [ exp , exp optcatch ]
337 237 | ( exp )
338 237 | lhs qualifier

339 210 optcatch ::= ! catchlist
340 236 |

341 211 transferop ::= SIGNAL
342 212 | ERROR
343 213 | START
344 214 | JOIN
345 215 | NEW
346 216 | FORK

347 217 prefixop ::= LONG
348 218 | ABS
349 219 | PRED
350 220 | SUCC
351 221 | ORD
352 222 | MIN
353 223 | MAX
354 224 | BASE
355 225 | LENGTH

356 226 typeop ::= CODE
357 227 | FIRST
358 228 | LAST
359 229 | NIL

360 230 desclist ::= exp , exp opttype
361 237 | exp

362 231 directory ::= DIRECTORY ;
363 234 | DIRECTORY includelist ;
364 237 |

365 231 imports ::= IMPORTS
366 234 | IMPORTS modulelist
367 237 |

368 231 pointerprefix ::= POINTER
369 237 | POINTER interval

370 231 free ::= FREE
371 237 | lhs . FREE

372 231 new ::= NEW
373 237 | lhs . NEW

374 231 cons ::= CONS
375 237 | lhs . CONS

376 231 listcons ::= LIST
377 237 | lhs . LIST

378 231 exports ::= EXPORTS
379 234 | EXPORTS modulelist
380 237 |

381 231 fieldlist ::= [ ]
382 234 | [ pairlist ]
383 234 | [ typelist ]

384 232 using ::= USING [ ]
385 237 | USING [ idlist ]
386 237 |

387 233 declist ::= declaration
388 233 | declist ; declaration

389 233 elementlist ::=
390 237 | elementlist'

391 233 pairlist ::= pairitem
392 233 | pairlist , pairitem

393 233 variantlist ::= variantitem
394 233 | variantlist , variantitem

395 233 orderlist ::= optexp
396 233 | orderlist , optexp

397 233 casestmtlist ::=
398 237 | casestmtlist'
399 237 | casestmtlist' ;

400 233 statementlist ::=
401 237 | statementlist'
402 237 | statementlist' ;

403 233 exitlist ::=
404 237 | exitlist'
405 237 | exitlist' ;

406 233 catchhead ::=
407 233 | catchhead catchcase ;

408 233 lhslist ::= lhs
409 233 | lhslist , lhs

410 233 caseexplist ::=
411 237 | caseexplist'
412 237 | caseexplist' ,

413 233 includelist ::= includeitem
414 233 | includelist , includeitem

415 233 modulelist ::= moduleitem
416 233 | modulelist , moduleitem

417 233 elementlist' ::= element
418 233 | elementlist' , element

419 233 bindlist ::= binditem
420 233 | bindlist , binditem

421 233 statementlist' ::= statement
422 233 | statementlist' ; statement

423 233 casestmtlist' ::= casestmtitem
424 233 | casestmtlist' ; casestmtitem

425 233 caselabel' ::= casetest
426 233 | caselabel' , casetest

427 233 exitlist' ::= exititem
428 233 | exitlist' ; exititem

429 233 keylist ::= keyitem
430 233 | keylist , keyitem

431 233 caseexplist' ::= caseexpitem
432 233 | caseexplist' , caseexpitem

433 234 identlist ::= identlist'

434 234 open ::= OPEN bindlist ;
435 237 |

436 234 idlist ::= idlist'

437 234 explist ::= orderlist
438 234 | keylist

439 235 class ::= PROGRAM
440 236 | MONITOR

441 235 casehead ::= SELECT exp FROM
442 236 | WITH binditem SELECT optexp FROM

443 236 readonly ::= READONLY
444 236 |

445 236 ordered ::= ORDERED
446 236 |

447 236 base ::= BASE
448 236 |

449 236 heap ::= UNCOUNTED
450 236 |

451 236 inline ::= INLINE
452 236 |

453 237 arguments ::= arglist returnlist

454 237 interface ::= imports exports shares

455 237 bindop ::= ~
456 237 | =

457 237 shares ::= SHARES idlist
458 237 |

459 237 default ::= ← defaultopt
460 237 |

461 237 optsize ::= [ exp ]
462 237 |

463 237 bounds ::= exp .. exp

464 237 length ::= [ exp ]

465 237 indextype ::= typeexp
466 237 |

467 237 catchany ::= ANY => statement

468 237 trash ::= TRASH
469 237 | NULL

470 237 opttype ::= , typeexp
471 237 |

472 238 checked ::=
473 239 | CHECKED
474 240 | TRUSTED
475 241 | UNCHECKED