Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Barrett G.Occam 3 reference manual.1992

.pdf
Источник:
Скачиваний:
9
Добавлен:
23.08.2013
Размер:
1.56 Mб
Скачать

guard

hex.digit

import.item

input.item

input

instance

integer

interface.type

literal

|

input

boolean & input

|

boolean & SKIP

|

ACCEPT call.channel ( , call.formal

 

process

|

boolean & ACCEPT call.channel ( ,

 

process

|

GRANT channel

 

process

|

boolean & GRANT channel

 

process

digit | A | B | C | D | E | F

|

name

name AS name

|

variable

variable :: variable

|

channel ? 1 ; input.item

channel ? CASE tagged.list

|

timer.input

|

delayed.input

|

port ? variable

)

call.formal )

name ( 0 , actual

)

 

 

digits | #hex.digits

name

|

integer

 

byte

 

|

integer(decoration)

 

|

byte(decoration)

 

|

real(decoration)

 

|

string

 

|

TRUE | FALSE

 

|

[](NONE)

 

|

[ 1 , expression

]

|

[ , expression

](decoration)

|

[VAL replicator : expression]

|

( name :- expression ) (decoration)

DRAFT --- March 31, 1992

loop

module.specifier

module

operand

option

output.item

output

parallel

 

WHILE boolean

process

 

|

MODULE

MODULE interface.type

|

name

module[expression]

|

INSTANCE name( 0, actual )

|

[ 1, module ]

|

[module FROM base FOR count ]

|

[module FROM base ]

|

[module FOR count ]

|

[INSTANCE replicator : module ]

|

CONVERT(interface.specifier) module

|

variable

literal

|

table

|

(expression)

|

( value.process

 

)

 

|

name ( 0 , expression )

 

1 , case.expression

process

 

|

ELSE

 

process

|

specification

 

option

|

expression

expression :: expression

|

channel ! 1 ; output.item

channel ! tag

|

channel ! tag ; 1 ; output.item

|

port ! expression

 

PAR

 

 

process

 

|

PAR replicator

 

process

|

PRI PAR

 

 

process

|

PRI PAR replicator

 

process

|

placedpar

DRAFT --- March 31, 1992

placedpar

port.type

port

process

protocol

real

 

PLACED PAR

placedpar

 

|

PLACED PAR replicator

 

placedpar

|

PROCESSOR expression

 

process

|

PORT OF data.type

[expression]port.type

|

name

port[expression]

|

[port FROM base FOR count]

|

[port FROM base ]

|

[port FOR count]

 

CASETAG expression

discriminant

 

|

allocation :

 

process

|

assignment

|

input

|

output

|

SKIP

|

STOP

|

instance

|

sequence

|

conditional

|

selection

|

loop

|

parallel

|

alternation

|

specification

 

process

|

ACCEPT call.channel ( , call.formal )

 

process

|

CLAIM channel

 

process

|

GRANT channel

 

process

|

call.channel ( 0, call.actual )

|

case.input

|

name

simple.protocol

digits.digits | digits.digits Eexponent

DRAFT --- March 31, 1992

replicator

selection

selector

sequence

sequential.protocol

shared.call

shared.channels

simple.protocol

specification

specifier

name = base FOR count

CASE selector

 

option

 

 

 

expression

 

SEQ

 

 

process

 

|

SEQ replicator

 

process

 

1 ; simple.protocol

 

 

|

SHARED CALL

[expression]shared.call

|

SHARED name

[expression]shared.channels

|

data.type

data.type::[]data.type

|

declaration

abbreviation

|

definition

|

EXPORT

 

 

export.item

 

FROM

 

 

specification

 

:

 

|

call.type

channel.type

|

data.type

|

timer.type

|

[]specifier

|

[expression]specifier

DRAFT --- March 31, 1992

structured.type

table

tagged.list

tagged.protocol

tag

timer.input

timer.type

timer

valof

value.process

 

RECORD

data.type 1, field.name :

 

|

UNION

 

data.type 1, name :

|

RECORD

 

PLACE data.type name OFFSET expression :

|

UNION

 

data.type 1 , (expression) name :

|

table [ subscript ]

[ 1 , expression ]

|

[ table FROM subscript FOR count ]

|

[ table FROM subscript ]

|

[ table FOR count ]

|

tag

tag ; 1 ; input.item

|

tag

tag ; sequential.protocol

name

timer ? variable

|

[expression]timer.type

TIMER

|

name

timer[expression]

|

[timer FROM base FOR count]

|

[timer FROM base]

|

[timer FOR count]

specification valof

VALOF process

RESULT expression.list | specification

value.process

DRAFT --- March 31, 1992

variable.list

variable

variant

|

|

|

|

|

|

1 , variable

variable[name]

[ variable FROM base FOR count ] [ variable FOR count ]

[ variable FROM base ] variable[expression]

specification variant tagged.list

process specification variant

DRAFT --- March 31, 1992

K Keywords and symbols

This section provides a complete list of occam symbols and keywords.

ACCEPT

call channel body

AFTER

later than operator

ALT

alternation

AND

boolean and operator

ANY

anarchic protocol

AS

import renaming

AT

at location

BITAND

bitwise and operator

BITNOT

bitwise not operator

BITOR

bitwise or operator

BOOL

boolean type

BYTE

byte type

WIDTHOF

data type width

CALL

call channel type

CASE

selection, variant protocol, case input

CASETAG

union type discriminator

CHAN OF

channel type

CLAIM

claim of shared channel

CONVERT

data type conversion

DATA

