summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/ast/break-exp.hh
blob: 25d89e8007cb77bd91c715a3c076e414f21ea18c (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/break-exp.hh
 ** \brief Declaration of ast::BreakExp.
 */

#pragma once

#include <ast/exp.hh>

namespace ast
{
  /// BreakExp.
  class BreakExp : public Exp
  {
  public:
    /** \name Ctor & dtor.
     ** \{ */
    /// Construct a BreakExp node.
    explicit BreakExp(const Location& location);
    BreakExp(const BreakExp&) = delete;
    BreakExp& operator=(const BreakExp&) = delete;
    /// Destroy a BreakExp node.
    /** \} */

    /// \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.
     ** \{ */
    // FIXME DONE: Some code was deleted here.
    /// Return definition site.
    const Exp* def_get() const;
    Exp* def_get();
    // FIXME DONE: Some code was deleted here.
    /// Set definition site.
    void def_set(Exp*);
    /** \} */

  protected:
    /// The loop it breaks.
    Exp* def_ = nullptr;
  };
} // namespace ast
#include <ast/break-exp.hxx>