diff options
Diffstat (limited to 'tiger-compiler/src/ast/int-exp.hh')
| -rw-r--r-- | tiger-compiler/src/ast/int-exp.hh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tiger-compiler/src/ast/int-exp.hh b/tiger-compiler/src/ast/int-exp.hh new file mode 100644 index 0000000..a15bdf0 --- /dev/null +++ b/tiger-compiler/src/ast/int-exp.hh @@ -0,0 +1,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> |