data type definition

ELSE

default selection

EXPORT

library export

FALSE

boolean constant

FINAL

finalised declaration, finalisation process

FOR

count

FROM

base

FUNCTION

function definition

GRANT

grant of shared channel

IF

conditional

IMPORT

import from library

INITIAL

initialised declaration, initialisation process

INSTANCE

module instance

INT

integer type

INT16

16bit integer type

INT32

32bit integer type

INT64

64bit integer type

INTERFACE

module interface

IS

specification introduction

MINUS

modulo subtraction/negation operator

MODULE

module

 

 

 

 

MOSTNEG

most negative

MOSTPOS

most positive

NAME

type name exported from library

NONE

data type with no content

NOT

boolean not operator

OFFSET

record layout

OR

boolean or operator

PAR

parallel

PLACE

allocation

PLACED

placed processes

PLUS

modulo addition operator

PORT OF

port type

PRI

prioritised construction

PROC

procedure

PROCESSOR

processor allocation

PROTOCOL

protocol definition

REAL32

32bit real type

REAL64

64bit real type

RECORD

record type

REM

remainder operator

RESOURCE

resource process

RESULT

value process result

RETYPES

retyping conversion

ROUND

rounding operator

SEQ

sequence

SERVER

server declaration

SHARED

channel type modifier

SIZE

array size operator

SKIP

skip process

STOP

stop process

TIMER

timer type

TIMES

modulo multiplication operator

TO

 

TRUE

boolean constant

TRUNC

truncation operator

TYPE

type definition

UNION

union type

VAL

value

VALOF

value process

WHILE

loop

WIDTH

data type width specification

 

 

If an implementation adds further reserved words, then the names used must not include lower case letters.

DRAFT --- March 31, 1992

Arithmetic operators

Communication symbols

+

plus

!

Input

-

minus

?

Output

*

times

 

 

Other symbols

/

divide

#

Hexadecimal

\

remainder

&

Ampersand; used in a guard

 

 

Bit operators

(

Parentheses; used to delimit expressions,

/\

and

)

the type of literals and a parameter list

\/

or

[

Square brackets; used to delimit array subscripts,

><

exclusive or

]

and to construct segments and tables

~

not

[]

Array type specifier

<<

left shift

::

Counted array communication

>>

right shift

:=

Assignment symbol

 

 

 

Double quote; used to construct a string byte table

Relational operators

"

 

 

Single quote; used to delimit character byte literal

=

equal

<

less than

,

Separator for specifications, parameters, and table

>

greater than

;

Sequential protocol separator

<=

less than or equal to

:

Specification terminator

>=

greater than or equal to

--

Comment introduction

<>

not equal

:-

Union type literal constructor

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DRAFT --- March 31, 1992

L Character set

Characters in occam are represented according to the American Standard Code for Information Interchange (ASCII). Where the full character set is not available occam guarantees the following subset:

ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 !"#&’()*+,-./:;<=>?[]

For reference, here is a table of all printable ASCII characters, and their values:

ASCII

Dec

Hex

 

ASCII

Dec

Hex

 

ASCII

Dec

Hex

SPACE

32

20

 

@

64

40

 

96

60

!

33

21

 

A

65

41

 

a

97

61

"

34

22

 

B

66

42

 

b

98

62

#

35

23

 

C

67

43

 

c

99

63

$

36

24

 

D

68

44

 

d

100

64

%

37

25

 

E

69

45

 

e

101

65

&

38

26

 

F

70

46

 

f

102

66

39

27

 

G

71

47

 

g

103

67

(

40

28

 

H

72

48

 

h

104

68

)

41

29

 

I

73

49

 

i

105

69

*

42

2A

 

J

74

4A

 

j

106

6A

+

43

2B

 

K

75

4B

 

k

107

6B

,

44

2C

 

L

76

4C

 

l

108

6C

-

45

2D

 

M

77

4D

 

m

109

6D

.

46

2E

 

N

78

4E

 

n

110

6E

/

47

2F

 

O

79

4F

 

o

111

6F

0

48

30

 

P

80

50

 

p

112

70

1

49

31

 

Q

81

51

 

q

113

71

2

50

32

 

R

82

52

 

r

114

72

3

51

33

 

S

83

53

 

s

115

73

4

52

34

 

T

84

54

 

t

116

74

5

53

35

 

U

85

55

 

u

117

75

6

54

36

 

V

86

56

 

v

118

76

7

55

37

 

W

87

57

 

w

119

77

8

56

38

 

X

88

58

 

x

120

78

9

57

39

 

Y

89

59

 

y

121

79

:

58

3A

 

Z

90

5A

 

z

122

7A

;

59

3B

 

[

91

5B

 

{

123

7B

<

60

3C

 

\

92

5C

 

|

124

7C

=

61

3D

 

]

93

5D

 

}

125

7D

>

62

3E

 

^

94

5E

 

~

126

7E

?

63

3F

 

_

95

5F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The characters *, and " may not be used directly in strings or as character constants. These and nonprintable characters (such as carriage return, tab &c.) can be included in strings, or used as character

DRAFT --- March 31, 1992

constants, in the following form:

*c

*C

carriage return

= *#0D

*n

*N

newline

= *#0A

*t

*T

tab

= *#09

*s

*S

space

= *#20

*’

 

quotation mark

 

*"

 

double quotation mark

 

**asterisk

In addition, any byte value can be represented by *# followed by two hexadecimal digits, for example:

soh := ’*#01’ ’*#01’ is a byte constant.

DRAFT --- March 31, 1992