compiler-design-eth/javali_tests/HW2_nop90/Statements.javali

34 lines
731 B
Text
Raw Permalink Normal View History

2020-01-15 22:30:09 +01:00
/* testing different statements
'condition' is not initialized
*/
class Main {
void main() {
if (condition) {
instructions();
asd.b = c;
if (cond2) {
} else {
nonEmptyBlock = a;
}
} else {
}
// Whiles
while (condition) {
while (anotherLoop == false) {
nestedLoops();
}
}
while (false) {} // emptyloop
// Returns
return; // empty
return expr; // with expressions (expressions already tested)
return array[index];
// Writes
write(a);
write(9 + 10);
writeln();
write(call());
}
}