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/ast/record-ty.hh | |
Diffstat (limited to 'tiger-compiler/src/ast/record-ty.hh')
| -rw-r--r-- | tiger-compiler/src/ast/record-ty.hh | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tiger-compiler/src/ast/record-ty.hh b/tiger-compiler/src/ast/record-ty.hh new file mode 100644 index 0000000..d2d1a46 --- /dev/null +++ b/tiger-compiler/src/ast/record-ty.hh @@ -0,0 +1,49 @@ + +/** + ** \file ast/record-ty.hh + ** \brief Declaration of ast::RecordTy. + */ + +#pragma once + +#include <ast/field.hh> +#include <ast/ty.hh> + +namespace ast +{ + /// RecordTy. + class RecordTy : public Ty + { + public: + /** \name Ctor & dtor. + ** \{ */ + /// Construct a RecordTy node. + RecordTy(const Location& location, fields_type* fields); + RecordTy(const RecordTy&) = delete; + RecordTy& operator=(const RecordTy&) = delete; + /// Destroy a RecordTy node. + ~RecordTy() override; + /** \} */ + + /// \name Visitors entry point. + /// \{ */ + /// Accept a const visitor \a v. + void accept(ConstVisitor& v) const override; + /// Accept a non-const visitor \a v. + void accept(Visitor& v) override; + /// \} + + /** \name Accessors. + ** \{ */ + /// Return the field list. + const fields_type& fields_get() const; + /// Return the field list. + fields_type& fields_get(); + /** \} */ + + protected: + /// The field list. + fields_type* fields_; + }; +} // namespace ast +#include <ast/record-ty.hxx> |
