-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME
More file actions
42 lines (35 loc) · 1.19 KB
/
README
File metadata and controls
42 lines (35 loc) · 1.19 KB
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
==========================================
CS240H Final Project - Historical Debugger
==========================================
authors: Daniel Sommermann, Michael Gummelt
For this project, we define a toy language to implement our debugger
on. The BNF of the language is given below:
f = fn(x1, .., xn) { s; [s;] }
s = var = e
return e
returnif e, e
e = c1 | ... | cn (constants)
(e)
x
e1 + e2
e1 - e2
e1 * e2
e1 / e2
e1 == e2
!e1
e1 && e2
e1 || e2
e1 == e2
e1 < e2
e1 > e2
if e1 then e2 else e3
f(e1, ..., en)
Every function must return a value (that is, have a return
statement). Explicitly, there must always be some return statement that is
executed. The function can return early through the use of a
returnif(). If the first argument to returnif is non-zero, the second
argument is evaluated and returned. The return keyword may only be used as
the last statement in a function body.
e interpreter. Also changed the semantics and grammar of the language (added assignment and return statements)
There must be exactly one function called 'main' in every text file. The
value of the return of main will be printed once it has been computed.