From 967be9e750221ab2ab783f95df79bb26d290a45e Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:07:58 +0200 Subject: add: added projects --- tiger-compiler/src/ast/let-exp.hh | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tiger-compiler/src/ast/let-exp.hh (limited to 'tiger-compiler/src/ast/let-exp.hh') diff --git a/tiger-compiler/src/ast/let-exp.hh b/tiger-compiler/src/ast/let-exp.hh new file mode 100644 index 0000000..7955eeb --- /dev/null +++ b/tiger-compiler/src/ast/let-exp.hh @@ -0,0 +1,55 @@ +/** + ** \file ast/let-exp.hh + ** \brief Declaration of ast::LetExp. + */ + +#pragma once + +#include +#include +#include + +namespace ast +{ + /// LetExp. + class LetExp : public Exp + { + public: + /** \name Ctor & dtor. + ** \{ */ + /// Construct a LetExp node. + LetExp(const Location& location, ChunkList* chunks, Exp* body); + LetExp(const LetExp&) = delete; + LetExp& operator=(const LetExp&) = delete; + /// Destroy a LetExp node. + ~LetExp() override; + /** \} */ + + /// \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 list of declarations. + const ChunkList& chunks_get() const; + /// Return list of declarations. + ChunkList& chunks_get(); + /// Return list of instructions. + const Exp& body_get() const; + /// Return list of instructions. + Exp& body_get(); + /** \} */ + + protected: + /// List of declarations. + ChunkList* chunks_; + /// List of instructions. + Exp* body_; + }; +} // namespace ast +#include -- cgit v1.2.3