-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsyntax6
107 lines (77 loc) · 2.47 KB
/
syntax6
1
2
3
4
5
6
7
8
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
From [email protected] Mon Feb 27 11:04:14 1995
Date: Mon, 27 Feb 95 11:04:12 CST
From: [email protected] (Bruce Duba)
Subject: [[email protected]: Returned mail: User unknown]
Date: Mon, 27 Feb 95 09:54:28 CST
From: [email protected] (Mail Delivery Subsystem)
Subject: Returned mail: User unknown
----- Transcript of session follows -----
550 mathias... User unknown
----- Unsent message follows -----
Received: by aten.cs.rice.edu (AA06247); Mon, 27 Feb 95 09:54:28 CST
Date: Mon, 27 Feb 95 09:54:28 CST
From: duba (Bruce Duba)
Message-Id: <[email protected]>
To: mathias, shriram
Subject: modified syntax
<defn> := <id> = <expr>
| <id> ( <formals> ) = <expr>
| <id> ( <formals> ) : <id>
<formals> := epsilon
| <id> { , <id> }*
<inits> := epsilon
| <id> = <expr> { , <id> = <expr> }*
<args> := epsilon
| <expr> { , <expr> }*
<lval> := <id>
| <id> [ <args> ]
<expr> := <constant>
| <id>
| <id> ( <args> )
| <id> [ <args> ]
| <prim>
| <prim> ( <args> )
| if <expr> then <expr> { elseif <expr> then <expr> }*
( { else <expr> } | { done } )
| let <defn>* in <expr>
| do <args> and <expr>
| set <lval> to <expr>
| call <id> ( <inits> ) = <expr>
| <uop> <expr>
| <expr> <bop> <expr>
| [ <args> { ; <args> }* ]
| ( <expr> )
<uop> := - | + | ~
<bop> := + | - | * | / | ^ | = | <= | >= | =/= | < | > | & | |
<prim> := tuple? | tabulate | size(?)
| array? | array | size(?)
| symbol?
| number? | zero? | positive? | odd? | sqrt | log
| sin | cos | tan | atan
? | list? | null? | pair? | cons | car | cdr
| function?
| equal?
<constant> := true | false
| <symbol>
| <string>
| <number>
| empty
<symbol> := ` <char>* '
<string> := " <char>* "
<char> := <charset> \ { \ , ` , ' , " , tab , newline}
| \\ | \` | \'| \" | \n | \t
<number> := <real>
| <imag>
<imag> := <real> i
<real> := <sign> <ureal>
<sign> := epsilon | + | -
<ureal> := <int>
| . <digit>+ <suffix>
| <digit>+ . <digit>* <suffix>
<int> := <digit>+ <suffix>
<suffix> := epsilon
| e <sign> <digit>+
<digit> := 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
where <charset> is currently left unspecified.