From 967be9e750221ab2ab783f95df79bb26d290a45e Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:07:58 +0200 Subject: add: added projects --- tiger-compiler/src/type/nil.cc | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tiger-compiler/src/type/nil.cc (limited to 'tiger-compiler/src/type/nil.cc') diff --git a/tiger-compiler/src/type/nil.cc b/tiger-compiler/src/type/nil.cc new file mode 100644 index 0000000..d3c663c --- /dev/null +++ b/tiger-compiler/src/type/nil.cc @@ -0,0 +1,34 @@ +/** + ** \file type/nil.cc + ** \brief Implementation for type/nil.hh. + */ + +#include + +#include +#include +#include +#include + +namespace type +{ + /*------. + | Nil. | + `------*/ + + void Nil::accept(ConstVisitor& v) const { v(*this); } + + void Nil::accept(Visitor& v) { v(*this); } + + bool Nil::compatible_with(const Type& other) const + { + // FIXME DONE: Some code was deleted here + return dynamic_cast(&other.actual()) != nullptr + || dynamic_cast(&other.actual()) != nullptr; + } + + const Type* Nil::record_type_get() const { return record_type_; } + + void Nil::record_type_set(const Type& type) const { record_type_ = &type; } + +} // namespace type -- cgit v1.2.3