summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/ast/record-exp.cc
blob: 6ca817a9219be4d48120ac5a7605ff6ba99dc9fc (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
/**
 ** \file ast/record-exp.cc
 ** \brief Implementation of ast::RecordExp.
 */

#include <ast/record-exp.hh>
#include <ast/visitor.hh>
#include <misc/algorithm.hh>

namespace ast
{
  RecordExp::RecordExp(const Location& location,
                       NameTy* type_name,
                       fieldinits_type* fields)
    : Exp(location)
    , type_name_(type_name)
    , fields_(fields)
  {}

  RecordExp::~RecordExp()
  {
    delete type_name_;
    misc::deep_clear(*fields_);
    delete fields_;
  }

  void RecordExp::accept(ConstVisitor& v) const { v(*this); }

  void RecordExp::accept(Visitor& v) { v(*this); }
} // namespace ast