compiler-design-eth/javali_tests/HW4_nop90/OkAssignments.javali

35 lines
621 B
Text
Raw Permalink Normal View History

2020-01-15 22:34:57 +01:00
/* testing assign statements*/
class Main {
int methodCall() { return 0; }
int methodCall2(int a, int b) {
if (a >= b) {
return 0;
} else {
if (b <= a) {
return 1;
}
}
return a * b;
}
void main() {
int a, b, c, e;
Ast d;
int[] g;
Object f;
a = read();
b = methodCall();
c = methodCall2(a, b);
d = new Ast();
e = d.field;
g = new int[a];
f = new Object[a];
f = g;
g = (int[]) f;
}
}
class Ast {
int field;
}