.pn 43
.bp
.SZ 10 13
.HD
.fo ''- % - ''
.ce
\fBAppendix 1 \(em A Synopsis of the SR Language\fR
.sp 1.5
.lp
The general forms of the main SR constructs
are summarized below.
In this appendix, commonly omitted optional items are enclosed in brackets,
and plurals and ellipses are used to indicate zero
or more occurrences of items.
The syntax supports more flexibility than is shown here.
For example, items in components and blocks may appear in any order
and may be intermixed.
Numbers in parentheses indicate the section in the report
in which each construct is defined precisely.
.sp
.(b L
.ta 2.25i
Components (2)

     global (2.1)  	@global@ identifier
                   	     constants, types, and operation types
                   	@end@ [identifier]
.)b
.(b L
     simple combined resource (2.2)  	@resource@ identifier([parameters])
                                     	     declarations
                                     	     procs and processes
                                     	@end@ [identifier]
.)b
.(b L
     general combined resource (2.2) 	@resource@ identifier
                       	     @import@ or @extend@ component_identifiers
                             	     constants, types, or operations
                             	@body@ identifier([parameters])
                             	     [@import@ component_identifiers]
                             	     declarations
                             	     [@initial@ block @end@]
                             	     procs and processes
                             	     [@final@ block @end@]
                             	@end@ [identifier]
.)b
.(b L
     abstract spec (2.2.1)  	@resource@ identifier
                            	     @import@ or @extend@ component_identifiers
                            	     constants, types, or operations
                            	@end@ [identifier]
.)b
.(b L
     separate concrete spec (2.2.1)  	@resource@ identifier
                            	     @import@ or @extend@ component_identifiers
                            	     constants, types, or operations
                            	@body@ identifier([parameters]) @separate@
.)b
.(b L
     separate resource body (2.2.2)  	@body@ identifier
                                     	     [@import@ component_identifiers]
                                     	     declarations
                                     	     [@initial@ block @end@]
                                     	     procs and processes
                                     	     [@final@ block @end@]
                                     	@end@ [identifier]
.)b
.(b L
     block (2.2.2)    	declarations
                      	statements

.)b
.(b L
Types and Declarations (3)

     basic types (3)  	@bool@, @int@, @char@, @string@(integer_expression)

     type declaration (3.1)        	@type@ identifier @=@ type_definition
.)b
.(b L
     type definition (3.1)	@enum@(enumeration literals)
                           	@string@(integer_expression
                            	@rec@(field definitions)
                            	@ptr@ type or @ptr any@
                           	@cap@ resource or operation or operation type
.)b
.(b L
     constant (3.2)  	@const@ identifier [subscripts] [@:@ type] @:=@ expression

     uninitialized variable (3.2)   	@var@ identifier[subscripts]@,@ ... @:@ type

     initialized variable (3.2)   	@var@ identifier[subscripts] [@:@ type] @:=@ expression
.)b
.(b L
     operation type (3.3)	@optype@ identifier [@=@] ([parameters]) [@returns@ result]

     operation (3.4)   	@op@ identifier[subscripts] ([parameters]) [@returns@ result]
                 	@op@ identifier[subscripts] [@:@] optype_identifier
                     	@sem@ identifier[subscripts]

.)b
.(b L
.ta 2.25i
Procs and Processes (4)

     proc (4.1)    	@proc@ identifier([formal_identifiers]) [@returns@ result_identifier]
                   	     block
                   	@end@ [identifier]

     process (4.2)  	@process@ identifier[(quantifiers)]
                    	     block
                    	@end@ [identifier]
.)b
.(b L
.ta 2.25i
Sequential Statements (5)

     skip (5.1)         	@skip@

     stop (5.2)            	@stop@ [(expression)]
.)b
.(b L
     assignment (5.3)     	variable  @:=@  expression
                            	variable @++@
                            	variable @--@
                            	variable  @:=:@  variable
.)b
.(b L
     alternation (5.4)    	@if@ boolean_expression @->@ block @[]@ ... @fi@
.)b
.(b L
     iteration (5.5)      	@do@ boolean_expression @->@ block @[]@ ... @od@
                            	@fa@ quantifiers @->@ block @af@
                            	@exit@
                            	@next@

     quantifier (5.5)         	bound_variable @:=@ expr1 direction expr2 [@st@ bool_expr]

.)b
.(b L
.ta 2.25i
Interaction Statements (6)

     operation invocation (6.1)     	[@call@] operation([actuals])
                                   	@send@ operation([actuals])
                                 	@V@(semaphore)
.)b
.(b L
     operation implementation (6.2) 	@in@ [(quantifier)] operation([formal_identifiers])
                    	            [@and@ boolean_expression] [@by@ expression] @->@
                    	                block @[]@ ... @ni@
                    	@receive@ operation([variables])
                  	@P@(semaphore)
                    	@return@
                    	@reply@
.)b
.(b L
     resource control (6.3)	capability := @create@ resource_id([actuals]) [@on@ virtual_machine]
           	capability := @create@ @vm()@ [@on@ physical_machine]
                     	@destroy@  capability

     concurrent invocation (6.4) 	@co@ [(quantifiers)] invocation [@->@ block] @//@ ... @oc@
.)b
.sp
.(b L
.ta .5i,2.5i,4.5i
Keywords

	@EOF@  (8)        	@file@  (8)      	@receive@  (6.2)
	@af@  (5.5)      	@final@  (2.2.2)  	@reply@  (6.2)
	@and@  (7.4)     	@global@  (2.1)  	@res@  (3.4)
	@any@  (3.1)     	@if@  (5.4)      	@resource@  (2.2)
	@body@  (2.2)    	@import@  (2.2.1)	@return@  (6.2)
	@bool@  (3)      	@in@  (6.2)      	@returns@  (3.4)
	@by@  (6.2)      	@initial@  (2.2.2)	@sem@  (3.4)
	@call@  (6.1)     	@int@  (2)        	@send@  (6.1)
	@cap@  (3.1)     	@new@  (7.5)     	@separate@  (2.2)
	@char@  (3)      	@next@  (5.5)    	@skip@  (5.1)
	@co@  (6.4)      	@ni@  (6.2)      	@st@  (5.5)
	@const@  (3.2)    	@noop@  (7.2)     	@stderr@  (8)
	@create@  (6.3)   	@not@  (7.4)     	@stdin@  (8)
	@destroy@  (6.2) 	@null@  (7.2)    	@stdout@  (8)
	@do@  (5.5)      	@oc@  (6.4)      	@stop@  (5.2)
	@downto@  (5.5)  	@od@  (5.5)        	@string@  (3)
	@else@  (5.4)    	@on@  (6.3)      	@to@  (5.5)
	@end@  (2)        	@op@  (3.4)      	@true@  (7.2)
	@enum@  (3.1)     	@optype@  (3.3)  	@type@  (3.1)
	@exit@  (5.5)    	@or@  (7.4)       	@V@  (6.1)
	@extend@  (2.2.1)	@P@  (6.2)       	@val@  (3.4)
	@external@  (8.3)	@proc@  (4.1)     	@var@  (3.4)
	@fa@  (5.5)      	@process@  (4.2)  	@xor@  (7.4)
	@false@  (7.2)   	@ptr@  (3.1)
	@fi@  (5.4)      	@rec@  (3.1)
.)b
