Homework 3

This commit is contained in:
Carlos Galindo 2020-01-15 22:32:25 +01:00
parent bf60a078d7
commit 0afc86ceeb
Signed by: kauron
GPG key ID: 83E68706DEE119A3
129 changed files with 3163 additions and 4316 deletions

View file

@ -0,0 +1,19 @@
// call an method that does not exist (even in superclass)
class Main extends Other {
void main() {
aux();
go();
}
void aux() {}
}
class Other {
void aux() {}
void otherAux() {}
void noGo() {}
void GO() {}
void gO() {}
void Go() {}
}

View file

@ -0,0 +1,6 @@
// No such type in method body (handled by TypeGenerator)
class Main {
void method(NoSuchType param) {}
void main() {}
}

View file

@ -0,0 +1,5 @@
// No such type in method body (handled by checkCircularInheritance)
class Main extends NoSuchType {
void main() {}
}

View file

@ -0,0 +1,8 @@
// No such type in method body (handled by ExprVisitor and StmtVisitor)
class Main {
void main() {
Object a;
write((NoType) a);
}
}

View file

@ -0,0 +1,28 @@
// Test NO SUCH VARIABLE
// All referenced variables must exist.
class Main extends Other {
int a;
int b;
int C;
Object notC;
void main() {
int a;
boolean b;
write(c + 1);
}
}
class Other {
boolean a;
boolean b;
boolean C;
Object[] notC;
void main() {
int a;
boolean b;
Object c;
}
}