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/array-ty.hh | |
Diffstat (limited to 'tiger-compiler/src/ast/array-ty.hh')
| -rw-r--r-- | tiger-compiler/src/ast/array-ty.hh | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tiger-compiler/src/ast/array-ty.hh b/tiger-compiler/src/ast/array-ty.hh new file mode 100644 index 0000000..73bb956 --- /dev/null +++ b/tiger-compiler/src/ast/array-ty.hh @@ -0,0 +1,48 @@ +/** + ** \file ast/array-ty.hh + ** \brief Declaration of ast::ArrayTy. + */ + +#pragma once + +#include <ast/name-ty.hh> +#include <ast/ty.hh> + +namespace ast +{ + /// ArrayTy. + class ArrayTy : public Ty + { + public: + /** \name Ctor & dtor. + ** \{ */ + /// Construct an ArrayTy node. + ArrayTy(const Location& location, NameTy* base_type); + ArrayTy(const ArrayTy&) = delete; + ArrayTy& operator=(const ArrayTy&) = delete; + /// Destroy an ArrayTy node. + ~ArrayTy() 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 name of the base type. + const NameTy& base_type_get() const; + /// Return name of the base type. + NameTy& base_type_get(); + /** \} */ + + protected: + /// Name of the base type. + NameTy* base_type_; + }; +} // namespace ast +#include <ast/array-ty.hxx> |
