-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestProcFunctions
More file actions
97 lines (82 loc) · 1.3 KB
/
testProcFunctions
File metadata and controls
97 lines (82 loc) · 1.3 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
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
/*fac loop (p.23)*/
y:=1;
while !(x=1) do (
y:=y*x;
x:=x-1
)
//scope test (p.53)
y := 1;
x := 8;
z := 2;
begin
var x := 0;
begin
var x := 5;
y := x
end
end
"y := 1;\nx := 8;\nz := 2;\nbegin\n var x := 0;\n begin\n var x := 5;\n y := x\n y := x\n end\nend"
x := 8;
y := 1;
z := 2;
begin
var x := 5;
y := x
end
"x := 8;\ny := 1;\nz := 2;\nbegin\n var x := 5;\n y := x\nend"
begin
var x := 0;
x := 1
end
"begin\n var x := 0;\n x := 2\nend"
x := 1;
begin
var y := 10;
proc p is (x := x * 10);
call p
end
"x := 1;\nbegin\nvar y := 10;\nproc p is (x := x * 10);\ncall p\nend"
"x := 1"
//scope test (p.53)
begin
var x:=0;
proc p is (x:=x*2);
proc q is (call p);
begin
var x:=5;
proc p is (x:=x+1);
call q;
y:=x
end
end
"begin proc p is (call p); call p end"
"begin\n var x:=0;\n proc p is x:=x*2;\n proc q is call p;\n begin\n var x:=5;\n proc p is (x:=x+1);\n call q;\n y:=x\n end\nend"
//scope test (p.53)
y := 1;
x := 8;
z := 2;
begin
var x := 0;
proc p is x := x*2;
begin
var x := 5;
y := x;
proc q = call p
call q
end
end
//fac_call
begin
proc fac is
begin
var z:=x;
if x=1 then
skip
else (
x:=x-1;
call fac;
y:=z*y )
end;
(y:=1;
call fac)
end