summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/ast/int-exp.hh
blob: a15bdf07c58e1bba644865d13ffc443cbd622b03 (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
/**
 ** \file ast/int-exp.hh
 ** \brief Declaration of ast::IntExp.
 */

#pragma once

#include <ast/exp.hh>

namespace ast
{
  /// IntExp.
  class IntExp : public Exp
  {
  public:
    /** \name Ctor & dtor.
     ** \{ */
    /// Construct an IntExp node.
    IntExp(const Location& location, int value);
    IntExp(const IntExp&) = delete;
    IntExp& operator=(const IntExp&) = delete;
    /// Destroy an IntExp 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.
     ** \{ */
    /// Return stored integer value.
    int value_get() const;
    /** \} */

  protected:
    /// Stored integer value.
    int value_;
  };
} // namespace ast
#include <ast/int-exp.hxx>