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/string-exp.hh | |
Diffstat (limited to 'tiger-compiler/src/ast/string-exp.hh')
| -rw-r--r-- | tiger-compiler/src/ast/string-exp.hh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tiger-compiler/src/ast/string-exp.hh b/tiger-compiler/src/ast/string-exp.hh new file mode 100644 index 0000000..c9fd4f0 --- /dev/null +++ b/tiger-compiler/src/ast/string-exp.hh @@ -0,0 +1,47 @@ +/** + ** \file ast/string-exp.hh + ** \brief Declaration of ast::StringExp. + */ + +#pragma once + +#include <string> +#include <ast/exp.hh> + +namespace ast +{ + /// StringExp. + class StringExp : public Exp + { + public: + /** \name Ctor & dtor. + ** \{ */ + /// Construct a StringExp node. + StringExp(const Location& location, const std::string& value); + StringExp(const StringExp&) = delete; + StringExp& operator=(const StringExp&) = delete; + /// Destroy a StringExp 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 string value. + const std::string& value_get() const; + /// Return stored string value. + std::string& value_get(); + /** \} */ + + protected: + /// Stored string value. + std::string value_; + }; +} // namespace ast +#include <ast/string-exp.hxx> |
