summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/ast/array-ty.hh
diff options
context:
space:
mode:
Diffstat (limited to 'tiger-compiler/src/ast/array-ty.hh')
-rw-r--r--tiger-compiler/src/ast/array-ty.hh48
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>