CS143-Lab/assignments/PA5/example.cl
2023-03-29 16:09:53 +00:00

46 lines
671 B
Common Lisp

(* Example cool program testing as many aspects of the code generator
as possible.
*)
class A inherits IO {
attr_A_1 : Int <- 10;
attr_A_2 : Bool <- false;
attr_A_3 : A <- self;
method_common(x1: Int) : SELF_TYPE {
self
};
method_common2() : String {
"A"
};
};
class B inherits A {
};
class C inherits A {
attr_C_1 : String <- "This is C\n";
attr_C_2 : SELF_TYPE;
method_common(x1: Int) : SELF_TYPE {
self
};
method_common2() : String {
"C"
};
method_1(x1: Int) : Bool {
true
};
};
class D inherits C {
method_common(x1: Int) : SELF_TYPE {
self
};
};
class Main inherits IO {
main():Int { 0 };
};