diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
| commit | 967be9e750221ab2ab783f95df79bb26d290a45e (patch) | |
| tree | 6802900a5e975f9f68b169f0f503f040056d6952 /tiger-compiler/src/type/attribute.hh | |
Diffstat (limited to 'tiger-compiler/src/type/attribute.hh')
| -rw-r--r-- | tiger-compiler/src/type/attribute.hh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tiger-compiler/src/type/attribute.hh b/tiger-compiler/src/type/attribute.hh new file mode 100644 index 0000000..d252da4 --- /dev/null +++ b/tiger-compiler/src/type/attribute.hh @@ -0,0 +1,44 @@ +/** + ** \file type/attribute.hh + ** \brief The class Attribute (of a class type). + */ +#pragma once + +#include <ast/var-dec.hh> + +namespace type +{ + + /** \brief The base object for Class attributes. + ** + ** Very much like Named, but it is *not* a Type. */ + class Attribute + { + /** \name Constructor. + ** \{ */ + public: + /** \brief Construct a Attribute. + ** \param def attribute's definition site.*/ + explicit Attribute(const ast::VarDec* def); + /** \} */ + + /** \name Accessors. + ** \{ */ + public: + /// Return the attribute's name. + misc::symbol name_get() const; + /// Return the attribute's type. + const Type& type_get() const; + /// Return attribute's definition site. + const ast::VarDec* def_get() const; + /// Set the attribute's definition site. + void def_set(const ast::VarDec* def); + /** \} */ + + private: + const ast::VarDec* def_; + }; + +} // namespace type + +#include <type/attribute.hxx> |
