MimosaPGS.grammar
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Bill Jackson (bj) April 22, 1987 10:02:51 pm PDT
fork grep -t ::= Pass1T.pgs
Target: *-- <p:&&>*::= <t:*>
Replacement: <p> ::= <t>
goal ::= . module .
goal ::= . module ..
module ::= directory identlist cedar proghead trusted checked block
module ::= directory identlist cedar defhead defbody
includeitem ::= id : FROM string using
includeitem ::= id : TYPE using
includeitem ::= id using
includeitem ::= id : TYPE id using
cedar ::= CEDAR
cedar ::= resident safe class arguments locks interface bindop public
resident ::=
defhead ::= definitions locks imports shares bindop public
definitions ::= DEFINITIONS
defbody ::= BEGIN open declist END
defbody ::= BEGIN open declist ; END
defbody ::= { open declist }
defbody ::= { open declist ; }
locks ::= LOCKS primary lambda
lambda ::= USING ident typeexp
moduleitem ::= id
moduleitem ::= id : id
declaration ::= identlist public entry readonly typeexp initialization
declaration ::= identlist public TYPE bindop public typeexp default
declaration ::= identlist public TYPE optsize
public ::= PUBLIC
public ::= PRIVATE
procaccess ::= ENTRY
entry ::= INTERNAL
entry ::= id
identlist ::= id :
idlist ::= id , idlist'
identlist ::= id , identlist'
identlist ::= id position :
identlist ::= id position , identlist'
position ::= ( exp optbits )
optbits ::= : bounds
interval ::= [ bounds ]
interval ::= [ bounds )
interval ::= ( bounds ]
interval ::= ( bounds )
typeexp ::= id
range ::= id
typeid ::= id . id
typeid ::= typeid' . id
typeappl ::= typeappl . id
typeid ::= id id
typeid ::= id typeid
typeappl ::= id length
typeappl ::= typeid length
typeappl ::= typeappl length
typecons ::= interval
typecons ::= id interval
range ::= id interval
typecons ::= typeid interval
range ::= typeid interval
typecons ::= dependent { elementlist }
ident ::= id position :
element ::= id ( exp )
element ::= ( exp )
typecons ::= dependent monitored RECORD reclist
typecons ::= ordered base pointertype
typecons ::= VAR typeexp
typecons ::= REF readonly typeexp
typecons ::= REF readonly ANY
typecons ::= REF
typecons ::= LIST OF readonly typeexp
typecons ::= PACKED typecons
variantpart ::= PACKED variantpart
typecons ::= ARRAY indextype OF typeexp
typecons ::= DESCRIPTOR FOR readonly typeexp
typecons ::= safe transfermode arguments
safe ::= ANY
returnlist ::= RETURNS ANY
typecons ::= id RELATIVE typeexp
typecons ::= typeid RELATIVE typeexp
typecons ::= heap ZONE
typecons ::= LONG typeexp
typecons ::= FRAME [ id ]
typecons ::= id PAINTED typeexp
typecons ::= typeid PAINTED typeexp
monitored ::= MONITORED
dependent ::= MACHINE DEPENDENT
reclist ::= [ ]
reclist ::= NULL
reclist ::= [ pairlist ]
reclist ::= [ typelist ]
reclist ::= [ pairlist , variantpair ]
reclist ::= [ variantpart default ]
variantpart ::= SELECT vcasehead FROM variantlist ENDCASE
variantpart ::= SELECT vcasehead FROM variantlist , ENDCASE
variantpart ::= SEQUENCE vcasehead OF typeexp
vcasehead ::= ident public tagtype
pairitem ::= identlist public typeexp default
variantpair ::= identlist public variantpart default
vcasehead ::= COMPUTED tagtype
vcasehead ::= OVERLAID tagtype
tagtype ::= *
variantitem ::= idlist => reclist
typelist ::= id
typelist ::= typecons default
typelist ::= typeid default
typelist ::= id ← defaultopt
typelist ::= typecons default , typelist
typelist ::= typeid default , typelist
typelist ::= id , typelist
typelist ::= id ← defaultopt , typelist
pointertype ::= pointerprefix
pointertype ::= pointerprefix TO readonly typeexp
transfermode ::= PROCEDURE
transfermode ::= PROC
transfermode ::= PORT
transfermode ::= SIGNAL
transfermode ::= ERROR
transfermode ::= PROCESS
transfermode ::= PROGRAM
initialization ::= procaccess trusted checked inline entry block
initvalue ::= CODE
initvalue ::= procaccess trusted checked MACHINE CODE BEGIN codelist END
initvalue ::= procaccess trusted checked MACHINE CODE { codelist }
trusted ::= orderlist
codelist ::= codelist ; orderlist
statement ::= IF exp THEN statement
statement ::= IF exp THEN balstmt ELSE statement
balstmt ::= IF exp THEN balstmt ELSE balstmt
statement ::= casehead casestmtlist ENDCASE => statement
balstmt ::= casehead casestmtlist ENDCASE => balstmt
basicstmt ::= lhs
basicstmt ::= lhs ← exp
basicstmt ::= [ explist ] ← exp
basicstmt ::= trusted checked block
basicstmt ::= casehead casestmtlist ENDCASE
basicstmt ::= forclause dotest DO scope doexit ENDLOOP
basicstmt ::= EXIT
basicstmt ::= LOOP
basicstmt ::= GOTO id
basicstmt ::= GO TO id
basicstmt ::= RETURN optargs
basicstmt ::= transfer lhs
basicstmt ::= free [ exp optcatch ]
basicstmt ::= WAIT lhs
basicstmt ::= ERROR
basicstmt ::= STOP
basicstmt ::= NULL
basicstmt ::= RESUME optargs
basicstmt ::= REJECT
basicstmt ::= CONTINUE
basicstmt ::= RETRY
block ::= BEGIN scope exits END
block ::= { scope exits }
scope ::= open enables statementlist
scope ::= open enables declist ; statementlist
binditem ::= exp
binditem ::= id ~ ~ exp
binditem ::= id : exp
exits ::= EXITS exitlist
casestmtitem ::= caselabel => statement
caseexpitem ::= caselabel => exp
exititem ::= idlist => statement
casetest ::= optrelation
casetest ::= exp
caselabel ::= ident typeexp
controlid ::= ident typeexp
forclause ::= FOR controlid ← exp , exp
forclause ::= FOR controlid direction IN range
forclause ::= THROUGH range
direction ::=
direction ::= DECREASING
dotest ::= UNTIL exp
doexit ::= REPEAT exitlist
doexit ::= REPEAT exitlist FINISHED => statement
doexit ::= REPEAT exitlist FINISHED => statement ;
enables ::= ENABLE catchcase ;
enables ::= ENABLE catchany ;
enables ::= ENABLE BEGIN catchlist END ;
enables ::= ENABLE { catchlist } ;
catchlist ::= catchhead catchcase
catchcase ::= lhslist => statement
optargs ::= [ explist ]
optargs ::=
transfer ::= SIGNAL
transfer ::= ERROR
transfer ::= RETURN WITH ERROR
transfer ::= START
transfer ::= RESTART
transfer ::= JOIN
transfer ::= NOTIFY
transfer ::= BROADCAST
keyitem ::= id ~ optexp
keyitem ::= id : optexp
defaultopt ::= trash
optexp ::= trash
initvalue ::= trash
defaultopt ::= exp '| trash
exp ::= IF exp THEN exp ELSE exp
exp ::= casehead caseexplist ENDCASE => exp
exp ::= lhs ← exp
exp ::= [ explist ] ← exp
exp ::= ERROR
disjunct ::= disjunct OR conjunct
conjunct ::= conjunct AND negation
negation ::= ~ relation
negation ::= NOT relation
relation ::= sum optrelation
sum ::= sum addop product
product ::= product multop factor
optrelation ::= NOT relationtail
relationtail ::= IN range
relop ::= =
relop ::= #
relop ::= <
relop ::= <=
relop ::= >
relop ::= >=
addop ::= +
addop ::= -
multop ::= *
multop ::= /
multop ::= MOD
factor ::= primary ** factor
factor ::= addop primary
primary ::= [ explist ]
primary ::= prefixop [ orderlist ]
primary ::= VAL [ orderlist ]
primary ::= ALL [ orderlist ]
primary ::= new [ typeexp initialization optcatch ]
primary ::= cons [ explist optcatch ]
primary ::= listcons [ explist ]
primary ::= NIL
primary ::= typeop [ typeexp ]
exp ::= transferop lhs
qualifier ::= . prefixop
qualifier ::= . typeop
primary ::= BITS [ typeexp ]
qualifier ::= . BITS
primary ::= BITS [ typeexp , exp ]
primary ::= BYTES [ typeexp ]
qualifier ::= . BYTES
primary ::= BYTES [ typeexp , exp ]
primary ::= UNITS [ typeexp ]
qualifier ::= . UNITS
primary ::= UNITS [ typeexp , exp ]
primary ::= SIZE [ typeexp ]
qualifier ::= . SIZE
primary ::= SIZE [ typeexp , exp ]
primary ::= WORDS [ typeexp ]
qualifier ::= . WORDS
primary ::= WORDS [ typeexp , exp ]
primary ::= ISTYPE [ exp , typeexp ]
primary ::= @ lhs
primary ::= DESCRIPTOR [ desclist ]
lhs ::= id
element ::= id
ident ::= id :
controlid ::= id
lhs ::= num
lhs ::= string
lhs ::= lnum
lhs ::= flnum
lhs ::= char
lhs ::= lstring
lhs ::= atom
lhs ::= NARROW [ exp opttype optcatch ]
lhs ::= LOOPHOLE [ exp opttype ]
lhs ::= APPLY [ exp , exp optcatch ]
qualifier ::= [ explist optcatch ]
qualifier ::= . id
qualifier ::= ^
optcatch ::= ! catchlist
transferop ::= SIGNAL
transferop ::= ERROR
transferop ::= START
transferop ::= JOIN
transferop ::= NEW
transferop ::= FORK
prefixop ::= LONG
prefixop ::= ABS
prefixop ::= PRED
prefixop ::= SUCC
prefixop ::= ORD
prefixop ::= MIN
prefixop ::= MAX
prefixop ::= BASE
prefixop ::= LENGTH
typeop ::= CODE
typeop ::= FIRST
typeop ::= LAST
typeop ::= NIL
desclist ::= exp , exp opttype
directory ::= DIRECTORY ;
imports ::= IMPORTS
exports ::= EXPORTS
fieldlist ::= [ ]
new ::= NEW
free ::= FREE
cons ::= CONS
listcons ::= LIST
pointerprefix ::= POINTER
catchlist ::= catchhead
using ::= USING [ ]
defaultopt ::=
casestmtlist ::=
catchhead ::= includeitem
modulelist ::= moduleitem
declist ::= declaration
pairlist ::= pairitem
elementlist ::= element
variantlist ::= variantitem
bindlist ::= binditem
statementlist ::= statement
casestmtlist ::= casestmtitem
caselabel ::= casetest
exitlist ::= exititem
lhslist ::= lhs
orderlist ::= optexp
keylist ::= keyitem
caseexplist ::= caseexpitem
includelist ::= includelist , includeitem
modulelist ::= modulelist , moduleitem
declist ::= declist ; declaration
pairlist ::= pairlist , pairitem
elementlist ::= elementlist' , element
variantlist ::= variantlist , variantitem
bindlist ::= bindlist , binditem
statementlist ::= statementlist' ; statement
casestmtlist ::= casestmtlist' ; casestmtitem
caselabel ::= caselabel' , casetest
exitlist ::= exitlist' ; exititem
catchhead ::= catchhead catchcase ;
lhslist ::= lhslist , lhs
orderlist ::= orderlist , optexp
keylist ::= keylist , keyitem
caseexplist ::= caseexplist' , caseexpitem
idlist ::= idlist'
identlist ::= identlist'
explist ::= orderlist
explist ::= keylist
caselabel ::= caselabel'
directory ::= DIRECTORY includelist ;
imports ::= IMPORTS modulelist
exports ::= EXPORTS modulelist
open ::= OPEN bindlist ;
fieldlist ::= [ pairlist ]
fieldlist ::= [ typelist ]
class ::= PROGRAM
safe ::= UNSAFE
initialization ::= ← initvalue
casehead ::= SELECT exp FROM
class ::= MONITOR
safe ::= SAFE
readonly ::= READONLY
reclist ::= [ variantpair ]
ordered ::= ORDERED
base ::= BASE
heap ::= UNCOUNTED
initialization ::= bindop initvalue
inline ::= INLINE
optargs ::= lhs
casehead ::= WITH binditem SELECT optexp FROM
readonly ::= USING [ idlist ]
interface ::= imports exports shares
shares ::= SHARES idlist
bindop ::= ~
bindop ::= =
typeid ::= typeid'
typeexp ::= typeid
typeexp ::= typecons
typecons ::= typeappl
optsize ::= [ exp ]
elementlist ::= elementlist'
length ::= [ exp ]
default ::= ← defaultopt
defaultopt ::= exp
tagtype ::= typeexp
pointerprefix ::= POINTER interval
indextype ::= typeexp
arguments ::= arglist returnlist
arglist ::= fieldlist
returnlist ::= RETURNS fieldlist
initvalue ::= exp
statement ::= basicstmt
balstmt ::= basicstmt
dotest ::= WHILE exp
catchany ::= ANY => statement
catchlist ::= catchhead catchany
catchlist ::= catchhead catchany ;
statementlist ::= statementlist'
statementlist ::= statementlist' ;
casestmtlist ::= casestmtlist'
casestmtlist ::= casestmtlist' ;
exitlist ::= exitlist'
exitlist ::= exitlist' ;
caseexplist ::= caseexplist'
caseexplist ::= caseexplist' ,
trash ::= TRASH
trash ::= NULL
optexp ::= exp
exp ::= disjunct
disjunct ::= sum
optrelation ::= relationtail
relationtail ::= relop sum
range ::= interval
range ::= typeid
bounds ::= exp .. exp
sum ::= lhs
desclist ::= exp
lhs ::= ( exp )
lhs ::= lhs qualifier
new ::= lhs . NEW
free ::= lhs . FREE
cons ::= lhs . CONS
listcons ::= lhs . LIST
opttype ::= , typeexp
directory ::=
using ::=
locks ::=
lambda ::=
imports ::=
exports ::=
shares ::=
optsize ::=
optbits ::=
default ::=
open ::=
returnlist ::=
indextype ::=
dotest ::=
optexp ::= CHECKED
checked ::= TRUSTED
checked ::= UNCHECKED