forked from tobydennison/WHILE-Syntax-Highlighter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreference.while
44 lines (40 loc) · 1.08 KB
/
reference.while
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
(* reference.while
Reference for highlighting
Bernhard Reus 15.2.2020
*)
reference read X {
//comment
X:= <pred> X;
Y:= tl 23;
Z:= [@while,[@var,0],[]];
Z:= (X=Y);
if Z {
A := [12,X,Y]
}
else { Z := nil
};
Z:= hd Z;
Z:= cons 3 cons true Z;
Z:= cons hd hd hd X cons Y nil;
switch hd Z {
case @doHd: A:= true
case @doTl: A:= false
case @doCons: A := cons (cons A nil) (tl tl A)
case @doAsgn: X := hd tl A
case @dowhile: if (hd Z) = A
{ Z := 0
B:= hd tl tl A;
B := <reverse> cons Z B; // reverse comment
while B
{
}
} else
{ A := 3545875847
}
case @doIf: A := [1,2,3]
case @:= : Z:= [true,true,<nil.nil>,@doHd]
default : Z:= [cons nil 3,true,false,42]
}; // end switch
A := [<nil.nil>, <nil.<nil.nil>>,nil]
}
write Z