FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
MiniJava-Compiler/test/src9 at main · ron-che-debugger/MiniJava-Compiler · GitHub
ron-che-debugger
/
MiniJava-Compiler
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
MiniJava-Compiler
/
test
/
src9
Copy path
More file actions
More file actions
Latest commit
History
History
History
75 lines (70 loc) · 1.22 KB
Breadcrumbs
MiniJava-Compiler
/
test
/
src9
Copy path
File metadata and controls
75 lines (70 loc) · 1.22 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
/* EXAMPLE 4: Two classes this time */
program x4;
class Point0 {
declarations
int[] parr0 = int [12];
int x = 5, y;
enddeclarations
method void f0()
{
system.println('Before x=');
system.println(x);
x := x*x;
y := 1;
while (y<12)
{
parr0[y] := parr0[y-1]+1;
y := y+1;
};
system.println('After x=');
system.println(x);
}
}
class Point1 {
declarations
int t1 = 12;
Point0 p1;
enddeclarations
method void f1()
{
system.println('Before t1=');
system.println(t1);
t1 := 1024;
p1.f0();
system.println('After t1=');
system.println(t1);
}
}
class Point2 {
declarations
Point1 p21;
Point0 p20;
int xy;
enddeclarations
method void main()
declarations
int xx = 22;
Point1 px;
enddeclarations
{
Point0.f0();
p21.f1();
px.p1.x := xx;
px.p1.f0();
p21.t1 := 133;
p21.f1();
system.println('p21.p1.x=');
system.println(p21.p1.x);
p20.f0();
xy := 0;
while (xy <12)
{
system.println('p20.parr0:');
system.println(p20.parr0[xy]);
xy := xy+1;
};
Point1.f1();
system.println('p20.x=');
system.println(p20.x);
}
}
Back
|
FazBrowse Home
|
New Git URL