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/assert/desugar-visitor.hh | |
Diffstat (limited to 'tiger-compiler/src/assert/desugar-visitor.hh')
| -rw-r--r-- | tiger-compiler/src/assert/desugar-visitor.hh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tiger-compiler/src/assert/desugar-visitor.hh b/tiger-compiler/src/assert/desugar-visitor.hh new file mode 100644 index 0000000..88d689e --- /dev/null +++ b/tiger-compiler/src/assert/desugar-visitor.hh @@ -0,0 +1,42 @@ +/** + ** \file assert/desugar-visitor.hh + ** \brief Declaration of assert::DesugarVisitor. + */ + +#pragma once + +#include <ast/assert-visitor.hh> +#include <desugar/desugar-visitor.hh> + +namespace assert { + + class DesugarVisitor + : public desugar::DesugarVisitor + , public ast::AssertConstVisitor + { + public: + using super_type = desugar::DesugarVisitor; + using super_type::operator(); + + // Build a DesugarVisitor + DesugarVisitor(bool desugar_for_p, bool desugar_string_cmp_p); + + // Desugar assertions + // \param e Node to visit + void operator()(const ast::AssertExp& e) override; + + private: + + // Retrieve the pretty-printed version of an assertion's condition as a + // string + // \param e Node to pretty-print. + inline std::string get_formatted_assert_cond(const ast::AssertExp& e); + + // Retrieve the pretty-printed version of a Location as a string + // \param loc Location record to pretty-print + inline std::string get_formatted_location(const ast::Location& loc); + }; + +} // namespace assert + +#include <assert/desugar-visitor.hxx> |
