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/field.hh | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tiger-compiler/src/type/field.hh (limited to 'tiger-compiler/src/type/field.hh') diff --git a/tiger-compiler/src/type/field.hh b/tiger-compiler/src/type/field.hh new file mode 100644 index 0000000..e1f5609 --- /dev/null +++ b/tiger-compiler/src/type/field.hh @@ -0,0 +1,45 @@ +/** + ** \file type/field.hh + ** \brief The class Field (of a record type). + */ +#pragma once + +#include +#include +#include + +namespace type +{ + /** \brief The base type for Record fields. + ** + ** Very much like Named, but it is *not* a Type. */ + class Field + { + public: + /** \name Ctor & dtor. + ** \{ */ + /** \brief Construct a Field. + ** \param name field's identifier. + ** \param type field's type. */ + Field(misc::symbol name, const Type& type); + /** \} */ + + /** \name Accessors. + ** \{ */ + /// Return the field's name. + misc::symbol name_get() const; + /// Return the field's type. + const Type& type_get() const; + /** \} */ + + protected: + /// Field's identifier. + misc::symbol name_; + + /// Field's type. + const Type& type_; + }; + +} // namespace type + +#include -- cgit v1.2.3