summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/type/attribute.hxx
diff options
context:
space:
mode:
authorMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:07:58 +0200
committerMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:07:58 +0200
commit967be9e750221ab2ab783f95df79bb26d290a45e (patch)
tree6802900a5e975f9f68b169f0f503f040056d6952 /tiger-compiler/src/type/attribute.hxx
add: added projectsHEADmain
Diffstat (limited to 'tiger-compiler/src/type/attribute.hxx')
-rw-r--r--tiger-compiler/src/type/attribute.hxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/tiger-compiler/src/type/attribute.hxx b/tiger-compiler/src/type/attribute.hxx
new file mode 100644
index 0000000..e59177d
--- /dev/null
+++ b/tiger-compiler/src/type/attribute.hxx
@@ -0,0 +1,25 @@
+/**
+ ** \file type/attribute.hxx
+ ** \brief Inline methods for type::Attribute.
+ */
+#pragma once
+
+#include <misc/contract.hh>
+
+namespace type
+{
+ inline misc::symbol Attribute::name_get() const { return def_->name_get(); }
+
+ inline const Type& Attribute::type_get() const
+ {
+ // FIXME DONE: Some code was deleted here.
+ precondition(def_->type_get() != nullptr);
+
+ return *def_->type_get();
+ }
+
+ inline const ast::VarDec* Attribute::def_get() const { return def_; }
+
+ inline void Attribute::def_set(const ast::VarDec* def) { def_ = def; }
+
+} // namespace type