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