summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/ast/record-ty.hh
blob: d2d1a46be89853d3225cf66c6b2f11cd9db32880 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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>