diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
| commit | 967be9e750221ab2ab783f95df79bb26d290a45e (patch) | |
| tree | 6802900a5e975f9f68b169f0f503f040056d6952 /tiger-compiler/src/ast/object-exp.hh | |
Diffstat (limited to 'tiger-compiler/src/ast/object-exp.hh')
| -rw-r--r-- | tiger-compiler/src/ast/object-exp.hh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tiger-compiler/src/ast/object-exp.hh b/tiger-compiler/src/ast/object-exp.hh new file mode 100644 index 0000000..efab0a5 --- /dev/null +++ b/tiger-compiler/src/ast/object-exp.hh @@ -0,0 +1,47 @@ +/** + ** \file ast/object-exp.hh + ** \brief Declaration of ast::ObjectExp. + */ + +#pragma once + +#include <ast/exp.hh> +#include <ast/name-ty.hh> + +namespace ast +{ + /// ObjectExp. + class ObjectExp : public Exp + { + public: + /** \name Ctor & dtor. + ** \{ */ + /// Construct an ObjectExp node. + ObjectExp(const Location& location, NameTy* type_name); + ObjectExp(const ObjectExp&) = delete; + ObjectExp& operator=(const ObjectExp&) = delete; + /// Destroy an ObjectExp 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 name of the class from which the object is instantiated. + const NameTy& type_name_get() const; + /// Return name of the class from which the object is instantiated. + NameTy& type_name_get(); + /** \} */ + + protected: + /// Name of the class from which the object is instantiated. + NameTy* type_name_; + }; +} // namespace ast +#include <ast/object-exp.hxx> |
